1 grammar t053heteroTP18; 2 options { 3 language=JavaScript; 4 output=AST; 5 tokenVocab=t053heteroT18; 6 } 7 tokens { ROOT; } 8 @header { 9 function V18(ttype, tree) { 10 if (!tree) { 11 V18.superclass.constructor.call(this, new org.antlr.runtime.CommonToken(ttype)); 12 } else { 13 V18.superclass.constructor.call(this, tree); 14 this.token.type = ttype; 15 } 16 }; 17 org.antlr.lang.extend(V18, org.antlr.runtime.tree.CommonTree, { 18 toString: function() { 19 return t053heteroTP18Parser.tokenNames[this.getType()] + "<V>@" + 20 this.token.getLine(); 21 } 22 }); 23 } 24 a : ID -> ROOT<V18>[$ID] 25 ; 26 27