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