[antlr-interest] executing actions during backtrack

Jeff Barnes Jeff.Barnes at codesic.com
Tue May 9 15:03:12 PDT 2006


Like the Command Stack pattern? Gamma et al.

________________________________

From: antlr-interest-bounces at antlr.org on behalf of Terence Parr
Sent: Tue 5/9/2006 2:24 PM
To: ANTLR Interest
Subject: Re: [antlr-interest] executing actions during backtrack




On May 9, 2006, at 1:59 PM, 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?

Hi :)  Yep, thought about that and decided it's probably very hard to 
always do an undo.  That said, for symbol tables it might be doable.  
Might have to track stuff in a data structure to manage the undos.  
What if we did "software transaction" like stuff to auto-rewind?

Ter




More information about the antlr-interest mailing list