antlr4 python 3 print or dump tokens from plsql grammar
问题 I am using antlr4 in Python, to read the following grammar : https://github.com/antlr/grammars-v4/tree/master/plsql file grants.sql just has "begin select 'bob' from dual; end;" simple code to print lisp like tree from antlr4 import * from PlSqlLexer import PlSqlLexer from PlSqlParser import PlSqlParser from PlSqlParserListener import PlSqlParserListener input = FileStream('grants.sql') lexer = PlSqlLexer(input) stream = CommonTokenStream(lexer) parser = PlSqlParser(stream) tree = parser.sql