Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
2.4
-
None
-
None
Description
SQL parser implementation contains many abbreviation rule violations and names that doesn't reflect the method intention:
1. "token" instead of "tok" in variables
2. SqlParserUtils.skipIfMatches throws an exception if the token doesn't match, although the name doesn't reflect this. 'accept' or 'skip' without 'if' would be more precise
3. SqlKeyword.DEFAULT clashes with SqlParserTokenType.DEFAULT
4. SqlParserUtils.skipCommaOrRightParenthesis() can be generalized. It's better to return the token it's met instead of obscure boolean (otherwise the name should reflect the returned type)
5. It makes sense to have a method to return the current token. The container can be refactored from SqlLexerLookAheadToken, since lookahead token doesn't need it's own class.
6. SqlLexerTokenType.EOF does not mean 'end of FILE'.