gll
gll copied to clipboard
Parametric ("macro"?) grammar rules.
Allow defining rules that expand based on parameters - we can start off with something like this:
eq(x, x) = {};
Expr(allow_ident_left, allow_ident_right) = {
eq(allow_ident_left, "1") eq(allow_ident_right, "1") Ident |
Expr(allow_ident_left, "1") "+" Expr("1", allow_ident_right) |
...
}
Incidentally, that example is close to one of the possible solutions for #14.