diff options
author | Ed Willink | 2016-09-19 15:30:25 +0000 |
---|---|---|
committer | Ed Willink | 2016-09-19 15:30:25 +0000 |
commit | 35b79a0257dd3213d6574df8faff2e00784b2f7f (patch) | |
tree | 7e8cc668ff4058caba033588c9f98e33285bbe58 /plugins | |
parent | 1d4eebfce2da24c20531ffc161c221a62048399d (diff) | |
download | org.eclipse.qvtd-35b79a0257dd3213d6574df8faff2e00784b2f7f.tar.gz org.eclipse.qvtd-35b79a0257dd3213d6574df8faff2e00784b2f7f.tar.xz org.eclipse.qvtd-35b79a0257dd3213d6574df8faff2e00784b2f7f.zip |
[500369] Unify MappingParameters
Diffstat (limited to 'plugins')
6 files changed, 37 insertions, 32 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore index d0fd64c3e..7959d4ab3 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore @@ -23,6 +23,11 @@ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression" containment="true"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AppendParameter" eSuperTypes="#//ConnectionVariable #//MappingParameter"> + <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> + <details key="documentation" value="A ConnectionVariable accumulates one or more assignments."/> + </eAnnotations> + </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="CheckStatement" eSuperTypes="#//ObservableStatement"> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedExpression" lowerBound="1" eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression" @@ -45,7 +50,7 @@ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression" containment="true"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="GuardVariable" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableDeclaration"> + <eClassifiers xsi:type="ecore:EClass" name="GuardParameter" eSuperTypes="#//MappingParameter"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="A ConnectionVariable accumulates one or more assignments."/> </eAnnotations> @@ -66,11 +71,6 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="isEnforced" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="InConnectionVariable" eSuperTypes="#//ConnectionVariable"> - <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> - <details key="documentation" value="A ConnectionVariable accumulates one or more assignments."/> - </eAnnotations> - </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="LoopVariable" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableDeclaration"> <eStructuralFeatures xsi:type="ecore:EReference" name="owningMappingLoop" lowerBound="1" eType="#//MappingLoop" eOpposite="#//MappingLoop/ownedIterators"/> @@ -79,10 +79,8 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="An Imperative Mapping extends the abstract declarative mapping to support
explicit nested invocation of mappings with bindings for the invoked mapping's
bound variables."/> </eAnnotations> - <eStructuralFeatures xsi:type="ecore:EReference" name="ownedGuardVariables" ordered="false" - upperBound="-1" eType="#//GuardVariable" containment="true"/> - <eStructuralFeatures xsi:type="ecore:EReference" name="inoutVariables" ordered="false" - upperBound="-1" eType="#//InConnectionVariable" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="ownedParameters" ordered="false" + upperBound="-1" eType="#//MappingParameter" containment="true"/> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedStatements" upperBound="-1" eType="#//Statement" containment="true"/> </eClassifiers> @@ -144,6 +142,11 @@ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression" containment="true"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="MappingParameter" abstract="true" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableDeclaration"> + <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> + <details key="documentation" value="A ConnectionVariable accumulates one or more assignments."/> + </eAnnotations> + </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="MappingStatement" abstract="true" eSuperTypes="#//Statement"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="A MappingCall specifies the invocation of a referredMapping with a set of bindings
of the bound variables of the referredMapping to values provided in the invocation.
Where Collections of values are provided for isLoop bindings, a distinct invocation
is performed for each distinct permutation of Collection elements."/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel index 7497f09fd..dc4f92475 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel @@ -23,6 +23,7 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperative.ecore#//AddStatement/isEnforcedUnique"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//AddStatement/ownedExpression"/> </genClasses> + <genClasses ecoreClass="QVTimperative.ecore#//AppendParameter"/> <genClasses ecoreClass="QVTimperative.ecore#//CheckStatement"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//CheckStatement/ownedExpression"/> </genClasses> @@ -31,21 +32,19 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperative.ecore#//DeclareStatement/isChecked"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//DeclareStatement/ownedExpression"/> </genClasses> - <genClasses ecoreClass="QVTimperative.ecore#//GuardVariable"> - <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//GuardVariable/referredTypedModel"/> + <genClasses ecoreClass="QVTimperative.ecore#//GuardParameter"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//GuardParameter/referredTypedModel"/> </genClasses> <genClasses ecoreClass="QVTimperative.ecore#//ImperativeModel"/> <genClasses ecoreClass="QVTimperative.ecore#//ImperativeTypedModel"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperative.ecore#//ImperativeTypedModel/isChecked"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperative.ecore#//ImperativeTypedModel/isEnforced"/> </genClasses> - <genClasses ecoreClass="QVTimperative.ecore#//InConnectionVariable"/> <genClasses ecoreClass="QVTimperative.ecore#//LoopVariable"> <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference QVTimperative.ecore#//LoopVariable/owningMappingLoop"/> </genClasses> <genClasses ecoreClass="QVTimperative.ecore#//Mapping"> - <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedGuardVariables"/> - <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/inoutVariables"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedParameters"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedStatements"/> </genClasses> <genClasses ecoreClass="QVTimperative.ecore#//MappingCall"> @@ -63,6 +62,7 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingLoop/ownedMappingStatements"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingLoop/ownedExpression"/> </genClasses> + <genClasses image="false" ecoreClass="QVTimperative.ecore#//MappingParameter"/> <genClasses image="false" ecoreClass="QVTimperative.ecore#//MappingStatement"/> <genClasses ecoreClass="QVTimperative.ecore#//NewStatement"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//NewStatement/referredTypedModel"/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl index 3010a426f..a614fc482 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl @@ -11,7 +11,7 @@ endpackage package qvtimperative context Mapping -def: guardVariables : Set(ocl::Variable) = ownedGuardVariables +def: guardVariables : Set(ocl::Variable) = ownedParameters def: boundGuardVariables : Set(ocl::Variable) = ownedStatements->selectByKind(DeclareStatement) /* Mapping guard variables that are assigned */ --def: boundGuardVariables : Set(ocl::Variable) = guardVariables->select(initExpression <> null) diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore index fe1dbd7ff..010854d25 100644 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore @@ -8,6 +8,7 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="targetVariable" lowerBound="1" eType="ecore:EClass ../../org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore#//ConnectionVariable"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AppendParameterCS" eSuperTypes="#//MappingParameterCS"/> <eClassifiers xsi:type="ecore:EClass" name="CheckStatementCS" eSuperTypes="#//StatementCS #//ObservableStatementCS"> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedCondition" lowerBound="1" eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS" @@ -26,18 +27,15 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="isChecked" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="isEnforced" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="GuardVariableCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS"> + <eClassifiers xsi:type="ecore:EClass" name="GuardParameterCS" eSuperTypes="#//MappingParameterCS"> <eStructuralFeatures xsi:type="ecore:EReference" name="referredTypedModel" lowerBound="1" eType="ecore:EClass ../../org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore#//ImperativeTypedModel"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="InoutVariableCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS"/> <eClassifiers xsi:type="ecore:EClass" name="MappingCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//NamedElementCS"> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedInPathName" eType="ecore:EClass ../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//PathNameCS" containment="true"/> - <eStructuralFeatures xsi:type="ecore:EReference" name="ownedGuardVariables" upperBound="-1" - eType="#//GuardVariableCS" containment="true"/> - <eStructuralFeatures xsi:type="ecore:EReference" name="ownedInoutVariables" upperBound="-1" - eType="#//InoutVariableCS" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="ownedParameters" upperBound="-1" + eType="#//MappingParameterCS" containment="true"/> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedStatements" upperBound="-1" eType="#//StatementCS" containment="true"/> </eClassifiers> @@ -70,6 +68,8 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappingStatements" lowerBound="1" upperBound="-1" eType="#//MappingStatementCS" containment="true"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="MappingParameterCS" abstract="true" + eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS"/> <eClassifiers xsi:type="ecore:EClass" name="MappingStatementCS" abstract="true" eSuperTypes="#//StatementCS"/> <eClassifiers xsi:type="ecore:EClass" name="NewStatementCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS #//ObservableStatementCS"> diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel index 109d9247f..b693884fe 100644 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel @@ -19,6 +19,7 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AddStatementCS/ownedExpression"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AddStatementCS/targetVariable"/> </genClasses> + <genClasses ecoreClass="QVTimperativeCS.ecore#//AppendParameterCS"/> <genClasses ecoreClass="QVTimperativeCS.ecore#//CheckStatementCS"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//CheckStatementCS/ownedCondition"/> </genClasses> @@ -31,14 +32,12 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperativeCS.ecore#//DirectionCS/isChecked"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperativeCS.ecore#//DirectionCS/isEnforced"/> </genClasses> - <genClasses ecoreClass="QVTimperativeCS.ecore#//GuardVariableCS"> - <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//GuardVariableCS/referredTypedModel"/> + <genClasses ecoreClass="QVTimperativeCS.ecore#//GuardParameterCS"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//GuardParameterCS/referredTypedModel"/> </genClasses> - <genClasses ecoreClass="QVTimperativeCS.ecore#//InoutVariableCS"/> <genClasses ecoreClass="QVTimperativeCS.ecore#//MappingCS"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedInPathName"/> - <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedGuardVariables"/> - <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedInoutVariables"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedParameters"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedStatements"/> </genClasses> <genClasses ecoreClass="QVTimperativeCS.ecore#//MappingCallBindingCS"> @@ -57,6 +56,7 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingLoopCS/ownedInExpression"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingLoopCS/ownedMappingStatements"/> </genClasses> + <genClasses image="false" ecoreClass="QVTimperativeCS.ecore#//MappingParameterCS"/> <genClasses image="false" ecoreClass="QVTimperativeCS.ecore#//MappingStatementCS"/> <genClasses ecoreClass="QVTimperativeCS.ecore#//NewStatementCS"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//NewStatementCS/ownedExpression"/> diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext index 5de26681f..85627360b 100644 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext @@ -27,6 +27,8 @@ TopLevelCS: AddStatementCS: ('observe' observedProperties+=PathNameCS (',' observedProperties+=PathNameCS)*)? 'add' targetVariable=[qvtimperative::ConnectionVariable|UnrestrictedName] '+=' ownedExpression=ExpCS ';'; +AppendParameterCS: 'append' name=UnrestrictedName ':' ownedType=TypeExpCS ';'; + CommitStatementCS returns StatementCS: NewStatementCS | SetStatementCS; CheckStatementCS: 'check' ownedCondition=ExpCS ';'; @@ -40,18 +42,16 @@ DirectionCS: {DirectionCS} (isChecked?='check'|isEnforced?='enforce')? name=Unre 'imports' imports+=[pivot::Package|UnrestrictedName] (',' imports+=[pivot::Package|UnrestrictedName])* ; -GuardStatementCS returns StatementCS: OutVariableCS | DeclareStatementCS | DeclareStatementCS | CheckStatementCS; +GuardParameterCS: 'in' ':' referredTypedModel=[qvtimperative::ImperativeTypedModel|UnrestrictedName] name=UnrestrictedName ':' ownedType=TypeExpCS ';'; -GuardVariableCS: 'in' ':' referredTypedModel=[qvtimperative::ImperativeTypedModel|UnrestrictedName] name=UnrestrictedName ':' ownedType=TypeExpCS ';'; +GuardStatementCS returns StatementCS: OutVariableCS | DeclareStatementCS | DeclareStatementCS | CheckStatementCS; ImportCS returns base::ImportCS: 'import' (name=Identifier ':')? ownedPathName=URIPathNameCS (isAll?='::' '*')? ';'; -InoutVariableCS: 'inout' name=UnrestrictedName ':' ownedType=TypeExpCS ';'; - MappingCS: {MappingCS} 'map' name=UnrestrictedName ('in' ownedInPathName=PathNameCS)? '{' - (ownedGuardVariables+=GuardVariableCS | ownedInoutVariables+=InoutVariableCS)* + ownedParameters+=MappingParameterCS* ownedStatements+=GuardStatementCS* ownedStatements+=CommitStatementCS* ownedStatements+=ControlStatementCS* @@ -67,6 +67,8 @@ MappingLoopCS: ('observe' observedProperties+=PathNameCS (',' observedProperties MappingIteratorCS returns essentialocl::VariableCS: name=UnrestrictedName (':' ownedType=TypeExpCS)?; +MappingParameterCS: GuardParameterCS | AppendParameterCS; + NewStatementCS: ('observe' observedProperties+=PathNameCS (',' observedProperties+=PathNameCS)*)? 'new' ':' referredTypedModel=[qvtimperative::ImperativeTypedModel|UnrestrictedName] name=UnrestrictedName ':' ownedType=TypeExpCS (':=' ownedExpression=ExpCS)? ';' ; |