Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-15 19:15:52 +0000
committerEd Willink2016-09-19 11:31:16 +0000
commit06eced9136abc405baff3262ac9be06547b22256 (patch)
tree2fb6b2b048dfaee7756c7d8ba9f699dfe9ac4ed0
parent0e80ece45e3010c6d85abb58c6b82a054e546703 (diff)
downloadorg.eclipse.qvtd-06eced9136abc405baff3262ac9be06547b22256.tar.gz
org.eclipse.qvtd-06eced9136abc405baff3262ac9be06547b22256.tar.xz
org.eclipse.qvtd-06eced9136abc405baff3262ac9be06547b22256.zip
Add AccessStatement
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore15
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel5
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore6
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel4
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/QVTimperative.xtext6
5 files changed, 33 insertions, 3 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
index 855f215d7..ee9136480 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.ecore
@@ -8,6 +8,21 @@
<eAnnotations source="http://www.eclipse.org/OCL/Import">
<details key="qvtb" value="../../org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore#/"/>
</eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="AccessStatement" eSuperTypes="#//VariableStatement">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sourceVariable" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableDeclaration">
+ <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
+ <details key="body" value="assignment"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sourceProperty" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Property">
+ <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
+ <details key="body" value="assignment"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="isOpposite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AddStatement" eSuperTypes="#//MappingStatement">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="A ConnectionStatement assigns results to a ConnectionVariable."/>
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
index 56fb01043..2800424e1 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel
@@ -18,6 +18,11 @@
<genPackages prefix="QVTimperative" basePackage="org.eclipse.qvtd.pivot" disposableProviderFactory="true"
contentTypeIdentifier="org.eclipse.qvtd.qvtimperative" fileExtensions="qvtias"
ecorePackage="QVTimperative.ecore#/">
+ <genClasses ecoreClass="QVTimperative.ecore#//AccessStatement">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//AccessStatement/sourceVariable"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//AccessStatement/sourceProperty"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute QVTimperative.ecore#//AccessStatement/isOpposite"/>
+ </genClasses>
<genClasses ecoreClass="QVTimperative.ecore#//AddStatement">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//AddStatement/targetVariable"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//AddStatement/ownedInit"/>
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
index e8b4966c7..b3ce6e224 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.ecore
@@ -2,6 +2,12 @@
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="qvtimperativecs" nsURI="http://www.eclipse.org/qvt/2015/QVTimperativeCS"
nsPrefix="qvtics">
+ <eClassifiers xsi:type="ecore:EClass" name="AccessStatementCS" eSuperTypes="../../org.eclipse.ocl.xtext.base/model/BaseCS.ecore#//TypedElementCS #//StatementCS">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sourceProperty" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//Property"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sourceVariable" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.ocl.pivot/model/Pivot.ecore#//VariableDeclaration"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AddStatementCS" eSuperTypes="#//MappingStatementCS">
<eStructuralFeatures xsi:type="ecore:EReference" name="ownedExpression" eType="ecore:EClass ../../org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore#//ExpCS"
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 7653f01ac..82312bda2 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/model/QVTimperativeCS.genmodel
@@ -15,6 +15,10 @@
<foreignModel>QVTimperativeCS.ecore</foreignModel>
<genPackages prefix="QVTimperativeCS" basePackage="org.eclipse.qvtd.xtext" disposableProviderFactory="true"
fileExtensions="qvtics" ecorePackage="QVTimperativeCS.ecore#/">
+ <genClasses ecoreClass="QVTimperativeCS.ecore#//AccessStatementCS">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AccessStatementCS/sourceProperty"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperativeCS.ecore#//AccessStatementCS/sourceVariable"/>
+ </genClasses>
<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"/>
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 2c6d6e54b..f90566de0 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,6 +24,8 @@ TopLevelCS:
(ownedPackages+=QualifiedPackageCS | ownedTransformations+=TransformationCS | ownedMappings+=MappingCS | ownedQueries+=QueryCS)*
;
+AccessStatementCS: 'access' name=UnrestrictedName (':' ownedType=TypeExpCS)? ':=' sourceVariable=[pivot::VariableDeclaration|UnrestrictedName] '.' sourceProperty=[pivot::Property|UnrestrictedName] ';';
+
AddStatementCS: 'add' targetVariable=[qvtimperative::ConnectionVariable|UnrestrictedName] '+=' ownedExpression=ExpCS ';';
CommitStatementCS returns StatementCS: NewStatementCS | SetStatementCS;
@@ -39,7 +41,7 @@ DirectionCS: {DirectionCS} (isChecked?='check'|isEnforced?='enforce')? name=Unre
('uses' uses+=[qvtimperative::ImperativeDomain|UnrestrictedName] (',' uses+=[qvtimperative::ImperativeDomain|UnrestrictedName])*)?
;
-GuardStatementCS returns StatementCS: OutVariableCS | DeclareStatementCS | DeclareStatementCS | CheckStatementCS | IfStatementCS;
+GuardStatementCS returns StatementCS: OutVariableCS | DeclareStatementCS | DeclareStatementCS | InitializeStatementCS | CheckStatementCS | AccessStatementCS | IfStatementCS;
GuardVariableCS: 'in' ':' referredTypedModel=[qvtimperative::ImperativeTypedModel|UnrestrictedName] name=UnrestrictedName ':' ownedType=TypeExpCS ';';
@@ -101,8 +103,6 @@ SourceDomainCS returns DomainCS: isCheck?='check' direction=[qvtimperative::Impe
('{' ('check' checkedProperties+=PathNameCS (',' checkedProperties+=PathNameCS)*)? '}')?
'(' ')' '{' '}'
;
-
-StatementCS: ControlStatementCS;
TransformationCS:
'transformation' ownedPathName=ScopeNameCS? name=UnreservedName '{' (ownedDirections+=DirectionCS ';')* '}';

Back to the top