Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Type inference across inferred jvm elements
Type inference across inferred jvm elements [message #903063] Tue, 21 August 2012 19:14 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 672
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I have a model that uses Xbase and JvmTypes, from which I infer and
generate Java code. In the spirit if Xtend/Xbase, I would like to
relieve the user of my DSL from having to specify all types, and this
will mean inferring types across my model objects.

A bit simplified the model includes typed slots the values of which may
be derived from others. Suppose slots A and B has type Integer and slot
C is derived from slots A and B through the function [a, b | a + b].
Xbase can infer the types of the a and b arguments, and I would like to
infer the type of C from the return value of the function.

Where should I insert the code to perform this inference, so I'm sure to
be able to use Xbase's built-in type inference.

Hallvard
Re: Type inference across inferred jvm elements [message #903095 is a reply to message #903063] Tue, 21 August 2012 21:25 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
Hi Hallvard,

you may try to customize override
JvmModelAssociator.installDerivedState(DerivedStateAwareResource,
boolean) and set the return types if the preIndexing flag is set to false.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 21.08.12 21:14, schrieb Hallvard Trætteberg:
> Hi,
>
> I have a model that uses Xbase and JvmTypes, from which I infer and
> generate Java code. In the spirit if Xtend/Xbase, I would like to
> relieve the user of my DSL from having to specify all types, and this
> will mean inferring types across my model objects.
>
> A bit simplified the model includes typed slots the values of which may
> be derived from others. Suppose slots A and B has type Integer and slot
> C is derived from slots A and B through the function [a, b | a + b].
> Xbase can infer the types of the a and b arguments, and I would like to
> infer the type of C from the return value of the function.
>
> Where should I insert the code to perform this inference, so I'm sure to
> be able to use Xbase's built-in type inference.
>
> Hallvard
Previous Topic:issue with start levels in launch config?
Next Topic:Can't bind IStorage2UriMapper
Goto Forum:
  


Current Time: Thu Dec 03 22:05:37 GMT 2020

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

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

Back to the top