[antlr-interest] Can't create AST Node?

Ric Klaren klaren at cs.utwente.nl
Thu Jul 8 08:32:58 PDT 2004


On Thu, Jul 08, 2004 at 10:54:09AM -0400, Tiller, Michael (M.M.) wrote:
> Actually, I've reached the end of the rope with heterogenous AST types
> in ANTLR.  It was such a pain to do this in C++ and I see a whole new
> horizon of problems on the Java side.  I'm just going to bite the bullet
> and turn "buildAST" off and make the tree myself.  It is just too much
> trouble (for me) to deal with all the inheritance and casting issues.
> The downside is that this tosses tree parsing right out the window but I
> haven't really used the tree parser stuff anyway so I'm not losing much
> there.

I can understand. The heterogeneous AST stuff always looked like a quick
hack on top of the old functionality. The combination of the action parser
and the codegenerators is really sucky when it comes to figuring the stuff
out for codegeneration.

Actually you can come a very long way with just using a custom AST. (which
is what I'm doing in my projects so far) Once you got a homogeneous AST you
can quite easily convert it to a custom structure that better support
visitor like patterns and such.

I hope we can get the heterogeneous stuff right in ANTLR 3. (Or if someone
gets inspiration to lobotomize the current ANTLR 2 codegen interface)

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.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
  Chaos is found in greatest abundance wherever order is being sought.
  --- Terry Pratchet



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list