bug fixed for oracle sql parser

This commit is contained in:
温少
2012-02-29 17:31:36 +08:00
65 changed files with 2937 additions and 183 deletions
@@ -90,6 +90,10 @@ public class Lexer {
Token token;
}
public Keywords getKeywods() {
return keywods;
}
public void mark() {
SavePoint savePoint = new SavePoint();
savePoint.bp = bp;
@@ -143,7 +147,7 @@ public class Lexer {
protected final void scanChar() {
ch = buf[++bp];
}
protected void unscan() {
ch = buf[--bp];
}
@@ -292,11 +296,24 @@ public class Lexer {
case '@':
scanVariable();
return;
case '-':
int subNextChar = buf[bp + 1];
if (subNextChar == '-') {
scanComment();
if ((token() == Token.LINE_COMMENT || token() == Token.MULTI_LINE_COMMENT) && skipComment) {
sp = 0;
continue;
}
} else {
scanOperator();
}
return;
case '/':
int nextChar = buf[bp + 1];
if (nextChar == '/' || nextChar == '*') {
scanComment();
if ((token() == Token.LINE_COMMENT || token() == Token.MULTI_LINE_COMMENT) && skipComment) {
sp = 0;
continue;
}
} else {
@@ -852,6 +869,20 @@ public class Lexer {
return result;
}
}
public int bp() {
return this.bp;
}
public char current() {
return this.ch;
}
public void reset(int mark, char mark_ch, Token token) {
this.bp = mark;
this.ch = mark_ch;
this.token = token;
}
public final String numberString() {
return new String(buf, np, sp);