1 grammar t049treeparserh; 2 options { 3 language=JavaScript; 4 output=AST; 5 } 6 a : x=ID INT? (y=ID)? SEMI -> ^($x INT? $y?) SEMI ; 7 ID : 'a'..'z'+ ; 8 INT : '0'..'9'+; 9 SEMI : ';' ; 10 WS : (' '|'\\n') {$channel=HIDDEN;} ; 11