[antlr-interest] executing actions during backtrack

Martin Probst mail at martin-probst.com
Wed May 10 00:00:45 PDT 2006


Hi,

>>  How can I know what to track?
>> Impossible.  Users will
>> have to provide a specific undo action that I can
>> execute:
>
> Not sure why... a checkpoint would manage that for
> you. A redo "log" would provide snapshots of the state
> along with the Command object that caused that change
> of state. Command would by its nature change the state
> of the model. Nothing else matters.

What would you checkpoint then, the entire heap & stack? Somehow the  
user needs to tell you what is going to be changed as you can't find  
it out from looking at the code, at least not generally (Turing  
anyone?) and certainly not easily in imperative languages. You can't  
generate a checkpoint without either knowing what to save or copying  
the whole machine. And even if you generally know what to save (e.g.  
all member variables of the parser class) it might get horribly  
inefficient, as for many actions you wouldn't really need to save  
them all. Then you get copy on write etc., this is the way to a lot  
of complexity and completely out of the scope of ANTLR.

This is why we have databases with special query languages, they are  
explicitly designed so that you can analyze what gets modified or  
accessed...

Martin



More information about the antlr-interest mailing list