Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Use of ITypeProvider in the JvmModelInferrer
Use of ITypeProvider in the JvmModelInferrer [message #911430] Tue, 11 September 2012 15:26
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1770
Registered: July 2009
Location: Firenze, Italy
Senior Member

I have a DSL (based on Xbase) which allows to do something like (I'll
use a simpler syntax Domainmodel-like):

entity C { }
entity D {
// type is inferred from the initialization expression
myProp = new C()

now in the JvmModelInferrer I'd like to use the ITypeProvider to infer
the type for the field which is associated to the property, something like

@Inject extension ITypeProvider


property.toField(, property.initexpression.type)

however, this seems to fail if the JvmTypeReferences involved in the
initialization expression refer to another entity type (since scoping is
not fully performed?)... for instance, in

myProp = new C()

the type for the initialization expression cannot be computed in the
inferrer, since 'C' is still a proxy, am I right?

In this context the creation of the fields corresponding to the
properties should be delayed? I.e. it should be done in the generator
and not in the inferrer? Is that correct? Or are there any other

thanks in advance

Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)

Previous Topic:How to access Xcore model from Xtext?
Next Topic:How to iterate in a collection using Xtend?
Goto Forum:

Current Time: Sat Dec 05 09:40:23 GMT 2020

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

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

Back to the top