Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JVM model inferrer for non-xbase models
JVM model inferrer for non-xbase models [message #757895] Mon, 21 November 2011 15:56 Go to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 42
Registered: July 2009
Member
Hi,

I have an an entity model, whose DSL does not extend Xbase (and I cannot
change this). Nonetheless, I would like to reference these entities from
Xbase-based models - for this, it would be nice if I could simply
implement a JvmModelInferrer for the non-Xbase model - but how would I
best do this? The whole "inferring" infrastructure is only generated for
Xbase-based DSLs. Is there an easy way to achieve this nonetheless?

Glad for any hints!
Kai
Re: JVM model inferrer for non-xbase models [message #758273 is a reply to message #757895] Tue, 22 November 2011 14:20 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
To reference entities in your DSL in an Xbase-based DSL you just need to import your DSL's meta model into the grammar for the Xbase-based DSL and make sure you have cross-references to the entity concept. The JvmModelInferrer is used to define a mapping from DSL concepts to Java types so that's only useful if your entity concept has a JVM counterpart (e.g., through code generation), in which case it can be used as target in the Xbase-based DSL without explicitly creating cross-references to that type.

Re: JVM model inferrer for non-xbase models [message #758282 is a reply to message #758273] Tue, 22 November 2011 14:41 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 42
Registered: July 2009
Member
> so that's only useful if your entity concept has a JVM counterpart

I am not sure about that. What I would like to achieve is to be able to
travers my (non-xbase) entity model within my xbase-DSL with feature calls.
Example: I have Entity "a" in the scope, I would like to be able to do a
"a.b.c" expression.
As far as I understand, Xbase requires me to have JvmTypes for these
entities/properties (unless I am re-implementing XAbstractFeatureCall
myself). Note that I do not have a "real" JVM counterpart for these
JvmTypes, they would only exist "virtually".
Re: JVM model inferrer for non-xbase models [message #758293 is a reply to message #758282] Tue, 22 November 2011 15:18 Go to previous message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
I should have said that JvmModelInferrer only caters for the situation that your DSL concepts have JVM counterparts. Having Xbase-type functionality for your concepts would indeed be useful. I think that overriding XAbstractFeatureCall to include references to your DSL concepts (and features thereof) is probably the way to go. You'll have to override/extend Xbase scoping as well.

Previous Topic:Crossreference to member of aliased container
Next Topic:[Xtend2] floats
Goto Forum:
  


Current Time: Wed Apr 01 22:17:19 GMT 2020

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

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

Back to the top