Commit cebc63cb authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ meta-model implementation improvements and fixes according to latest updates in Part 1

+ fixed #13 and #14
+ added resolveDataType for LiteralValueUse
+ added unassignedMember to CollectionDataInstance
+ changed super-class of Assignment to AtomicBehaviour (and added getParticipatingComponents implementation)
+ added DataUse.isEffectivelyStatic operation
+ changed StructuredDataType.extension to 0..* (multiple extensions)
+ changed SimpleDataType.extension to 0..* (multiple extensions)
parent 94344783
Loading
Loading
Loading
Loading
+39 −9
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
      eSuperTypes="#//NamedElement">
    <eOperations name="conformsTo" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;if (self.oclIsKindOf(AnnotationType)) then&#xA;&#x9;&#x9;&#x9;&#x9;self.oclAsType(AnnotationType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(ComponentType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(AnnotationType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(GateType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(StructuredDataType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;false&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;"/>
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;if (self.oclIsKindOf(AnnotationType)) then&#xA;&#x9;&#x9;&#x9;&#x9;self.oclAsType(AnnotationType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(ComponentType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(ComponentType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(GateType).extension.extending(e)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(StructuredDataType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(StructuredDataType).extension->exists(ex | ex.extending(e))&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.oclIsKindOf(SimpleDataType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.oclAsType(SimpleDataType).extension->exists(ex | ex.extending(e))&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;false&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
      <eParameters name="e" eType="#//PackageableElement"/>
    </eOperations>
@@ -111,21 +111,29 @@
        eType="#//DataType"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="SimpleDataType" eSuperTypes="#//DataType">
    <eStructuralFeatures xsi:type="ecore:EReference" name="extension" eType="#//Extension"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="extension" upperBound="-1"
        eType="#//Extension" containment="true">
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eStructuralFeatures>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="SimpleDataInstance" eSuperTypes="#//DataInstance"/>
  <eClassifiers xsi:type="ecore:EClass" name="StructuredDataType" eSuperTypes="#//DataType">
    <eOperations name="allMembers" upperBound="-1" eType="#//Member">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;if (not self.extension.oclIsUndefined()) then&#xA;                self.extension.extending.oclAsType(StructuredDataType).allMembers()->union(self.member)->asOrderedSet()&#xA;&#x9;&#x9;&#x9;else &#xA;&#x9;&#x9;&#x9;&#x9;self.member&#xA;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;"/>
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;if (not self.extension->isEmpty()) then&#xA;                self.extension->collect(e | e.extending.oclAsType(StructuredDataType).allMembers())->union(self.member)->asOrderedSet()&#xA;&#x9;&#x9;&#x9;else &#xA;&#x9;&#x9;&#x9;&#x9;self.member&#xA;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="extension" eType="#//Extension"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="extension" upperBound="-1"
        eType="#//Extension" containment="true">
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="member" upperBound="-1"
        eType="#//Member" containment="true"/>
  </eClassifiers>
@@ -157,6 +165,11 @@
        <details key="body" value="null"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="isEffectivelyStatic" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;&#x9;(self.oclIsKindOf(StaticDataUse)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;or (self.oclIsKindOf(DataElementUse) and &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;(self.oclAsType(DataElementUse).dataElement.oclIsUndefined()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;or self.oclAsType(DataElementUse).dataElement.oclIsKindOf(DataInstance)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;or self.oclAsType(DataElementUse).dataElement.oclIsKindOf(DataType)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;)&#xA;&#x9;&#x9;&#x9;&#x9;)&#xA;&#x9;&#x9;&#x9;&#x9;and self.argument->forAll(a | a.dataUse.isEffectivelyStatic())&#xA;&#x9;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="argument" upperBound="-1"
        eType="#//ParameterBinding" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="reduction" upperBound="-1"
@@ -547,7 +560,15 @@
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Stop" eSuperTypes="#//AtomicBehaviour"/>
  <eClassifiers xsi:type="ecore:EClass" name="Break" eSuperTypes="#//AtomicBehaviour"/>
  <eClassifiers xsi:type="ecore:EClass" name="Assignment" eSuperTypes="#//ActionBehaviour">
  <eClassifiers xsi:type="ecore:EClass" name="Assignment" eSuperTypes="#//AtomicBehaviour">
    <eOperations name="getParticipatingComponents" upperBound="-1" eType="#//ComponentInstance">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if self.getParentTestDescription()->exists(td | td.isLocallyOrdered) and self.container().oclIsKindOf(Block) then (&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if not self.variable.componentInstance.oclIsUndefined() then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;OrderedSet { self.variable.componentInstance }&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.container().oclAsType(Block).getParticipatingComponentsExcluding(self)->asOrderedSet()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9; ) else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.getParentTestDescription().testConfiguration.componentInstance->asOrderedSet()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="variable" lowerBound="1"
        eType="#//VariableUse" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="expression" lowerBound="1"
@@ -686,11 +707,15 @@
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Extension" eSuperTypes="#//Element">
    <eOperations name="transitiveExtending" eType="#//Extension">
    <eOperations name="transitiveExtending" upperBound="-1" eType="#//Extension">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(AnnotationType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(AnnotationType).extension&#xA;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(ComponentType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(AnnotationType).extension&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(GateType).extension&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(StructuredDataType).extension&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;null&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;"/>
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(AnnotationType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;OrderedSet { self.extending.oclAsType(AnnotationType).extension }&#xA;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(ComponentType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;OrderedSet { self.extending.oclAsType(ComponentType).extension }&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(GateType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;OrderedSet { self.extending.oclAsType(GateType).extension }&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(StructuredDataType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(StructuredDataType).extension&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.extending.oclIsKindOf(SimpleDataType)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.extending.oclAsType(SimpleDataType).extension&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;OrderedSet { }&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eOperations>
    <eOperations name="extending" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject">
@@ -703,6 +728,11 @@
        eType="#//PackageableElement"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="LiteralValueUse" eSuperTypes="#//StaticDataUse">
    <eOperations name="resolveDataType" eType="#//DataType">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;&#x9;if (not self.dataType.oclIsUndefined()) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;self.dataType&#xA;&#x9;&#x9;&#x9;&#x9;else &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.container().oclIsTypeOf(MemberAssignment)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.container().oclAsType(MemberAssignment).member.dataType&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;else &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (self.container().oclIsTypeOf(ParameterBinding)) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;self.container().oclAsType(ParameterBinding).parameter.dataType&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (not self.intValue.oclIsUndefined()) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;SimpleDataType.allInstances()->select(t | t.name = 'Integer')->asOrderedSet()->first()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;if (not self.boolValue.oclIsUndefined()) then&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;SimpleDataType.allInstances()->select(t | t.name = 'Boolean')->asOrderedSet()->first()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;else &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;SimpleDataType.allInstances()->select(t | t.name = 'String')->asOrderedSet()->first()&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;endif&#xA;&#x9;&#x9;&#x9;&#x9;"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="intValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigInteger"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="boolValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+4 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference tdl.ecore#//DataUse/argument"/>
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference tdl.ecore#//DataUse/reduction"/>
      <genOperations ecoreOperation="tdl.ecore#//DataUse/resolveDataType"/>
      <genOperations ecoreOperation="tdl.ecore#//DataUse/isEffectivelyStatic"/>
    </genClasses>
    <genClasses ecoreClass="tdl.ecore#//ParameterBinding">
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference tdl.ecore#//ParameterBinding/dataUse"/>
@@ -428,6 +429,7 @@
    <genClasses ecoreClass="tdl.ecore#//Assignment">
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference tdl.ecore#//Assignment/variable"/>
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference tdl.ecore#//Assignment/expression"/>
      <genOperations ecoreOperation="tdl.ecore#//Assignment/getParticipatingComponents"/>
    </genClasses>
    <genClasses image="false" ecoreClass="tdl.ecore#//ActionBehaviour">
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference tdl.ecore#//ActionBehaviour/componentInstance"/>
@@ -494,6 +496,7 @@
    </genClasses>
    <genClasses ecoreClass="tdl.ecore#//CollectionDataInstance">
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference tdl.ecore#//CollectionDataInstance/item"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute tdl.ecore#//CollectionDataInstance/unassignedMember"/>
    </genClasses>
    <genClasses ecoreClass="tdl.ecore#//Extension">
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference tdl.ecore#//Extension/extending.1"/>
@@ -507,6 +510,7 @@
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute tdl.ecore#//LiteralValueUse/intValue"/>
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute tdl.ecore#//LiteralValueUse/boolValue"/>
      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference tdl.ecore#//LiteralValueUse/dataType"/>
      <genOperations ecoreOperation="tdl.ecore#//LiteralValueUse/resolveDataType"/>
    </genClasses>
    <genClasses ecoreClass="tdl.ecore#//ConstraintType"/>
    <genClasses ecoreClass="tdl.ecore#//Constraint">