[antlr-interest] Can tree rewriting be done (easily/out-of-the-box) with the current ANTLR 3.x?

Johannes Luber jaluber at gmx.de
Thu Dec 13 13:52:58 PST 2007


Terence Parr schrieb:
> Hi Harald,
> 
> I apologize for the delay in getting the tree rewriting done.  I am back
> working on antlr now, well after I grade my final exam, but Kay Roepke
> is here for two weeksfrom Hamburg and we will be doing a lot of hacking.
> 
> In the meantime, you can do tree rewriting by returning a new tree
> from every rule.  Start by including an @after action I think that 
> makes a duplicate of the incoming tree $rule.start. When you need to do
> a rewrite, you will have to probably manually build the new tree for
> those productions needing a new tree.  Set the return value.  Ack, every
> reference to a rule will need to build up a new tree based upon what is
> returned.  This will be very messy and error prone.  Hmm...
> 
> Ter
> 

Does this mean you haven't written the parts so far that it works with
ANTLR rewritng syntax (whichever that may look like)? If I'm correct
then how long will you probably need for the missing parts?

Johannes


More information about the antlr-interest mailing list