Open chengchengpei opened 1 year ago
Please include the following information
python3 antlr4 version is 4.9.3
import sys import antlr4 from PrestoSqlLexer import PrestoSqlLexer from PrestoSqlParser import PrestoSqlParser def main(): input_stream = antlr4.CharStream('select 1') lexer = PrestoSqlLexer(input_stream) tokens = antlr4.CommonTokenStream(lexer) tokens.fill() print([token.text for token in tokens.tokens][:-1]) if __name__ == '__main__': main()
error:
Traceback (most recent call last): File "/Users/clients/autocomplete/parseQuery.py", line 4, in <module> from PrestoSqlParser import PrestoSqlParser File "/Users/clients/autocomplete/PrestoSqlParser.py", line 1837 self.from = None # QualifiedNameContext ^^^^ SyntaxError: invalid syntax
looks like you are using a reserved keyword in you grammar rules ?
I changed to 4.11.1 and the errors gone...
Please close ?
Please include the following information
python3 antlr4 version is 4.9.3
error: