[antlr-interest] Confused about backtracking

franck102 franck102 at yahoo.com
Mon Nov 28 06:18:04 PST 2011


Christian wrote
> 
> Hi,
> 
> what is the error/exception message?
> 
> Regards,
> Christian
> 
> 

MissingTokenException at the second '=', after parsing a=b.c as an
expression. The tail recursion on expr is causing it it seems, but that's a
real issue for me... here is a slightly modified version with the recursion
made explicit that has the same problem:

program
        : statement* EOF
        ;
       
statement
        : ID '=' expr
        | sep
        ;

expr : ID ( '.' expr )*;

sep : ';' | '.';

--
View this message in context: http://antlr.1301665.n2.nabble.com/Confused-about-backtracking-tp7033712p7038881.html
Sent from the ANTLR mailing list archive at Nabble.com.


More information about the antlr-interest mailing list