[antlr-interest] blog entry to new tree stuff

Terence Parr parrt at cs.usfca.edu
Thu Jun 9 10:21:22 PDT 2005


On Jun 8, 2005, at 5:00 PM, Matthew Ford wrote:

> Hi Ter,
> What about creating trees/nodes programmatically after a tree  
> branch is
> matched?

The operators are probably best done on the fly rather than queueing  
up the instructions, but I'm not positive of that.  For example, to  
debug tree construction i may have to compute the set of tree  
building primitives anyway to send to the gui.  Can you give me an  
example that you need to do again?

> In a rewrite project I am creating derivatives for equations and  
> need to add
> extra trees, nodes ect.
> In V2 I had to copy/clone almost everything to prevent tree loops.
> I have sent you notes on this in the past.  What are you current  
> ideas?

Well, for building stuff after the fact, the -> rewrite stuff will  
probably work, right?

> matthew
>
> p.s.
>
> I think you ment
> e : ^(PLUS a=INT b=INT) -> {$a.getValue()==0}? $b
>                         -> ^(PLUS $a $b)

Right!

Thanks,
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com



More information about the antlr-interest mailing list