iguana-parser / iguana

prototype parser run-time, back-end for different kinds of parser generators, including rascal.
51 stars 15 forks source link

Allow parsing from rewritten nonterminals #46

Closed afroozeh closed 1 year ago

afroozeh commented 1 year ago

This PR allows parsing from the nonterminals that will get rewritten during the datadependent grammar transformations. This is particularly useful to start parsing from expression grammar nonterminals. In this PR we generate nonterminals of the form $_expression = expression(0) and provide mechanism to pick up these top-level nonterminals when parsing from expression and also convert the parse trees back to the expected one (no $_expression node is present in the final parse tree).

jurgenvinju commented 1 year ago

That's a great feature indeed. Necessary to close the abstraction.