Commit 8ceb4968 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added memberRefinement to meta-model, grammar, #250

* reordered and aligned property definitions in TDL and TO
parent 3d21ee80
Loading
Loading
Loading
Loading
Loading
+6 −7
Changes for plugins/org.etsi.mts.tdl.model/model/structured.ecore: 6 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@
      </eAnnotations>
      <eParameters name="object" eType="#//Element"/>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="picsReference" upperBound="-1"
        eType="#//PICSReference" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" eType="ecore:EClass tdl.ecore#//TestConfiguration"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="initialConditions" eType="#//InitialConditions"
        containment="true"/>
@@ -43,8 +45,6 @@
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="finalConditions" eType="#//FinalConditions"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="picsReference" upperBound="-1"
        eType="#//PICSReference" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="variants" eType="#//Variants"
        containment="true"/>
  </eClassifiers>
@@ -57,10 +57,10 @@
        eType="#//EventOccurrence" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="EventOccurrence" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeConstraint" upperBound="-1"
        eType="ecore:EClass tdl.ecore#//TimeConstraint" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeLabel" eType="ecore:EClass tdl.ecore#//TimeLabel"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeConstraint" upperBound="-1"
        eType="ecore:EClass tdl.ecore#//TimeConstraint" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="occurrence" eType="#//EventOccurrenceSpecification"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="template" eType="#//EventTemplateOccurrence"
@@ -85,10 +85,10 @@
  <eClassifiers xsi:type="ecore:EClass" name="EventOccurrenceSpecification" eSuperTypes="#//EventOccurrence #//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="entityReference" eType="#//EntityReference"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="eventReference" lowerBound="1"
        eType="#//EventReference" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="oppositeEntityReference"
        upperBound="-1" eType="#//EntityReference" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="eventReference" lowerBound="1"
        eType="#//EventReference" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="eventArgument" eType="#//Value"
        containment="true"/>
  </eClassifiers>
@@ -100,7 +100,6 @@
    <eStructuralFeatures xsi:type="ecore:EReference" name="event" lowerBound="1" eType="#//Event"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Value" abstract="true" eSuperTypes="#//Element"/>
  <eClassifiers xsi:type="ecore:EClass" name="EventArgument" eSuperTypes="#//Element"/>
  <eClassifiers xsi:type="ecore:EClass" name="DataReference" eSuperTypes="#//Value #//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="content" lowerBound="1"
        eType="ecore:EClass tdl.ecore#//DataUse" containment="true"/>
+41 −27
Changes for plugins/org.etsi.mts.tdl.model/model/tdl.ecore: 41 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -22,22 +22,22 @@
        <details key="body" value="&#xA;&#x9;&#x9;&#x9;--applicable on 'LocalExpression', 'VariableUse', 'TimeOperation', and 'ActionBehaviour', &#xA;&#x9;&#x9;&#x9;--returns the 'ComponentInstance' specified for the element or the 'defaultTester' from the nearest containing 'Block' that has the 'defaultTester' specified.&#xA;            if (self.oclContainer().oclIsUndefined()) then&#xA;                null&#xA;            else &#xA;                self.container().effectiveComponent()&#xA;            endif"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="comment" upperBound="-1"
        eType="#//Comment" containment="true" eOpposite="#//Comment/commentedElement"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="annotation" upperBound="-1"
        eType="#//Annotation" containment="true" eOpposite="#//Annotation/annotatedElement"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Comment" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="body" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="commentedElement" lowerBound="1"
        eType="#//Element" eOpposite="#//Element/comment"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="body" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Annotation" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="key" lowerBound="1" eType="#//AnnotationType"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="annotatedElement" lowerBound="1"
        eType="#//Element" eOpposite="#//Element/annotation"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="key" lowerBound="1" eType="#//AnnotationType"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="AnnotationType" eSuperTypes="#//PackageableElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="extension" eType="#//Extension"
@@ -82,15 +82,15 @@
        upperBound="-1" eType="#//Package" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ElementImport" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="importedElement" ordered="false"
        upperBound="-1" eType="#//PackageableElement"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="importedPackage" lowerBound="1"
        eType="#//Package"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="importedElement" ordered="false"
        upperBound="-1" eType="#//PackageableElement"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="TestObjective" eSuperTypes="#//PackageableElement">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectiveURI" ordered="false"
        unique="false" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="DataInstance" abstract="true" eSuperTypes="#//MappableDataElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataType" lowerBound="1"
