From 0843b587a31a90a1ac5568b1dfa091ba10b8cdf8 Mon Sep 17 00:00:00 2001 From: Johannes Mey <johannes.mey@tu-dresden.de> Date: Fri, 20 Mar 2020 15:34:51 +0100 Subject: [PATCH] add pnml ecore files and initial test --- .../inf/st/e2j/TransformationTest.java | 6 + src/test/resources/ecore/pnml/LICENSE.md | 12 + .../ecore/pnml/arbitrarydeclarations.ecore | 28 ++ src/test/resources/ecore/pnml/booleans.ecore | 75 ++++ .../ecore/pnml/cyclicEnumerations.ecore | 26 ++ src/test/resources/ecore/pnml/dots.ecore | 16 + .../ecore/pnml/finiteEnumerations.ecore | 21 + .../ecore/pnml/finiteIntRanges.ecore | 52 +++ .../ecore/pnml/hlcorestructure.ecore | 361 ++++++++++++++++++ src/test/resources/ecore/pnml/integers.ecore | 111 ++++++ src/test/resources/ecore/pnml/lists.ecore | 37 ++ src/test/resources/ecore/pnml/multisets.ecore | 83 ++++ .../resources/ecore/pnml/partitions.ecore | 54 +++ .../ecore/pnml/placeTransition.ecore | 336 ++++++++++++++++ .../resources/ecore/pnml/pnmlcoremodel.ecore | 312 +++++++++++++++ src/test/resources/ecore/pnml/strings.ecore | 31 ++ src/test/resources/ecore/pnml/terms.ecore | 138 +++++++ 17 files changed, 1699 insertions(+) create mode 100644 src/test/resources/ecore/pnml/LICENSE.md create mode 100644 src/test/resources/ecore/pnml/arbitrarydeclarations.ecore create mode 100644 src/test/resources/ecore/pnml/booleans.ecore create mode 100644 src/test/resources/ecore/pnml/cyclicEnumerations.ecore create mode 100644 src/test/resources/ecore/pnml/dots.ecore create mode 100644 src/test/resources/ecore/pnml/finiteEnumerations.ecore create mode 100644 src/test/resources/ecore/pnml/finiteIntRanges.ecore create mode 100644 src/test/resources/ecore/pnml/hlcorestructure.ecore create mode 100644 src/test/resources/ecore/pnml/integers.ecore create mode 100644 src/test/resources/ecore/pnml/lists.ecore create mode 100644 src/test/resources/ecore/pnml/multisets.ecore create mode 100644 src/test/resources/ecore/pnml/partitions.ecore create mode 100644 src/test/resources/ecore/pnml/placeTransition.ecore create mode 100644 src/test/resources/ecore/pnml/pnmlcoremodel.ecore create mode 100644 src/test/resources/ecore/pnml/strings.ecore create mode 100644 src/test/resources/ecore/pnml/terms.ecore diff --git a/src/test/java/de/tudresden/inf/st/e2j/TransformationTest.java b/src/test/java/de/tudresden/inf/st/e2j/TransformationTest.java index 4aada10..1f3e109 100644 --- a/src/test/java/de/tudresden/inf/st/e2j/TransformationTest.java +++ b/src/test/java/de/tudresden/inf/st/e2j/TransformationTest.java @@ -120,6 +120,12 @@ class TransformationTest extends AbstractTest { transformFile("/ecore/crom.ecore", "src/gen/resources/grammar/crom.relast"); } + @Test + void transformPNML() { + transformFile("/ecore/pnml/pnmlcoremodel.ecore", "src/gen/resources/grammar/pnmlcoremodel.relast"); + transformFile("/ecore/pnml/placeTransition.ecore", "src/gen/resources/grammar/placeTransition.relast"); + } + @Test void transformTrain() { transformFile("/ecore/Train.ecore", "src/gen/resources/grammar/Train.relast"); diff --git a/src/test/resources/ecore/pnml/LICENSE.md b/src/test/resources/ecore/pnml/LICENSE.md new file mode 100644 index 0000000..20064c9 --- /dev/null +++ b/src/test/resources/ecore/pnml/LICENSE.md @@ -0,0 +1,12 @@ +# PNML Specification Disclaimer + +http://www.pnml.org/disclaimer.php + +© Pnml.org 2009-2015. + +We are providing the meta-models of PNML specification with the following disclaimer: + +- Give credit to Pnml.org for these meta-models. +- In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of these meta-models. +- We are the maintainers of these meta-models, therefore we may at any moment update them. +- Please, give us feedback about your use of these meta-models, including bugs and further modifications of your own and the features of the tool that relies upon them. We will release that information about your tool on this website, upon your agreement. diff --git a/src/test/resources/ecore/pnml/arbitrarydeclarations.ecore b/src/test/resources/ecore/pnml/arbitrarydeclarations.ecore new file mode 100644 index 0000000..3963bf6 --- /dev/null +++ b/src/test/resources/ecore/pnml/arbitrarydeclarations.ecore @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="arbitrarydeclarations" + nsURI="http:///hlpn.arbitrarydeclarations.ecore" nsPrefix="arbitrarydeclarations"> + <eClassifiers xsi:type="ecore:EClass" name="ArbitrarySort" eSuperTypes="terms.ecore#//SortDecl"/> + <eClassifiers xsi:type="ecore:EClass" name="ArbitraryOperator" eSuperTypes="terms.ecore#//OperatorDecl"> + <eStructuralFeatures xsi:type="ecore:EReference" name="input" upperBound="-1" + eType="#//AnySort" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="output" lowerBound="1" + eType="#//AnySort" containment="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Unparsed" eSuperTypes="terms.ecore#//TermsDeclaration"> + <eStructuralFeatures xsi:type="ecore:EReference" name="unparsedModel" eType="ecore:EClass hlcorestructure.ecore#//AnyObject" + containment="true" eOpposite="hlcorestructure.ecore#//AnyObject/containerUnparsed"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AnySort" eSuperTypes="terms.ecore#//Sort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value=""/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="anySortModel" eType="ecore:EClass hlcorestructure.ecore#//AnyObject" + eOpposite="hlcorestructure.ecore#//AnyObject/containerAnySort"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/booleans.ecore b/src/test/resources/ecore/pnml/booleans.ecore new file mode 100644 index 0000000..874db4d --- /dev/null +++ b/src/test/resources/ecore/pnml/booleans.ecore @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="booleans" + nsURI="http:///symmetricnet.booleans.ecore" nsPrefix="booleans"> + <eClassifiers xsi:type="ecore:EClass" name="Equality" eSuperTypes="terms.ecore#//Operator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input.size() >= 2 and self.input->forAll{c, d | c.oclIsTypeOf(d) or d.oclIsTypeOf(c)} and self.output.oclIsKindOf(Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Inequality" eSuperTypes="terms.ecore#//Operator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input.size() = 2 and self.input->forAll{c, d | c.oclIsTypeOf(d) or d.oclIsTypeOf(c)} and self.output.oclIsKindOf(Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="BooleanConstant" eSuperTypes="terms.ecore#//BuiltInConstant"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Or" eSuperTypes="#//BooleanOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputSize" value="self.input.size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputSize"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="BooleanOperator" abstract="true" eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsKindOf(Bool) and self.input->forAll{c | c.oclIsKindOf(Bool)}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="And" eSuperTypes="#//BooleanOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputSize" value="self.input.size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputSize"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Imply" eSuperTypes="#//BooleanOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputSize" value="self.input.size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputSize"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Not" eSuperTypes="#//BooleanOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputSize" value="self.input.size() = 1"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputSize"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Bool" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
		 //by default they are the same sort, unless they have been named.
		 	isEqual = true;
		 	if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				// we test them if they have been explicitly named.
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			}// otherwise, keep the default.
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 * @throws NullPointerException if according to the model, some
 * required reference attributes have not been set.
 */"/> + </eAnnotations> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/cyclicEnumerations.ecore b/src/test/resources/ecore/pnml/cyclicEnumerations.ecore new file mode 100644 index 0000000..9c0c554 --- /dev/null +++ b/src/test/resources/ecore/pnml/cyclicEnumerations.ecore @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="cyclicEnumerations" + nsURI="http:///symmetricnet.cyclicEnumerations.ecore" nsPrefix="cyclicEnumerations"> + <eClassifiers xsi:type="ecore:EClass" name="CyclicEnumOperator" abstract="true" + eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input->size() = 1 and self.input.oclIsTypeOf(CyclicEnumeration) and self.output.oclIsTypeOf(CyclicEnumeration)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="CyclicEnumeration" eSuperTypes="finiteEnumerations.ecore#//FiniteEnumeration"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				if ("CyclicEnumeration".equalsIgnoreCase(this.eClass().getName())) {
					CyclicEnumeration myFE = (CyclicEnumeration) this;
					CyclicEnumeration thatFE = (CyclicEnumeration) sort;
					List<FEConstant> myConstants = myFE.getElements();
					List<FEConstant> thoseConstants = thatFE.getElements();
					int i = 0;
					int j = 0;
					
					for (; i < myConstants.size() && j < thoseConstants.size(); i++, j++) {
						if (myConstants
								.get(i)
								.getName()
								.equalsIgnoreCase(
										thoseConstants.get(j).getName())) {
							isEqual = true;
						} else {
							isEqual = false;
							break;
						}
					}
				}
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Successor" eSuperTypes="#//CyclicEnumOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Predecessor" eSuperTypes="#//CyclicEnumOperator"/> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/dots.ecore b/src/test/resources/ecore/pnml/dots.ecore new file mode 100644 index 0000000..845b3fe --- /dev/null +++ b/src/test/resources/ecore/pnml/dots.ecore @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="dots" + nsURI="http:///symmetricnet.dots.ecore" nsPrefix="dots"> + <eClassifiers xsi:type="ecore:EClass" name="Dot" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
		 //by default they are the same sort, unless they have been named.
		 	isEqual = true;
		 	if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				// we test them if they have been explicitly named.
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			}// otherwise, keep the default.
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 * @throws NullPointerException if according to the model, some
 * required reference attributes have not been set.
 */"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="DotConstant" eSuperTypes="terms.ecore#//BuiltInConstant"/> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/finiteEnumerations.ecore b/src/test/resources/ecore/pnml/finiteEnumerations.ecore new file mode 100644 index 0000000..7a23f1a --- /dev/null +++ b/src/test/resources/ecore/pnml/finiteEnumerations.ecore @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="finiteEnumerations" + nsURI="http:///symmetricnet.finiteEnumerations.ecore" nsPrefix="finiteEnumerations"> + <eClassifiers xsi:type="ecore:EClass" name="FiniteEnumeration" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				if ("FiniteEnumeration".equalsIgnoreCase(this.eClass().getName())) {
					FiniteEnumeration myFE = (FiniteEnumeration) this;
					FiniteEnumeration thatFE = (FiniteEnumeration) sort;
					List<FEConstant> myConstants = myFE.getElements();
					List<FEConstant> thoseConstants = thatFE.getElements();
					int i = 0;
					int j = 0;
					
					for (; i < myConstants.size() && j < thoseConstants.size(); i++, j++) {
						if (myConstants
								.get(i)
								.getName()
								.equalsIgnoreCase(
										thoseConstants.get(j).getName())) {
							isEqual = true;
						} else {
							isEqual = false;
							break;
						}
					}
				}
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="elements" upperBound="-1" + eType="#//FEConstant" containment="true" eOpposite="#//FEConstant/sort"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FEConstant" eSuperTypes="terms.ecore#//OperatorDecl"> + <eStructuralFeatures xsi:type="ecore:EReference" name="sort" ordered="false" lowerBound="1" + eType="#//FiniteEnumeration" eOpposite="#//FiniteEnumeration/elements"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/finiteIntRanges.ecore b/src/test/resources/ecore/pnml/finiteIntRanges.ecore new file mode 100644 index 0000000..774d92b --- /dev/null +++ b/src/test/resources/ecore/pnml/finiteIntRanges.ecore @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="finiteIntRanges" + nsURI="http:///symmetricnet.finiteIntRanges.ecore" nsPrefix="finiteIntRanges"> + <eClassifiers xsi:type="ecore:EClass" name="FiniteIntRange" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="range" value="- ∞ < self.start <= self.end < ∞"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="range"/> + </eAnnotations> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				if ("FiniteIntRange".equalsIgnoreCase(this.eClass().getName())) {
					FiniteIntRange myFIR = (FiniteIntRange) this;
					FiniteIntRange thatFIR = (FiniteIntRange) sort;
					isEqual = (myFIR.getStart() == thatFIR.getStart()
					 && myFIR.getEnd() == thatFIR.getEnd()); 						
					
				}
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="start" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="end" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerFiniteIntRangeConstant" + eType="#//FiniteIntRangeConstant" eOpposite="#//FiniteIntRangeConstant/range"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="FiniteIntRangeConstant" eSuperTypes="terms.ecore#//BuiltInConstant"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputRange" value="self.input->size() = 0 and self.range.start <= self.value <= self.range.end"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputRange"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="range" ordered="false" + lowerBound="1" eType="#//FiniteIntRange" containment="true" eOpposite="#//FiniteIntRange/containerFiniteIntRangeConstant"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="LessThan" eSuperTypes="#//FiniteIntRangeOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="FiniteIntRangeOperator" abstract="true" + eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputOutputTypes" value="self.input->size() = 2 and self.input->forAll{c | c.oclIsTypeOf(FiniteIntRange)} and self.output.oclIsTypeOf(booleans::Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThan" eSuperTypes="#//FiniteIntRangeOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="LessThanOrEqual" eSuperTypes="#//FiniteIntRangeOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThanOrEqual" eSuperTypes="#//FiniteIntRangeOperator"/> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/hlcorestructure.ecore b/src/test/resources/ecore/pnml/hlcorestructure.ecore new file mode 100644 index 0000000..bfce9f4 --- /dev/null +++ b/src/test/resources/ecore/pnml/hlcorestructure.ecore @@ -0,0 +1,361 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="hlcorestructure" + nsURI="http:///symmetricnet.hlcorestructure.ecore" nsPrefix="hlcorestructure"> + <eClassifiers xsi:type="ecore:EClass" name="PetriNetDoc"> + <eStructuralFeatures xsi:type="ecore:EReference" name="nets" ordered="false" lowerBound="1" + upperBound="-1" eType="#//PetriNet" containment="true" eOpposite="#//PetriNet/containerPetriNetDoc"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlns" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" changeable="false" + defaultValueLiteral="http://www.pnml.org/version-2009/grammar/pnml"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PetriNet"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="" + iD="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" ordered="false" lowerBound="1" + eType="#//PNType"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="pages" ordered="false" + lowerBound="1" upperBound="-1" eType="#//Page" containment="true" eOpposite="#//Page/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePetriNet"> + <eAnnotations source="redefines"/> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNetDoc" ordered="false" + lowerBound="1" eType="#//PetriNetDoc" eOpposite="#//PetriNetDoc/nets"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" upperBound="-1" + eType="#//Declaration" containment="true" eOpposite="#//Declaration/containerDeclarationPetriNet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="PNType"> + <eLiterals name="SYMNET" value="2" literal="http://www.pnml.org/version-2009/grammar/symmetricnet"/> + <eLiterals name="COREMODEL" literal="http://www.pnml.org/version-2009/grammar/pnmlcoremodel"/> + <eLiterals name="PTNET" value="1" literal="http://www.pnml.org/version-2009/grammar/ptnet"/> + <eLiterals name="HLPN" value="3" literal="http://www.pnml.org/version-2009/grammar/highlevelnet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Page" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="objects" ordered="false" + upperBound="-1" eType="#//PnObject" containment="true" eOpposite="#//PnObject/containerPage"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/pages"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerPage"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" upperBound="-1" + eType="#//Declaration" containment="true" eOpposite="#//Declaration/containerDeclarationPage"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PnObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePnObject"> + <eAnnotations source="redefines"/> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPnObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" ordered="false" + eType="#//Page" eOpposite="#//Page/objects"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Name" eSuperTypes="#//Annotation"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePetriNet" + eType="#//PetriNet" eOpposite="#//PetriNet/name"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePnObject" + eType="#//PnObject" eOpposite="#//PnObject/name"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ToolInfo"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="tool" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="formattedXMLBuffer" ordered="false" + eType="#//LongString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="toolInfoGrammarURI" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPnObject" ordered="false" + eType="#//PnObject" eOpposite="#//PnObject/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerLabel" ordered="false" + eType="#//Label" eOpposite="#//Label/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolInfoModel" eType="#//AnyObject" + containment="true" eOpposite="#//AnyObject/containerToolInfo"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Label" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerLabel"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="NodeGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="position" ordered="false" + eType="#//Position" containment="true" eOpposite="#//Position/containerPNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="dimension" ordered="false" + eType="#//Dimension" containment="true" eOpposite="#//Dimension/containerDNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNode" eType="#//Node" + eOpposite="#//Node/nodegraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" eType="#//Page" + eOpposite="#//Page/nodegraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Graphics" abstract="true"/> + <eClassifiers xsi:type="ecore:EClass" name="Coordinate" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="x" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="y" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Position" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/positions"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPNodeGraphics" + eType="#//NodeGraphics" eOpposite="#//NodeGraphics/position"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Offset" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/offset"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Dimension" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/dimension"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AnnotationGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="offset" ordered="false" + eType="#//Offset" containment="true" eOpposite="#//Offset/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="font" ordered="false" eType="#//Font" + containment="true" eOpposite="#//Font/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotation" eType="#//Annotation" + eOpposite="#//Annotation/annotationgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Fill"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientcolor" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientrotation" ordered="false" + eType="#//Gradient"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="image" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/fill"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/fill"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2Color"> + <eLiterals name="AQUA" literal="aqua"/> + <eLiterals name="BLACK" value="1" literal="black"/> + <eLiterals name="BLUE" value="2" literal="blue"/> + <eLiterals name="FUCHSIA" value="3" literal="fuchsia"/> + <eLiterals name="GRAY" value="4" literal="gray"/> + <eLiterals name="GREEN" value="5" literal="green"/> + <eLiterals name="LIME" value="6" literal="lime"/> + <eLiterals name="MAROON" value="7" literal="maroon"/> + <eLiterals name="NAVY" value="8" literal="navy"/> + <eLiterals name="OLIVE" value="9" literal="olive"/> + <eLiterals name="ORANGE" value="10" literal="orange"/> + <eLiterals name="PURPLE" value="11" literal="purple"/> + <eLiterals name="RED" value="12" literal="red"/> + <eLiterals name="SILVER" value="13" literal="silver"/> + <eLiterals name="TEAL" value="14" literal="teal"/> + <eLiterals name="WHITE" value="15" literal="white"/> + <eLiterals name="YELLOW" value="16" literal="yellow"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="Gradient"> + <eLiterals name="HORIZONTAL" literal="horizontal"/> + <eLiterals name="VERTICAL" value="1" literal="vertical"/> + <eLiterals name="DIAGONAL" value="2" literal="diagonal"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Line"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="shape" ordered="false" + eType="#//LineShape" defaultValueLiteral="LINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" eType="#//LineStyle"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="LineShape"> + <eLiterals name="LINE" literal="line"/> + <eLiterals name="CURVE" value="1" literal="curve"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ArcGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="positions" upperBound="-1" + eType="#//Position" containment="true" eOpposite="#//Position/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArc" eType="#//Arc" + eOpposite="#//Arc/arcgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Arc" eSuperTypes="#//PnObject"> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="samePageSourceTarget differentSourceTarget"/> + </eAnnotations> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="samePageSourceTarget" value="self.source.containerPage = self.target.containerPage"/> + <details key="differentSourceTarget" value="(self.source.oclIsKindOf(PlaceNode) and self.target.oclIsKindOf(TransitionNode)) or (self.source.oclIsKindOf(TransitionNode) and self.target.oclIsKindOf(PlaceNode))"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/OutArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/InArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="arcgraphics" ordered="false" + eType="#//ArcGraphics" containment="true" eOpposite="#//ArcGraphics/containerArc"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="hlinscription" eType="#//HLAnnotation" + containment="true" eOpposite="#//HLAnnotation/containerArc"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Node" abstract="true" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="InArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/target"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="OutArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/source"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerNode"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Font"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="align" ordered="false" + eType="#//FontAlign" defaultValueLiteral="LEFT"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="decoration" ordered="false" + eType="#//FontDecoration" defaultValueLiteral="UNDERLINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="family" ordered="false" + eType="#//CSS2FontFamily" defaultValueLiteral="VERDANA"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="rotation" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" ordered="false" eType="#//CSS2FontSize" + defaultValueLiteral="SMALL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" ordered="false" + eType="#//CSS2FontStyle" defaultValueLiteral="NORMAL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight" ordered="false" + eType="#//CSS2FontWeight"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/font"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontAlign"> + <eLiterals name="LEFT" literal="left"/> + <eLiterals name="CENTER" value="1" literal="center"/> + <eLiterals name="RIGHT" value="2" literal="right"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontDecoration"> + <eLiterals name="UNDERLINE" literal="underline"/> + <eLiterals name="OVERLINE" value="1" literal="overline"/> + <eLiterals name="LINETHROUGH" value="2" literal="linethrough"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontFamily"> + <eLiterals name="VERDANA" literal="verdana"/> + <eLiterals name="ARIAL" value="1" literal="arial"/> + <eLiterals name="TIMES" value="2" literal="times"/> + <eLiterals name="GEORGIA" value="3" literal="georgia"/> + <eLiterals name="TREBUCHET" value="4" literal="trebuchet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontSize"> + <eLiterals name="XXSMALL" literal="xxsmall"/> + <eLiterals name="XSMALL" value="1" literal="xsmall"/> + <eLiterals name="SMALL" value="2" literal="small"/> + <eLiterals name="MEDIUM" value="3" literal="medium"/> + <eLiterals name="LARGE" value="4" literal="large"/> + <eLiterals name="XLARGE" value="5" literal="xlarge"/> + <eLiterals name="XXLARGE" value="6" literal="xxlarge"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontStyle"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="ITALIC" value="1" literal="italic"/> + <eLiterals name="OBLIQUE" value="2" literal="oblique"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontWeight"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="BOLD" value="1" literal="bold"/> + <eLiterals name="BOLDER" value="2" literal="bolder"/> + <eLiterals name="LIGHTER" value="3" literal="lighter"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PlaceNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingPlaces" upperBound="-1" + eType="#//RefPlace" changeable="false" eOpposite="#//RefPlace/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TransitionNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingTransitions" + upperBound="-1" eType="#//RefTransition" changeable="false" eOpposite="#//RefTransition/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Place" eSuperTypes="#//PlaceNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//Type" containment="true" + eOpposite="#//Type/containerPlace"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="hlinitialMarking" eType="#//HLMarking" + containment="true" eOpposite="#//HLMarking/containerPlace"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="RefTransition" eSuperTypes="#//TransitionNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//TransitionNode" eOpposite="#//TransitionNode/referencingTransitions"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//TransitionNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="condition" eType="#//Condition" + containment="true" eOpposite="#//Condition/containerTransition"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="RefPlace" eSuperTypes="#//PlaceNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//PlaceNode" eOpposite="#//PlaceNode/referencingPlaces"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Attribute" abstract="true" eSuperTypes="#//Label"/> + <eClassifiers xsi:type="ecore:EEnum" name="LineStyle"> + <eLiterals name="SOLID" literal="solid"/> + <eLiterals name="DASH" value="1" literal="dash"/> + <eLiterals name="DOT" value="2" literal="dot"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Annotation" abstract="true" eSuperTypes="#//Label"> + <eStructuralFeatures xsi:type="ecore:EReference" name="annotationgraphics" ordered="false" + eType="#//AnnotationGraphics" containment="true" eOpposite="#//AnnotationGraphics/containerAnnotation"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EDataType" name="URI" instanceClassName="java.net.URI"/> + <eClassifiers xsi:type="ecore:EDataType" name="LongString" instanceClassName="java.lang.StringBuffer"/> + <eClassifiers xsi:type="ecore:EClass" name="AnyObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerToolInfo" eType="#//ToolInfo" + changeable="false" eOpposite="#//ToolInfo/toolInfoModel"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="HLCoreAnnotation" abstract="true" eSuperTypes="#//Annotation"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Type" eSuperTypes="#//HLCoreAnnotation"> + <eStructuralFeatures xsi:type="ecore:EReference" name="structure" eType="ecore:EClass terms.ecore#//Sort" + containment="true" eOpposite="terms.ecore#//Sort/containerType"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPlace" eType="#//Place" + eOpposite="#//Place/type"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="HLMarking" eSuperTypes="#//HLCoreAnnotation"> + <eStructuralFeatures xsi:type="ecore:EReference" name="structure" eType="ecore:EClass terms.ecore#//Term" + containment="true" eOpposite="terms.ecore#//Term/containerHLMarking"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPlace" eType="#//Place" + eOpposite="#//Place/hlinitialMarking"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Condition" eSuperTypes="#//HLCoreAnnotation"> + <eStructuralFeatures xsi:type="ecore:EReference" name="structure" eType="ecore:EClass terms.ecore#//Term" + containment="true" eOpposite="terms.ecore#//Term/containerCondition"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerTransition" eType="#//Transition" + eOpposite="#//Transition/condition"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="HLAnnotation" eSuperTypes="#//HLCoreAnnotation"> + <eStructuralFeatures xsi:type="ecore:EReference" name="structure" eType="ecore:EClass terms.ecore#//Term" + containment="true" eOpposite="terms.ecore#//Term/containerHLAnnotation"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArc" eType="#//Arc" + eOpposite="#//Arc/hlinscription"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Declaration" eSuperTypes="#//HLCoreAnnotation"> + <eStructuralFeatures xsi:type="ecore:EReference" name="structure" eType="ecore:EClass terms.ecore#//Declarations" + containment="true" eOpposite="terms.ecore#//Declarations/containerDeclaration"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclarationPetriNet" + eType="#//PetriNet" eOpposite="#//PetriNet/declaration"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclarationPage" + eType="#//Page" eOpposite="#//Page/declaration"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/integers.ecore b/src/test/resources/ecore/pnml/integers.ecore new file mode 100644 index 0000000..7a3bec0 --- /dev/null +++ b/src/test/resources/ecore/pnml/integers.ecore @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="integers" + nsURI="http:///symmetricnet.integers.ecore" nsPrefix="integers"> + <eClassifiers xsi:type="ecore:EClass" name="HLPNNumber" abstract="true" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
		 //by default they are the same sort, unless they have been named.
		 	isEqual = true;
		 	if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				// we test them if they have been explicitly named.
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			}// otherwise, keep the default.
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNumberConstant" + eType="#//NumberConstant" eOpposite="#//NumberConstant/type"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Natural" eSuperTypes="#//HLPNNumber"/> + <eClassifiers xsi:type="ecore:EClass" name="Positive" eSuperTypes="#//HLPNNumber"/> + <eClassifiers xsi:type="ecore:EClass" name="HLInteger" eSuperTypes="#//HLPNNumber"/> + <eClassifiers xsi:type="ecore:EClass" name="NumberConstant" eSuperTypes="terms.ecore#//BuiltInConstant"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="typeType" value="self.input->size() = 0 and self.type.oclIsTypeOf(Natural) implies self.value >= 0 and self.type.oclIsTypeOf(Positive) implies self.value > 0"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="typeType"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HLPNNumber" + containment="true" eOpposite="#//HLPNNumber/containerNumberConstant"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="IntegerOperator" abstract="true" eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputType" value="self.input->size() = 2 and self.input->forAll{c | c.oclIsKindOf(Number)}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Addition" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsKindOf(Number)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Subtraction" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsKindOf(Number)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Multiplication" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsKindOf(Number)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Division" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsKindOf(Number)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Modulo" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsKindOf(Number)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThan" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsTypeOf(booleans::Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThanOrEqual" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsTypeOf(booleans::Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="LessThan" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsTypeOf(booleans::Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="LessThanOrEqual" eSuperTypes="#//IntegerOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="outputType" value="self.output.oclIsTypeOf(booleans::Bool)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="outputType"/> + </eAnnotations> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/lists.ecore b/src/test/resources/ecore/pnml/lists.ecore new file mode 100644 index 0000000..170dc09 --- /dev/null +++ b/src/test/resources/ecore/pnml/lists.ecore @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="lists" + nsURI="http:///hlpn.lists.ecore" nsPrefix="lists"> + <eClassifiers xsi:type="ecore:EClass" name="HLPNList" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				//further sub-classes must override this method.
				if ("HLPNList".equalsIgnoreCase(this.eClass().getName())) {
					HLPNList myList = (HLPNList) this;
					HLPNList thatList = (HLPNList) sort;
					if (myList.getBasis() instanceof UserSort
					 && thatList.getBasis() instanceof UserSort) { 
						isEqual = ((UserSort) myList.getBasis()).getDeclaration().getName()
							.equalsIgnoreCase(
									((UserSort) thatList.getBasis()).getDeclaration()
											.getName());
				 }
				}
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="basis" lowerBound="1" eType="ecore:EClass terms.ecore#//Sort" + containment="true" eOpposite="terms.ecore#//Sort/containerList"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="EmptyList" eSuperTypes="terms.ecore#//BuiltInConstant"> + <eStructuralFeatures xsi:type="ecore:EReference" name="refsort" lowerBound="1" + eType="ecore:EClass terms.ecore#//Sort" containment="true" eOpposite="terms.ecore#//Sort/containerEmptyList"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ListOperator" abstract="true" eSuperTypes="terms.ecore#//BuiltInOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Append" eSuperTypes="#//ListOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Concatenation" eSuperTypes="#//ListOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Length" eSuperTypes="#//ListOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="MakeList" eSuperTypes="#//ListOperator"> + <eStructuralFeatures xsi:type="ecore:EReference" name="refsort" lowerBound="1" + eType="ecore:EClass terms.ecore#//Sort" containment="true" eOpposite="terms.ecore#//Sort/containerMakeList"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="MemberAtIndex" eSuperTypes="#//ListOperator"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="index" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Sublist" eSuperTypes="#//ListOperator"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="start" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/multisets.ecore b/src/test/resources/ecore/pnml/multisets.ecore new file mode 100644 index 0000000..12f0ec2 --- /dev/null +++ b/src/test/resources/ecore/pnml/multisets.ecore @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="multisets" + nsURI="http:///symmetricnet.multisets.ecore" nsPrefix="multisets"> + <eClassifiers xsi:type="ecore:EClass" name="Cardinality" eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsTypeOf(integers::Natural) and self.input.oclIsKindOf(terms::MultisetSort)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Contains" eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsTypeOf(booleans::Bool) and self.input->size() = 2 and self.input->forAll {c | c.oclIsKindOf(terms::MultisetSort)}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="CardinalityOf" eSuperTypes="terms.ecore#//BuiltInOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsTypeOf(integers::Natural) and self.input.size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Add" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputType" value="self.input->size() >= 2 and self.input->forAll{c | c.oclIsKindOf(terms::MultisetSort)} "/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="All" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input->size() = 0"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="refsort" ordered="false" + lowerBound="1" eType="ecore:EClass terms.ecore#//Sort" containment="true" + eOpposite="terms.ecore#//Sort/containerAll"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Empty" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="InputSize" value="self.input->size = 0"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="InputSize"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="NumberOf" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input->size() = 2 and self.input->forAll{c, d | c.oclIsTypeOf(integers::Natural) and d.oclIsKindOf(terms::Sort)} and self.output.oclIsKindOf(terms::MultisetSort)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Subtract" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputType" value="self.input->size() = 2 and self.input->forAll{c | c.oclIsKindOf(terms::MultisetSort)}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputType"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ScalarProduct" eSuperTypes="terms.ecore#//MultisetOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsKindOf(terms::MultisetSort) and self.input->forAll{c,d | c.oclIsKindOf(integers::Natural) and d.oclIsKindOf(terms::MultisetSort)}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/partitions.ecore b/src/test/resources/ecore/pnml/partitions.ecore new file mode 100644 index 0000000..9976161 --- /dev/null +++ b/src/test/resources/ecore/pnml/partitions.ecore @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="partitions" + nsURI="http:///symmetricnet.partitions.ecore" nsPrefix="partitions"> + <eClassifiers xsi:type="ecore:EClass" name="Partition" eSuperTypes="terms.ecore#//SortDecl"> + <eStructuralFeatures xsi:type="ecore:EReference" name="def" ordered="false" lowerBound="1" + eType="ecore:EClass terms.ecore#//Sort" containment="true" eOpposite="terms.ecore#//Sort/containerPartition"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="partitionelements" lowerBound="1" + upperBound="-1" eType="#//PartitionElement" containment="true" eOpposite="#//PartitionElement/refpartition"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PartitionElement" eSuperTypes="terms.ecore#//OperatorDecl"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="constantsType" value="self.partitionelementconstants->forAll{p | p.sort = self.refpartition.def}"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="constantsType"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="refpartition" eType="#//Partition" + eOpposite="#//Partition/partitionelements"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="partitionelementconstants" + ordered="false" lowerBound="1" upperBound="-1" eType="ecore:EClass terms.ecore#//Term" + containment="true" eOpposite="terms.ecore#//Term/containerPartitionElement"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThan" eSuperTypes="#//PartitionOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsTypeOf(booleans::Bool) and self.input->size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PartitionElementOf" eSuperTypes="#//PartitionOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.input->size() = 1"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="refpartition" lowerBound="1" + eType="#//Partition"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PartitionOperator" abstract="true" eSuperTypes="terms.ecore#//BuiltInOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="LessThan" eSuperTypes="#//PartitionOperator"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inputOutputTypes" value="self.output.oclIsTypeOf(booleans::Bool) and self.input->size() = 2"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inputOutputTypes"/> + </eAnnotations> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/placeTransition.ecore b/src/test/resources/ecore/pnml/placeTransition.ecore new file mode 100644 index 0000000..08fa231 --- /dev/null +++ b/src/test/resources/ecore/pnml/placeTransition.ecore @@ -0,0 +1,336 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="ptnet" + nsURI="http:///ptnet.ecore" nsPrefix="ptnet"> + <eClassifiers xsi:type="ecore:EClass" name="PTMarking" eSuperTypes="#//Annotation"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="markingValueRange" value="self.text >= 0"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="markingValueRange"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" lowerBound="1" eType="#//Natural"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPlace" eType="#//Place" + eOpposite="#//Place/initialMarking"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PTArcAnnotation" eSuperTypes="#//Annotation"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="inscriptionValueRange" value="self.text > 0"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="inscriptionValueRange"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" lowerBound="1" eType="#//PositiveInteger"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArc" eType="#//Arc" + eOpposite="#//Arc/inscription"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EDataType" name="PositiveInteger" instanceClassName="java.lang.Integer"/> + <eClassifiers xsi:type="ecore:EDataType" name="Natural" instanceClassName="java.lang.Integer"/> + <eClassifiers xsi:type="ecore:EClass" name="PetriNetDoc"> + <eStructuralFeatures xsi:type="ecore:EReference" name="nets" ordered="false" lowerBound="1" + upperBound="-1" eType="#//PetriNet" containment="true" eOpposite="#//PetriNet/containerPetriNetDoc"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlns" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" + changeable="false" defaultValueLiteral="http://www.pnml.org/version-2009/grammar/pnml"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PetriNet"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="" + iD="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" ordered="false" lowerBound="1" + eType="#//PNType" defaultValueLiteral=""/> + <eStructuralFeatures xsi:type="ecore:EReference" name="pages" ordered="false" + lowerBound="1" upperBound="-1" eType="#//Page" containment="true" eOpposite="#//Page/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNetDoc" ordered="false" + eType="#//PetriNetDoc" eOpposite="#//PetriNetDoc/nets"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="PNType"> + <eLiterals name="PTNET" value="1" literal="http://www.pnml.org/version-2009/grammar/ptnet"/> + <eLiterals name="COREMODEL" literal="http://www.pnml.org/version-2009/grammar/pnmlcoremodel"/> + <eLiterals name="SYMNET" value="2" literal="http://www.pnml.org/version-2009/grammar/snnet"/> + <eLiterals name="HLPN" value="3" literal="http://www.pnml.org/version-2009/grammar/highlevelnet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Page" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="objects" ordered="false" + upperBound="-1" eType="#//PnObject" containment="true" eOpposite="#//PnObject/containerPage"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/pages"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerPage"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PnObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePnObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPnObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" ordered="false" + eType="#//Page" eOpposite="#//Page/objects"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Name" eSuperTypes="#//Annotation"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePetriNet" + eType="#//PetriNet" eOpposite="#//PetriNet/name"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePnObject" + eType="#//PnObject" eOpposite="#//PnObject/name"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ToolInfo"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="tool" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="formattedXMLBuffer" ordered="false" + eType="#//LongString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="toolInfoGrammarURI" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPnObject" ordered="false" + eType="#//PnObject" eOpposite="#//PnObject/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerLabel" ordered="false" + eType="#//Label" eOpposite="#//Label/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolInfoModel" eType="#//AnyObject" + containment="true" eOpposite="#//AnyObject/containerToolInfo"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Label" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerLabel"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="NodeGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="position" ordered="false" + eType="#//Position" containment="true" eOpposite="#//Position/containerPNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="dimension" ordered="false" + eType="#//Dimension" containment="true" eOpposite="#//Dimension/containerDNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNode" eType="#//Node" + eOpposite="#//Node/nodegraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" eType="#//Page" + eOpposite="#//Page/nodegraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Graphics" abstract="true"/> + <eClassifiers xsi:type="ecore:EClass" name="Coordinate" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="x" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="y" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Position" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/positions"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPNodeGraphics" + eType="#//NodeGraphics" eOpposite="#//NodeGraphics/position"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Offset" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/offset"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Dimension" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/dimension"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AnnotationGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="offset" ordered="false" + eType="#//Offset" containment="true" eOpposite="#//Offset/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="font" ordered="false" eType="#//Font" + containment="true" eOpposite="#//Font/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotation" eType="#//Annotation" + eOpposite="#//Annotation/annotationgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Fill"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientcolor" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientrotation" ordered="false" + eType="#//Gradient"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="image" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/fill"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/fill"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2Color"> + <eLiterals name="AQUA" literal="aqua"/> + <eLiterals name="BLACK" value="1" literal="black"/> + <eLiterals name="BLUE" value="2" literal="blue"/> + <eLiterals name="FUCHSIA" value="3" literal="fuchsia"/> + <eLiterals name="GRAY" value="4" literal="gray"/> + <eLiterals name="GREEN" value="5" literal="green"/> + <eLiterals name="LIME" value="6" literal="lime"/> + <eLiterals name="MAROON" value="7" literal="maroon"/> + <eLiterals name="NAVY" value="8" literal="navy"/> + <eLiterals name="OLIVE" value="9" literal="olive"/> + <eLiterals name="ORANGE" value="10" literal="orange"/> + <eLiterals name="PURPLE" value="11" literal="purple"/> + <eLiterals name="RED" value="12" literal="red"/> + <eLiterals name="SILVER" value="13" literal="silver"/> + <eLiterals name="TEAL" value="14" literal="teal"/> + <eLiterals name="WHITE" value="15" literal="white"/> + <eLiterals name="YELLOW" value="16" literal="yellow"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="Gradient"> + <eLiterals name="HORIZONTAL" literal="horizontal"/> + <eLiterals name="VERTICAL" value="1" literal="vertical"/> + <eLiterals name="DIAGONAL" value="2" literal="diagonal"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Line"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="shape" ordered="false" + eType="#//LineShape" defaultValueLiteral="LINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" eType="#//LineStyle"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="LineShape"> + <eLiterals name="LINE" literal="line"/> + <eLiterals name="CURVE" value="1" literal="curve"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ArcGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="positions" upperBound="-1" + eType="#//Position" containment="true" eOpposite="#//Position/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArc" eType="#//Arc" + eOpposite="#//Arc/arcgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Arc" eSuperTypes="#//PnObject"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="samePageSourceTarget" value="self.source.containerPage = self.target.containerPage"/> + <details key="differentSourceTarget" value="(self.source.oclIsKindOf(PlaceNode) and self.target.oclIsKindOf(TransitionNode)) or (self.source.oclIsKindOf(TransitionNode) and self.target.oclIsKindOf(PlaceNode))"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="samePageSourceTarget differentSourceTarget"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/OutArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/InArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="arcgraphics" ordered="false" + eType="#//ArcGraphics" containment="true" eOpposite="#//ArcGraphics/containerArc"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="inscription" eType="#//PTArcAnnotation" + containment="true" eOpposite="#//PTArcAnnotation/containerArc"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Node" abstract="true" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="InArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/target"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="OutArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/source"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerNode"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Font"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="align" ordered="false" + eType="#//FontAlign" defaultValueLiteral="LEFT"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="decoration" ordered="false" + eType="#//FontDecoration" defaultValueLiteral="UNDERLINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="family" ordered="false" + eType="#//CSS2FontFamily" defaultValueLiteral="VERDANA"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="rotation" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" ordered="false" eType="#//CSS2FontSize" + defaultValueLiteral="SMALL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" ordered="false" + eType="#//CSS2FontStyle" defaultValueLiteral="NORMAL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight" ordered="false" + eType="#//CSS2FontWeight"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/font"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontAlign"> + <eLiterals name="LEFT" literal="left"/> + <eLiterals name="CENTER" value="1" literal="center"/> + <eLiterals name="RIGHT" value="2" literal="right"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontDecoration"> + <eLiterals name="UNDERLINE" literal="underline"/> + <eLiterals name="OVERLINE" value="1" literal="overline"/> + <eLiterals name="LINETHROUGH" value="2" literal="linethrough"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontFamily"> + <eLiterals name="VERDANA" literal="verdana"/> + <eLiterals name="ARIAL" value="1" literal="arial"/> + <eLiterals name="TIMES" value="2" literal="times"/> + <eLiterals name="GEORGIA" value="3" literal="georgia"/> + <eLiterals name="TREBUCHET" value="4" literal="trebuchet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontSize"> + <eLiterals name="XXSMALL" literal="xxsmall"/> + <eLiterals name="XSMALL" value="1" literal="xsmall"/> + <eLiterals name="SMALL" value="2" literal="small"/> + <eLiterals name="MEDIUM" value="3" literal="medium"/> + <eLiterals name="LARGE" value="4" literal="large"/> + <eLiterals name="XLARGE" value="5" literal="xlarge"/> + <eLiterals name="XXLARGE" value="6" literal="xxlarge"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontStyle"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="ITALIC" value="1" literal="italic"/> + <eLiterals name="OBLIQUE" value="2" literal="oblique"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontWeight"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="BOLD" value="1" literal="bold"/> + <eLiterals name="BOLDER" value="2" literal="bolder"/> + <eLiterals name="LIGHTER" value="3" literal="lighter"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PlaceNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingPlaces" upperBound="-1" + eType="#//RefPlace" changeable="false" eOpposite="#//RefPlace/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TransitionNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingTransitions" + upperBound="-1" eType="#//RefTransition" changeable="false" eOpposite="#//RefTransition/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Place" eSuperTypes="#//PlaceNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="initialMarking" eType="#//PTMarking" + containment="true" eOpposite="#//PTMarking/containerPlace"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="RefTransition" eSuperTypes="#//TransitionNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//TransitionNode" eOpposite="#//TransitionNode/referencingTransitions"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//TransitionNode"/> + <eClassifiers xsi:type="ecore:EClass" name="RefPlace" eSuperTypes="#//PlaceNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//PlaceNode" eOpposite="#//PlaceNode/referencingPlaces"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Attribute" abstract="true" eSuperTypes="#//Label"/> + <eClassifiers xsi:type="ecore:EEnum" name="LineStyle"> + <eLiterals name="SOLID" literal="solid"/> + <eLiterals name="DASH" value="1" literal="dash"/> + <eLiterals name="DOT" value="2" literal="dot"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Annotation" abstract="true" eSuperTypes="#//Label"> + <eStructuralFeatures xsi:type="ecore:EReference" name="annotationgraphics" ordered="false" + eType="#//AnnotationGraphics" containment="true" eOpposite="#//AnnotationGraphics/containerAnnotation"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EDataType" name="URI" instanceClassName="java.net.URI"/> + <eClassifiers xsi:type="ecore:EDataType" name="LongString" instanceClassName="java.lang.StringBuffer"/> + <eClassifiers xsi:type="ecore:EClass" name="AnyObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerToolInfo" eType="#//ToolInfo" + changeable="false" eOpposite="#//ToolInfo/toolInfoModel"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/pnmlcoremodel.ecore b/src/test/resources/ecore/pnml/pnmlcoremodel.ecore new file mode 100644 index 0000000..3b54294 --- /dev/null +++ b/src/test/resources/ecore/pnml/pnmlcoremodel.ecore @@ -0,0 +1,312 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="pnmlcoremodel" + nsURI="http:///pnmlcoremodel.ecore" nsPrefix="pnmlcoremodel"> + <eClassifiers xsi:type="ecore:EClass" name="PetriNetDoc"> + <eStructuralFeatures xsi:type="ecore:EReference" name="nets" ordered="false" lowerBound="1" + upperBound="-1" eType="#//PetriNet" containment="true" eOpposite="#//PetriNet/containerPetriNetDoc"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlns" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" changeable="false" + defaultValueLiteral="http://www.pnml.org/version-2009/grammar/pnml"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PetriNet"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="" + iD="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" ordered="false" lowerBound="1" + eType="#//PNType"> + <eAnnotations source="http://www.pnml.org/models/ToPNML"> + <details key="tag" value="type"/> + <details key="kind" value="attribute"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="pages" ordered="false" + lowerBound="1" upperBound="-1" eType="#//Page" containment="true" eOpposite="#//Page/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPetriNet"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNetDoc" ordered="false" + lowerBound="1" eType="#//PetriNetDoc" eOpposite="#//PetriNetDoc/nets"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="PNType"> + <eLiterals name="COREMODEL" literal="http://www.pnml.org/version-2009/grammar/pnmlcoremodel"/> + <eLiterals name="PTNET" value="1" literal="http://www.pnml.org/version-2009/grammar/ptnet"/> + <eLiterals name="SYMNET" value="2" literal="http://www.pnml.org/version-2009/grammar/symmetricnet"/> + <eLiterals name="HLPN" value="3" literal="http://www.pnml.org/version-2009/grammar/highlevelnet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Page" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="objects" ordered="false" + upperBound="-1" eType="#//PnObject" containment="true" eOpposite="#//PnObject/containerPage"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/pages"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerPage"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PnObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="name" ordered="false" eType="#//Name" + containment="true" eOpposite="#//Name/containerNamePnObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerPnObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" ordered="false" + eType="#//Page" eOpposite="#//Page/objects"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Name" eSuperTypes="#//Annotation"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="text" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePetriNet" + eType="#//PetriNet" eOpposite="#//PetriNet/name"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamePnObject" + eType="#//PnObject" eOpposite="#//PnObject/name"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ToolInfo"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="tool" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" ordered="false" + lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="formattedXMLBuffer" ordered="false" + eType="#//LongString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="toolInfoGrammarURI" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPetriNet" ordered="false" + eType="#//PetriNet" eOpposite="#//PetriNet/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPnObject" ordered="false" + eType="#//PnObject" eOpposite="#//PnObject/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerLabel" ordered="false" + eType="#//Label" eOpposite="#//Label/toolspecifics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolInfoModel" eType="#//AnyObject" + containment="true" eOpposite="#//AnyObject/containerToolInfo"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Label" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="toolspecifics" ordered="false" + upperBound="-1" eType="#//ToolInfo" containment="true" eOpposite="#//ToolInfo/containerLabel"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="NodeGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="position" ordered="false" + eType="#//Position" containment="true" eOpposite="#//Position/containerPNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="dimension" ordered="false" + eType="#//Dimension" containment="true" eOpposite="#//Dimension/containerDNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerNodeGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNode" eType="#//Node" + eOpposite="#//Node/nodegraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPage" eType="#//Page" + eOpposite="#//Page/nodegraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Graphics" abstract="true"/> + <eClassifiers xsi:type="ecore:EClass" name="Coordinate" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="x" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="y" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Position" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPNodeGraphics" + eType="#//NodeGraphics" eOpposite="#//NodeGraphics/position"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/positions"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Offset" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/offset"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Dimension" eSuperTypes="#//Coordinate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/dimension"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AnnotationGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="offset" ordered="false" + eType="#//Offset" containment="true" eOpposite="#//Offset/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="fill" ordered="false" eType="#//Fill" + containment="true" eOpposite="#//Fill/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="font" ordered="false" eType="#//Font" + containment="true" eOpposite="#//Font/containerAnnotationGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotation" eType="#//Annotation" + eOpposite="#//Annotation/annotationgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Fill"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientcolor" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientrotation" ordered="false" + eType="#//Gradient"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="image" ordered="false" + eType="#//URI"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/fill"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/fill"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2Color"> + <eLiterals name="AQUA" literal="aqua"/> + <eLiterals name="BLACK" value="1" literal="black"/> + <eLiterals name="BLUE" value="2" literal="blue"/> + <eLiterals name="FUCHSIA" value="3" literal="fuchsia"/> + <eLiterals name="GRAY" value="4" literal="gray"/> + <eLiterals name="GREEN" value="5" literal="green"/> + <eLiterals name="LIME" value="6" literal="lime"/> + <eLiterals name="MAROON" value="7" literal="maroon"/> + <eLiterals name="NAVY" value="8" literal="navy"/> + <eLiterals name="OLIVE" value="9" literal="olive"/> + <eLiterals name="ORANGE" value="10" literal="orange"/> + <eLiterals name="PURPLE" value="11" literal="purple"/> + <eLiterals name="RED" value="12" literal="red"/> + <eLiterals name="SILVER" value="13" literal="silver"/> + <eLiterals name="TEAL" value="14" literal="teal"/> + <eLiterals name="WHITE" value="15" literal="white"/> + <eLiterals name="YELLOW" value="16" literal="yellow"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="Gradient"> + <eLiterals name="HORIZONTAL" literal="horizontal"/> + <eLiterals name="VERTICAL" value="1" literal="vertical"/> + <eLiterals name="DIAGONAL" value="2" literal="diagonal"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Line"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="color" ordered="false" + eType="#//CSS2Color" defaultValueLiteral="BLACK"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="shape" ordered="false" + eType="#//LineShape" defaultValueLiteral="LINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNodeGraphics" + ordered="false" eType="#//NodeGraphics" eOpposite="#//NodeGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArcGraphics" ordered="false" + eType="#//ArcGraphics" eOpposite="#//ArcGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/line"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" eType="#//LineStyle"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="LineShape"> + <eLiterals name="LINE" literal="line"/> + <eLiterals name="CURVE" value="1" literal="curve"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ArcGraphics" eSuperTypes="#//Graphics"> + <eStructuralFeatures xsi:type="ecore:EReference" name="positions" upperBound="-1" + eType="#//Position" containment="true" eOpposite="#//Position/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="line" ordered="false" eType="#//Line" + containment="true" eOpposite="#//Line/containerArcGraphics"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerArc" eType="#//Arc" + eOpposite="#//Arc/arcgraphics"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Arc" eSuperTypes="#//PnObject"> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="samePageSourceTarget"/> + </eAnnotations> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="samePageSourceTarget" value="self.source.containerPage = self.target.containerPage"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/OutArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false" + lowerBound="1" eType="#//Node" eOpposite="#//Node/InArcs"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="arcgraphics" ordered="false" + eType="#//ArcGraphics" containment="true" eOpposite="#//ArcGraphics/containerArc"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Node" abstract="true" eSuperTypes="#//PnObject"> + <eStructuralFeatures xsi:type="ecore:EReference" name="InArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/target"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="OutArcs" ordered="false" + upperBound="-1" eType="#//Arc" changeable="false" eOpposite="#//Arc/source"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="nodegraphics" eType="#//NodeGraphics" + containment="true" eOpposite="#//NodeGraphics/containerNode"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Font"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="align" ordered="false" + eType="#//FontAlign" defaultValueLiteral="LEFT"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="decoration" ordered="false" + eType="#//FontDecoration" defaultValueLiteral="UNDERLINE"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="family" ordered="false" + eType="#//CSS2FontFamily" defaultValueLiteral="VERDANA"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="rotation" ordered="false" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" ordered="false" eType="#//CSS2FontSize" + defaultValueLiteral="SMALL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="style" ordered="false" + eType="#//CSS2FontStyle" defaultValueLiteral="NORMAL"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="weight" ordered="false" + eType="#//CSS2FontWeight"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAnnotationGraphics" + ordered="false" eType="#//AnnotationGraphics" eOpposite="#//AnnotationGraphics/font"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontAlign"> + <eLiterals name="LEFT" literal="left"/> + <eLiterals name="CENTER" value="1" literal="center"/> + <eLiterals name="RIGHT" value="2" literal="right"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="FontDecoration"> + <eLiterals name="UNDERLINE" literal="underline"/> + <eLiterals name="OVERLINE" value="1" literal="overline"/> + <eLiterals name="LINETHROUGH" value="2" literal="linethrough"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontFamily"> + <eLiterals name="VERDANA" literal="verdana"/> + <eLiterals name="ARIAL" value="1" literal="arial"/> + <eLiterals name="TIMES" value="2" literal="times"/> + <eLiterals name="GEORGIA" value="3" literal="georgia"/> + <eLiterals name="TREBUCHET" value="4" literal="trebuchet"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontSize"> + <eLiterals name="XXSMALL" literal="xxsmall"/> + <eLiterals name="XSMALL" value="1" literal="xsmall"/> + <eLiterals name="SMALL" value="2" literal="small"/> + <eLiterals name="MEDIUM" value="3" literal="medium"/> + <eLiterals name="LARGE" value="4" literal="large"/> + <eLiterals name="XLARGE" value="5" literal="xlarge"/> + <eLiterals name="XXLARGE" value="6" literal="xxlarge"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontStyle"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="ITALIC" value="1" literal="italic"/> + <eLiterals name="OBLIQUE" value="2" literal="oblique"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EEnum" name="CSS2FontWeight"> + <eLiterals name="NORMAL" literal="normal"/> + <eLiterals name="BOLD" value="1" literal="bold"/> + <eLiterals name="BOLDER" value="2" literal="bolder"/> + <eLiterals name="LIGHTER" value="3" literal="lighter"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="PlaceNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingPlaces" upperBound="-1" + eType="#//RefPlace" changeable="false" eOpposite="#//RefPlace/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TransitionNode" abstract="true" eSuperTypes="#//Node"> + <eStructuralFeatures xsi:type="ecore:EReference" name="referencingTransitions" + upperBound="-1" eType="#//RefTransition" changeable="false" eOpposite="#//RefTransition/ref"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Place" eSuperTypes="#//PlaceNode"/> + <eClassifiers xsi:type="ecore:EClass" name="RefTransition" eSuperTypes="#//TransitionNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//TransitionNode" eOpposite="#//TransitionNode/referencingTransitions"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//TransitionNode"/> + <eClassifiers xsi:type="ecore:EClass" name="RefPlace" eSuperTypes="#//PlaceNode"> + <eStructuralFeatures xsi:type="ecore:EReference" name="ref" ordered="false" lowerBound="1" + eType="#//PlaceNode" eOpposite="#//PlaceNode/referencingPlaces"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Attribute" abstract="true" eSuperTypes="#//Label"/> + <eClassifiers xsi:type="ecore:EEnum" name="LineStyle"> + <eLiterals name="SOLID" literal="solid"/> + <eLiterals name="DASH" value="1" literal="dash"/> + <eLiterals name="DOT" value="2" literal="dot"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Annotation" abstract="true" eSuperTypes="#//Label"> + <eStructuralFeatures xsi:type="ecore:EReference" name="annotationgraphics" ordered="false" + eType="#//AnnotationGraphics" containment="true" eOpposite="#//AnnotationGraphics/containerAnnotation"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EDataType" name="URI" instanceClassName="java.net.URI"/> + <eClassifiers xsi:type="ecore:EDataType" name="LongString" instanceClassName="java.lang.StringBuffer"/> + <eClassifiers xsi:type="ecore:EClass" name="AnyObject" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerToolInfo" eType="#//ToolInfo" + changeable="false" eOpposite="#//ToolInfo/toolInfoModel"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/strings.ecore b/src/test/resources/ecore/pnml/strings.ecore new file mode 100644 index 0000000..ea430c6 --- /dev/null +++ b/src/test/resources/ecore/pnml/strings.ecore @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="strings" + nsURI="http:///hlpn.strings.ecore" nsPrefix="strings"> + <eClassifiers xsi:type="ecore:EClass" name="HLPNString" eSuperTypes="terms.ecore#//BuiltInSort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
		 //by default they are the same sort, unless they have been named.
		 	isEqual = true;
		 	if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				// we test them if they have been explicitly named.
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			}// otherwise, keep the default.
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="StringConstant" eSuperTypes="terms.ecore#//BuiltInConstant"> + <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="StringOperator" abstract="true" eSuperTypes="terms.ecore#//BuiltInOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Append" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Concatenation" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThan" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="GreaterThanOrEqual" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="LessThan" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="LessThanOrEqual" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Length" eSuperTypes="#//StringOperator"/> + <eClassifiers xsi:type="ecore:EClass" name="Substring" eSuperTypes="#//StringOperator"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="start" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/> + </eClassifiers> +</ecore:EPackage> diff --git a/src/test/resources/ecore/pnml/terms.ecore b/src/test/resources/ecore/pnml/terms.ecore new file mode 100644 index 0000000..6eec7e2 --- /dev/null +++ b/src/test/resources/ecore/pnml/terms.ecore @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Meta-model for PNML specification --> +<!-- Provided by www.pnml.org --> +<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="terms" + nsURI="http:///symmetricnet.terms.ecore" nsPrefix="terms"> + <eClassifiers xsi:type="ecore:EClass" name="Declarations"> + <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false" + upperBound="-1" eType="#//TermsDeclaration" containment="true" eOpposite="#//TermsDeclaration/containerDeclarations"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclaration" eType="ecore:EClass hlcorestructure.ecore#//Declaration" + eOpposite="hlcorestructure.ecore#//Declaration/structure"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="TermsDeclaration" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerDeclarations" + eType="#//Declarations" eOpposite="#//Declarations/declaration"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Sort" abstract="true"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value=""/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually semantically the
 * same sort, even in two different objects. 
 * <p>Ex: two FiniteEnumerations F1 = {1,4,6} and F2 = {1,4,6} or
 * two Integers I1 and I2.</p> 
 * <p><strong>Note</strong> : the implementation available for
 * MultisetSort is not complete. In particular, we just test equality
 * of the references or of the enclosing NamedSorts (if any). 
 * You should consider overriding it in that case.
 * 
 * @return true if so.
 * @param sort
 * the sort to which we compare this one.
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="multi" ordered="false" + eType="#//MultisetSort" eOpposite="#//MultisetSort/basis"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedSort" eType="#//NamedSort" + eOpposite="#//NamedSort/sortdef"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerVariableDecl" + eType="#//VariableDecl" eOpposite="#//VariableDecl/sort"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerProductSort" eType="#//ProductSort" + eOpposite="#//ProductSort/elementSort"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerType" eType="ecore:EClass hlcorestructure.ecore#//Type" + eOpposite="hlcorestructure.ecore#//Type/structure"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerAll" eType="ecore:EClass multisets.ecore#//All" + eOpposite="multisets.ecore#//All/refsort"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerEmpty" eType="ecore:EClass multisets.ecore#//Empty"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPartition" ordered="false" + eType="ecore:EClass partitions.ecore#//Partition" eOpposite="partitions.ecore#//Partition/def"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="MultisetSort" eSuperTypes="#//Sort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
		 	if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				// we test them if they have been explicitly named.
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
			 throw new UnsupportedOperationException("Cannot determine if these two multisets are equal."
			 + "You should override this method.");
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * Note : there is no implementation available for MultisetSort yet.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="basis" ordered="false" + lowerBound="1" eType="#//Sort" containment="true" eOpposite="#//Sort/multi"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Term" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EReference" name="sort" ordered="false" eType="#//Sort" + derived="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerOperator" eType="#//Operator" + eOpposite="#//Operator/subterm"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedOperator" + eType="#//NamedOperator" eOpposite="#//NamedOperator/def"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerHLMarking" eType="ecore:EClass hlcorestructure.ecore#//HLMarking" + eOpposite="hlcorestructure.ecore#//HLMarking/structure"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerCondition" eType="ecore:EClass hlcorestructure.ecore#//Condition" + eOpposite="hlcorestructure.ecore#//Condition/structure"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerHLAnnotation" + eType="ecore:EClass hlcorestructure.ecore#//HLAnnotation" eOpposite="hlcorestructure.ecore#//HLAnnotation/structure"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerPartitionElement" + eType="ecore:EClass partitions.ecore#//PartitionElement" eOpposite="partitions.ecore#//PartitionElement/partitionelementconstants"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Operator" abstract="true" eSuperTypes="#//Term"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="sameOperatorNTermSort" value="self.sort = self.output"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="sameOperatorNTermSort"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="subterm" upperBound="-1" + eType="#//Term" containment="true" eOpposite="#//Term/containerOperator"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="output" ordered="false" + eType="#//Sort" derived="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="input" upperBound="-1" + eType="#//Sort" derived="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="VariableDecl" eSuperTypes="#//TermsDeclaration"> + <eStructuralFeatures xsi:type="ecore:EReference" name="sort" ordered="false" lowerBound="1" + eType="#//Sort" containment="true" eOpposite="#//Sort/containerVariableDecl"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="containerNamedOperator" + eType="#//NamedOperator" eOpposite="#//NamedOperator/parameters"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Variable" eSuperTypes="#//Term"> + <eStructuralFeatures xsi:type="ecore:EReference" name="variableDecl" ordered="false" + lowerBound="1" eType="#//VariableDecl"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="BuiltInSort" abstract="true" eSuperTypes="#//Sort"/> + <eClassifiers xsi:type="ecore:EClass" name="ProductSort" eSuperTypes="#//Sort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				// Someone may one day inherit from ProductSort, so we should
				// strictly check for ProductSort only. Further sub-classes must 
				//override this method.
				if ("ProductSort".equalsIgnoreCase(this.eClass().getName())) {
					ProductSort mySort = (ProductSort) this;
					ProductSort thatSort = (ProductSort) sort;
					List<Sort> myElements = mySort.getElementSort();
					List<Sort> thoseElements = thatSort.getElementSort();
					int i = 0;
					int j = 0;
					for (; i < myElements.size() && j < thoseElements.size(); i++, j++) {
						if (myElements
								.get(i)
								.eClass()
								.getName()
								.equalsIgnoreCase(
										thoseElements.get(j).eClass().getName())) {
							isEqual = true;
						} else {
							isEqual = false;
							break;
						}
					}
				}		
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="elementSort" upperBound="-1" + eType="#//Sort" containment="true" eOpposite="#//Sort/containerProductSort"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="BuiltInConstant" abstract="true" eSuperTypes="#//Operator"/> + <eClassifiers xsi:type="ecore:EClass" name="MultisetOperator" abstract="true" eSuperTypes="#//Operator"/> + <eClassifiers xsi:type="ecore:EClass" name="Tuple" eSuperTypes="#//Operator"/> + <eClassifiers xsi:type="ecore:EClass" name="SortDecl" abstract="true" eSuperTypes="#//TermsDeclaration"/> + <eClassifiers xsi:type="ecore:EClass" name="BuiltInOperator" abstract="true" eSuperTypes="#//Operator"/> + <eClassifiers xsi:type="ecore:EClass" name="NamedSort" eSuperTypes="#//SortDecl"> + <eAnnotations source="http://www.pnml.org/models/OCL"> + <details key="refSortNotMultiset" value="not(self.sortdef.oclIsTypeOf(MultisetSort))"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> + <details key="constraints" value="refSortNotMultiset"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="sortdef" ordered="false" + lowerBound="1" eType="#//Sort" containment="true" eOpposite="#//Sort/containerNamedSort"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="UserSort" eSuperTypes="#//Sort"> + <eAnnotations source="http://www.pnml.org/models/methods/SORT"> + <details key="signature" value="boolean equalSorts(Sort sort)"/> + <details key="body" value="boolean isEqual = false;
		if (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {
			if (this.getContainerNamedSort() != null
					&& sort.getContainerNamedSort() != null) {
				isEqual = this.getContainerNamedSort().getName()
						.equalsIgnoreCase(
								sort.getContainerNamedSort().getName());
			} else {
				//further sub-classes must override this method.
				if ("UserSort".equalsIgnoreCase(this.eClass().getName())) {
					isEqual = ((UserSort) this).getDeclaration().getName()
							.equalsIgnoreCase(
									((UserSort) sort).getDeclaration()
											.getName());
				}
			}
		}
		return isEqual;"/> + <details key="documentation" value="/**
 * Returns true if this sort and argument sort are actually 
 * semantically the same sort, even in two different objects.
 * Ex: two FiniteEnumerations or two Integers.
 * @return true if so. 
 * @param sort the sort to which we compare this one. 
 */"/> + </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false" + lowerBound="1" eType="#//SortDecl"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="OperatorDecl" abstract="true" eSuperTypes="#//TermsDeclaration"/> + <eClassifiers xsi:type="ecore:EClass" name="NamedOperator" eSuperTypes="#//OperatorDecl"> + <eStructuralFeatures xsi:type="ecore:EReference" name="def" ordered="false" lowerBound="1" + eType="#//Term" containment="true" eOpposite="#//Term/containerNamedOperator"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1" + eType="#//VariableDecl" containment="true" eOpposite="#//VariableDecl/containerNamedOperator"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="UserOperator" eSuperTypes="#//Operator"> + <eStructuralFeatures xsi:type="ecore:EReference" name="declaration" ordered="false" + lowerBound="1" eType="#//OperatorDecl"/> + </eClassifiers> +</ecore:EPackage> -- GitLab