Use of ITypeProvider in the JvmModelInferrer [message #911430] |
Tue, 11 September 2012 15:26 |
|
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
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Powered by
FUDForum. Page generated in 0.04041 seconds