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