1 grammar t057autoAST42; 2 options {language=JavaScript;output=AST;} 3 a returns [result] : x+=b! x+=b { 4 $result = "1st x="+$x[0].toStringTree()+','; 5 } ; 6 b : ID; 7 ID : 'a'..'z'+ ; 8 INT : '0'..'9'+; 9 WS : (' '|'\n') {$channel=HIDDEN;} ; 10