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: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

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.name, 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
solutions?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


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


Current Time: Fri Mar 29 10:45:45 GMT 2024

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

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

Back to the top