[antlr-interest] Re: Summary of ANTLR Issues

Ric Klaren klaren at cs.utwente.nl
Thu Jul 10 02:47:21 PDT 2003


Hi,

On Wed, Jul 09, 2003 at 06:05:45PM -0000, lgcraymer wrote:
> Actually, immediate invocation of an AST method is something that 
> ANTLR 3 probably won't support--we are likely to change the way ASTs 
> are constructed to optimize away the problem of excessive AST node 
> allocation (creating a node and then never using it).  The idea is 
> that ANTLR would construct a list of AST operations (node creation, 
> add sibling, make root) and then apply them at the end of a rule.  You 
> would have to have "MyMethod" called by the constructor.

Sounds like a good solution to getting rid of a lot of the action.g horror.
Although you still have the problem of having to do two passes over an
action to see which nodes are actually referenced? Or it might shift the
problem to creating a set of AST operations that would get thrown away ?
(But you guys probably thought of that ;) )

And you then have a way to specify that a certain AST type has different
parameters?

Would it still be possible to label parts of the tree, so you can do stuff
after it's been constructed? For some stuff a parser/treeparser chain is a
bit overkill although it might depend on the amount of trouble it is to
make such a chain in the new setup.

Will the new codegenerator lose the (ab)use of exceptions for parsing ?
This eats cycles, and makes the binaries bigger in C++ mode. (And somewhat
prevents targetting old C)

I wouldn't mind seeing some code generated by any prototype if available ;)

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  Wo das Chaos auf die Ordnung trifft, gewinnt meist das Chaos, weil es
  besser organisiert ist. --- Friedrich Nietzsche


 

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




More information about the antlr-interest mailing list