diff options
author | Ed Willink | 2017-03-03 16:58:46 +0000 |
---|---|---|
committer | Ed Willink | 2017-03-11 10:47:27 +0000 |
commit | 528215977976d4e249cc425d62485b289e65df44 (patch) | |
tree | cd6f596d33d0343eaab8a847c1e11b041dcc78e0 | |
parent | 1995c67268890419ec86ebe132162843f87ce379 (diff) | |
download | org.eclipse.qvtd-528215977976d4e249cc425d62485b289e65df44.tar.gz org.eclipse.qvtd-528215977976d4e249cc425d62485b289e65df44.tar.xz org.eclipse.qvtd-528215977976d4e249cc425d62485b289e65df44.zip |
[unrelated] Add no extends/overrides cycle WFRs
18 files changed, 472 insertions, 49 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbasePackage.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbasePackage.java index 87cab9504..ea4c0e2d7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbasePackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbasePackage.java @@ -1269,13 +1269,22 @@ public interface QVTbasePackage extends EPackage { int RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 0; /** + * The operation id for the '<em>Validate No Overrides Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 1; + + /** * The operation id for the '<em>Validate Overrides Rule Is Extended Rule</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int RULE___VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 1; + int RULE___VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 2; /** * The operation id for the '<em>Validate Overrides Rule Overrides All Domains</em>' operation. @@ -1284,7 +1293,7 @@ public interface QVTbasePackage extends EPackage { * @generated * @ordered */ - int RULE___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 2; + int RULE___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 3; /** * The number of operations of the '<em>Rule</em>' class. @@ -1293,7 +1302,7 @@ public interface QVTbasePackage extends EPackage { * @generated * @ordered */ - int RULE_OPERATION_COUNT = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 3; + int RULE_OPERATION_COUNT = PivotPackage.NAMED_ELEMENT_OPERATION_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtbase.impl.TransformationImpl <em>Transformation</em>}' class. @@ -1657,13 +1666,22 @@ public interface QVTbasePackage extends EPackage { int TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = PivotPackage.CLASS_OPERATION_COUNT + 4; /** + * The operation id for the '<em>Validate No Extends Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP = PivotPackage.CLASS_OPERATION_COUNT + 5; + + /** * The number of operations of the '<em>Transformation</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int TRANSFORMATION_OPERATION_COUNT = PivotPackage.CLASS_OPERATION_COUNT + 5; + int TRANSFORMATION_OPERATION_COUNT = PivotPackage.CLASS_OPERATION_COUNT + 6; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtbase.impl.TypedModelImpl <em>Typed Model</em>}' class. @@ -2079,6 +2097,16 @@ public interface QVTbasePackage extends EPackage { EOperation getRule__ValidateDomainNameIsUnique__DiagnosticChain_Map(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtbase.Rule#validateNoOverridesCycle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate No Overrides Cycle</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate No Overrides Cycle</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtbase.Rule#validateNoOverridesCycle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getRule__ValidateNoOverridesCycle__DiagnosticChain_Map(); + + /** * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtbase.Rule#validateOverridesRuleIsExtendedRule(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Overrides Rule Is Extended Rule</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2214,6 +2242,16 @@ public interface QVTbasePackage extends EPackage { EOperation getTransformation__ValidateModelParameterIsUnique__DiagnosticChain_Map(); /** + * Returns the meta object for the '{@link org.eclipse.qvtd.pivot.qvtbase.Transformation#validateNoExtendsCycle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate No Extends Cycle</em>}' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the '<em>Validate No Extends Cycle</em>' operation. + * @see org.eclipse.qvtd.pivot.qvtbase.Transformation#validateNoExtendsCycle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * @generated + */ + EOperation getTransformation__ValidateNoExtendsCycle__DiagnosticChain_Map(); + + /** * Returns the meta object for class '{@link org.eclipse.qvtd.pivot.qvtbase.TypedModel <em>Typed Model</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2520,6 +2558,14 @@ public interface QVTbasePackage extends EPackage { EOperation RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getRule__ValidateDomainNameIsUnique__DiagnosticChain_Map(); /** + * The meta object literal for the '<em><b>Validate No Overrides Cycle</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getRule__ValidateNoOverridesCycle__DiagnosticChain_Map(); + + /** * The meta object literal for the '<em><b>Validate Overrides Rule Is Extended Rule</b></em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2626,6 +2672,14 @@ public interface QVTbasePackage extends EPackage { EOperation TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getTransformation__ValidateModelParameterIsUnique__DiagnosticChain_Map(); /** + * The meta object literal for the '<em><b>Validate No Extends Cycle</b></em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EOperation TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP = eINSTANCE.getTransformation__ValidateNoExtendsCycle__DiagnosticChain_Map(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtbase.impl.TypedModelImpl <em>Typed Model</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbaseTables.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbaseTables.java index 10638db67..9a216661d 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbaseTables.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/QVTbaseTables.java @@ -93,11 +93,13 @@ public class QVTbaseTables public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Function_c_c_ReturnTypeIsQueryType = "Function::ReturnTypeIsQueryType"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Predicate_c_c_ConditionIsBoolean = "Predicate::ConditionIsBoolean"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Rule_c_c_DomainNameIsUnique = "Rule::DomainNameIsUnique"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Rule_c_c_NoOverridesCycle = "Rule::NoOverridesCycle"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Rule_c_c_OverridesRuleIsExtendedRule = "Rule::OverridesRuleIsExtendedRule"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Rule_c_c_OverridesRuleOverridesAllDomains = "Rule::OverridesRuleOverridesAllDomains"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Transformation_c_c_ContextTypeIsTransformation = "Transformation::ContextTypeIsTransformation"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Transformation_c_c_ExtendedTypedModelIsExtended = "Transformation::ExtendedTypedModelIsExtended"; public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Transformation_c_c_ModelParameterIsUnique = "Transformation::ModelParameterIsUnique"; + public static final /*@NonInvalid*/ java.lang.@org.eclipse.jdt.annotation.NonNull String STR_Transformation_c_c_NoExtendsCycle = "Transformation::NoExtendsCycle"; public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId BAG_CLSSid_Domain = org.eclipse.ocl.pivot.ids.TypeId.BAG.getSpecializedId(org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables.CLSSid_Domain); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId BAG_CLSSid_Rule = org.eclipse.ocl.pivot.ids.TypeId.BAG.getSpecializedId(org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables.CLSSid_Rule); public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId ORD_CLSSid_Domain = org.eclipse.ocl.pivot.ids.TypeId.ORDERED_SET.getSpecializedId(org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables.CLSSid_Domain); diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Rule.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Rule.java index c44a676d7..28f2f9d6e 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Rule.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Rule.java @@ -172,6 +172,15 @@ public interface Rule extends NamedElement { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='NoOverridesCycle'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv NoOverridesCycle:\n * let severity : Integer[1] = \'Rule::NoOverridesCycle\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * result : Boolean[1] = overrides->closure(overrides)\n * ->excludes(self)\n * in\n * \'Rule::NoOverridesCycle\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.ids.@<%org.eclipse.jdt.annotation.NonNull%> IdResolver idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> StandardLibrary standardLibrary = idResolver.getStandardLibrary();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Rule_c_c_NoOverridesCycle);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_1;\nif (le) {\n\tsymbol_1 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_result;\n\ttry {\n\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Rule overrides = this.getOverrides();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue oclAsSet = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Rule, overrides);\n\t\tfinal org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYPE_closure_0 = executor.getStaticTypeOf(oclAsSet);\n\t\tfinal <%org.eclipse.ocl.pivot.library.LibraryIteration%>.@org.eclipse.jdt.annotation.NonNull LibraryIterationExtension IMPL_closure_0 = (<%org.eclipse.ocl.pivot.library.LibraryIteration%>.LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, <%org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables%>.Operations._Set__closure);\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Rule, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.CLSSid_Rule);\n\t\t/**\n\t\t * Implementation of the iterator body.\n\t\t \052/\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%> BODY_closure_0 = new <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%>()\n\t\t{\n\t\t\t/**\n\t\t\t * overrides\n\t\t\t \052/\n\t\t\t@Override\n\t\t\tpublic @<%org.eclipse.jdt.annotation.Nullable%> Object evaluate(final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.evaluation.Executor%> executor, final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.ids.TypeId%> typeId, final @<%org.eclipse.jdt.annotation.Nullable%> Object oclAsSet, final /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object _1) {\n\t\t\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Rule symbol_0 = (<%org.eclipse.qvtd.pivot.qvtbase.Rule%>)_1;\n\t\t\t\tif (symbol_0 == null) {\n\t\t\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'\\\'http://www.eclipse.org/qvt/2017/QVTbase\\\'::Rule::overrides\\\'\");\n\t\t\t\t}\n\t\t\t\tfinal /*@Thrown\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Rule overrides_0 = symbol_0.getOverrides();\n\t\t\t\treturn overrides_0;\n\t\t\t}\n\t\t};\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%> MGR_closure_0 = new <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%>(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Rule, BODY_closure_0, oclAsSet, ACC_closure_0);\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue closure = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState((<%org.eclipse.ocl.pivot.values.SetValue%>)IMPL_closure_0.evaluateIteration(MGR_closure_0));\n\t\tfinal /*@Thrown\052/ boolean result = <%org.eclipse.ocl.pivot.library.collection.CollectionExcludesOperation%>.INSTANCE.evaluate(closure, this).booleanValue();\n\t\tCAUGHT_result = result;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_result = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Rule_c_c_NoOverridesCycle, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n\tsymbol_1 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_1;'" + * @generated + */ + boolean validateNoOverridesCycle(DiagnosticChain diagnostics, Map<Object, Object> context); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='OverridesRuleIsExtendedRule'" * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv OverridesRuleIsExtendedRule:\n * let\n * severity : Integer[1] = \'Rule::OverridesRuleIsExtendedRule\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let result : Boolean[?] = overrides <> null and transformation <> null implies\n * let\n * extendedRules : Bag(qvtbase::Rule) = transformation->closure(extends)\n * ->excluding(transformation)\n * ?->collect(rule)\n * in extendedRules->includes(overrides)\n * in\n * \'Rule::OverridesRuleIsExtendedRule\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.ids.@<%org.eclipse.jdt.annotation.NonNull%> IdResolver idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> StandardLibrary standardLibrary = idResolver.getStandardLibrary();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Rule_c_c_OverridesRuleIsExtendedRule);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_2;\nif (le) {\n\tsymbol_2 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_result;\n\ttry {\n\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Rule overrides_0 = this.getOverrides();\n\t\tfinal /*@NonInvalid\052/ boolean ne = overrides_0 != null;\n\t\t/*@NonInvalid\052/ boolean and;\n\t\tif (ne) {\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation transformation = this.getTransformation();\n\t\t\tfinal /*@NonInvalid\052/ boolean ne_0 = transformation != null;\n\t\t\tand = ne_0;\n\t\t}\n\t\telse {\n\t\t\tand = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\n\t\t}\n\t\t/*@Thrown\052/ boolean result;\n\t\tif (and) {\n\t\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation transformation_1 = this.getTransformation();\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue oclAsSet = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, transformation_1);\n\t\t\tfinal org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYPE_closure_0 = executor.getStaticTypeOf(oclAsSet);\n\t\t\tfinal <%org.eclipse.ocl.pivot.library.LibraryIteration%>.@org.eclipse.jdt.annotation.NonNull LibraryIterationExtension IMPL_closure_0 = (<%org.eclipse.ocl.pivot.library.LibraryIteration%>.LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, <%org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables%>.Operations._Set__closure);\n\t\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.CLSSid_Transformation);\n\t\t\t/**\n\t\t\t * Implementation of the iterator body.\n\t\t\t \052/\n\t\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%> BODY_closure_0 = new <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%>()\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * extends\n\t\t\t\t \052/\n\t\t\t\t@Override\n\t\t\t\tpublic @<%org.eclipse.jdt.annotation.Nullable%> Object evaluate(final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.evaluation.Executor%> executor, final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.ids.TypeId%> typeId, final @<%org.eclipse.jdt.annotation.Nullable%> Object oclAsSet, final /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object _1) {\n\t\t\t\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation symbol_0 = (<%org.eclipse.qvtd.pivot.qvtbase.Transformation%>)_1;\n\t\t\t\t\tif (symbol_0 == null) {\n\t\t\t\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'\\\'http://www.eclipse.org/qvt/2017/QVTbase\\\'::Transformation::extends\\\'\");\n\t\t\t\t\t}\n\t\t\t\t\tfinal /*@Thrown\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation symbol_1 = symbol_0.getExtends();\n\t\t\t\t\treturn symbol_1;\n\t\t\t\t}\n\t\t\t};\n\t\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%> MGR_closure_0 = new <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%>(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, BODY_closure_0, oclAsSet, ACC_closure_0);\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue closure = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState((<%org.eclipse.ocl.pivot.values.SetValue%>)IMPL_closure_0.evaluateIteration(MGR_closure_0));\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue excluding = (<%org.eclipse.ocl.pivot.values.SetValue%>)<%org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation%>.INSTANCE.evaluate(closure, transformation_1);\n\t\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue safe_null_sources = (<%org.eclipse.ocl.pivot.values.SetValue%>)<%org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation%>.INSTANCE.evaluate(excluding, (Object)null);\n\t\t\t/*@Thrown\052/ <%org.eclipse.ocl.pivot.values.BagValue%>.@org.eclipse.jdt.annotation.NonNull Accumulator accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createBagAccumulatorValue(<%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.BAG_CLSSid_Rule);\n\t\t\t@<%org.eclipse.jdt.annotation.NonNull%> <%java.util.Iterator%><<%java.lang.Object%>> ITERATOR__1_0 = safe_null_sources.iterator();\n\t\t\t/*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> BagValue extendedRules;\n\t\t\twhile (true) {\n\t\t\t\tif (!ITERATOR__1_0.hasNext()) {\n\t\t\t\t\textendedRules = accumulator;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t@SuppressWarnings(\"null\")\n\t\t\t\t/*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.NonNull%> Transformation _1_0 = (<%org.eclipse.qvtd.pivot.qvtbase.Transformation%>)ITERATOR__1_0.next();\n\t\t\t\t/**\n\t\t\t\t * rule\n\t\t\t\t \052/\n\t\t\t\tfinal /*@NonInvalid\052/ java.util.@<%org.eclipse.jdt.annotation.NonNull%> List<<%org.eclipse.qvtd.pivot.qvtbase.Rule%>> rule = _1_0.getRule();\n\t\t\t\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue BOXED_rule = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Rule, rule);\n\t\t\t\t//\n\t\t\t\tfor (Object value : BOXED_rule.flatten().getElements()) {\n\t\t\t\t\taccumulator.add(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinal /*@Thrown\052/ boolean includes = <%org.eclipse.ocl.pivot.library.collection.CollectionIncludesOperation%>.INSTANCE.evaluate(extendedRules, overrides_0).booleanValue();\n\t\t\tresult = includes;\n\t\t}\n\t\telse {\n\t\t\tresult = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t}\n\t\tCAUGHT_result = result;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_result = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Rule_c_c_OverridesRuleIsExtendedRule, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n\tsymbol_2 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_2;'" * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Transformation.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Transformation.java index cf8b79626..9b6c6f7a7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Transformation.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/Transformation.java @@ -192,4 +192,13 @@ public interface Transformation extends org.eclipse.ocl.pivot.Class { */ boolean validateModelParameterIsUnique(DiagnosticChain diagnostics, Map<Object, Object> context); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='NoExtendsCycle'" + * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv NoExtendsCycle:\n * let severity : Integer[1] = \'Transformation::NoExtendsCycle\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let\n * result : Boolean[1] = extends->closure(extends)\n * ->excludes(self)\n * in\n * \'Transformation::NoExtendsCycle\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.ids.@<%org.eclipse.jdt.annotation.NonNull%> IdResolver idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> StandardLibrary standardLibrary = idResolver.getStandardLibrary();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Transformation_c_c_NoExtendsCycle);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_3;\nif (le) {\n\tsymbol_3 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\t/*@Caught\052/ @<%org.eclipse.jdt.annotation.NonNull%> <%java.lang.Object%> CAUGHT_result;\n\ttry {\n\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation symbol_0 = this.getExtends();\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue oclAsSet = <%org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, symbol_0);\n\t\tfinal org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYPE_closure_0 = executor.getStaticTypeOf(oclAsSet);\n\t\tfinal <%org.eclipse.ocl.pivot.library.LibraryIteration%>.@org.eclipse.jdt.annotation.NonNull LibraryIterationExtension IMPL_closure_0 = (<%org.eclipse.ocl.pivot.library.LibraryIteration%>.LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, <%org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables%>.Operations._Set__closure);\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.CLSSid_Transformation);\n\t\t/**\n\t\t * Implementation of the iterator body.\n\t\t \052/\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%> BODY_closure_0 = new <%org.eclipse.ocl.pivot.library.AbstractBinaryOperation%>()\n\t\t{\n\t\t\t/**\n\t\t\t * extends\n\t\t\t \052/\n\t\t\t@Override\n\t\t\tpublic @<%org.eclipse.jdt.annotation.Nullable%> Object evaluate(final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.evaluation.Executor%> executor, final @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.ids.TypeId%> typeId, final @<%org.eclipse.jdt.annotation.Nullable%> Object oclAsSet, final /*@NonInvalid\052/ java.lang.@<%org.eclipse.jdt.annotation.Nullable%> Object _1) {\n\t\t\t\tfinal /*@NonInvalid\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation symbol_1 = (<%org.eclipse.qvtd.pivot.qvtbase.Transformation%>)_1;\n\t\t\t\tif (symbol_1 == null) {\n\t\t\t\t\tthrow new <%org.eclipse.ocl.pivot.values.InvalidValueException%>(\"Null source for \\\'\\\'http://www.eclipse.org/qvt/2017/QVTbase\\\'::Transformation::extends\\\'\");\n\t\t\t\t}\n\t\t\t\tfinal /*@Thrown\052/ org.eclipse.qvtd.pivot.qvtbase.@<%org.eclipse.jdt.annotation.Nullable%> Transformation symbol_2 = symbol_1.getExtends();\n\t\t\t\treturn symbol_2;\n\t\t\t}\n\t\t};\n\t\tfinal @<%org.eclipse.jdt.annotation.NonNull%> <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%> MGR_closure_0 = new <%org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager%>(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.SET_CLSSid_Transformation, BODY_closure_0, oclAsSet, ACC_closure_0);\n\t\tfinal /*@Thrown\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> SetValue closure = <%org.eclipse.ocl.pivot.utilities.ClassUtil%>.nonNullState((<%org.eclipse.ocl.pivot.values.SetValue%>)IMPL_closure_0.evaluateIteration(MGR_closure_0));\n\t\tfinal /*@Thrown\052/ boolean result = <%org.eclipse.ocl.pivot.library.collection.CollectionExcludesOperation%>.INSTANCE.evaluate(closure, this).booleanValue();\n\t\tCAUGHT_result = result;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_result = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Transformation_c_c_NoExtendsCycle, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n\tsymbol_3 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_3;'" + * @generated + */ + boolean validateNoExtendsCycle(DiagnosticChain diagnostics, Map<Object, Object> context); + } // Transformation diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/QVTbasePackageImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/QVTbasePackageImpl.java index 1f142df25..7fddf6eea 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/QVTbasePackageImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/QVTbasePackageImpl.java @@ -453,7 +453,7 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { * @generated */ @Override - public EOperation getRule__ValidateOverridesRuleIsExtendedRule__DiagnosticChain_Map() { + public EOperation getRule__ValidateNoOverridesCycle__DiagnosticChain_Map() { return ruleEClass.getEOperations().get(1); } @@ -463,7 +463,7 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { * @generated */ @Override - public EOperation getRule__ValidateOverridesRuleOverridesAllDomains__DiagnosticChain_Map() { + public EOperation getRule__ValidateOverridesRuleIsExtendedRule__DiagnosticChain_Map() { return ruleEClass.getEOperations().get(2); } @@ -473,6 +473,16 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { * @generated */ @Override + public EOperation getRule__ValidateOverridesRuleOverridesAllDomains__DiagnosticChain_Map() { + return ruleEClass.getEOperations().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getTransformation() { return transformationEClass; } @@ -583,6 +593,16 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { * @generated */ @Override + public EOperation getTransformation__ValidateNoExtendsCycle__DiagnosticChain_Map() { + return transformationEClass.getEOperations().get(5); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getTypedModel() { return typedModelEClass; } @@ -689,6 +709,7 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { createEReference(ruleEClass, RULE__TRANSFORMATION); createEReference(ruleEClass, RULE__OVERRIDDEN); createEOperation(ruleEClass, RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP); + createEOperation(ruleEClass, RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP); createEOperation(ruleEClass, RULE___VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE__DIAGNOSTICCHAIN_MAP); createEOperation(ruleEClass, RULE___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP); @@ -703,6 +724,7 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { createEOperation(transformationEClass, TRANSFORMATION___VALIDATE_CONTEXT_TYPE_IS_TRANSFORMATION__DIAGNOSTICCHAIN_MAP); createEOperation(transformationEClass, TRANSFORMATION___VALIDATE_EXTENDED_TYPED_MODEL_IS_EXTENDED__DIAGNOSTICCHAIN_MAP); createEOperation(transformationEClass, TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP); + createEOperation(transformationEClass, TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP); typedModelEClass = createEClass(TYPED_MODEL); createEReference(typedModelEClass, TYPED_MODEL__TRANSFORMATION); @@ -836,6 +858,15 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getRule__ValidateNoOverridesCycle__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateNoOverridesCycle", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(ecorePackage.getEMap()); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getRule__ValidateOverridesRuleIsExtendedRule__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateOverridesRuleIsExtendedRule", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(ecorePackage.getEMap()); @@ -894,6 +925,15 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getTransformation__ValidateNoExtendsCycle__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "validateNoExtendsCycle", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); + g1 = createEGenericType(ecorePackage.getEMap()); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + g2 = createEGenericType(ecorePackage.getEJavaObject()); + g1.getETypeArguments().add(g2); + addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); + initEClass(typedModelEClass, TypedModel.class, "TypedModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getTypedModel_Transformation(), this.getTransformation(), this.getTransformation_ModelParameter(), "transformation", null, 1, 1, TypedModel.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getTypedModel_UsedPackage(), thePivotPackage.getPackage(), null, "usedPackage", null, 0, -1, TypedModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); @@ -1000,6 +1040,12 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { "originalName", "DomainNameIsUnique" }); addAnnotation + (getRule__ValidateNoOverridesCycle__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "NoOverridesCycle" + }); + addAnnotation (getRule__ValidateOverridesRuleIsExtendedRule__DiagnosticChain_Map(), source, new String[] { @@ -1029,6 +1075,12 @@ public class QVTbasePackageImpl extends EPackageImpl implements QVTbasePackage { new String[] { "originalName", "ModelParameterIsUnique" }); + addAnnotation + (getTransformation__ValidateNoExtendsCycle__DiagnosticChain_Map(), + source, + new String[] { + "originalName", "NoExtendsCycle" + }); } } //QVTbasePackageImpl diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/RuleImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/RuleImpl.java index 6ef908c13..f36915840 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/RuleImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/RuleImpl.java @@ -35,6 +35,7 @@ import org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationMa import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; import org.eclipse.ocl.pivot.library.AbstractBinaryOperation; import org.eclipse.ocl.pivot.library.LibraryIteration; +import org.eclipse.ocl.pivot.library.collection.CollectionExcludesOperation; import org.eclipse.ocl.pivot.library.collection.CollectionExcludingOperation; import org.eclipse.ocl.pivot.library.collection.CollectionIncludesOperation; import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; @@ -370,6 +371,76 @@ public abstract class RuleImpl extends NamedElementImpl implements Rule { * @generated */ @Override + public boolean validateNoOverridesCycle(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv NoOverridesCycle: + * let severity : Integer[1] = 'Rule::NoOverridesCycle'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * result : Boolean[1] = overrides->closure(overrides) + * ->excludes(self) + * in + * 'Rule::NoOverridesCycle'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull StandardLibrary standardLibrary = idResolver.getStandardLibrary(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTbaseTables.STR_Rule_c_c_NoOverridesCycle); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTbaseTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_1; + if (le) { + symbol_1 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_result; + try { + final /*@NonInvalid*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Rule overrides = this.getOverrides(); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, QVTbaseTables.SET_CLSSid_Rule, overrides); + final org.eclipse.ocl.pivot.@NonNull Class TYPE_closure_0 = executor.getStaticTypeOf(oclAsSet); + final LibraryIteration.@org.eclipse.jdt.annotation.NonNull LibraryIterationExtension IMPL_closure_0 = (LibraryIteration.LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, OCLstdlibTables.Operations._Set__closure); + final @NonNull Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, QVTbaseTables.SET_CLSSid_Rule, QVTbaseTables.CLSSid_Rule); + /** + * Implementation of the iterator body. + */ + final @NonNull AbstractBinaryOperation BODY_closure_0 = new AbstractBinaryOperation() { + /** + * overrides + */ + @Override + public @Nullable Object evaluate(final @NonNull Executor executor, final @NonNull TypeId typeId, final @Nullable Object oclAsSet, final /*@NonInvalid*/ java.lang.@Nullable Object _1) { + final /*@NonInvalid*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Rule symbol_0 = (Rule)_1; + if (symbol_0 == null) { + throw new InvalidValueException("Null source for \'\'http://www.eclipse.org/qvt/2017/QVTbase\'::Rule::overrides\'"); + } + final /*@Thrown*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Rule overrides_0 = symbol_0.getOverrides(); + return overrides_0; + } + }; + final @NonNull ExecutorSingleIterationManager MGR_closure_0 = new ExecutorSingleIterationManager(executor, QVTbaseTables.SET_CLSSid_Rule, BODY_closure_0, oclAsSet, ACC_closure_0); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue closure = ClassUtil.nonNullState((SetValue)IMPL_closure_0.evaluateIteration(MGR_closure_0)); + final /*@Thrown*/ boolean result = CollectionExcludesOperation.INSTANCE.evaluate(closure, this).booleanValue(); + CAUGHT_result = result; + } + catch (Exception e) { + CAUGHT_result = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTbaseTables.STR_Rule_c_c_NoOverridesCycle, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, QVTbaseTables.INT_0).booleanValue(); + symbol_1 = logDiagnostic; + } + return Boolean.TRUE == symbol_1; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public boolean validateOverridesRuleIsExtendedRule(final DiagnosticChain diagnostics, final Map<Object, Object> context) { /** * @@ -782,6 +853,8 @@ public abstract class RuleImpl extends NamedElementImpl implements Rule { switch (operationID) { case QVTbasePackage.RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP: return validateDomainNameIsUnique((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case QVTbasePackage.RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP: + return validateNoOverridesCycle((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTbasePackage.RULE___VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE__DIAGNOSTICCHAIN_MAP: return validateOverridesRuleIsExtendedRule((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTbasePackage.RULE___VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS__DIAGNOSTICCHAIN_MAP: diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/TransformationImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/TransformationImpl.java index 4c1b1c9ca..139e30a7f 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/TransformationImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/impl/TransformationImpl.java @@ -29,15 +29,23 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.ocl.pivot.Annotation; import org.eclipse.ocl.pivot.Variable; +import org.eclipse.ocl.pivot.evaluation.Executor; import org.eclipse.ocl.pivot.ids.TypeId; import org.eclipse.ocl.pivot.internal.ClassImpl; +import org.eclipse.ocl.pivot.internal.library.executor.ExecutorSingleIterationManager; import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; +import org.eclipse.ocl.pivot.library.AbstractBinaryOperation; +import org.eclipse.ocl.pivot.library.LibraryIteration; +import org.eclipse.ocl.pivot.library.collection.CollectionExcludesOperation; import org.eclipse.ocl.pivot.library.collection.CollectionIncludesAllOperation; +import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; import org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation; import org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation; import org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation; import org.eclipse.ocl.pivot.messages.PivotMessages; +import org.eclipse.ocl.pivot.oclstdlib.OCLstdlibTables; import org.eclipse.ocl.pivot.util.Visitor; +import org.eclipse.ocl.pivot.utilities.ClassUtil; import org.eclipse.ocl.pivot.utilities.NameUtil; import org.eclipse.ocl.pivot.utilities.ValueUtil; import org.eclipse.ocl.pivot.values.InvalidValueException; @@ -436,6 +444,8 @@ public class TransformationImpl extends ClassImpl implements Transformation { return validateExtendedTypedModelIsExtended((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); case QVTbasePackage.TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP: return validateModelParameterIsUnique((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); + case QVTbasePackage.TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP: + return validateNoExtendsCycle((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); } return super.eInvoke(operationID, arguments); } @@ -732,4 +742,74 @@ public class TransformationImpl extends ClassImpl implements Transformation { } return Boolean.TRUE == symbol_0; } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean validateNoExtendsCycle(final DiagnosticChain diagnostics, final Map<Object, Object> context) { + /** + * + * inv NoExtendsCycle: + * let severity : Integer[1] = 'Transformation::NoExtendsCycle'.getSeverity() + * in + * if severity <= 0 + * then true + * else + * let + * result : Boolean[1] = extends->closure(extends) + * ->excludes(self) + * in + * 'Transformation::NoExtendsCycle'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0) + * endif + */ + final /*@NonInvalid*/ org.eclipse.ocl.pivot.evaluation.@NonNull Executor executor = PivotUtilInternal.getExecutor(this); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@NonNull IdResolver idResolver = executor.getIdResolver(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.@NonNull StandardLibrary standardLibrary = idResolver.getStandardLibrary(); + final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, QVTbaseTables.STR_Transformation_c_c_NoExtendsCycle); + final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, QVTbaseTables.INT_0).booleanValue(); + /*@NonInvalid*/ boolean symbol_3; + if (le) { + symbol_3 = ValueUtil.TRUE_VALUE; + } + else { + /*@Caught*/ @NonNull Object CAUGHT_result; + try { + final /*@NonInvalid*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Transformation symbol_0 = this.getExtends(); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(executor, QVTbaseTables.SET_CLSSid_Transformation, symbol_0); + final org.eclipse.ocl.pivot.@NonNull Class TYPE_closure_0 = executor.getStaticTypeOf(oclAsSet); + final LibraryIteration.@org.eclipse.jdt.annotation.NonNull LibraryIterationExtension IMPL_closure_0 = (LibraryIteration.LibraryIterationExtension)TYPE_closure_0.lookupImplementation(standardLibrary, OCLstdlibTables.Operations._Set__closure); + final @NonNull Object ACC_closure_0 = IMPL_closure_0.createAccumulatorValue(executor, QVTbaseTables.SET_CLSSid_Transformation, QVTbaseTables.CLSSid_Transformation); + /** + * Implementation of the iterator body. + */ + final @NonNull AbstractBinaryOperation BODY_closure_0 = new AbstractBinaryOperation() { + /** + * extends + */ + @Override + public @Nullable Object evaluate(final @NonNull Executor executor, final @NonNull TypeId typeId, final @Nullable Object oclAsSet, final /*@NonInvalid*/ java.lang.@Nullable Object _1) { + final /*@NonInvalid*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Transformation symbol_1 = (Transformation)_1; + if (symbol_1 == null) { + throw new InvalidValueException("Null source for \'\'http://www.eclipse.org/qvt/2017/QVTbase\'::Transformation::extends\'"); + } + final /*@Thrown*/ org.eclipse.qvtd.pivot.qvtbase.@Nullable Transformation symbol_2 = symbol_1.getExtends(); + return symbol_2; + } + }; + final @NonNull ExecutorSingleIterationManager MGR_closure_0 = new ExecutorSingleIterationManager(executor, QVTbaseTables.SET_CLSSid_Transformation, BODY_closure_0, oclAsSet, ACC_closure_0); + final /*@Thrown*/ org.eclipse.ocl.pivot.values.@NonNull SetValue closure = ClassUtil.nonNullState((SetValue)IMPL_closure_0.evaluateIteration(MGR_closure_0)); + final /*@Thrown*/ boolean result = CollectionExcludesOperation.INSTANCE.evaluate(closure, this).booleanValue(); + CAUGHT_result = result; + } + catch (Exception e) { + CAUGHT_result = ValueUtil.createInvalidValue(e); + } + final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, QVTbaseTables.STR_Transformation_c_c_NoExtendsCycle, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, QVTbaseTables.INT_0).booleanValue(); + symbol_3 = logDiagnostic; + } + return Boolean.TRUE == symbol_3; + } } //TransformationImpl diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/util/QVTbaseValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/util/QVTbaseValidator.java index 7b0df7ea4..58383bcb7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/util/QVTbaseValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/util/QVTbaseValidator.java @@ -107,12 +107,20 @@ public class QVTbaseValidator extends EObjectValidator { public static final int RULE__VALIDATE_DOMAIN_NAME_IS_UNIQUE = 6; /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate No Overrides Cycle' of 'Rule'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int RULE__VALIDATE_NO_OVERRIDES_CYCLE = 7; + + /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Overrides Rule Is Extended Rule' of 'Rule'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final int RULE__VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE = 7; + public static final int RULE__VALIDATE_OVERRIDES_RULE_IS_EXTENDED_RULE = 8; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Overrides Rule Overrides All Domains' of 'Rule'. @@ -120,7 +128,7 @@ public class QVTbaseValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int RULE__VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS = 8; + public static final int RULE__VALIDATE_OVERRIDES_RULE_OVERRIDES_ALL_DOMAINS = 9; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Context Type Is Transformation' of 'Transformation'. @@ -128,7 +136,7 @@ public class QVTbaseValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int TRANSFORMATION__VALIDATE_CONTEXT_TYPE_IS_TRANSFORMATION = 9; + public static final int TRANSFORMATION__VALIDATE_CONTEXT_TYPE_IS_TRANSFORMATION = 10; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Extended Typed Model Is Extended' of 'Transformation'. @@ -136,7 +144,7 @@ public class QVTbaseValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int TRANSFORMATION__VALIDATE_EXTENDED_TYPED_MODEL_IS_EXTENDED = 10; + public static final int TRANSFORMATION__VALIDATE_EXTENDED_TYPED_MODEL_IS_EXTENDED = 11; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate Model Parameter Is Unique' of 'Transformation'. @@ -144,7 +152,15 @@ public class QVTbaseValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - public static final int TRANSFORMATION__VALIDATE_MODEL_PARAMETER_IS_UNIQUE = 11; + public static final int TRANSFORMATION__VALIDATE_MODEL_PARAMETER_IS_UNIQUE = 12; + + /** + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate No Extends Cycle' of 'Transformation'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final int TRANSFORMATION__VALIDATE_NO_EXTENDS_CYCLE = 13; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. @@ -152,7 +168,7 @@ public class QVTbaseValidator extends EObjectValidator { * <!-- end-user-doc --> * @generated */ - private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 11; + private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 13; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. @@ -395,6 +411,7 @@ public class QVTbaseValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_EveryKeyUnique(rule, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(rule, diagnostics, context); if (result || diagnostics != null) result &= validateRule_validateDomainNameIsUnique(rule, diagnostics, context); + if (result || diagnostics != null) result &= validateRule_validateNoOverridesCycle(rule, diagnostics, context); if (result || diagnostics != null) result &= validateRule_validateOverridesRuleIsExtendedRule(rule, diagnostics, context); if (result || diagnostics != null) result &= validateRule_validateOverridesRuleOverridesAllDomains(rule, diagnostics, context); return result; @@ -411,6 +428,16 @@ public class QVTbaseValidator extends EObjectValidator { } /** + * Validates the validateNoOverridesCycle constraint of '<em>Rule</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateRule_validateNoOverridesCycle(Rule rule, DiagnosticChain diagnostics, Map<Object, Object> context) { + return rule.validateNoOverridesCycle(diagnostics, context); + } + + /** * Validates the validateOverridesRuleIsExtendedRule constraint of '<em>Rule</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -450,6 +477,7 @@ public class QVTbaseValidator extends EObjectValidator { if (result || diagnostics != null) result &= validateTransformation_validateContextTypeIsTransformation(transformation, diagnostics, context); if (result || diagnostics != null) result &= validateTransformation_validateExtendedTypedModelIsExtended(transformation, diagnostics, context); if (result || diagnostics != null) result &= validateTransformation_validateModelParameterIsUnique(transformation, diagnostics, context); + if (result || diagnostics != null) result &= validateTransformation_validateNoExtendsCycle(transformation, diagnostics, context); return result; } @@ -484,6 +512,16 @@ public class QVTbaseValidator extends EObjectValidator { } /** + * Validates the validateNoExtendsCycle constraint of '<em>Transformation</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean validateTransformation_validateNoExtendsCycle(Transformation transformation, DiagnosticChain diagnostics, Map<Object, Object> context) { + return transformation.validateNoExtendsCycle(diagnostics, context); + } + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbase.oclas b/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbase.oclas index 21fcc0461..337dfaea3 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbase.oclas +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbase.oclas @@ -5,10 +5,10 @@ <ownedClasses xmi:id="T.qvtbase.BaseModel" name="BaseModel" superClasses="../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.Model"/> <ownedClasses xmi:id="T.qvtbase.Domain" isAbstract="true" name="Domain" superClasses="../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.NamedElement ../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.ReferringElement"> <ownedInvariants xmi:id="ciqvtbase.Domain.NameIsTypedModelName" isCallable="true" name="NameIsTypedModelName"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
typedModel <> null implies name = typedModel.name
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	typedModel <> null implies name = typedModel.name

