[antlr-interest] executing actions during backtrack

Kay Roepke kroepke at dolphin-services.de
Tue May 9 15:26:17 PDT 2006


On 9. May 2006, at 22:59 Uhr, Oliver Zeigermann wrote:

> I guess you need something like an inverse action that applies when
> backtracking fails. So you might need a pair of actions. This way all
> actions executed inside backtracking are undone when backtracking is
> done. Maybe it is enough to add an inverse action to indicate it
> should be executed inside backtracking?

I concur. It would be helpful to have both, though.
@guessing{} for those actions I only want to be doing while guessing  
and a "@unguessing{}" or rather "@backtrack{}"
for unrolling the things I have done previously (if any).

It would be cool if the @guessing{} part would be executed again like  
a normal action when doing the actual "parse with feeling" (I like  
that :))
so users don't have to write the same action twice, though it might  
be hard to decide whether or not the user actually wants this. Dunno.

-k




More information about the antlr-interest mailing list