[antlr-interest] Reference neseted rewriting result?

Chan David lifesting at gmail.com
Mon Jul 30 07:20:30 PDT 2012

Hi, I created a grammar, there’s a rule looks like below:

Big_rule: p1=(e=expr -> ^(VR $e1))  p2(s=statement->^(VT $s))  -> ^(ROOT
$p1 $p2)

As you see, there are three AST rewritings. ‘p1’ and ‘p2’ are nested result
of AST rewriting, and they will be referenced in the final rewriting. But
after code emitted, I found I was wrong, it doesn’t work as my mind. How to
reference nested rewriting result?

Thanks for your great help!


More information about the antlr-interest mailing list