[antlr-interest] Reccomended method: actions or TreeAdaptor?

Jim Idle jimi at temporal-wave.com
Wed Apr 25 18:03:54 PDT 2007


Your colleague is correct. Unless you need some weird and wonderful elements to form the tree, you don't need your won tree adaptor or anything. You can specify the type of object that is passed around in the tree, so long as it inherits from BaseTree, but I doubt you need that either.

What you should do is download the ANTLR examples. In there you will find a small tree example.

Bon Chance,
Jim


-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Marc-André Laverdière
Sent: Wednesday, April 25, 2007 2:38 PM
To: ANTLR Interest
Subject: [antlr-interest] Reccomended method: actions or TreeAdaptor?

Hello,

I guess you can tell by now that I'm a newbie to the world of 
programming languages/compilation.

My objective is to translate the raw AST into something that fits in a 
class diagram that represents my program logic, so that I can write some 
code interfacing with it and handling it.

I was discussing with a colleague who used yacc who told me that I 
should modify the AST using actions. Yet, the Wiki hints that the 
TreeAdaptor is the way to go now...

Some articles on the website (from Antlr2) talk about tree grammars as 
well, so I end up not knowing what's the best way to do what I have to do.

What are the options, the pros and the cons?

Thanks!


-- 
Marc-André LAVERDIÈRE, B. Eng., M. A. Sc. (in progress)
Computer Security Laboratory - Laboratoire de sécurité informatique
CIISE, Université Concordia University, Montréal, Québec, Canada
www.ciise.concordia.ca

/"\
\ /    ASCII Ribbon Campaign
  X      against HTML e-mail
/ \

"Perseverance must finish its work so that you may be mature and 
complete, not lacking anything." -James 1:4


More information about the antlr-interest mailing list