@@ -118,11 +118,11 @@
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="resourceURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="DataElementMapping" eSuperTypes="#//PackageableElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="mappableDataElement" lowerBound="1"
        eType="#//MappableDataElement"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="elementURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataResourceMapping" lowerBound="1"
        eType="#//DataResourceMapping"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="mappableDataElement" lowerBound="1"
        eType="#//MappableDataElement"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="parameterMapping" ordered="false"
        upperBound="-1" eType="#//ParameterMapping" containment="true"/>
  </eClassifiers>
@@ -170,14 +170,16 @@
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="member" upperBound="-1"
        eType="#//Member" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="memberRefinement" upperBound="-1"
        eType="#//MemberRefinement" 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>
  <eClassifiers xsi:type="ecore:EClass" name="Member" eSuperTypes="#//Parameter">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isOptional" lowerBound="1"
@@ -289,9 +291,9 @@
        <details key="body" value="&#xA;            if (self.componentInstance.oclIsUndefined()) then&#xA;                self.container().effectiveComponent()&#xA;            else&#xA;            &#x9;self.componentInstance &#xA;            endif"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstance" eType="#//ComponentInstance"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="variable" lowerBound="1"
        eType="#//Variable"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstance" eType="#//ComponentInstance"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ComponentInstance" eSuperTypes="#//NamedElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//ComponentType"/>
@@ -373,8 +375,8 @@
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataInstance" eType="#//DataInstance"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataType" eType="#//DataType"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//DataUse"
        containment="true">
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
@@ -410,10 +412,10 @@
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeConstraint" ordered="false"
        upperBound="-1" eType="#//TimeConstraint" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeLabel" eType="#//TimeLabel"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="timeConstraint" ordered="false"
        upperBound="-1" eType="#//TimeConstraint" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Behaviour" abstract="true" eSuperTypes="#//Element">
    <eOperations name="isTesterInputEvent" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject">
@@ -464,9 +466,9 @@
        <details key="body" value="&#xA;            if (self.componentInstance.oclIsUndefined()) then&#xA;                self.container().effectiveComponent()&#xA;            else&#xA;            &#x9;self.componentInstance &#xA;            endif"/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstance" eType="#//ComponentInstance"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="period" lowerBound="1"
        eType="#//DataUse" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstance" eType="#//ComponentInstance"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Wait" eSuperTypes="#//TimeOperation"/>
  <eClassifiers xsi:type="ecore:EClass" name="Quiescence" eSuperTypes="#//TimeOperation">
@@ -516,10 +518,10 @@
  <eClassifiers xsi:type="ecore:EClass" name="TestDescription" eSuperTypes="#//PackageableElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="testConfiguration" lowerBound="1"
        eType="#//TestConfiguration"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="formalParameter" upperBound="-1"
        eType="#//FormalParameter" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="behaviourDescription" eType="#//BehaviourDescription"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="formalParameter" upperBound="-1"
        eType="#//FormalParameter" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="testObjective" ordered="false"
        upperBound="-1" eType="#//TestObjective"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isLocallyOrdered" lowerBound="1"
@@ -672,10 +674,10 @@
        eType="#//DataUse" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Assertion" eSuperTypes="#//ActionBehaviour">
    <eStructuralFeatures xsi:type="ecore:EReference" name="otherwise" eType="#//DataUse"
        containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="condition" lowerBound="1"
        eType="#//DataUse" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="otherwise" eType="#//DataUse"
        containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Stop" eSuperTypes="#//AtomicBehaviour"/>
  <eClassifiers xsi:type="ecore:EClass" name="Break" eSuperTypes="#//AtomicBehaviour"/>
@@ -729,10 +731,10 @@
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="testDescription" lowerBound="1"
        eType="#//TestDescription"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstanceBinding"
        ordered="false" upperBound="-1" eType="#//ComponentInstanceBinding" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="argument" upperBound="-1"
        eType="#//ParameterBinding" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="componentInstanceBinding"
        ordered="false" upperBound="-1" eType="#//ComponentInstanceBinding" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ComponentInstanceBinding" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="formalComponent" lowerBound="1"
