J'essaye d'utiliser la grammaire ci dessous mais la regle 'variableDeclarator' ne fonctionne pas en
mettant 'int' ou 'string' suivi d'un identifier si j'essaye de parser 'string x = 12;'
Si en plus de 'string' et 'int' je mets Identifier dans la liste, ca fonctionne !!!

une idée ?
merci


grammar Test;
prog : methodDeclaration* EOF;
methodDeclaration : returnType Identifier '(' parameterList? ')' block ;
parameterList : Identifier (',' Identifier)*;
returnType : 'void' | Identifier;
block : '{' statement* '}';
statement : variableDeclarator;
variableDeclarator : ('string' | 'int') Identifier '=' NUM ';' ;

Identifier : [a-z]+ ;
NUM : [0-9]+ ;
COMMA : ',';
EQUAL : '=';
PV : ';';
PAR : '(';
PAR2 : ')';
ACC : '{';
ACC2 : '}';
INT : 'int';
STRING : 'string';
WS : [ \t\r\n]+ -> skip ;