mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql parser refactor
This commit is contained in:
+3
-4
@@ -26,16 +26,15 @@ import com.alibaba.druid.sql.parser.Token;
|
||||
public class PGSQLStatementParser extends SQLStatementParser {
|
||||
|
||||
public PGSQLStatementParser(String sql) throws ParserException{
|
||||
this(new PGLexer(sql));
|
||||
this.lexer.nextToken();
|
||||
super (new PGExprParser(sql));
|
||||
}
|
||||
|
||||
public PGSQLStatementParser(Lexer lexer){
|
||||
super(lexer);
|
||||
super(new PGExprParser(lexer));
|
||||
}
|
||||
|
||||
public PGSelectParser createSQLSelectParser() {
|
||||
return new PGSelectParser(this.lexer);
|
||||
return new PGSelectParser(this.exprParser);
|
||||
}
|
||||
|
||||
public SQLUpdateStatement parseUpdateStatement() throws ParserException {
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectQuery;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.IntoOption;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLExprParser;
|
||||
import com.alibaba.druid.sql.parser.SQLSelectParser;
|
||||
@@ -15,13 +14,12 @@ import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class PGSelectParser extends SQLSelectParser {
|
||||
|
||||
public PGSelectParser(Lexer lexer){
|
||||
super(lexer);
|
||||
public PGSelectParser(SQLExprParser exprParser){
|
||||
super(exprParser);
|
||||
}
|
||||
|
||||
public PGSelectParser(String sql) throws ParserException{
|
||||
this(new PGLexer(sql));
|
||||
this.lexer.nextToken();
|
||||
this(new PGExprParser(sql));
|
||||
}
|
||||
|
||||
protected SQLExprParser createExprParser() {
|
||||
|
||||
Reference in New Issue
Block a user