[antlr-interest] lexical nondeterminism question.

Silvain Piree s.piree at enneya.com
Tue Jun 25 07:32:00 PDT 2002


Trey,

syntactic predicates don't work across tokens ... so you'll
have to merge the lexer rules.

My suggestion would be something like this:

    conflicting_tokens:
        : (NUM_INT_lookahead)=> NUM_INT
                {$setType(NUM_INT);}
        | AMPERSAND 
                {$setType(AMPERSAND);}
        ;

    private NUM_INT : ..... ;
    private NUM_INT_lookahead: .... ;
    private AMPERSAND: ..... ;

Hope that helps a bit, Silvain




 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list