@@ -755,10 +757,10 @@
        lowerBound="1" upperBound="-1" eType="#//Target" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Message" eSuperTypes="#//Interaction">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isTrigger" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="argument" lowerBound="1"
        eType="#//DataUse" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isTrigger" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="PredefinedFunction" eSuperTypes="#//PackageableElement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="returnType" eType="#//DataType"/>
@@ -799,9 +801,9 @@
    <eLiterals name="First" value="2"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ValueAssignment" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="parameter" eType="#//Parameter"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="variable" lowerBound="1"
        eType="#//Variable"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="parameter" eType="#//Parameter"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ProcedureCall" eSuperTypes="#//Interaction">
    <eStructuralFeatures xsi:type="ecore:EReference" name="signature" lowerBound="1"
@@ -892,7 +894,6 @@
        <details key="body" value="&#xA;                if (not self.dataElement.oclIsUndefined()) then&#xA;                    if (self.dataElement.oclIsKindOf(DataType)) then&#xA;                        self.dataElement.oclAsType(DataType)&#xA;                    else&#xA;                        if (self.dataElement.oclIsKindOf(DataInstance)) then&#xA;                            self.dataElement.oclAsType(DataInstance).dataType&#xA;                        else &#xA;                            if (self.dataElement.oclIsTypeOf(FormalParameter)) then&#xA;                                self.dataElement.oclAsType(FormalParameter).dataType&#xA;                            else &#xA;                                if (self.dataElement.oclIsTypeOf(Function)) then&#xA;                                    self.dataElement.oclAsType(Function).returnType&#xA;                                else&#xA;&#x9;                                if (self.dataElement.oclIsTypeOf(Variable)) then&#xA;&#x9;                                    self.dataElement.oclAsType(Variable).dataType&#xA;&#x9;                                else&#xA;                                    &#x9;null&#xA;                                    endif&#xA;                                endif&#xA;                            endif &#xA;                        endif&#xA;                    endif&#xA;                else &#xA;                    self.resolveBaseDataTypeFromContainer()                &#xA;                endif&#xA;                "/>
      </eAnnotations>
    </eOperations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataElement" eType="#//NamedElement"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="item" upperBound="-1" eType="#//DataUse"
        containment="true">
@@ -900,8 +901,9 @@
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="unassignedMember" eType="#//UnassignedMemberTreatment"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="CastDataUse" eSuperTypes="#//StaticDataUse">
  <eClassifiers xsi:type="ecore:EClass" name="CastDataUse" eSuperTypes="#//DataUse">
    <eOperations name="resolveBaseDataType" eType="#//DataType">
      <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
        <details key="body" value="self.dataType"/>
@@ -912,4 +914,16 @@
    <eStructuralFeatures xsi:type="ecore:EReference" name="dataType" lowerBound="1"
        eType="#//DataType"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="MemberRefinement" eSuperTypes="#//Element">
    <eStructuralFeatures xsi:type="ecore:EReference" name="member" lowerBound="1"
        eType="#//Member"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="constraint" upperBound="-1"
        eType="#//Constraint" containment="true">
      <eAnnotations source="http://www.eclipse.org/OCL/Collection">
        <details key="nullFree" value="false"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isMandatory" lowerBound="1"
        eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="false"/>
  </eClassifiers>
</ecore:EPackage>
+14 −1
Changes for plugins/org.etsi.mts.tdl.tx/src/org/etsi/mts/tdl/TDLtx.xtext: 14 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -244,7 +244,12 @@ StructuredDataType returns tdl::StructuredDataType:
    'Structure' name=Identifier
    ConstraintFragment
    ('extends' extension+=Extension (',' extension+=Extension)*)?
    LParen (member+=Member (',' member+=Member)*)? RParen
    LParen 
    (
        (member+=Member | memberRefinement+=MemberRefinement) 
        (',' (member+=Member | memberRefinement+=MemberRefinement))*
    )? 
    RParen
;

//Member
@@ -257,6 +262,14 @@ Member returns tdl::Member:
    ('=' value=DataUse)?
;

//MemberRefinement
MemberRefinement returns tdl::MemberRefinement:
    AnnotationCommentFragment
    (isMandatory?='mandatory')?
    member=[tdl::Member|ParameterIdentifier]
    (LBrace constraint+=Constraint RBrace)*
;

//StructuredDataInstance
StructuredDataInstance returns tdl::StructuredDataInstance:
    AnnotationCommentFragment