[antlr-interest] Simple grammar seems to produce infinite loop

Terence Parr parrt at cs.usfca.edu
Sat Apr 7 11:33:26 PDT 2007


oops. added:

http://www.antlr.org:8888/browse/ANTLR-102
Ter
On Apr 6, 2007, at 11:29 AM, shmuel siegel wrote:

> I accidentally wrote a grammar that produces a token based on  
> nothing. The generated lexer will accept the nothing and keep  
> going. This, of course, doesn't consume any characters, hence the  
> infinite loop. Antlr should probably reject the grammar. The  
> problem occurs both with antlrworks 1.0b8 and antlr-03-30-2007.14.jar.
>
> sample grammar:
> grammar boo;
> what    :    What;
> What    :    Why|;
> fragment Why
>    :    'y';
>
>



More information about the antlr-interest mailing list