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