"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Domain.TypedModelIsTransformationModelParameter" isCallable="true" name="TypedModelIsTransformationModelParameter"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies
oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel)

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies
	oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel)

"/> </ownedInvariants> <ownedProperties xmi:id="p.qvtbase.Domain.isCheckable" isUnsettable="true" name="isCheckable" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"/> <ownedProperties xmi:id="p.qvtbase.Domain.isEnforceable" isUnsettable="true" name="isEnforceable" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"/> @@ -18,10 +18,10 @@ </ownedClasses> <ownedClasses xmi:id="T.qvtbase.Function" name="Function" superClasses="../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.Operation"> <ownedInvariants xmi:id="ciqvtbase.Function.ParametersAreFunctionParameter" isCallable="true" name="ParametersAreFunctionParameter"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
ownedParameters->forAll(oclIsKindOf(FunctionParameter))
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	ownedParameters->forAll(oclIsKindOf(FunctionParameter))

"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Function.ReturnTypeIsQueryType" isCallable="true" name="ReturnTypeIsQueryType"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
queryExpression <> null implies type = queryExpression.type

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	queryExpression <> null implies type = queryExpression.type

"/> </ownedInvariants> <ownedProperties xmi:id="p.qvtbase.Function.queryExpression" isComposite="true" isRequired="false" name="queryExpression" opposite="#p.pivot.OCLExpression.Function" type="pivot:Class ../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.OCLExpression"/> @@ -43,13 +43,16 @@ </ownedClasses> <ownedClasses xmi:id="T.qvtbase.Rule" isAbstract="true" name="Rule" superClasses="../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.NamedElement"> <ownedInvariants xmi:id="ciqvtbase.Rule.DomainNameIsUnique" isCallable="true" name="DomainNameIsUnique"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
domain->isUnique(name)
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	domain->isUnique(name)

