[antlr-interest] Can't create AST Node?
Tiller, Michael (M.M.)
mtiller at ford.com
Thu Jul 8 10:35:04 PDT 2004
> -----Original Message-----
> From: Ric Klaren [mailto:klaren at cs.utwente.nl]
> Subject: Re: [antlr-interest] Can't create AST Node?
> On Thu, Jul 08, 2004 at 10:54:09AM -0400, Tiller, Michael (M.M.)
> > Actually, I've reached the end of the rope with heterogenous AST
> > in ANTLR. It was such a pain to do this in C++ and I see a whole
> > horizon of problems on the Java side. I'm just going to bite the
> > and turn "buildAST" off and make the tree myself. It is just too
> > trouble (for me) to deal with all the inheritance and casting
> > The downside is that this tosses tree parsing right out the window
> > haven't really used the tree parser stuff anyway so I'm not losing
> > there.
> I can understand. The heterogeneous AST stuff always looked like a
> hack on top of the old functionality. The combination of the action
> and the codegenerators is really sucky when it comes to figuring the
> out for codegeneration.
> Actually you can come a very long way with just using a custom AST.
> is what I'm doing in my projects so far) Once you got a homogeneous
> you can quite easily convert it to a custom structure that better
> visitor like patterns and such.
Well that is what I was attempting in the original note in this message
but I couldn't get that to work either!
> I hope we can get the heterogeneous stuff right in ANTLR 3. (Or if
> gets inspiration to lobotomize the current ANTLR 2 codegen interface)
Well, once I get ANTLR to build my tree the way I want it, I'll try to
put something together to show what I did how I would like things.
Obviously, if my needs are unique then I don't expect much support for
them from ANTLR. So far, I find the grammar much easier to follow than
before with the added benefit that I'm not casting stuff all over the
place or introducing lots of complexity to support tree parsing.
> It might be though that the problem on the java side is easier. The
> absence of the Reference counter's in java might make things a lot
> less painfull as things are on the C++ side.
Keep in mind that I'm doing this in **Java**.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest