Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-09 16:07:04 +0000
committerEd Willink2016-09-19 11:18:05 +0000
commit9c4e408dbf185c5953d070691e974fd1b85ae63d (patch)
treee2732671701c18d85bfcbc1cacae7a3ea493e192 /plugins
parentff872207b58b8048262a081f44a91f1b9a7638ee (diff)
downloadorg.eclipse.qvtd-9c4e408dbf185c5953d070691e974fd1b85ae63d.tar.gz
org.eclipse.qvtd-9c4e408dbf185c5953d070691e974fd1b85ae63d.tar.xz
org.eclipse.qvtd-9c4e408dbf185c5953d070691e974fd1b85ae63d.zip
[500369] Use NewStatement rather than RealizedVariable
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore7
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel5
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl12
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/NewStatement.gif (renamed from plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/RealizedVariable.gif)bin327 -> 327 bytes
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore6
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel14
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext17
7 files changed, 30 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 ba2444f2c..f4f6a2e5a 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
@@ -63,8 +63,6 @@
transient="true" eOpposite="#//Area/bottomPattern"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="assignment" upperBound="-1"
eType="#//Assignment" containment="true" eOpposite="#//Assignment/bottomPattern"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="realizedVariable" ordered="false"
- upperBound="-1" eType="#//RealizedVariable" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BottomStatement" abstract="true" eSuperTypes="#//Statement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
@@ -176,7 +174,10 @@
<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>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="RealizedVariable" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Variable"/>
+ <eClassifiers xsi:type="ecore:EClass" name="NewStatement" eSuperTypes="../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Variable #//BottomStatement">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="referredTypedModel" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore#//TypedModel"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SetStatement" eSuperTypes="#//BottomStatement">
<eStructuralFeatures xsi:type="ecore:EReference" name="slotExpression" lowerBound="1"
eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableExp"
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
index 41b04a63e..555ea5651 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
@@ -37,7 +37,6 @@
<genClasses ecoreClass="QVTimperative.ecore#//BottomPattern">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference QVTimperative.ecore#//BottomPattern/area"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//BottomPattern/assignment"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//BottomPattern/realizedVariable"/>
</genClasses>
<genClasses image="false" ecoreClass="QVTimperative.ecore#//BottomStatement"/>
<genClasses ecoreClass="QVTimperative.ecore#//ConnectionVariable"/>
@@ -72,7 +71,9 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//MappingLoop/ownedSource"/>
</genClasses>
<genClasses image="false" ecoreClass="QVTimperative.ecore#//MappingStatement"/>
- <genClasses ecoreClass="QVTimperative.ecore#//RealizedVariable"/>
+ <genClasses ecoreClass="QVTimperative.ecore#//NewStatement">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//NewStatement/referredTypedModel"/>
+ </genClasses>
<genClasses ecoreClass="QVTimperative.ecore#//SetStatement">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//SetStatement/slotExpression"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//SetStatement/targetProperty"/>
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
index fe15299fb..1143113eb 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ocl
@@ -59,13 +59,13 @@ context SetStatement
inv IsNotReadOnly: not targetProperty.isReadOnly
inv PropertyOfSlot(slotExpression.type.name + ' must conform to ' + targetProperty.owningClass.name): slotExpression.type.conformsTo(targetProperty.owningClass)
inv CompatibleType(value.type.name + ' must conform to ' + targetProperty.type.name): value.type.conformsTo(targetProperty.type)
-inv NoRealizedVariableNavigations: value->closure(oclContents())->selectByKind(ocl::VariableExp)->select(referredVariable.oclIsKindOf(RealizedVariable))->select(oclContainer().oclIsKindOf(ocl::CallExp))->isEmpty()
+inv NoRealizedVariableNavigations: value->closure(oclContents())->selectByKind(ocl::VariableExp)->select(referredVariable.oclIsKindOf(NewStatement))->select(oclContainer().oclIsKindOf(ocl::CallExp))->isEmpty()
-context RealizedVariable
-def: isBottom : Boolean = oclContainer().oclIsKindOf(BottomPattern)
-def: isGuard : Boolean = oclContainer().oclIsKindOf(GuardPattern)
-inv IsBottom('RealizedVariable ' + name + ' must be in a BottomPattern'): isBottom
-inv IsEnforced('RealizedVariable ' + name + ' must be in an enforceable Area'): isBottom and oclContainer().oclAsType(BottomPattern).area.isTarget
+--context NewStatement
+--def: isBottom : Boolean = oclContainer().oclIsKindOf(BottomPattern)
+--def: isGuard : Boolean = oclContainer().oclIsKindOf(GuardPattern)
+--inv IsBottom('RealizedVariable ' + name + ' must be in a BottomPattern'): isBottom
+--inv IsEnforced('RealizedVariable ' + name + ' must be in an enforceable Area'): isBottom and oclContainer().oclAsType(BottomPattern).area.isTarget
--context Variable
--inv IsInGuard: oclContainer().oclIsKindOf(GuardPattern)
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/RealizedVariable.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/NewStatement.gif
index d707bc265..d707bc265 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/RealizedVariable.gif
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/NewStatement.gif
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
index b532babb0..fd6919938 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
@@ -15,8 +15,6 @@
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BottomPatternCS" eSuperTypes="#//PatternCS">
- <eStructuralFeatures xsi:type="ecore:EReference" name="ownedRealizedVariables"
- upperBound="-1" eType="#//RealizedVariableCS" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedConstraints" upperBound="-1"
eType="#//PredicateOrAssignmentCS" containment="true"/>
</eClassifiers>
@@ -129,9 +127,11 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="RealizeableVariableCS" abstract="true"
eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS"/>
- <eClassifiers xsi:type="ecore:EClass" name="RealizedVariableCS" eSuperTypes="#//RealizeableVariableCS">
+ <eClassifiers xsi:type="ecore:EClass" name="NewStatementCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS #//StatementCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedInitExpression" eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS"
containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="referredTypedModel" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore#//TypedModel"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SetStatementCS" eSuperTypes="#//StatementCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="referredProperty" lowerBound="1"
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
index 2e2013a64..eeb0d95c4 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
@@ -15,18 +15,17 @@
<foreignModel>QVTimperativeCS.ecore</foreignModel>
<genPackages prefix="QVTimperativeCS" basePackage="org.eclipse.qvtd.xtext" disposableProviderFactory="true"
fileExtensions="qvtics" ecorePackage="QVTimperativeCS.ecore#/">
+ <genClasses ecoreClass="QVTimperativeCS.ecore#//AddStatementCS">
+ <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 image="false" ecoreClass="QVTimperativeCS.ecore#//AreaCS">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AreaCS/ownedGuardPattern"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AreaCS/ownedBottomPattern"/>
</genClasses>
<genClasses ecoreClass="QVTimperativeCS.ecore#//BottomPatternCS">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//BottomPatternCS/ownedRealizedVariables"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//BottomPatternCS/ownedConstraints"/>
</genClasses>
- <genClasses ecoreClass="QVTimperativeCS.ecore#//ConnectionStatementCS">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//ConnectionStatementCS/ownedExpression"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//ConnectionStatementCS/targetVariable"/>
- </genClasses>
<genClasses ecoreClass="QVTimperativeCS.ecore#//DirectionCS">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//DirectionCS/imports"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//DirectionCS/uses"/>
@@ -87,8 +86,9 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperativeCS.ecore#//QueryCS/isTransient"/>
</genClasses>
<genClasses image="false" ecoreClass="QVTimperativeCS.ecore#//RealizeableVariableCS"/>
- <genClasses ecoreClass="QVTimperativeCS.ecore#//RealizedVariableCS">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//RealizedVariableCS/ownedInitExpression"/>
+ <genClasses ecoreClass="QVTimperativeCS.ecore#//NewStatementCS">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//NewStatementCS/ownedInitExpression"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//NewStatementCS/referredTypedModel"/>
</genClasses>
<genClasses ecoreClass="QVTimperativeCS.ecore#//SetStatementCS">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//SetStatementCS/referredProperty"/>
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 5b1d4b78c..59e22b72a 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
@@ -24,16 +24,14 @@ TopLevelCS:
(ownedPackages+=QualifiedPackageCS | ownedTransformations+=TransformationCS | ownedMappings+=MappingCS | ownedQueries+=QueryCS)*
;
-AddStatementCS returns ConnectionStatementCS: 'add' targetVariable=[pivot::Variable|UnrestrictedName] '+=' ownedExpression=ExpCS ';';
+AddStatementCS: 'add' targetVariable=[pivot::Variable|UnrestrictedName] '+=' ownedExpression=ExpCS ';';
BottomPatternCS: // Bug 466385 explains the redundancy below
(
- '{' (ownedUnrealizedVariables+=UnrealizedVariableCS | ownedRealizedVariables+=RealizedVariableCS)
- (',' (ownedUnrealizedVariables+=UnrealizedVariableCS | ownedRealizedVariables+=RealizedVariableCS))*
+ '{' ownedUnrealizedVariables+=UnrealizedVariableCS (',' ownedUnrealizedVariables+=UnrealizedVariableCS)*
'|' ownedConstraints+=PredicateOrAssignmentCS* '}'
) | (
- '{' (ownedUnrealizedVariables+=UnrealizedVariableCS | ownedRealizedVariables+=RealizedVariableCS)
- (',' (ownedUnrealizedVariables+=UnrealizedVariableCS | ownedRealizedVariables+=RealizedVariableCS))* '}'
+ '{' ownedUnrealizedVariables+=UnrealizedVariableCS (',' ownedUnrealizedVariables+=UnrealizedVariableCS)* '}'
) | (
'{' ownedConstraints+=PredicateOrAssignmentCS+ '}'
) | (
@@ -41,7 +39,7 @@ BottomPatternCS: // Bug 466385 explains the redundancy below
)
;
-BottomStatementCS returns StatementCS: SetStatementCS;
+BottomStatementCS returns StatementCS: NewStatementCS | SetStatementCS;
ControlStatementCS returns MappingStatementCS: AddStatementCS | MappingCallCS | MappingLoopCS;
@@ -134,8 +132,8 @@ QueryCS: isTransient?='transient'? 'query' ownedPathName=ScopeNameCS name=Unrest
// ':' <TypeCS>
// (';' | '{' <OCLExpressionCS> '}')
-RealizedVariableCS:
- 'realize' name=UnrestrictedName ':' ownedType=TypeExpCS (':=' ownedInitExpression=ExpCS)?
+NewStatementCS:
+ 'new' ':' referredTypedModel=[qvtbase::TypedModel|UnrestrictedName] name=UnrestrictedName ':' ownedType=TypeExpCS (':=' ownedInitExpression=ExpCS)?';'
;
ScopeNameCS returns base::PathNameCS:
@@ -171,8 +169,7 @@ TargetDomainCS returns DomainCS: isEnforce?='enforce' direction=[qvtbase::TypedM
;
TargetBottomPatternCS returns BottomPatternCS:
- {BottomPatternCS} '{' ((ownedRealizedVariables+=RealizedVariableCS | ownedUnrealizedVariables+=UnrealizedVariableCS)
- (',' (ownedRealizedVariables+=RealizedVariableCS | ownedUnrealizedVariables+=UnrealizedVariableCS))*)?
+ {BottomPatternCS} '{' (ownedUnrealizedVariables+=UnrealizedVariableCS (',' ownedUnrealizedVariables+=UnrealizedVariableCS)*)?
'}'
;

Back to the top