Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Enumeration in an extended gastm(How to define a new enumation in an gastm extension)
Enumeration in an extended gastm [message #1439825] Tue, 07 October 2014 15:00 Go to next message
Martin Paquin is currently offline Martin PaquinFriend
Messages: 21
Registered: July 2014
Junior Member
Hello,

I am defining a new extension to gastm for a 4GL language. I need to create some enumerations with some literals. In gastm there are EnumTypeDefinition, EnumTypeDeclaration, EnumLiteralDefinition and EnumLiteral

In emf I declare an enumaration like this:

<eClassifiers xsi:type="ecore:EEnum" name="TextType">
   <eLiterals name="Functional" value="0" literal="F"/>
   <eLiterals name="Help" value="1" literal="H"/>
</eClassifiers>


How should I translated it in my ecore file?


Martin
Re: Enumeration in an extended gastm [message #1439854 is a reply to message #1439825] Tue, 07 October 2014 15:46 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 667
Registered: July 2009
Senior Member
In EMF, there is no declaration/definition distinction.
An EEnum is an EDataType and so an EClassifier (such as an EClass is also).

Thus, to create your new enumeration type you have to use an EEnum, each different literal being an EEnumLiteral.

index.php/fa/19408/0/

If you want more details on this Ecore thing, I guess the EMF forum would be a more suitable place.

Kind regards,


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Enumeration in an extended gastm [message #1439871 is a reply to message #1439854] Tue, 07 October 2014 16:13 Go to previous messageGo to next message
Martin Paquin is currently offline Martin PaquinFriend
Messages: 3
Registered: July 2014
Junior Member
Hi Hugo,

Maybe I have not be clear enough, sorry. As I wrote before, what I want to do is to create a extension to OMG gastm. As such I want to used as much as possible type defined in the gastm.ecore model.

EnumTypeDefinition, EnumTypeDeclaration, EnumLiteralDefinition and EnumLiteral
are type define in the gastm. But the documentation in the OMG spec on how to use these type is a little bit unclear.

If i can found how to used these types, I will simply used the emf EENum.

Thanks for your help,

Martin
Re: Enumeration in an extended gastm [message #1439875 is a reply to message #1439871] Tue, 07 October 2014 16:18 Go to previous message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 667
Registered: July 2009
Senior Member
Sorry, I indeed misunderstood your question Smile
So then you should probably extend the current GASTM definition in Ecore by creating some new EClass(es) inheriting from the EnumTypeDefinition, EnumTypeDeclaration and so on.
In this case, this is really more a GASTM problem than an Ecore one and only the spec (or related documentations) should be relevant in this context.


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:Creating a new discoverer
Next Topic:Is there any plan to implement a Java 8 discoverer?
Goto Forum:
  


Current Time: Tue Jan 23 08:24:37 GMT 2018

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

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