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

shmuel siegel antlr at shmuelhome.mine.nu
Fri Apr 6 11:29:28 PDT 2007


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