[antlr-interest] Confused about backtracking

Christian chwchw at gmx.de
Mon Nov 28 07:02:11 PST 2011


Mh, I am with you. I also do not understand backtracking in this
situation ;)

Could anyone else explain it, please?

Am 28.11.2011 15:18, schrieb franck102:
> 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.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



More information about the antlr-interest mailing list