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