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