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
pgen2 is the LL parser generator borrowed from Python, used for recognizing the Oil expression language (which is based on Python). Caveat: it's a bit hard to use!!!
Tips:
Print out the parse tree with print_parse_tree in frontend/parse_lib.py. The structured of the parse tree depends on the exact structure of the grammar's rules.
In oil_lang/expr_to_ast.py, make sure you copy the relevant productions into comments. That will make it easier to write the "transformer".
See opy/compiler2/transformer.py for "tips" on transforming rules to AST nodes. However, note that we have the "singleton-collapse" rule which OPy doesn't have. Ping me for details if you don't understand this.