"/> + </ownedInvariants> + <ownedInvariants xmi:id="ciqvtbase.Rule.NoOverridesCycle" isCallable="true" name="NoOverridesCycle"> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	overrides->closure(overrides)->excludes(self)

"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Rule.OverridesRuleIsExtendedRule" isCallable="true" name="OverridesRuleIsExtendedRule"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
overrides <> null and transformation <> null implies
let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule)
in extendedRules->includes(overrides)
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	overrides <> null and transformation <> null implies
	let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule)
	in extendedRules->includes(overrides)

"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Rule.OverridesRuleOverridesAllDomains" isCallable="true" name="OverridesRuleOverridesAllDomains"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
overrides <> null implies
overrides.domain->forAll(od | self.domain.name->includes(od.name))

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	overrides <> null implies
	overrides.domain->forAll(od | self.domain.name->includes(od.name))

"/> </ownedInvariants> <ownedProperties xmi:id="p.qvtbase.Rule.domain" isComposite="true" name="domain" opposite="#p.qvtbase.Domain.rule" type="#//@ownedPackages.2/@ownedClasses.13"/> <ownedProperties xmi:id="p.qvtbase.Rule.isDefault" defaultValueString="false" name="isDefault" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"/> @@ -60,13 +63,16 @@ </ownedClasses> <ownedClasses xmi:id="T.qvtbase.Transformation" name="Transformation" superClasses="../../org.eclipse.ocl.pivot/model/Pivot.ecore.oclas#T.pivot.Class"> <ownedInvariants xmi:id="ciqvtbase.Transformation.ContextTypeIsTransformation" isCallable="true" name="ContextTypeIsTransformation"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
ownedContext <> null implies ownedContext.type = self
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	ownedContext <> null implies ownedContext.type = self

