Standalone executable with multiple DSLs [message #1753885] |
Sat, 11 February 2017 18:04 |
Abhishek Dubey Messages: 10 Registered: July 2015 |
Junior Member |
|
|
Hi all,
I have a project where there are 3 grammars: Datatypes, APP, and System. The App cross references entries from datatypes and System cross references entries from APP.
I am trying to create a standalone generated for System Models. Based on available information, I have called the 3 standalone setups. Then I am passing all the related models (for all of the 3 grammars) into the main file. And I am loading them using injectors specific to the grammar.
For example
injectsystem = new SystemStandaloneSetup().createInjectorAndDoEMFRegistration()
injectapp = new AppStandaloneSetup().createInjectorAndDoEMFRegistration()
injectdata= new AppStandaloneSetup().createInjectorAndDoEMFRegistration()
.... and
var resourceSetSystem= injectsystem .getInstance(typeof(XtextResourceSet))
var resourceSetApp = injectapp .getInstance(typeof(XtextResourceSet))
var resourceSetData = injectdata.getInstance(typeof(XtextResourceSet))
...
then
for (arg : args) {
... do some processing to get ext (extension)
if(ext=="sys")
{
resourceSetSystem.getResource(URI.createFileURI(arg), true)
}
else if (ext=="app")
{
resourceSetApp .getResource(URI.createFileURI(arg), true)
}
else if (ext=="dt")
{
resourceSetData .getResource(URI.createFileURI(arg), true)
}
}
However, when I try to run the validator on the system model it gives me errors that the references cannot be resolved. I think I understand why it is happening. However, I am not sure how to resolve the references across the three resourcesets in the standalone mode.
Thanks for your help.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds