Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to leverage ecore in Xtext
How to leverage ecore in Xtext [message #835501] Tue, 03 April 2012 10:03 Go to next message
Jingang Zhou is currently offline Jingang ZhouFriend
Messages: 57
Registered: December 2010
Member
Hi, all,

In the Terminal Grammar file, I see the following declarations:

import "http: //www.eclipse.org/emf/2002/Ecore" as ecore
...
terminal INT returns ecore::EInt: ('0'..'9')+;


So, the questions here are how to leverage the ecore for other datatypes, e.g., long, date, and where can I find the content of the ecore (if has) so as to leverage other information?

Thanks.
Robin
Re: How to leverage ecore in Xtext [message #835545 is a reply to message #835501] Tue, 03 April 2012 11:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

the very same as with EInt. the only extra thing you need is a value converter http://www.eclipse.org/Xtext/documentation/2_1_0/090-valueconverter.php

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to leverage ecore in Xtext [message #835601 is a reply to message #835545] Tue, 03 April 2012 12:55 Go to previous messageGo to next message
Jingang Zhou is currently offline Jingang ZhouFriend
Messages: 57
Registered: December 2010
Member
Christian Dietrich wrote on Tue, 03 April 2012 07:30
Hi,

the very same as with EInt. the only extra thing you need is a value converter
http: //www.eclipse.org/Xtext/documentation/2_1_0/090-valueconverter.php

~Christian


But, how can I know what datatypes are there in ecore to be reused?

Thanks.
Re: How to leverage ecore in Xtext [message #835603 is a reply to message #835601] Tue, 03 April 2012 12:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i do not understand this question. Datatype is Datatype there a not such datatypes and other datatypes.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to leverage ecore in Xtext [message #835620 is a reply to message #835601] Tue, 03 April 2012 13:15 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

- open Ecore.ecore with a model editor
- show the type hierarchy of EDataType
- buy the EMF book

Regards

Ed Willink

On 03/04/2012 13:55, zhou-jg wrote:
> Christian Dietrich wrote on Tue, 03 April 2012 07:30
>> Hi,
>>
>> the very same as with EInt. the only extra thing you need is a value
>> converter http:
>> //www.eclipse.org/Xtext/documentation/2_1_0/090-valueconverter.php
>>
>> ~Christian
>
>
> But, how can I know what datatypes are there in ecore to be reused?
>
> Thanks.
Previous Topic:opening an editor on virtual content
Next Topic:problem with Unordered Groups
Goto Forum:
  


Current Time: Thu Apr 25 17:08:41 GMT 2024

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

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

Back to the top