Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore23
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel9
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore11
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel3
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext8
5 files changed, 23 insertions, 31 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
index 993d7370f..7730c5498 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
@@ -100,8 +100,8 @@
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="An Imperative Mapping extends the abstract declarative mapping to support&#xA;explicit nested invocation of mappings with bindings for the invoked mapping's&#xA;bound variables."/>
</eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappingStatement" eType="#//MappingStatement"
- containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ownedStatements" upperBound="-1"
+ eType="#//Statement" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="polledClasses" upperBound="-1"
eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Class">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
@@ -163,25 +163,19 @@
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MappingLoop" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//CallExp #//MappingStatement">
+ <eClassifiers xsi:type="ecore:EClass" name="MappingLoop" eSuperTypes="#//MappingStatement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="An Imperative MappingLoop support an iterated nested mapping call."/>
</eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ownedBody" lowerBound="1"
- eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression"
- containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedIterators" upperBound="-1"
eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Variable"
containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappingStatements"
+ upperBound="-1" eType="#//MappingStatement" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ownedSource" eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression"
+ containment="true"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MappingSequence" eSuperTypes="#//MappingStatement">
- <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="documentation" value="A MappingSequence specifies a sequence of mapping statements"/>
- </eAnnotations>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappingStatements" upperBound="-1"
- eType="#//MappingStatement" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MappingStatement" abstract="true" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//OCLExpression">
+ <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&#xA;of the bound variables of the referredMapping to values provided in the invocation.&#xA;Where Collections of values are provided for isLoop bindings, a distinct invocation&#xA;is performed for each distinct permutation of Collection elements."/>
</eAnnotations>
@@ -213,6 +207,7 @@
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RealizedVariable" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Variable"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Statement" abstract="true" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//NamedElement"/>
<eClassifiers xsi:type="ecore:EClass" name="VariableAssignment" eSuperTypes="#//Assignment">
<eStructuralFeatures xsi:type="ecore:EReference" name="targetVariable" lowerBound="1"
eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Variable">
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
index e5bbc8aed..f04f5b3f5 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
@@ -52,7 +52,7 @@
<genOperations ecoreOperation="QVTimperative.ecore#//ImperativePattern/getArea"/>
</genClasses>
<genClasses ecoreClass="QVTimperative.ecore#//Mapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/mappingStatement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedStatements"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/polledClasses"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedKeyExpression"/>
</genClasses>
@@ -68,11 +68,9 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingCallBinding/value"/>
</genClasses>
<genClasses ecoreClass="QVTimperative.ecore#//MappingLoop">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingLoop/ownedBody"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingLoop/ownedIterators"/>
- </genClasses>
- <genClasses ecoreClass="QVTimperative.ecore#//MappingSequence">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingSequence/mappingStatements"/>
+ <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/ownedSource"/>
</genClasses>
<genClasses image="false" ecoreClass="QVTimperative.ecore#//MappingStatement"/>
<genClasses image="false" ecoreClass="QVTimperative.ecore#//NavigationAssignment">
@@ -85,6 +83,7 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//PropertyAssignment/targetProperty"/>
</genClasses>
<genClasses ecoreClass="QVTimperative.ecore#//RealizedVariable"/>
+ <genClasses image="false" ecoreClass="QVTimperative.ecore#//Statement"/>
<genClasses ecoreClass="QVTimperative.ecore#//VariableAssignment">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//VariableAssignment/targetVariable"/>
</genClasses>
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
index 618619293..517ff74f1 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
@@ -57,8 +57,8 @@
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedKeyExpression" eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS"
containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappingSequence" eType="#//MappingSequenceCS"
- containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ownedStatements" upperBound="-1"
+ eType="#//StatementCS" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedMiddle" lowerBound="1"
eType="#//DomainCS" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedUsesPathNames" upperBound="-1"
@@ -93,15 +93,11 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedInExpression" lowerBound="1"
eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS"
containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappingSequence" lowerBound="1"
- eType="#//MappingSequenceCS" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MappingSequenceCS" eSuperTypes="#//MappingStatementCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappingStatements"
lowerBound="1" upperBound="-1" eType="#//MappingStatementCS" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MappingStatementCS" abstract="true"
- eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//ModelElementCS"/>
+ eSuperTypes="#//StatementCS"/>
<eClassifiers xsi:type="ecore:EClass" name="ParamDeclarationCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS"/>
<eClassifiers xsi:type="ecore:EClass" name="PatternCS" abstract="true" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//ModelElementCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedUnrealizedVariables"
@@ -140,6 +136,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedInitExpression" eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS"
containment="true"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="StatementCS" abstract="true" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//ModelElementCS"/>
<eClassifiers xsi:type="ecore:EClass" name="TopLevelCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//RootPackageCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedMappings" upperBound="-1"
eType="#//MappingCS" containment="true"/>
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
index dbfaad102..b073a2625 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
@@ -46,7 +46,7 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedDomains"/>
<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/ownedKeyExpression"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedMappingSequence"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedStatements"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedMiddle"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//MappingCS/ownedUsesPathNames"/>
</genClasses>
@@ -95,6 +95,7 @@
<genClasses ecoreClass="QVTimperativeCS.ecore#//RealizedVariableCS">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//RealizedVariableCS/ownedInitExpression"/>
</genClasses>
+ <genClasses image="false" ecoreClass="QVTimperativeCS.ecore#//StatementCS"/>
<genClasses ecoreClass="QVTimperativeCS.ecore#//TopLevelCS">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//TopLevelCS/ownedMappings"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//TopLevelCS/ownedQueries"/>
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 5445b9b2e..d446e5489 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
@@ -66,18 +66,16 @@ ImportCS returns base::ImportCS:
MappingCS: {MappingCS} isDefault?='default'? 'map' name=UnrestrictedName ('in' ownedInPathName=PathNameCS)?
('uses' ownedUsesPathNames+=PathNameCS (',' ownedUsesPathNames+=PathNameCS)*)? ('key' ownedKeyExpression=ExpCS ';')?
- '{' ownedDomains+=(SourceDomainCS | TargetDomainCS)* ('where' ownedMiddle=MiddleDomainCS)? ownedMappingSequence=MappingSequenceCS? '}';
+ '{' ownedDomains+=(SourceDomainCS | TargetDomainCS)* ('where' ownedMiddle=MiddleDomainCS)? ownedStatements+=StatementCS* '}';
MappingCallCS: {MappingCallCS} isInfinite?='infinite'? 'call' ownedPathName=PathNameCS
'{' ownedBindings+=MappingCallBindingCS* '}';
MappingCallBindingCS: referredVariable=[pivot::Variable|UnrestrictedName] (':='|isPolled?='?=') ownedValue=ExpCS ';';
-MappingLoopCS: 'for' ownedIterator=MappingIteratorCS 'in' ownedInExpression=ExpCS '{' ownedMappingSequence=MappingSequenceCS '}';
+MappingLoopCS: 'for' ownedIterator=MappingIteratorCS 'in' ownedInExpression=ExpCS '{' ownedMappingStatements+=MappingStatementCS+ '}';
MappingIteratorCS returns essentialocl::VariableCS: name=UnrestrictedName (':' ownedType=TypeExpCS)?;
-
-MappingSequenceCS: ownedMappingStatements+=MappingStatementCS+;
MappingStatementCS: ConnectionStatementCS | MappingCallCS | MappingLoopCS;
@@ -155,6 +153,8 @@ SourceBottomPatternCS returns BottomPatternCS:
SourceGuardPatternCS returns GuardPatternCS:
{GuardPatternCS} '(' (ownedUnrealizedVariables+=UnrealizedVariableCS (',' ownedUnrealizedVariables+=UnrealizedVariableCS)*)? ')'
;
+
+StatementCS: MappingStatementCS;
TransformationCS:
'transformation' ownedPathName=ScopeNameCS? name=UnreservedName '{' (ownedDirections+=DirectionCS ';')* '}';

Back to the top