[antlr-interest] EOF in ANTLR 3.1

Gerard van de Glind g.vandeglind at beinformed.nl
Mon Aug 11 03:31:53 PDT 2008


> Hi all,
>
> I am testing my grammar with the upcomming ANTLR 3.1 release (using the
> latest beta 3.1b2).
>
> This transition causes problems with the EOF token recognition. With the
> latest 3.1 beta my grammar has become less strict.
>
> It doesn't seem to look for the EOF token anymore. Has something changed
> with regards to the EOF token?
>
> Regards, Gerard
>

Do you have a start rule with EOF at its end? Or did you remove EOF?

Johannes


Hi Johannes and all,

I have a start rule with EOF at each alternative, as follows:

expression
 options { backtrack = true; }
  : formula             EOF!
  | condition   EOF!
  | dateAtom    EOF!
  | stringAtom  EOF!
  ;

Does the backtrack option cause problems?

Regards, Gerard




More information about the antlr-interest mailing list