[antlr-interest] lexer nondeterministic warning

Ruben Trancoso rubentrancoso at gmail.com
Thu Mar 8 13:09:48 PST 2007


> > as reference (another discusson). Well, but the case here is that I
> > got a 'lexical nondeterminism warnig' on the WORD rule when dealing
> > with  SINGLE and COMPOUND word. Like in 'context' and
> > 'context-sensitivity'.
>
> You need left factoring the rules. Google 'left factoring antlr' may
> help you get some idea.

Thank you,

very simple (with your help). I was trying to make grammar readable
and was catched by a wrong path. I just changed the WORD rule and it
worked well.

WORD
    : SINGLEWORD (HYPHEN SINGLEWORD)*
    ;

-- 
Ruben

Quando um homem não acredita em Deus,
não é que não acredite mais em nada -
é que ele acredita em qualquer coisa.
(G. K. Chesterton)


More information about the antlr-interest mailing list