Hi, 

This is my first post on this mailing list. so let's start by a little 
presentation. I'm a French young researcher (aka 'postdoc'), working on the 
definition of mechanisms to support separation of concerns approaches.

I'm currently using ANTLR & StringTemplate to implement a translator associated 
to a prototype. By the way, these two tools are impressive (I previously only 
work with ANTLR for another project). 

However, I'm encountering a (big) issue. The translator I'm designing must 
support the definition of a "require" mechanism. A source file "x" must be able 
to require the content of another source file "y".

The translator first start by building an AST, and then a tree grammar visit 
the AST and use the appropriate templates. My first idea is to implement 
something like the following snippet in the grammar:

require: 'require' fileName=STRING ';'  { 
                                          build the AST associated to $fileName;
                                          insert its content inside the current 
one;
                                        }

however, I have no idea on how to implement the second actions, that is, 
including the content of another AST into this one. I'm not even sure this is 
the right solution to my problem :'(. Is preprocessing a better solution?

Any ideas?

Cheers, 

--
 Sébastien

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

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

Reply via email to