improve mysql sql parser formance

This commit is contained in:
wenshao
2013-01-12 23:01:21 +08:00
parent e20247c503
commit 6c875e1ee0
11 changed files with 785 additions and 44 deletions
@@ -187,7 +187,40 @@ public class Lexer {
public String info() {
return this.token + " " + this.stringVal();
}
public final void nextTokenComma() {
if (ch == ' ') {
scanChar();
}
if (ch == ',') {
scanChar();
token = COMMA;
return;
}
if (ch == ')') {
scanChar();
token = RPAREN;
return;
}
nextToken();
}
public final void nextTokenLParen() {
if (ch == ' ') {
scanChar();
}
if (ch == '(') {
scanChar();
token = LPAREN;
return;
}
nextToken();
}
public final void nextToken() {
bufPos = 0;
@@ -223,7 +223,7 @@ public class SQLStatementParser extends SQLParser {
continue;
}
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal() + ", pos " + lexer.pos());
}
}