I have a grammar for parsing SQL scripts. The lexer for the grammar works fine with the following code:
with open("/path/to/sql/script.sql") as f:
query = f.read().upper()
tokenStream = antlr3.StringStream(query)
lexer = MyLexer(tokenStream)
for token in lexer:
# process the token
pass
I don't know how to parser the I have a grammar for parsing SQL scripts. The lexer for the grammar works fine with the following code. There is not much documentation forthe Python runtime on the ANLTR's website.