-- Variable declarations variable :type = OclExpr ... }] do { -- Value assignements variable <− OclExpr; -- Operations invocations ... save(...); ... remove(OclExpr); ... register (...); -- Control flow statements if... for... } helper context def: OclAny helper_name( params ) :return_type ... ; The using section is optional, and is used for declaring variables and assigning their initial value. The do section is mandatory and is the core of the program. In it, operations are used in combination with control flow statements and OCL queries to perform modelling artefacts manipulations. The OCL specification introduces de model element data type. This type corresponds to the classes contained in the metamodel of the model is being queried. In the case of MoScript, the model which is being queried, is a megamodel, so the model elements allowed in MoScript correspond to classes of the metamodel of the megamodel. MoScript uses the implementation of the megamodel provided by AM3 which conforms to the following metamodels among others: AM3Core: Is the top hierachy metamodel and can be found in /org.eclipse.gmt.am3.platform.runtime.core/model/AM3Core.ecore GMM: Which extends AM3Core and can be found GMM4ATL: A megamodel extension specific for ATL M2M transformations, which extends AM3Core and GMM and can be found in/org.eclipse.gmt.am3.platform.extension.gmm4atl/model/GMM4ATL.ecore Model element variables are referred to by means of the notation For !Class. instance, etc. !Model, !TerminalModel, !ATLTransformation
-- Variable declarations variable :type = OclExpr ... }] do { -- Value assignements variable <− OclExpr; -- Operations invocations ... save(...); ... remove(OclExpr); ... register (...); -- Control flow statements if... for... } helper context OclAny def: helper_name( params ) :return_type ... ; The using section is optional, and is used for declaring variables and assigning their initial value. The do section is mandatory and is the core of the program. In it, operations are used in combination with control flow statements and OCL queries to perform modelling artefacts manipulations. The OCL specification introduces de model element data type. This type corresponds to the classes contained in the metamodel of the model is being queried. In the case of MoScript, the model which is being queried, is a megamodel, so the model elements allowed in MoScript correspond to classes of the metamodel of the megamodel. MoScript uses the implementation of the megamodel provided by AM3 which conforms to the following metamodels among others: AM3Core: Is the top hierachy metamodel and can be found in /org.eclipse.gmt.am3.platform.runtime.core/model/AM3Core.ecore GMM: Which extends AM3Core and can be found GMM4ATL: A megamodel extension specific for ATL M2M transformations, which extends AM3Core and GMM and can be found in/org.eclipse.gmt.am3.platform.extension.gmm4atl/model/GMM4ATL.ecore Model element variables are referred to by means of the notation !Class. For instance, !Model, !TerminalModel, !ATLTransformation etc.
D4.5.2%20-%20Megamodel%20for%20transformations%20prototype.docx