[antlr-interest] executing actions during backtrack

Terence Parr parrt at cs.usfca.edu
Thu May 11 18:43:39 PDT 2006


On May 11, 2006, at 5:11 PM, Micheal J wrote:

>> Currently there is no way to specify that an action must
>> execute even when backtracking.  That we still need a suggestion
>> for.  I almost wonder if it's a global flag like "always exec
>> actions" and then if you need a few not-executed, you can manually
>> gate with "if ( !guessing )".
>
> As per my previous message:
>
> - Can backtracking still be nested?

Sure.

> - Can an action block execute multiple times due to [possibly nested]
> backtracking?

Yes, but not for the same input position.  The same rule can only  
parse once for any giving input position no matter how deep the nesting.

Ter


More information about the antlr-interest mailing list