[antlr-interest] non-determinism warning

Terence Parr parrt at cs.usfca.edu
Tue Jul 5 15:16:42 PDT 2005


On Jul 5, 2005, at 12:13 PM, Monty Zukowski wrote:

> Monty Zukowski wrote:
>
>
>> Otherwise you could keep your own state and do something like
>>
>>  (DOT
>>    {!tabMatched}?(IDENT|TAB{tabMatched=true;})
>>    | (SOME_IMAGINARY_TOKEN_THAT_YOUR_LEXER_NEVER_PRODUCES)
>>  )*
>>
>>
>
> OK, I'm not used to thinking of stuff with k=1.  My example won't  
> work.
>   It's a neat trick, but not the right one :)
>
> Convince me of a good reason not to use k=2 and I'll put some more
> thought into it.

The language is not LL(1)...no way to avoid k>1.  If you see DOT, you  
just don't know what to pick.

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com



More information about the antlr-interest mailing list