[antlr-interest] Re: tree --> tree transformation

Bernhard Damberger bernied at gmail.com
Thu Jun 22 12:06:37 PDT 2006


On Jun 19, 2006, at 10:31 PM, Bernhard Damberger wrote:
> I was trying to make a tree grammar with Antlr 3.0 that spits out
> another modified tree.

Uh oh!  You caught me!  I have not implemented that feature yet...I'm
not sure exactly how I want to do it.

> I just want to transform a tree from one form to another.


As a starting point, would it be possible for me to just make the two fixes
you outline below (locally), and just build trees using that for now? It
would be nice to be able to continue my development while your still hashing
out the issue of dups/no dups etc.

You might want to provide some control on whether dups are made or not. The
tree I am using is my own tree (which happens to implement Tree interface),
and it might not be the best representation for the transformed tree. So in
my case I am perfectly happy with creating a dup'ed tree. Also, the tree
that I am constructing from is a very simple (slist style) format, so its
going to be transformed from a compact representation to something much more
verbose and w/ more information.

Might also want to consider how TreeAdaptors fit into this whole scheme.

Is this feature going to be working for the beta?

_bernhard

PS I was trying to manually move the Java grammer from 2.7 to 3.0. Almost
got it working, but I don't understand enough about the parser (LL(*) etc)
to finish it. But what I did do instead was use antlr 2.7 to create a tree
that implements both antlr.AST and org.antlr.Tree, and then use the antlr
3.0 to do my tree transformation...which now I find is not yet done. :-( Its
a hack, but it works.

PPS Whats the diff between ^ and ^^ in antlr 3.0?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060622/96645bac/attachment.html


More information about the antlr-interest mailing list