enhance sql parser

This commit is contained in:
温少
2012-03-12 13:21:41 +08:00
parent f3e9808917
commit b43d363e6b
6 changed files with 9 additions and 5 deletions
@@ -40,7 +40,7 @@ public class MySqlSelectParser extends SQLSelectParser {
}
@Override
protected SQLSelectQuery query() throws ParserException {
public SQLSelectQuery query() throws ParserException {
if (lexer.token() == (Token.LPAREN)) {
lexer.nextToken();
@@ -229,7 +229,7 @@ public class OracleSelectParser extends SQLSelectParser {
return select;
}
protected SQLSelectQuery query() {
public SQLSelectQuery query() {
if (lexer.token() == (Token.LPAREN)) {
lexer.nextToken();
@@ -23,7 +23,7 @@ public class PGSelectParser extends SQLSelectParser {
}
@Override
protected SQLSelectQuery query() throws ParserException {
public SQLSelectQuery query() throws ParserException {
PGSelectQueryBlock queryBlock = new PGSelectQueryBlock();
accept(Token.SELECT);
@@ -35,7 +35,7 @@ public class SQLServerSelectParser extends SQLSelectParser {
return select;
}
protected SQLSelectQuery query() throws ParserException {
public SQLSelectQuery query() throws ParserException {
if (lexer.token() == Token.LPAREN) {
lexer.nextToken();
@@ -28,6 +28,10 @@ public class SQLParser {
this.lexer = lexer;
}
public final Lexer getLexer() {
return lexer;
}
protected boolean identifierEquals(String text) {
return lexer.token() == Token.IDENTIFIER && lexer.stringVal().equalsIgnoreCase(text);
}
@@ -102,7 +102,7 @@ public class SQLSelectParser extends SQLParser {
return selectQuery;
}
protected SQLSelectQuery query() throws ParserException {
public SQLSelectQuery query() throws ParserException {
if (lexer.token() == Token.LPAREN) {
lexer.nextToken();