[antlr-interest] Is this Recognizer optimization valid?

Ric Klaren klaren at cs.utwente.nl
Wed Oct 3 02:43:07 PDT 2001


Hi,

On Wed, Oct 03, 2001 at 09:57:55AM +0200, Sander Mägi wrote:
> RE: [antlr-interest] Is this Recognizer optimization valid?> You could do
> that but you still have to have guessing guards around individual
> productions, of course.  And you still have to increment and decrement the
> > guessing state just as happens now because syntactic predicates can be
> nested arbitrarily.
> 
> Are you sure?
>
> I think we would not need the guessing guard nor increment/decrement.

We would not need the guessing guard anymore. I think this is embedded then
in the call stack of the rules.

Though duplicating a lot of code to do guessing does not strike me as
efficient (size/gain ratio pretty low is my estimate) If you really go for
the last clock cycle then maybe but it depends a lot on the compiler what
the gain is. I think that in the general case it's a waste. In C++ mode I
really wouldn't go for it since code size is already biggish. In Java mode
I don't care too much no idea about gains/losses either.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
Wit is cultured insolence. - Aristotle


 

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



More information about the antlr-interest mailing list