Example:
Metamodels MA, MB and MC all share the same metaclass MClass with the
same set of attributes. There are transformations that transform MA into
MB or MB into MC.
So, I'd like to be able to write something like this:
module MClassLibrary (param1, param2);
create OUT: param2 from IN: param1;
-- Copy all MClasses from one model to the next
rule MClassToMClass {
from mclassIn : param1!MClass
to mclassOut : param2!MClass (
name <- mclassIn.name
,someOtherAttribute = mclassIn.someOtherAttribute
)
}
And then:
module TransformAtoB;
create OUT: MB from IN: MA;
uses MClassLibrary (MA, MB);
-- more rules that operate especially on MA go here.
As well as:
module TransformBtoC;
create OUT: MC from IN: MB;
uses MClassLibrary (MB, MC);
-- more rules that operate especially on MB go here.
Is this possible? How?