[antlr-interest] Why the generated parser code tolerates illegal expression?

Guntis Ozols guntiso at latnet.lv
Wed Nov 28 06:59:23 PST 2007


> Thanks Harald. It works now. Should this be recorded in FAQ?

This gotcha got me too.
It would also be nice to display some warning/hint in antlrworks when
debugging/interpreting and starting with rule that does not end with EOF.

>...
> I once found that explicit checking fro EOF helps to force the parser
>  to read thru all its input. So make your outermost rule (constraint?):
>
>  constraint: orexpression EOF ;
>
> - then it should work.
> I think that right now, only the part before the ANND is recognized,
>  then parsing ends.
>...



More information about the antlr-interest mailing list