Hello,
I'm trying to transform a model conform to a personal metamodel to ECore.
In my metamodel, I had an enumeration PrimitiveType with literals
String, Integer, Boolean, Float
I want to transform these personnal types into corresponding ECore types.
I try with
eType <- ECore!EString
wich works well, but I didn't know how to test the "source" type to
choose the ECore type (ECore!EString, ECore!EInt, ...)
I try with an helper or lazy rule like
helper context MM!PrimitiveType def : getEType : ECore!???? =
if String then ECore!EString
else ...
;
lazy rule getEType
{
from type :MM!PrimitiveType
to etype: ECore!????(
??? <- EString -- how to choose the right type ?
)
}
How can I do that, and what is the type of ECore!EString or ECore!EInt ?
Thank you.
(if there is a better way to make the correspondance between ECore
primitive types (all) and personnal PrimitiveType, I'm interested ;) )
Bye.