-- @path AMW=/WeavingToTransformation%20HOT/WeavingMetaModel.ecore
-- @path ATL=platform:/plugin/org.eclipse.m2m.atl.common/org/eclipse/m2m/atl/common/resources/ATL.ecore
module weavingToTransformation;
create transformation : ATL from weavingModel : AMW, left : UML, right : UML;
rule ModuleCreation {
from
input: AMW!Module
to
output: ATL!Module (
name <- input.name,
inModels <- input.leftModel,
outModels <- input.rightModel,
elements <- input.rules,
isRefining <- false,
commentsBefore <- Set {'-- @atlcompiler atl2010'}
)
}
rule LeftModelRef {
from
input: AMW!LeftModelRef
to
output: ATL!OclModel (
name <- input.name,
metamodel <- ametamodel
),
ametamodel: ATL!OclModel (
name <-'UML',
elements <- UML!Classifier.allInstancesFrom('left')
)
}
rule RightModelRef {
from
input: AMW!RightModelRef
to
output: ATL!OclModel (
name <- input.name,
metamodel <- ametamodel
),
ametamodel: ATL!OclModel (
name <- 'UML',
elements <- UML!Classifier.allInstancesFrom('right')
)
}
rule Classifiers {
from
element: UML!Classifier
to
atl: ATL!OclModelElement (
name <- element.name
)
}