[antlr-interest] Recursive not supposed behaivor when finding EOF
Indhu Bharathi
indhu.b at s7software.com
Fri May 8 04:54:16 PDT 2009
Looks like you are parsing with empty input. What is the input you gave
to the parser?
Cheers, Indhu
Marwan Ajraoui wrote:
> 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
>
>
>
>
More information about the antlr-interest
mailing list