You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then there are two APIs - visitors and listeners. Your example mixes the two. You need to say what you want the visitor or listener to do (or you can read from the AST directly, but it's not as useful normally).
The visitor API is on the README.
The listener API is something like this
Activity
lexanth commentedon Nov 29, 2021
First off, your python is broken:
should be
Then there are two APIs - visitors and listeners. Your example mixes the two. You need to say what you want the visitor or listener to do (or you can read from the AST directly, but it's not as useful normally).
The visitor API is on the README.
The listener API is something like this
which would log
print(for the print function) and"hello world!"for the variable it calls.I suggest using typescript if possible - the type definitions are the best documentation, followed by https://github.com/antlr/grammars-v4/blob/master/python/python3-ts/Python3.g4 if you can read the ANTLR grammar