1 // @@ANTLR Tool Options@@: -trace 2 tree grammar t051treeRewriteASTxWalker; 3 options { 4 language=JavaScript; 5 output=AST; 6 ASTLabelType=CommonTree; 7 tokenVocab=t051treeRewriteASTx; 8 rewrite=true; 9 } 10 tokens { X; } 11 s : a* b ; // only b contributes to tree, but it's after a*; s.tree = b.tree 12 a : X ; 13 b : ^(ID INT) -> INT 14 ; 15