1 grammar t053heteroTP14; 2 options { 3 language=JavaScript; 4 output=AST; 5 tokenVocab=t053heteroT14; 6 } 7 @header { 8 function V() { 9 V.superclass.constructor.apply(this, arguments); 10 }; 11 org.antlr.lang.extend(V, org.antlr.runtime.tree.CommonTree, { 12 toString: function() { 13 return this.getText() + "<V>"; 14 } 15 }); 16 17 function W() { 18 W.superclass.constructor.apply(this, arguments); 19 }; 20 org.antlr.lang.extend(W, org.antlr.runtime.tree.CommonTree, { 21 toString: function() { 22 return this.getText() + "<W>"; 23 } 24 }); 25 } 26 a : ID INT -> ^(INT<V> ID<W>) 27 ; 28 29