In my grammar i have an include rule as follow :
Script:
includes+=(Include)* assignments+=(Assignment)* clock=Clock? tests+=Test*
;
Include:
'INCLUDE' importURI=STRING
;
what I want to do is to include files same as the "main" file.
I'm working with an interpreter
that handels the .mydsl file.
/* Main exec methode */
def dispatch void exec(Script s) {
s.includes.forEach[ i | i.exec]
s.assignments.forEach[a | a.exec]
s.clock.exec
s.tests.forEach[t|t.exec]
}
/* include methode */
def dispatch void exec(Include i) {
System.out.println( i.importURI + " included")
}