Enumeration question and translation issue [message #1003767] |
Mon, 21 January 2013 19:29  |
Eclipse User |
|
|
|
Hi, I am glad that I was able to log on to this forum.
My current work involves translating XML file into EMF file.
My first question: enumeration
In my xml file there is
<componentType id="">
<componentKind> software | hardware </componentKind>
</componentType>
In this case, this means that I have to use enumeration... so what I have done is
I declared cKind enum as
enum Ckind{
software;
hardware;
}
Is this a valid way of specifying enumeration type?
Second question...
I have a thing called domain, which has to put component and its affixed things (port etc.) into the domain. We find specific component instance by looking at its ID. So what I have done is:
@gmf.node(label="name", border.width="5")
class ComponentType{
attr int ID;
attr String name;
attr String desc;
attr Ckind componentKind;
@gmf.affixed(foo="bar")
val InterfaceInstance[*] interfaceInstances;
}
@gmf.node(label="name")
class ComponentInstance{
attr int ID;
attr Trust trust;
attr String name;
attr String desc;
ref ComponentType componentTypeLink;
//The interface instance that are same as interface instance that its type has
@gmf.affixed(foo="bar")
ref ComponentType#interfaceInstances interfaceTypeLink;
}
You can see that ComponentInstance has ID.
So the domain somehow has to include some specific componentInstance or all of the componentInstance drawn on the diagram.
I think using compartment would work in this case. But I would like to know some other ways I might do this (referring to specific attributes etc.)
Thank you!
|
|
|
|
Powered by
FUDForum. Page generated in 0.04197 seconds