[antlr-interest] Wrong rule in parser gets matched

Martin Probst mail at martin-probst.com
Sun Feb 26 11:25:59 PST 2006


> I understand 
> that this is because both statements can start with an IDENT but i can't for 
> the life of me solve the problem. Could this be solved by a semantic 
> predicate that somehow recognises the variable type? Or does my code need 
> restructuring?

You can try to increase lookahead to 2. Alternatively, you can use a
predicate, e.g.

expression
| ( IDENT ("is" | "as") ) => sensorCont

Martin



More information about the antlr-interest mailing list