improved sql parser.

This commit is contained in:
wenshao
2017-07-19 17:55:24 +08:00
parent 8a0bf34a6c
commit 168518e0e5
37 changed files with 1017 additions and 387 deletions
@@ -56,7 +56,7 @@ public class SQLParser {
lexer.nextToken();
} else {
setErrorEndPos(lexer.pos());
throw new ParserException("syntax error, expect " + text + ", actual " + lexer.token());
throw new ParserException("syntax error, expect " + text + ", actual " + lexer.token() + ", " + lexer.info());
}
}
@@ -118,7 +118,7 @@ public class SQLParser {
return null;
}
throw new ParserException("Error : " + lexer.token());
throw new ParserException("Error : " + lexer.info());
}
if (lexer.token() == Token.LITERAL_ALIAS) {
@@ -296,14 +296,14 @@ public class SQLParser {
return intVal;
} else {
throw new ParserException("syntax error, expect int, actual " + lexer.token() + " "
+ lexer.stringVal());
+ lexer.info());
}
}
public void match(Token token) {
if (lexer.token() != token) {
throw new ParserException("syntax error, expect " + token + ", actual " + lexer.token() + " "
+ lexer.stringVal());
+ lexer.info());
}
}