sql parser refactor

This commit is contained in:
温少
2012-05-20 14:10:35 +08:00
15 changed files with 46 additions and 66 deletions
@@ -25,8 +25,8 @@ public class SQLCreateTableParser extends SQLDDLParser {
super(sql);
}
public SQLCreateTableParser(Lexer lexer){
super(lexer);
public SQLCreateTableParser(SQLExprParser exprParser){
super(exprParser);
}
public SQLCreateTableStatement parseCrateTable() {
@@ -24,8 +24,8 @@ public class SQLDDLParser extends SQLStatementParser {
super(sql);
}
public SQLDDLParser(Lexer lexer){
super(lexer);
public SQLDDLParser(SQLExprParser exprParser){
super(exprParser);
}
protected SQLTableConstaint parseConstraint() {
@@ -59,6 +59,11 @@ public class SQLStatementParser extends SQLParser {
super(lexer);
this.exprParser = new SQLExprParser(lexer);
}
public SQLStatementParser(SQLExprParser exprParser){
super(exprParser.getLexer());
this.exprParser = exprParser;
}
public SQLExprParser getExprParser() {
return exprParser;
@@ -476,7 +481,7 @@ public class SQLStatementParser extends SQLParser {
}
public SQLCreateTableParser getSQLCreateTableParser() {
return new SQLCreateTableParser(lexer);
return new SQLCreateTableParser(this.exprParser);
}
public SQLSelectStatement parseSelect() throws ParserException {