I'm working on a language that allows assignment of functions to variables.
Something like this.
fun = execute(params);

Later in the same scope if I want to do.
another_fun = fun

The most natural way to do this seems to me to save the tree from the first
execute(params) in a symbol table
and then, while generating the AST, when I see that "fun" is defined, to
substitute a duplicate of it's tree for the assignment to another_fun.

The trouble is the symbol table is in C world not Antlr.  It looks like I
could just duplicate the node save
the pointer and then re-use it, but I don't see any examples of how to do
this.

Does anyone have an idea?  Even a Java example would be helpful.

Regards,
David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to