Repository: apache/incubator-shardingsphere
Pull request #4716 (2020-03-11 16:24:47)

Decouple shardingsphere-sql-parser-spi and ANTLR
For #4688.

coveralls: ## Pull Request Test Coverage Report for [Build 2068](https://coveralls.io/builds/29281261)

* **2** of **22**   **(9.09%)**  changed or added relevant lines in **16** files are covered.
* **3** unchanged lines in **2** files lost coverage.
* Overall coverage decreased (**-0.01%**) to **59.165%**

---

|  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/ParseASTNode.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2FParseASTNode.java#L40) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserFactory.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2Fparser%2FSQLParserFactory.java#L60) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParser.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLParser.java#L37) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParserConfiguration.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLParserConfiguration.java#L38) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParser.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-oracle%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FOracleParser.java#L37) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParserConfiguration.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-oracle%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FOracleParserConfiguration.java#L38) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParser.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-postgresql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FPostgreSQLParser.java#L37) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParserConfiguration.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-postgresql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FPostgreSQLParserConfiguration.java#L38) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Parser.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-sql92%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FSQL92Parser.java#L37) | 0 | 1 | 0.0%
| [shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92ParserConfiguration.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-sql92%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FSQL92ParserConfiguration.java#L38) | 0 | 1 | 0.0%
<!-- | **Total:** | **2** | **22** | **9.09%** | -->

|  Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserExecutor.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2Fparser%2FSQLParserExecutor.java#L49) | 1 | 0% |
| [shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/SQLStatementType.java](https://coveralls.io/builds/29281261/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-statement%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fsql%2Fstatement%2FSQLStatementType.java#L23) | 2 | 0% |
<!-- | **Total:** | **3** |  | -->

|  Totals | [![Coverage Status](https://coveralls.io/builds/29281261/badge)](https://coveralls.io/builds/29281261) |
| :-- | --: |
| Change from base [Build 1048](https://coveralls.io/builds/29273445): |  -0.01% |
| Covered Lines: | 12201 |
| Relevant Lines: | 20622 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Patch:
diff --git a/shardingsphere-sql-parser/pom.xml b/shardingsphere-sql-parser/pom.xml
index 647d9429ecf..83f446f5650 100644
--- a/shardingsphere-sql-parser/pom.xml
+++ b/shardingsphere-sql-parser/pom.xml
@@ -43,11 +43,4 @@
         
         <module>shardingsphere-sql-parser-test</module>
     </modules>
-    
-    <dependencies>
-        <dependency>
-            <groupId>org.antlr</groupId>
-            <artifactId>antlr4-runtime</artifactId>
-        </dependency>
-    </dependencies>
 </project>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/pom.xml
index dda19ea1b53..ecb667b45b6 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/pom.xml
@@ -47,5 +47,9 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-collections4</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+        </dependency>
     </dependencies>
 </project>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/SQLParserEngine.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/SQLParserEngine.java
index 220eecf52f0..2949e424728 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/SQLParserEngine.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/SQLParserEngine.java
@@ -20,11 +20,11 @@ package org.apache.shardingsphere.sql.parser;
 import lombok.RequiredArgsConstructor;
 import org.antlr.v4.runtime.tree.ParseTree;
 import org.apache.shardingsphere.sql.parser.cache.SQLParseResultCache;
-import org.apache.shardingsphere.sql.parser.sql.constant.RuleName;
 import org.apache.shardingsphere.sql.parser.core.parser.SQLParserExecutor;
 import org.apache.shardingsphere.sql.parser.core.visitor.ParseTreeVisitorFactory;
 import org.apache.shardingsphere.sql.parser.hook.ParsingHook;
 import org.apache.shardingsphere.sql.parser.hook.SPIParsingHook;
+import org.apache.shardingsphere.sql.parser.core.visitor.VisitorRule;
 import org.apache.shardingsphere.sql.parser.sql.statement.SQLStatement;
 
 import java.util.Optional;
@@ -68,8 +68,8 @@ public final class SQLParserEngine {
                 return cachedSQLStatement.get();
             }
         }
-        ParseTree parseTree = new SQLParserExecutor(databaseTypeName, sql).execute();
-        SQLStatement result = (SQLStatement) ParseTreeVisitorFactory.newInstance(databaseTypeName, RuleName.valueOf(parseTree.getClass())).visit(parseTree);
+        ParseTree parseTree = new SQLParserExecutor(databaseTypeName, sql).execute().getRootNode();
+        SQLStatement result = (SQLStatement) ParseTreeVisitorFactory.newInstance(databaseTypeName, VisitorRule.valueOf(parseTree.getClass())).visit(parseTree);
         if (useCache) {
             cache.put(sql, result);
         }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/ParseASTNode.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/ParseASTNode.java
new file mode 100644
index 00000000000..9f6dde511e5
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/ParseASTNode.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.core;
+
+import lombok.RequiredArgsConstructor;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
+
+/**
+ * Parse AST node.
+ *
+ * @author zhangliang
+ */
+@RequiredArgsConstructor
+public final class ParseASTNode implements ASTNode {
+    
+    private final ParseTree parseTree;
+    
+    /**
+     * Get root node.
+     * 
+     * @return root node
+     */
+    public ParseTree getRootNode() {
+        return parseTree.getChild(0);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserExecutor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserExecutor.java
index b99d4dc36ad..4b1bfc248d4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserExecutor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserExecutor.java
@@ -24,8 +24,8 @@ import org.antlr.v4.runtime.Parser;
 import org.antlr.v4.runtime.atn.PredictionMode;
 import org.antlr.v4.runtime.misc.ParseCancellationException;
 import org.antlr.v4.runtime.tree.ErrorNode;
-import org.antlr.v4.runtime.tree.ParseTree;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
 
 /**
@@ -41,27 +41,27 @@ public final class SQLParserExecutor {
     /**
      * Execute to parse SQL.
      *
-     * @return parse tree
+     * @return AST node
      */
-    public ParseTree execute() {
-        ParseTree result = towPhaseParse();
-        if (result instanceof ErrorNode) {
+    public ParseASTNode execute() {
+        ParseASTNode result = towPhaseParse();
+        if (result.getRootNode() instanceof ErrorNode) {
             throw new SQLParsingException(String.format("Unsupported SQL of `%s`", sql));
         }
         return result;
     }
     
-    private ParseTree towPhaseParse() {
+    private ParseASTNode towPhaseParse() {
         SQLParser sqlParser = SQLParserFactory.newInstance(databaseTypeName, sql);
         try {
             ((Parser) sqlParser).setErrorHandler(new BailErrorStrategy());
             ((Parser) sqlParser).getInterpreter().setPredictionMode(PredictionMode.SLL);
-            return sqlParser.execute().getChild(0);
+            return (ParseASTNode) sqlParser.parse();
         } catch (final ParseCancellationException ex) {
             ((Parser) sqlParser).reset();
             ((Parser) sqlParser).setErrorHandler(new DefaultErrorStrategy());
             ((Parser) sqlParser).getInterpreter().setPredictionMode(PredictionMode.LL);
-            return sqlParser.execute().getChild(0);
+            return (ParseASTNode) sqlParser.parse();
         }
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserFactory.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserFactory.java
index d42a0488c76..d76fd73bf42 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserFactory.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserFactory.java
@@ -57,7 +57,7 @@ public final class SQLParserFactory {
     
     @SneakyThrows
     private static SQLParser createSQLParser(final String sql, final SQLParserConfiguration configuration) {
-        Lexer lexer = configuration.getLexerClass().getConstructor(CharStream.class).newInstance(CharStreams.fromString(sql));
+        Lexer lexer = (Lexer) configuration.getLexerClass().getConstructor(CharStream.class).newInstance(CharStreams.fromString(sql));
         return configuration.getParserClass().getConstructor(TokenStream.class).newInstance(new CommonTokenStream(lexer));
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java
index 10d1d81c1d7..42fe2128566 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java
@@ -22,8 +22,7 @@ import lombok.NoArgsConstructor;
 import lombok.SneakyThrows;
 import org.antlr.v4.runtime.tree.ParseTreeVisitor;
 import org.apache.shardingsphere.spi.NewInstanceServiceLoader;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.sql.constant.RuleName;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.sql.statement.SQLStatementType;
@@ -38,13 +37,13 @@ public final class ParseTreeVisitorFactory {
      * New instance of SQL visitor.
      * 
      * @param databaseTypeName name of database type
-     * @param ruleName rule name
+     * @param visitorRule visitor rule
      * @return parse tree visitor
      */
-    public static ParseTreeVisitor newInstance(final String databaseTypeName, final RuleName ruleName) {
+    public static ParseTreeVisitor newInstance(final String databaseTypeName, final VisitorRule visitorRule) {
         for (SQLParserConfiguration each : NewInstanceServiceLoader.newServiceInstances(SQLParserConfiguration.class)) {
             if (each.getDatabaseTypeName().equals(databaseTypeName)) {
-                return createParseTreeVisitor(each, ruleName.getType());
+                return createParseTreeVisitor(each, visitorRule.getType());
             }
         }
         throw new UnsupportedOperationException(String.format("Cannot support database type '%s'", databaseTypeName));
@@ -52,7 +51,7 @@ public final class ParseTreeVisitorFactory {
     
     @SneakyThrows
     private static ParseTreeVisitor createParseTreeVisitor(final SQLParserConfiguration configuration, final SQLStatementType type) {
-        ParseTreeVisitorFacade visitorFacade = configuration.getVisitorFacadeClass().getConstructor().newInstance();
+        SQLVisitorFacade visitorFacade = configuration.getVisitorFacadeClass().getConstructor().newInstance();
         switch (type) {
             case DML:
                 return (ParseTreeVisitor) visitorFacade.getDMLVisitorClass().getConstructor().newInstance();
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleName.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleName.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
index fa9e94cf447..5c80ec925c5 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleName.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.constant;
+package org.apache.shardingsphere.sql.parser.core.visitor;
 
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
@@ -23,10 +23,10 @@ import org.antlr.v4.runtime.tree.ParseTree;
 import org.apache.shardingsphere.sql.parser.sql.statement.SQLStatementType;
 
 /**
- * Rule name.
+ * Visitor rule.
  */
 @RequiredArgsConstructor
-public enum RuleName {
+public enum VisitorRule {
     
     SELECT("Select", SQLStatementType.DML),
     
@@ -142,18 +142,18 @@ public enum RuleName {
     }
     
     /**
-     * Value of rule name.
+     * Value of visitor rule.
      * 
      * @param parseTreeClass parse tree class
-     * @return rule name
+     * @return visitor rule
      */
-    public static RuleName valueOf(final Class<? extends ParseTree> parseTreeClass) {
+    public static VisitorRule valueOf(final Class<? extends ParseTree> parseTreeClass) {
         String parseTreeClassName = parseTreeClass.getSimpleName();
-        for (RuleName each : RuleName.values()) {
+        for (VisitorRule each : VisitorRule.values()) {
             if (each.getContextName().equals(parseTreeClassName)) {
                 return each;
             }
         }
-        throw new IllegalArgumentException(String.format("Can not find rule name: `%s`", parseTreeClassName));
+        throw new IllegalArgumentException(String.format("Can not find visitor rule: `%s`", parseTreeClassName));
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/pom.xml
index 7338acd8e04..d0df8448fbf 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/pom.xml
@@ -27,11 +27,6 @@
     <name>${project.artifactId}</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-sql-parser-spi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-engine</artifactId>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLLexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLLexer.java
new file mode 100644
index 00000000000..fd4ca34f189
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLLexer.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser;
+
+import org.antlr.v4.runtime.CharStream;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementLexer;
+
+/**
+ * SQL lexer for MySQL.
+ */
+public final class MySQLLexer extends MySQLStatementLexer implements SQLLexer {
+    
+    public MySQLLexer(final CharStream input) {
+        super(input);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParser.java
index d2d8aa6f227..4f085f7d145 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParser.java
@@ -18,8 +18,10 @@
 package org.apache.shardingsphere.sql.parser;
 
 import org.antlr.v4.runtime.TokenStream;
-import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 
 /**
  * SQL parser for MySQL.
@@ -29,4 +31,9 @@ public final class MySQLParser extends MySQLStatementParser implements SQLParser
     public MySQLParser(final TokenStream input) {
         super(input);
     }
+    
+    @Override
+    public ASTNode parse() {
+        return new ParseASTNode(execute());
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParserConfiguration.java
index a92bdf02136..15c2527da26 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLParserConfiguration.java
@@ -17,10 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementLexer;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.visitor.MySQLVisitorFacade;
 
@@ -35,8 +34,8 @@ public final class MySQLParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends Lexer> getLexerClass() {
-        return MySQLStatementLexer.class;
+    public Class<? extends SQLLexer> getLexerClass() {
+        return MySQLLexer.class;
     }
     
     @Override
@@ -45,7 +44,7 @@ public final class MySQLParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass() {
+    public Class<? extends SQLVisitorFacade> getVisitorFacadeClass() {
         return MySQLVisitorFacade.class;
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitor.java
index ab76cd3364e..16d5dd48cf7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitor.java
@@ -66,7 +66,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WeightS
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WindowFunctionContext;
 import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitorFacade.java
index b892e47ad3b..bc4a68a01d9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLVisitorFacade.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.MySQLDALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.MySQLDCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.MySQLDDLVisitor;
@@ -34,7 +34,7 @@ import org.apache.shardingsphere.sql.parser.visitor.impl.MySQLTCLVisitor;
 /**
  * Visitor facade for MySQL.
  */
-public final class MySQLVisitorFacade implements ParseTreeVisitorFacade {
+public final class MySQLVisitorFacade implements SQLVisitorFacade {
     
     @Override
     public Class<? extends DMLVisitor> getDMLVisitorClass() {
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDALVisitor.java
index baa6e17c393..c7a406071e2 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDALVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AnalyzeTableContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CacheIndexContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ChecksumTableContext;
@@ -53,7 +53,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ShowWar
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.UninstallPluginContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.UseContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.VariableContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dal.FromSchemaSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dal.FromTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dal.ShowLikeSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDCLVisitor.java
index 22a5042298a..93855cb774f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDCLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterUserContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateRoleContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateUserContext;
@@ -31,7 +31,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetDefa
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetPasswordContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetRoleContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.TableNameContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterUserStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.CreateRoleStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDDLVisitor.java
index d9ef693b462..3240d315cbd 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDDLVisitor.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.visitor.impl;
 
 import com.google.common.base.Preconditions;
 import org.antlr.v4.runtime.Token;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AddColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterDefinitionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterSpecificationContext;
@@ -50,7 +50,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.RenameC
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.RenameTableSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.StorageOptionContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.TruncateTableContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDMLVisitor.java
index c0c84a7eaa4..3aa920437c9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDMLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AliasContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AssignmentValueContext;
@@ -61,7 +61,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.TableRe
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.AssignmentSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.SetAssignmentSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLRLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLRLVisitor.java
index b87541e2039..0251f86c56d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLRLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLRLVisitor.java
@@ -17,11 +17,11 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ChangeMasterToContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.StartSlaveContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.StopSlaveContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.statement.rl.ChangeMasterStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.rl.StartSlaveStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.rl.StopSlaveStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLTCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLTCLVisitor.java
index bf12810836a..9f285e8e2ed 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLTCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLTCLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AutoCommitValueContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.BeginTransactionContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CommitContext;
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.Rollbac
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SavepointContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetAutoCommitContext;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.tcl.AutoCommitSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.BeginTransactionStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.CommitStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/pom.xml
index 0c1398e8d6a..8f72f9e4910 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/pom.xml
@@ -27,11 +27,6 @@
     <name>${project.artifactId}</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-sql-parser-spi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-engine</artifactId>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleLexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleLexer.java
new file mode 100644
index 00000000000..14536c0e4dd
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleLexer.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser;
+
+import org.antlr.v4.runtime.CharStream;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
+import org.apache.shardingsphere.sql.parser.autogen.OracleStatementLexer;
+
+/**
+ * SQL lexer for Oracle.
+ */
+public final class OracleLexer extends OracleStatementLexer implements SQLLexer {
+    
+    public OracleLexer(final CharStream input) {
+        super(input);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParser.java
index 3815d7261c7..1f1d29eb24b 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParser.java
@@ -18,8 +18,10 @@
 package org.apache.shardingsphere.sql.parser;
 
 import org.antlr.v4.runtime.TokenStream;
-import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 
 /**
  * SQL parser for Oracle.
@@ -29,4 +31,9 @@ public final class OracleParser extends OracleStatementParser implements SQLPars
     public OracleParser(final TokenStream input) {
         super(input);
     }
+    
+    @Override
+    public ASTNode parse() {
+        return new ParseASTNode(execute());
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParserConfiguration.java
index be2ed7a5bb6..c82efd5b58e 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/OracleParserConfiguration.java
@@ -17,10 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.autogen.OracleStatementLexer;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.visitor.OracleVisitorFacade;
 
@@ -35,8 +34,8 @@ public final class OracleParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends Lexer> getLexerClass() {
-        return OracleStatementLexer.class;
+    public Class<? extends SQLLexer> getLexerClass() {
+        return OracleLexer.class;
     }
     
     @Override
@@ -45,7 +44,7 @@ public final class OracleParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass() {
+    public Class<? extends SQLVisitorFacade> getVisitorFacadeClass() {
         return OracleVisitorFacade.class;
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitor.java
index 90047886079..c4dd62c19bc 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitor.java
@@ -56,7 +56,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.TableN
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UnreservedWordContext;
 import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitorFacade.java
index 74a8275bf01..cf7360cc427 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/OracleVisitorFacade.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.OracleDALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.OracleDCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.OracleDDLVisitor;
@@ -33,7 +33,7 @@ import org.apache.shardingsphere.sql.parser.visitor.impl.OracleTCLVisitor;
 /**
  * Visitor facade for Oracle.
  */
-public final class OracleVisitorFacade implements ParseTreeVisitorFacade {
+public final class OracleVisitorFacade implements SQLVisitorFacade {
     
     @Override
     public Class<? extends DMLVisitor> getDMLVisitorClass() {
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDALVisitor.java
index f03ef09d5cd..adb6240a765 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDALVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.OracleVisitor;
 
 /**
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDCLVisitor.java
index da00d516ad7..c5da6fda282 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDCLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AlterRoleContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AlterUserContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.CreateRoleContext;
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.DropUs
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.GrantContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.ObjectPrivilegeClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.RevokeContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterRoleStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterUserStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDDLVisitor.java
index 6c527152ea6..1c2dd2b9d73 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDDLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AddColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AlterDefinitionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AlterIndexContext;
@@ -39,7 +39,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.OutOfL
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.OutOfLineRefConstraintContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.RelationalPropertyContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.TruncateTableContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDMLVisitor.java
index 40ab8caa0b0..8fae5cddb90 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleDMLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AliasContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.AssignmentValueContext;
@@ -49,7 +49,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.TableR
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.AssignmentSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.SetAssignmentSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleTCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleTCLVisitor.java
index ee561787e85..72d91c5e423 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleTCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-oracle/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/OracleTCLVisitor.java
@@ -17,12 +17,12 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.CommitContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.RollbackContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.SavepointContext;
 import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.CommitStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.RollbackStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.SavepointStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/pom.xml
index 1b9cc162145..c68740d0b32 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/pom.xml
@@ -27,11 +27,6 @@
     <name>${project.artifactId}</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-sql-parser-spi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-engine</artifactId>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLLexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLLexer.java
new file mode 100644
index 00000000000..490894909f8
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLLexer.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser;
+
+import org.antlr.v4.runtime.CharStream;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementLexer;
+
+/**
+ * SQL lexer for PostgreSQL.
+ */
+public final class PostgreSQLLexer extends PostgreSQLStatementLexer implements SQLLexer {
+    
+    public PostgreSQLLexer(final CharStream input) {
+        super(input);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParser.java
index f4f21fd191f..dcdb9331b35 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParser.java
@@ -18,8 +18,10 @@
 package org.apache.shardingsphere.sql.parser;
 
 import org.antlr.v4.runtime.TokenStream;
-import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 
 /**
  * SQL parser for PostgreSQL.
@@ -29,4 +31,9 @@ public final class PostgreSQLParser extends PostgreSQLStatementParser implements
     public PostgreSQLParser(final TokenStream input) {
         super(input);
     }
+    
+    @Override
+    public ASTNode parse() {
+        return new ParseASTNode(execute());
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParserConfiguration.java
index db9f4ccb6ce..cf3cc38b26c 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/PostgreSQLParserConfiguration.java
@@ -17,10 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementLexer;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.visitor.PostgreSQLVisitorFacade;
 
@@ -35,8 +34,8 @@ public final class PostgreSQLParserConfiguration implements SQLParserConfigurati
     }
     
     @Override
-    public Class<? extends Lexer> getLexerClass() {
-        return PostgreSQLStatementLexer.class;
+    public Class<? extends SQLLexer> getLexerClass() {
+        return PostgreSQLLexer.class;
     }
     
     @Override
@@ -45,7 +44,7 @@ public final class PostgreSQLParserConfiguration implements SQLParserConfigurati
     }
     
     @Override
-    public Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass() {
+    public Class<? extends SQLVisitorFacade> getVisitorFacadeClass() {
         return PostgreSQLVisitorFacade.class;
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitor.java
index fd499d0ad33..62b1c576041 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitor.java
@@ -58,7 +58,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Un
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.WindowFunctionContext;
 import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitorFacade.java
index 4fb83b8f57a..0940455d69a 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/PostgreSQLVisitorFacade.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.PostgreSQLDALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.PostgreSQLDCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.PostgreSQLDDLVisitor;
@@ -33,7 +33,7 @@ import org.apache.shardingsphere.sql.parser.visitor.impl.PostgreSQLTCLVisitor;
 /**
  * Visitor facade for PostgreSQL.
  */
-public final class PostgreSQLVisitorFacade implements ParseTreeVisitorFacade {
+public final class PostgreSQLVisitorFacade implements SQLVisitorFacade {
     
     @Override
     public Class<? extends DMLVisitor> getDMLVisitorClass() {
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java
index 34b9a2c6d68..b4065b7ddb5 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java
@@ -17,12 +17,12 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ConfigurationParameterClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ResetParameterContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ShowContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dal.VariableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dal.SetStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dal.dialect.postgresql.ResetParameterStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDCLVisitor.java
index df527c3ddf3..1f5dee65ff3 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDCLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterRoleContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterUserContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateRoleContext;
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Dr
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.GrantContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.PrivilegeClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.RevokeContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterRoleStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterUserStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDDLVisitor.java
index dc860a6eaa8..5760efe6452 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDDLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AddColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterDefinitionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterIndexContext;
@@ -40,7 +40,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Ta
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TableNameClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TableNamesClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TruncateTableContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDMLVisitor.java
index 416846cec3d..93c7071768d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDMLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AliasContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AssignmentValueContext;
@@ -52,7 +52,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Ta
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.AssignmentSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.SetAssignmentSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLTCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLTCLVisitor.java
index c46ec91f2d9..5ef9b6731df 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLTCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLTCLVisitor.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.BeginTransactionContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CommitContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.RollbackContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SavepointContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.BeginTransactionStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.CommitStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.RollbackStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/ASTNode.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/ASTNode.java
similarity index 94%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/ASTNode.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/ASTNode.java
index 96840da32c7..9f211840aac 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/ASTNode.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/ASTNode.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql;
+package org.apache.shardingsphere.sql.parser.api;
 
 /**
  * AST node.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/lexer/SQLLexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/lexer/SQLLexer.java
new file mode 100644
index 00000000000..98144b33600
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/lexer/SQLLexer.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.api.lexer;
+
+/**
+ * SQL lexer.
+ */
+public interface SQLLexer {
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/parser/SQLParser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/parser/SQLParser.java
index b5eeafaefc1..3d13477adaa 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/parser/SQLParser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/parser/SQLParser.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.api.parser;
 
-import org.antlr.v4.runtime.tree.ParseTree;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 
 /**
  * SQL parser.
@@ -25,9 +25,9 @@ import org.antlr.v4.runtime.tree.ParseTree;
 public interface SQLParser {
     
     /**
-     * Execute to parse SQL.
+     * Parse SQL.
      * 
-     * @return parse tree
+     * @return AST node
      */
-    ParseTree execute();
+    ASTNode parse();
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/ParseTreeVisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
similarity index 76%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/ParseTreeVisitorFacade.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
index cbe70d9e8ad..1b4697d35b6 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/ParseTreeVisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/SQLVisitorFacade.java
@@ -17,10 +17,17 @@
 
 package org.apache.shardingsphere.sql.parser.api.visitor;
 
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
+
 /**
- * Parse tree visitor facade.
+ * SQL visitor facade.
  */
-public interface ParseTreeVisitorFacade {
+public interface SQLVisitorFacade {
     
     /**
      * Get DML visitor class.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DALVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DALVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DALVisitor.java
index 90232e8b1e5..c186d10475f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DALVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * DAL visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DCLVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DCLVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DCLVisitor.java
index 04529b5c982..9c44f7f24d0 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DCLVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * DCL visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DDLVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DDLVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DDLVisitor.java
index 40b4b17056a..06a641b92ae 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DDLVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * DDL visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DMLVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DMLVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DMLVisitor.java
index ae2f3a1c0ac..ba2450351a3 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/DMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/DMLVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * DML visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/RLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/RLVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/RLVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/RLVisitor.java
index 01f13057d07..c3acc518eb0 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/RLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/RLVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * RL visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/TCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/TCLVisitor.java
similarity index 92%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/TCLVisitor.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/TCLVisitor.java
index 1de2ff54649..e3726b7f294 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/TCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/statement/TCLVisitor.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.api.visitor;
+package org.apache.shardingsphere.sql.parser.api.visitor.statement;
 
 /**
  * TCL visitor.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java
index f2d1dae2469..a5e8b049b6c 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserConfiguration.java
@@ -17,9 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser.spi;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 
 /**
  * SQL parser configuration.
@@ -38,7 +38,7 @@ public interface SQLParserConfiguration {
      *
      * @return SQL lexer class type
      */
-    Class<? extends Lexer> getLexerClass();
+    Class<? extends SQLLexer> getLexerClass();
     
     /**
      * Get SQL parser class type.
@@ -48,9 +48,9 @@ public interface SQLParserConfiguration {
     Class<? extends SQLParser> getParserClass();
     
     /**
-     * Get visitor facade class.
+     * Get SQL visitor facade class.
      *
-     * @return visitor facade class
+     * @return SQL visitor facade class
      */
-    Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass();
+    Class<? extends SQLVisitorFacade> getVisitorFacadeClass();
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/pom.xml
index e2cb97f65bf..f297dce7f9a 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/pom.xml
@@ -27,11 +27,6 @@
     <name>${project.artifactId}</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-sql-parser-spi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-engine</artifactId>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Lexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Lexer.java
new file mode 100644
index 00000000000..c488bdc64be
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Lexer.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser;
+
+import org.antlr.v4.runtime.CharStream;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
+import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementLexer;
+
+/**
+ * SQL lexer for SQL92.
+ */
+public final class SQL92Lexer extends SQL92StatementLexer implements SQLLexer {
+    
+    public SQL92Lexer(final CharStream input) {
+        super(input);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Parser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Parser.java
index 3d272e8704d..0dd793fe464 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Parser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92Parser.java
@@ -18,8 +18,10 @@
 package org.apache.shardingsphere.sql.parser;
 
 import org.antlr.v4.runtime.TokenStream;
-import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 
 /**
  * SQL parser for SQL92.
@@ -29,4 +31,9 @@ public final class SQL92Parser extends SQL92StatementParser implements SQLParser
     public SQL92Parser(final TokenStream input) {
         super(input);
     }
+    
+    @Override
+    public ASTNode parse() {
+        return new ParseASTNode(execute());
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92ParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92ParserConfiguration.java
index b71f6bdc8e5..4a7e2b80395 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92ParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/SQL92ParserConfiguration.java
@@ -17,10 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementLexer;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.visitor.SQL92VisitorFacade;
 
@@ -35,8 +34,8 @@ public final class SQL92ParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends Lexer> getLexerClass() {
-        return SQL92StatementLexer.class;
+    public Class<? extends SQLLexer> getLexerClass() {
+        return SQL92Lexer.class;
     }
     
     @Override
@@ -45,7 +44,7 @@ public final class SQL92ParserConfiguration implements SQLParserConfiguration {
     }
     
     @Override
-    public Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass() {
+    public Class<? extends SQLVisitorFacade> getVisitorFacadeClass() {
         return SQL92VisitorFacade.class;
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92Visitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92Visitor.java
index d35143b9be4..ed5d25fad1d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92Visitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92Visitor.java
@@ -54,7 +54,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableNa
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.UnreservedWordContext;
 import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.ExpressionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92VisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92VisitorFacade.java
index 07d140f40ea..26130c4a407 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92VisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQL92VisitorFacade.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQL92DALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQL92DCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQL92DDLVisitor;
@@ -33,7 +33,7 @@ import org.apache.shardingsphere.sql.parser.visitor.impl.SQL92TCLVisitor;
 /**
  * Visitor facade for SQL92.
  */
-public final class SQL92VisitorFacade implements ParseTreeVisitorFacade {
+public final class SQL92VisitorFacade implements SQLVisitorFacade {
     
     @Override
     public Class<? extends DMLVisitor> getDMLVisitorClass() {
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DALVisitor.java
index 4193c311904..ae4a6f922f3 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DALVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.SQL92Visitor;
 
 /**
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DCLVisitor.java
index 528fce1618a..aba7259aa68 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DCLVisitor.java
@@ -17,11 +17,11 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.GrantContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.PrivilegeClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.RevokeContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.GrantStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.RevokeStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DDLVisitor.java
index 50a17cf7884..cba8d41b920 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DDLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AddColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AlterDefinitionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AlterTableContext;
@@ -30,7 +30,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.DataTyp
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.DropColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.DropTableContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.ModifyColumnSpecificationContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DMLVisitor.java
index b5e905eb074..0689b80368f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92DMLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AliasContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AssignmentValueContext;
@@ -48,7 +48,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableRe
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.AssignmentSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.SetAssignmentSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92TCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92TCLVisitor.java
index 86b98768efc..2d8e5c5e097 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92TCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQL92TCLVisitor.java
@@ -17,11 +17,11 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.CommitContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.RollbackContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.CommitStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.RollbackStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.SetTransactionStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/pom.xml
index 32ecf670b63..5e61b3ebb55 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/pom.xml
@@ -27,11 +27,6 @@
     <name>${project.artifactId}</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-sql-parser-spi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>shardingsphere-sql-parser-engine</artifactId>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerLexer.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerLexer.java
new file mode 100644
index 00000000000..1095b300ba1
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerLexer.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser;
+
+import org.antlr.v4.runtime.CharStream;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementLexer;
+
+/**
+ * SQL lexer for SQLServer.
+ */
+public final class SQLServerLexer extends SQLServerStatementLexer implements SQLLexer {
+    
+    public SQLServerLexer(final CharStream input) {
+        super(input);
+    }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParser.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParser.java
index 0dd94d835d3..6f12ed9c521 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParser.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParser.java
@@ -18,8 +18,10 @@
 package org.apache.shardingsphere.sql.parser;
 
 import org.antlr.v4.runtime.TokenStream;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
+import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
 
 /**
  * SQL parser for SQLServer.
@@ -29,4 +31,9 @@ public final class SQLServerParser extends SQLServerStatementParser implements S
     public SQLServerParser(final TokenStream input) {
         super(input);
     }
+    
+    @Override
+    public ASTNode parse() {
+        return new ParseASTNode(execute());
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParserConfiguration.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParserConfiguration.java
index 560da3108d1..7b28c706731 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParserConfiguration.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/SQLServerParserConfiguration.java
@@ -17,10 +17,9 @@
 
 package org.apache.shardingsphere.sql.parser;
 
-import org.antlr.v4.runtime.Lexer;
+import org.apache.shardingsphere.sql.parser.api.lexer.SQLLexer;
 import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementLexer;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
 import org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration;
 import org.apache.shardingsphere.sql.parser.visitor.SQLServerVisitorFacade;
 
@@ -35,8 +34,8 @@ public final class SQLServerParserConfiguration implements SQLParserConfiguratio
     }
     
     @Override
-    public Class<? extends Lexer> getLexerClass() {
-        return SQLServerStatementLexer.class;
+    public Class<? extends SQLLexer> getLexerClass() {
+        return SQLServerLexer.class;
     }
     
     @Override
@@ -45,7 +44,7 @@ public final class SQLServerParserConfiguration implements SQLParserConfiguratio
     }
     
     @Override
-    public Class<? extends ParseTreeVisitorFacade> getVisitorFacadeClass() {
+    public Class<? extends SQLVisitorFacade> getVisitorFacadeClass() {
         return SQLServerVisitorFacade.class;
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitor.java
index 57928082ef8..29e97cbb636 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitor.java
@@ -57,7 +57,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Tab
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.UnreservedWordContext;
 import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitorFacade.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitorFacade.java
index 98a2033df16..d0706e329b4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitorFacade.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/SQLServerVisitorFacade.java
@@ -17,13 +17,13 @@
 
 package org.apache.shardingsphere.sql.parser.visitor;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.ParseTreeVisitorFacade;
-import org.apache.shardingsphere.sql.parser.api.visitor.RLVisitor;
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitorFacade;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.RLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQLServerDALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQLServerDCLVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.impl.SQLServerDDLVisitor;
@@ -33,7 +33,7 @@ import org.apache.shardingsphere.sql.parser.visitor.impl.SQLServerTCLVisitor;
 /**
  * Visitor facade for SQLServer.
  */
-public final class SQLServerVisitorFacade implements ParseTreeVisitorFacade {
+public final class SQLServerVisitorFacade implements SQLVisitorFacade {
     
     @Override
     public Class<? extends DMLVisitor> getDMLVisitorClass() {
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDALVisitor.java
index 5cd3deadfc2..e0847c2b665 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDALVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDALVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DALVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DALVisitor;
 import org.apache.shardingsphere.sql.parser.visitor.SQLServerVisitor;
 
 /**
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDCLVisitor.java
index aeae1ff5c4d..a4c737ea0b7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDCLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AlterLoginContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AlterRoleContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AlterUserContext;
@@ -32,7 +32,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Dro
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.DropUserContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.GrantContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.RevokeContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterLoginStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.dcl.AlterRoleStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDDLVisitor.java
index e6ef2c1315f..017bfd3ca08 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDDLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DDLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AddColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AlterColumnAddOptionContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AlterDefinitionClauseContext;
@@ -37,7 +37,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Dro
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ModifyColumnSpecificationContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.TableConstraintContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.TruncateTableContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDMLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDMLVisitor.java
index fcb44b980ec..4e3fb0f5df2 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDMLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerDMLVisitor.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.DMLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.DMLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AliasContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.AssignmentValueContext;
@@ -49,7 +49,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Tab
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.UnionClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.UpdateContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.AssignmentSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.SetAssignmentSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerTCLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerTCLVisitor.java
index 001c974d06e..126006f0c79 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerTCLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/SQLServerTCLVisitor.java
@@ -17,14 +17,14 @@
 
 package org.apache.shardingsphere.sql.parser.visitor.impl;
 
-import org.apache.shardingsphere.sql.parser.api.visitor.TCLVisitor;
+import org.apache.shardingsphere.sql.parser.api.visitor.statement.TCLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.BeginTransactionContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.CommitContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.RollbackContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SavepointContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetImplicitTransactionsContext;
 import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.BeginTransactionStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.CommitStatement;
 import org.apache.shardingsphere.sql.parser.sql.statement.tcl.RollbackStatement;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/pom.xml
index bfa222201aa..c83ef2006a1 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/pom.xml
@@ -27,4 +27,12 @@
     </parent>
     <artifactId>shardingsphere-sql-parser-statement</artifactId>
     <name>${project.artifactId}</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>shardingsphere-sql-parser-spi</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
 </project>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/predicate/PredicateBuilder.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/predicate/PredicateBuilder.java
index 050be71f4cd..74611f7b098 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/predicate/PredicateBuilder.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/predicate/PredicateBuilder.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.sql.predicate;
 
 import com.google.common.base.Preconditions;
 import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import org.apache.shardingsphere.sql.parser.sql.constant.LogicalOperator;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.AndPredicate;
 import org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.OrPredicateSegment;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/SQLSegment.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/SQLSegment.java
index b16fce4f793..7906c130949 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/SQLSegment.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/SQLSegment.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.sql.segment;
 
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 
 /**
  * SQL segment.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dml/predicate/value/PredicateRightValue.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dml/predicate/value/PredicateRightValue.java
index 72f1a072022..f520a5cffd4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dml/predicate/value/PredicateRightValue.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/dml/predicate/value/PredicateRightValue.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value;
 
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 
 /**
  * Predicate right value.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/SQLStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/SQLStatement.java
index 2f5b73f9b68..5e9b369e461 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/SQLStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/SQLStatement.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.sql.statement;
 
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 
 /**
  * SQL statement.
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/value/ValueASTNode.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/value/ValueASTNode.java
index 02745b456ec..0f092d85d59 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/value/ValueASTNode.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/value/ValueASTNode.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.sql.parser.sql.value;
 
-import org.apache.shardingsphere.sql.parser.sql.ASTNode;
+import org.apache.shardingsphere.sql.parser.api.ASTNode;
 
 /**
  * Value AST node.


Test patch:
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/SelectContext.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/SelectContext.java
similarity index 93%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/SelectContext.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/SelectContext.java
index e1607571aab..4a3b73fa5ec 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/SelectContext.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/SelectContext.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.constant;
+package org.apache.shardingsphere.sql.parser.core.visitor;
 
 import org.antlr.v4.runtime.tree.ParseTree;
 
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleNameTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRuleTest.java
similarity index 83%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleNameTest.java
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRuleTest.java
index dc26b4e1e3e..7a3d6cf1160 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/constant/RuleNameTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/test/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRuleTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.constant;
+package org.apache.shardingsphere.sql.parser.core.visitor;
 
 import org.antlr.v4.runtime.tree.ParseTree;
 import org.junit.Test;
@@ -23,15 +23,15 @@ import org.junit.Test;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
-public final class RuleNameTest {
+public final class VisitorRuleTest {
     
     @Test
     public void assertValueOfParseTreeClassSuccess() {
-        assertThat(RuleName.valueOf(SelectContext.class), is(RuleName.SELECT));
+        assertThat(VisitorRule.valueOf(SelectContext.class), is(VisitorRule.SELECT));
     }
     
     @Test(expected = IllegalArgumentException.class)
     public void assertValueOfParseTreeClassFailure() {
-        RuleName.valueOf(ParseTree.class);
+        VisitorRule.valueOf(ParseTree.class);
     }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/pom.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/pom.xml
index b53d32e2870..4cfc7f50ff8 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/pom.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/pom.xml
@@ -63,14 +63,5 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.zaxxer</groupId>
-            <artifactId>HikariCP-java7</artifactId>
-        </dependency>
     </dependencies>
 </project>