views:

29

answers:

0

The problem is as follows:

I have an AST tree, e.g.:

^(IF cond stmt) :
{

}

Now, I would like to generate the code in the following order:

if_begin
cond
stmt
if_end

So as you can see, IF code encloses the two additional rules. Hence I would like to know, how can I generate such code. I don't want to use return values of cond and stmt rules. I wish I could invoke those rules from inside of the IF rule, so that I could place each code anywhere and anytime I want to.