1 grammar t057autoAST36; 2 options {language=JavaScript;output=AST;} 3 a returns [result] : ids+=ID ids+=ID { 4 var p, buffer=[]; 5 for (p=0; p<$ids.length; p++) { 6 buffer.push($ids[p]); 7 } 8 $result = "id list=["+buffer.join(",")+"],"; 9 } ; 10 ID : 'a'..'z'+ ; 11 INT : '0'..'9'+; 12 WS : (' '|'\n') {$channel=HIDDEN;} ; 13