[antlr-interest] comments on suggestion to reduce tree construction code size

Terence Parr parrt at jguru.com
Fri Dec 28 11:44:46 PST 2001


On Thursday, December 27, 2001, at 06:09  AM, Ric Klaren wrote:
> I would like to look at this before it might go into C++ mode. My
> experience with these kind of guards is that in a non critical loop the
> overhead is usually neglectible. Object creation can be very costly in 
> C++.

Okidoki.

> Also it would depend very much on the grammar and the amount of guessing
> occuring. Does this work in the general case?

It depends on how much you use predicates ;)

> It also depends on coding style in antlr. If you spread around a lot of
> actions which could be bundled in one action block, you'll end up with a
> lot of 'guards'.

Well, it only turns gates off of the automatically generated tree 
construction stuff as we can say "no side-effects".  user actions can 
lots of stuff like adding objects to symbol tables.

Ter
--
Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

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



More information about the antlr-interest mailing list