Reading in File from another DSL in Generator [message #1705757] |
Tue, 18 August 2015 20:34 |
Bine Lu Messages: 3 Registered: August 2015 |
Junior Member |
|
|
Hi everyone
I got a problem using two different DSLs and I can only find how to include the grammatik of another DSL into one DSL.
I have two grammatiks difined and need to read in a file from another DSL in my generator. That looks something like that:
DSL1-Definitions :
generate dsl1DSL "http://www.dsl1DSL.dsl1"
DSL1:
somecontent=STRING
(otherDSLs+=OtherDSL)*;
OtherDSL:
"OtherDSL" name=ID path=STRING;
DSL-Definition 2:
generate dsl2DSL "http://www.dsl2DSL.dsl2"
DSL2:
somecontent=STRING
(methodcalls+=MethodCall)*;
MethodCall:
"methos" returnValue=ID methodName=ID params=STRING;
Now I need to check for the DSL2 in my DSL1 generator.
Something like this:
for (otherDSL : DSL1.otherDSLs) {
Resource resource = new Resource(otherDSL.path);
val dsl2 = resource.allContents.filter(typeof(DSL2)).head;
for (methodcall : dsl2.methodCalls) {
//use content here
}
}
Any ideas how I can do that? Is there a way of creating a "Resource" or something similiar od an other DSL?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02494 seconds