"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Transformation.ExtendedTypedModelIsExtended" isCallable="true" name="ExtendedTypedModelIsExtended"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
_extends <> null implies
_extends.modelParameter->forAll(etm |
	self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage)
)
"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	_extends <> null implies
	_extends.modelParameter->forAll(etm |
		self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage)
	)
	
"/> </ownedInvariants> <ownedInvariants xmi:id="ciqvtbase.Transformation.ModelParameterIsUnique" isCallable="true" name="ModelParameterIsUnique"> - <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
modelParameter->isUnique(name)

"/> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	modelParameter->isUnique(name)

"/> + </ownedInvariants> + <ownedInvariants xmi:id="ciqvtbase.Transformation.NoExtendsCycle" isCallable="true" name="NoExtendsCycle"> + <ownedSpecification xsi:type="pivot:ExpressionInOCL" body="
	_extends->closure(_extends)->excludes(self)

"/> </ownedInvariants> <ownedOperations xmi:id="o.qvtbase.Transformation.getFunction..ocl.String" name="getFunction" type="#T.qvtbase.Function"> <ownedParameters xmi:id="p0o.qvtbase.Transformation.getFunction..ocl.String" name="name" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#String"/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore index 6848d0ba4..e3f2a6f29 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore @@ -16,7 +16,7 @@ <details key="originalName" value="NameIsTypedModelName"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
typedModel <> null implies name = typedModel.name
"/> + <details key="body" value="
	typedModel <> null implies name = typedModel.name

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -31,7 +31,7 @@ <details key="originalName" value="TypedModelIsTransformationModelParameter"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies
oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel)

