|
|
|
Re: transform model in XMI to xtext model [message #531160 is a reply to message #531071] |
Mon, 03 May 2010 23:38 |
Yu Sun Messages: 58 Registered: July 2009 |
Member |
|
|
Hi guys,
I have made the transformation from XMI to xtext working. However, there is one interesting problem:
In my xtext, I defined my own SHORT type, which is:
terminal SHORT returns ecore:Eshort :
INT's'
;
I also defined my own TerminalConverters to get the short value by removing the last 's'. It works perfect, and transforming the xtext file to XMI model also works fine.
However, now when I transform the XMI model back to xtext file, the short values in the xtext file does not contain the 's', which is not a correct xtext file in my grammar.
Is there anything I can do to solve this problem?
Thanks a lot.
Yu
[Updated on: Mon, 03 May 2010 23:39] Report message to a moderator
|
|
|
Re: transform model in XMI to xtext model [message #531201 is a reply to message #531160] |
Tue, 04 May 2010 07:44 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Yu,
please override the toString(Value) method in your value converter
implementation that removes the 's' from the parsed input. The
toString() should add it as it is required in the concrete syntax.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 04.05.10 01:38, schrieb Yu Sun:
> Hi guys,
>
> I have made the transformation from XMI to xtext working. However, there
> is one interesting problem:
>
> In my xtext, I defined my own SHORT type, which is:
>
> <CODE>
> terminal SHORT returns ecore:Eshort :
> INT's'
> ;
> </CODE>
>
> I also defined my own TerminalConverters to get the short value by
> removing the last 's'. It works perfect, and transforming the xtext file
> to XMI model also works fine.
>
> However, now when I transform the XMI model back to xtext file, the
> short values in the xtext file does not contain the 's', which is not a
> correct xtext file in my grammar.
>
> Is there anything I can do to solve this problem?
>
> Thanks a lot.
>
> Yu
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03610 seconds