[antlr-interest] rewriting tree such that children are at same level
hakan.eryargi at gmail.com
Sun Jul 19 10:04:20 PDT 2009
below is the main part of my grammar. it's ok but it creates an AST
a & b & c -> (& (& a b) c) : an AND node with children c and another
AND node with children a and b
but i want: (& a b c) : an AND node with tree children
how can i make that with a rewrite rule ?
i've found following post in mail list but didnt helped me much :/
: primary ((AND^ primary)+ | (OR^ primary)+)?
| LPAREN! expression RPAREN!
More information about the antlr-interest