"/> + <details key="body" value="
	oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies
	oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -59,7 +59,7 @@ <details key="originalName" value="ParametersAreFunctionParameter"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
ownedParameters->forAll(oclIsKindOf(FunctionParameter))
"/> + <details key="body" value="
	ownedParameters->forAll(oclIsKindOf(FunctionParameter))

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -74,7 +74,7 @@ <details key="originalName" value="ReturnTypeIsQueryType"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
queryExpression <> null implies type = queryExpression.type

"/> + <details key="body" value="
	queryExpression <> null implies type = queryExpression.type

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -133,7 +133,22 @@ <details key="originalName" value="DomainNameIsUnique"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
domain->isUnique(name)
"/> + <details key="body" value="
	domain->isUnique(name)

"/> + </eAnnotations> + <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> + <eParameters name="context"> + <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + </eGenericType> + </eParameters> + </eOperations> + <eOperations name="validateNoOverridesCycle" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> + <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> + <details key="originalName" value="NoOverridesCycle"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	overrides->closure(overrides)->excludes(self)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -148,7 +163,7 @@ <details key="originalName" value="OverridesRuleIsExtendedRule"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
overrides <> null and transformation <> null implies
let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule)
in extendedRules->includes(overrides)
"/> + <details key="body" value="
	overrides <> null and transformation <> null implies
	let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule)
	in extendedRules->includes(overrides)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -163,7 +178,7 @@ <details key="originalName" value="OverridesRuleOverridesAllDomains"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
