improved sql parser.

This commit is contained in:
wenshao
2017-09-13 20:56:20 +08:00
parent c49078c650
commit f208f42e01
33 changed files with 853 additions and 29 deletions
@@ -214,9 +214,8 @@ public class Lexer {
this.skipComment = skipComment;
this.text = input;
this.pos = -1;
scanChar();
this.pos = 0;
ch = charAt(pos);
}
public Lexer(char[] input, int inputLength, boolean skipComment){
@@ -419,6 +418,12 @@ public class Lexer {
}
}
if (ch == ')') {
scanChar();
token = Token.RPAREN;
return;
}
if (isFirstIdentifierChar(ch)) {
scanIdentifier();
return;
@@ -487,6 +492,25 @@ public class Lexer {
nextToken();
}
public final void nextTokenIdent() {
while (ch == ' ') {
scanChar();
}
if (isFirstIdentifierChar(ch)) {
scanIdentifier();
return;
}
if (ch == ')') {
scanChar();
token = RPAREN;
return;
}
nextToken();
}
public final void nextToken() {
startPos = pos;
bufPos = 0;