Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Is there a way to infer a non-JVM dsl model(Inferring one DSL from another DSL)
Is there a way to infer a non-JVM dsl model [message #1397196] Wed, 09 July 2014 10:52 Go to next message
nic newdigate is currently offline nic newdigateFriend
Messages: 2
Registered: July 2014
Location: Cape Town
Junior Member
I am trying to infer a dsl from another dsl during the DoGenerate(...) method call.

This works nicely when the generated dsl doesnt cross-reference other files using Import statements

When I manually generate the derived dsl code in eclipse, the scoping and cross-references work, however, when I use doGenerate(...) to derive the dsl code automatically, the scoping / cross references don't work as it seems the new derived resources/models are not visible.

I use a recursive method which iterates through the import statements and generates the dependent models. I serialize these models to their DSL representation and save them to the project using FileSystemAccess.. I have also tried creating and adding new Resources (which then dont appear in the project after the doGenerate is called). Both of these strategies do not seem to apply them to the scope because i get ["No EObjectDescription could be found in Scope"] exceptions.

Any insight would be appreciated. i can provide a project for you to reproduce if this will help...

Many thanks,
Regards
Re: Is there a way to infer a non-JVM dsl model [message #1397340 is a reply to message #1397196] Wed, 09 July 2014 15:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

the jvm magic is done in two steps

1 IDerivedStateComputer adds inferred stuff to the resources
2 JvmModelGenerator generated the code per resource from the derived stuff

so maybe it wont solve your problem since it generates since it actually never serializes a derived model by xtext serializer means


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Is there a way to infer a non-JVM dsl model [message #1397832 is a reply to message #1397340] Thu, 10 July 2014 08:06 Go to previous message
nic newdigate is currently offline nic newdigateFriend
Messages: 2
Registered: July 2014
Location: Cape Town
Junior Member
Thanks Christian for your response. I managed to get this scenario working by adding the generated model and its dependencies to the contents of a resource. It turns out I didnt need to save the resource, and serializing it and saving it using FileSystemAccess works well. The scoping/cross referencing actually just worked out of the box once the dependant models where added to the contents of a resource....




Previous Topic:[XBase] Corss-referencing function definitions
Next Topic:clean temp folders created by xtext-maven-plugin
Goto Forum:
  


Current Time: Thu Apr 25 19:29:47 GMT 2024

Powered by FUDForum. Page generated in 0.02980 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top