overrides <> null implies
overrides.domain->forAll(od | self.domain.name->includes(od.name))

"/> + <details key="body" value="
	overrides <> null implies
	overrides.domain->forAll(od | self.domain.name->includes(od.name))

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -201,7 +216,7 @@ <details key="originalName" value="ContextTypeIsTransformation"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
ownedContext <> null implies ownedContext.type = self
"/> + <details key="body" value="
	ownedContext <> null implies ownedContext.type = self

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -216,7 +231,7 @@ <details key="originalName" value="ExtendedTypedModelIsExtended"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
_extends <> null implies
_extends.modelParameter->forAll(etm |
	self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage)
)
"/> + <details key="body" value="
	_extends <> null implies
	_extends.modelParameter->forAll(etm |
		self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage)
	)
	
"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> @@ -231,7 +246,22 @@ <details key="originalName" value="ModelParameterIsUnique"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> - <details key="body" value="
modelParameter->isUnique(name)

"/> + <details key="body" value="
	modelParameter->isUnique(name)

"/> + </eAnnotations> + <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> + <eParameters name="context"> + <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + <eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/> + </eGenericType> + </eParameters> + </eOperations> + <eOperations name="validateNoExtendsCycle" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"> + <eAnnotations source="http://www.eclipse.org/uml2/2.0.0/UML"> + <details key="originalName" value="NoExtendsCycle"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"> + <details key="body" value="
	_extends->closure(_extends)->excludes(self)

