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

Marc-André Laverdière ma_laver at ciise.concordia.ca
Thu Apr 26 11:22:26 PDT 2007


Hello,

I tried putting in some classes in a {} pair at the beginning, to no 
avail. AntlrWorks doesn't like the grammar.

I was thinking of having something like
a: b[$$]
b[classA a]: ... {a.addB(new B ($$));}

Would that work in V3? I'm getting a bit frustrated by the small 
documentation online, and I don't have the budget to buy the book. I 
really want to spare myself the pain of using Bison (and its annoying 
generated C/C++ code).

Just negotiating a deal here: if I can make this work (and I'll need 
help for that), I'll write an article on the Wiki titled "My grammar 
works, what do I do now?".

MA

Jim Idle wrote:
> 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,

Bonne chance :P

> <snip>
-- 
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