[antlr-interest] ANTLR should warn about nullable tokens

Wincent Colaiuta win at wincent.com
Tue Jun 26 00:10:19 PDT 2007


El 26/6/2007, a las 1:44, David Piepgrass escribió:

> I was testing my lexer on an invalid input when it entered an  
> infinite loop.
>
> It turns out this was because of my whitepace rule:
>
> WS: (' '|'\t'|'\n'|'\r'|'\u000C')* { $channel=HIDDEN; };
>
> Which caused an infinite sequence of WS tokens. It should be
>
> WS: (' '|'\t'|'\n'|'\r'|'\u000C')+ { $channel=HIDDEN; };
>
> IMO, ANTLR should give a warning about this.

Yes, Ter already knows about this:

<http://www.antlr.org/pipermail/antlr-interest/2007-June/ 
021279.html>

I don't know if it's in the bugtracker or not yet.

Cheers,
Wincent



More information about the antlr-interest mailing list