Using own tree generation
1 posts in topic
Flat View  Flat View

Posted By:   frigot_eric
Posted On:   Thursday, October 25, 2001 01:10 AM

ok, i am using my own creation of tree.

And, for exemple i have a rule like :

do_statement : DO statement WHILE LPAREN expression RPAREN;

I want to produce an object of type DoStatement (Java class) which contain a Statement object and an Expression object, Must i write something like that :

do_statement[DoStatement dostate] : DO stat:statement WHILE LPAREN exp:expression RPAREN {dostate = new DoStatement (stat, exp) ; } ;

I think i have to write this, but where i made the include of all my classes, it's the only think i have to do ???

Re: Using own tree generation

Posted By:   Terence_Parr  
Posted On:   Saturday, October 27, 2001 12:06 PM

Howdy. You can use the heterogeneous tree construction stuff with 2.7.1 ANTLR. You can tell it what kind of tree node to make for any token. The way it puts it together is still a tree, but of course that is what you are suggesting (even if you don't think of it as a tree).
About | Sitemap | Contact