[antlr-interest] Recursive not supposed behaivor when finding EOF
Marwan Ajraoui
marwan.alephn at gmail.com
Fri May 8 02:58:00 PDT 2009
Hi there;
I'm getting a strange error form a parser. I have defined a grammar,
wich contains these rules;
decl_codigo : decl_libreria decl_program
decl_libreria : TAG_START_OPEN 'function_library' ':' FN_ID TAG_CLOSE
decl_funciones TAG_END_OPEN 'function_library' TAG_CLOSE;
decl_program : TAG_START_OPEN 'program' type_return '::' FN_ID ':'
params_list TAG_CLOSE lista_instrucciones TAG_END_OPEN 'program'
TAG_CLOSE ;
So when i finish parsing the input tested, ANTLR notifies,
line 0:-1 mismatched input '<EOF>' expecting TAG_START_OPEN
To find out what could be the problem, i put the TAG_START_OPEN , so i got:
line 0:-1 mismatched input '<EOF>' expecting 'function_library'
I did check my .g, if i have some other reference to "decl_libreria",
but No, the only reference is written is the one i mentioned before in
the lines above. it is supposed to finish without errors and return an
AST, as i set up the option.
So why it does behave in recursive way? Any idea.
thanks in advance
--
Marouane
More information about the antlr-interest
mailing list