[antlr-interest] Re: Local lookahead depth

Ric Klaren klaren at cs.utwente.nl
Tue Nov 11 10:04:34 PST 2003


Hi,

On Tue, Nov 11, 2003 at 08:07:41AM -0800, mzukowski at yci.com wrote:
> The only languages I know of that can roll back are functional languages.
> In the world of Java and C++ you'll be stuck doing it yourself.  mark() and
> rewind() give you the hooks, almost like guess-success & guess-fail above.
> I'm scratching my head about why it isn't just guess-finished (rewind()).

You could do some tricks with destructors and local objects in C++, but it
would depend largely on the datastructures used etc. Then again something
like this will always be dependant on the structures you're checking
against because usually these things will be domain specific, so doing
something generic will be somewhat hard i guess.

> If the guess succeeds the whole thing will be executed again (right Tom?).
> ANTLR 3 could be augmented to allow before & after actions for a synpred but
> the concern there is that people will use them without understanding what
> they are doing.  

We could move into the footbandage business ;)

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  Quidquid latine dictum sit, altum viditur.
                 (Whatever is said in Latin sounds profound.)


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list