"/> </eAnnotations> <eParameters name="diagnostics" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain"/> <eParameters name="context"> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.genmodel index 833167169..a2ed2b461 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.genmodel +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.genmodel @@ -65,6 +65,10 @@ <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateDomainNameIsUnique/diagnostics"/> <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateDomainNameIsUnique/context"/> </genOperations> + <genOperations ecoreOperation="QVTbase.ecore#//Rule/validateNoOverridesCycle"> + <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateNoOverridesCycle/diagnostics"/> + <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateNoOverridesCycle/context"/> + </genOperations> <genOperations ecoreOperation="QVTbase.ecore#//Rule/validateOverridesRuleIsExtendedRule"> <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateOverridesRuleIsExtendedRule/diagnostics"/> <genParameters ecoreParameter="QVTbase.ecore#//Rule/validateOverridesRuleIsExtendedRule/context"/> @@ -98,6 +102,10 @@ <genParameters ecoreParameter="QVTbase.ecore#//Transformation/validateModelParameterIsUnique/diagnostics"/> <genParameters ecoreParameter="QVTbase.ecore#//Transformation/validateModelParameterIsUnique/context"/> </genOperations> + <genOperations ecoreOperation="QVTbase.ecore#//Transformation/validateNoExtendsCycle"> + <genParameters ecoreParameter="QVTbase.ecore#//Transformation/validateNoExtendsCycle/diagnostics"/> + <genParameters ecoreParameter="QVTbase.ecore#//Transformation/validateNoExtendsCycle/context"/> + </genOperations> </genClasses> <genClasses ecoreClass="QVTbase.ecore#T-qvtbase-TypedModel"> <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference QVTbase.ecore#F-qvtbase-TypedModel-transformation"/> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ocl b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ocl index 22a659f73..b3dcdc2ab 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ocl +++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ocl @@ -5,16 +5,18 @@ package qvtbase context Domain inv NameIsTypedModelName: -typedModel <> null implies name = typedModel.name + typedModel <> null implies name = typedModel.name + inv TypedModelIsTransformationModelParameter: -oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies -oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel) + oclContainer().oclIsKindOf(Transformation) and typedModel <> null implies + oclContainer().oclAsType(Transformation).modelParameter->includes(typedModel) context Function inv ParametersAreFunctionParameter: -ownedParameters->forAll(oclIsKindOf(FunctionParameter)) + ownedParameters->forAll(oclIsKindOf(FunctionParameter)) + inv ReturnTypeIsQueryType: -queryExpression <> null implies type = queryExpression.type + queryExpression <> null implies type = queryExpression.type context Predicate inv ConditionIsBoolean: @@ -22,24 +24,34 @@ conditionExpression.type = Boolean context Rule inv DomainNameIsUnique: -domain->isUnique(name) + domain->isUnique(name) + +inv NoOverridesCycle: + overrides->closure(overrides)->excludes(self) + inv OverridesRuleIsExtendedRule: -overrides <> null and transformation <> null implies -let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule) -in extendedRules->includes(overrides) + overrides <> null and transformation <> null implies + let extendedRules = transformation->closure(_extends)->excluding(transformation)?->collect(rule) + in extendedRules->includes(overrides) + inv OverridesRuleOverridesAllDomains: -overrides <> null implies -overrides.domain->forAll(od | self.domain.name->includes(od.name)) + overrides <> null implies + overrides.domain->forAll(od | self.domain.name->includes(od.name)) context Transformation inv ContextTypeIsTransformation: -ownedContext <> null implies ownedContext.type = self + ownedContext <> null implies ownedContext.type = self + inv ExtendedTypedModelIsExtended: -_extends <> null implies -_extends.modelParameter->forAll(etm | - self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage) -) + _extends <> null implies + _extends.modelParameter->forAll(etm | + self.modelParameter->select(name = etm.name).usedPackage->includesAll(etm.usedPackage) + ) + inv ModelParameterIsUnique: -modelParameter->isUnique(name) + modelParameter->isUnique(name) + +inv NoExtendsCycle: + _extends->closure(_extends)->excludes(self) endpackage diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java index 8e65baa1d..96085bcc7 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/QVTcorePackage.java @@ -1708,6 +1708,15 @@ public interface QVTcorePackage extends EPackage { int MAPPING___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate No Overrides Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP; + + /** * The operation id for the '<em>Validate Overrides Rule Is Extended Rule</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java index 791bf2ccd..37565fcc0 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/emf-gen/org/eclipse/qvtd/pivot/qvtcore/util/QVTcoreValidator.java @@ -460,6 +460,7 @@ public class QVTcoreValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_EveryKeyUnique(mapping, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateDomainNameIsUnique(mapping, diagnostics, context); + if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateNoOverridesCycle(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleIsExtendedRule(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleOverridesAllDomains(mapping, diagnostics, context); if (result || diagnostics != null) result &= validateMapping_validateDomainsAreCoreDomains(mapping, diagnostics, context); diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java index 928f8660f..1fe07842c 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java @@ -2866,6 +2866,15 @@ public interface QVTimperativePackage extends EPackage { int IMPERATIVE_TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate No Extends Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int IMPERATIVE_TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP; + + /** * The operation id for the '<em>Validateall Rules Are Mappings</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3488,6 +3497,15 @@ public interface QVTimperativePackage extends EPackage { int MAPPING___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate No Overrides Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP; + + /** * The operation id for the '<em>Validate Overrides Rule Is Extended Rule</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/util/QVTimperativeValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/util/QVTimperativeValidator.java index 867d59dc4..e56707832 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/util/QVTimperativeValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/util/QVTimperativeValidator.java @@ -655,6 +655,7 @@ public class QVTimperativeValidator extends EObjectValidator { if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateContextTypeIsTransformation(imperativeTransformation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateExtendedTypedModelIsExtended(imperativeTransformation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateModelParameterIsUnique(imperativeTransformation, diagnostics, context); + if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateNoExtendsCycle(imperativeTransformation, diagnostics, context); if (result || diagnostics != null) result &= validateImperativeTransformation_validateallRulesAreMappings(imperativeTransformation, diagnostics, context); return result; } @@ -765,6 +766,7 @@ public class QVTimperativeValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_EveryKeyUnique(mapping, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateDomainNameIsUnique(mapping, diagnostics, context); + if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateNoOverridesCycle(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleIsExtendedRule(mapping, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleOverridesAllDomains(mapping, diagnostics, context); if (result || diagnostics != null) result &= validateMapping_validateNameIsNotNull(mapping, diagnostics, context); diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java index d17744041..ae315e682 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/QVTrelationPackage.java @@ -556,6 +556,15 @@ public interface QVTrelationPackage extends EPackage { int RELATION___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_DOMAIN_NAME_IS_UNIQUE__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate No Overrides Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELATION___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.RULE___VALIDATE_NO_OVERRIDES_CYCLE__DIAGNOSTICCHAIN_MAP; + + /** * The operation id for the '<em>Validate Overrides Rule Is Extended Rule</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1697,6 +1706,15 @@ public interface QVTrelationPackage extends EPackage { int RELATIONAL_TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.TRANSFORMATION___VALIDATE_MODEL_PARAMETER_IS_UNIQUE__DIAGNOSTICCHAIN_MAP; /** + * The operation id for the '<em>Validate No Extends Cycle</em>' operation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RELATIONAL_TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP = QVTbasePackage.TRANSFORMATION___VALIDATE_NO_EXTENDS_CYCLE__DIAGNOSTICCHAIN_MAP; + + /** * The operation id for the '<em>Validate Rules Are Relations</em>' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java index 1b19e79fd..dd5258139 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/emf-gen/org/eclipse/qvtd/pivot/qvtrelation/util/QVTrelationValidator.java @@ -388,6 +388,7 @@ public class QVTrelationValidator extends EObjectValidator { if (result || diagnostics != null) result &= validate_EveryKeyUnique(relation, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(relation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateDomainNameIsUnique(relation, diagnostics, context); + if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateNoOverridesCycle(relation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleIsExtendedRule(relation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateRule_validateOverridesRuleOverridesAllDomains(relation, diagnostics, context); if (result || diagnostics != null) result &= validateRelation_validateDomainsAreRelationDomains(relation, diagnostics, context); @@ -543,6 +544,7 @@ public class QVTrelationValidator extends EObjectValidator { if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateContextTypeIsTransformation(relationalTransformation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateExtendedTypedModelIsExtended(relationalTransformation, diagnostics, context); if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateModelParameterIsUnique(relationalTransformation, diagnostics, context); + if (result || diagnostics != null) result &= qvTbaseValidator.validateTransformation_validateNoExtendsCycle(relationalTransformation, diagnostics, context); if (result || diagnostics != null) result &= validateRelationalTransformation_validateRulesAreRelations(relationalTransformation, diagnostics, context); return result; } |