Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtend -> Java transformation bug? (scoping of type names)
Xtend -> Java transformation bug? (scoping of type names) [message #804230] Wed, 22 February 2012 10:53 Go to next message
Alex G is currently offline Alex GFriend
Messages: 96
Registered: January 2012
Member
Hi!

I'm writing validation of a XText DSL in XTend. Transformation to Java is done automatically. Since there is no "generateStub" for validation.JavaValidatorFragment I had to plugin the XTend class in between, e.g. instead of
MyDSLValidator extends AbstractMyDSLJavaValidator

I use
MyDSLJavaValidator extends MyDSLXTendValidator
MyDSLXTendValidator extends AbstractMyDSLJavaValidator

The MyDSLXTendValidator.xtend is automatically transformed to xtend-gen/MyDSLXTendValidator.java.

Now I have a XTend expression in the validator of kind
eObject.feature.map(o|o.states)

where states is of type org.xtext.example.mydsl.mydsl.State

The transformation to java:
public EList<State> apply(final StateDefinitions o) {
   EList<State> _states = o.getStates();
   return _states;
}

where the class State is automatically determined to be of type org.eclipse.xtext.validation.AbstractDeclarativeValidator.State

I tried to cast in XTend manually, but that didn't help. Is it a transformation bug or do I have to do something completely different (disregarding renaming of the "State" type in my DSL)?
Re: Xtend -&gt; Java transformation bug? (scoping of type names) [message #804237 is a reply to message #804230] Wed, 22 February 2012 11:02 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Alex,

this is a bug in the transformation. Please file a ticket. I'm
unfortunately not aware of a workaround.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 22.02.12 11:53, schrieb Alex G:
> Hi!
>
> I'm writing validation of a XText DSL in XTend. Transformation to Java
> is done automatically. Since there is no "generateStub" for
> validation.JavaValidatorFragment I had to plugin the XTend class in
> between, e.g. instead of
>
> MyDSLValidator extends AbstractMyDSLJavaValidator
>
> I use
>
> MyDSLJavaValidator extends MyDSLXTendValidator
> MyDSLXTendValidator extends AbstractMyDSLJavaValidator
>
> The MyDSLXTendValidator.xtend is automatically transformed to
> xtend-gen/MyDSLXTendValidator.java.
>
> Now I have a XTend expression in the validator of kind
>
> eObject.feature.map(o|o.states)
>
> where states is of type org.xtext.example.mydsl.mydsl.State
>
> The transformation to java:
>
> public EList<State> apply(final StateDefinitions o) {
> EList<State> _states = o.getStates();
> return _states;
> }
>
> where the class State is automatically determined to be of type
> org.eclipse.xtext.validation.AbstractDeclarativeValidator.State
>
> I tried to cast in XTend manually, but that didn't help. Is it a
> transformation bug or do I have to do something completely different
> (disregarding renaming of the "State" type in my DSL)?
Re: Xtend -> Java transformation bug? (scoping of type names) [message #804270 is a reply to message #804230] Wed, 22 February 2012 12:02 Go to previous message
Alex G is currently offline Alex GFriend
Messages: 96
Registered: January 2012
Member
Here you go:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=372214
Previous Topic:toEnumerationType not working
Next Topic:Using an Xtext editor for maninpulating an Ecore model
Goto Forum:
  


Current Time: Thu Apr 09 16:55:39 GMT 2020

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

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

Back to the top