Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/util/HenshinValidator.java963
-rw-r--r--plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/ConflictAnalysis.java78
-rw-r--r--plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/Utils.java40
3 files changed, 706 insertions, 375 deletions
diff --git a/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/util/HenshinValidator.java b/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/util/HenshinValidator.java
index ee2f15e3c..3a232b27a 100644
--- a/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/util/HenshinValidator.java
+++ b/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/util/HenshinValidator.java
@@ -29,6 +29,8 @@ import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -74,21 +76,24 @@ import org.eclipse.emf.henshin.model.Xor;
/**
* <!-- begin-user-doc --> The <b>Validator</b> for the Henshin model. <!--
* end-user-doc -->
+ *
* @see org.eclipse.emf.henshin.model.HenshinPackage
* @generated
*/
public class HenshinValidator extends EObjectValidator {
/**
- * The cached model package
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public static final HenshinValidator INSTANCE = new HenshinValidator();
/**
- * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource()
+ * source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode()
+ * codes} from this package. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see org.eclipse.emf.common.util.Diagnostic#getSource()
* @see org.eclipse.emf.common.util.Diagnostic#getCode()
* @generated
@@ -96,17 +101,19 @@ public class HenshinValidator extends EObjectValidator {
public static final String DIAGNOSTIC_SOURCE = "org.eclipse.emf.henshin.model";
/**
- * A constant with a fixed name that can be used as the base value for additional hand written constants.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
+ * A constant with a fixed name that can be used as the base value for
+ * additional hand written constants. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
* @generated
*/
private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
/**
- * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
- * <!-- begin-user-doc
- * --> <!-- end-user-doc -->
+ * A constant with a fixed name that can be used as the base value for
+ * additional hand written constants in a derived class. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
* @generated
*/
protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
@@ -138,11 +145,11 @@ public class HenshinValidator extends EObjectValidator {
"typeof", "var", "void", "volatile", "while", "with", "yield" }));
private Set<Unit> unitsWithIllegallyNamedParameters = new HashSet<Unit>();
-
+
/**
- * Creates an instance of the switch.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
+ * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
* @generated
*/
public HenshinValidator() {
@@ -150,100 +157,102 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Returns the package of this validator switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * Returns the package of this validator switch. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
* @generated
*/
@Override
protected EPackage getEPackage() {
- return HenshinPackage.eINSTANCE;
+ return HenshinPackage.eINSTANCE;
}
/**
* Calls <code>validateXXX</code> for the corresponding classifier of the model.
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics,
Map<Object, Object> context) {
switch (classifierID) {
- case HenshinPackage.MODEL_ELEMENT:
- return validateModelElement((ModelElement)value, diagnostics, context);
- case HenshinPackage.ANNOTATION:
- return validateAnnotation((Annotation)value, diagnostics, context);
- case HenshinPackage.NAMED_ELEMENT:
- return validateNamedElement((NamedElement)value, diagnostics, context);
- case HenshinPackage.GRAPH_ELEMENT:
- return validateGraphElement((GraphElement)value, diagnostics, context);
- case HenshinPackage.MODULE:
- return validateModule((Module)value, diagnostics, context);
- case HenshinPackage.UNIT:
- return validateUnit((Unit)value, diagnostics, context);
- case HenshinPackage.RULE:
- return validateRule((Rule)value, diagnostics, context);
- case HenshinPackage.PARAMETER:
- return validateParameter((Parameter)value, diagnostics, context);
- case HenshinPackage.PARAMETER_MAPPING:
- return validateParameterMapping((ParameterMapping)value, diagnostics, context);
- case HenshinPackage.GRAPH:
- return validateGraph((Graph)value, diagnostics, context);
- case HenshinPackage.NODE:
- return validateNode((Node)value, diagnostics, context);
- case HenshinPackage.EDGE:
- return validateEdge((Edge)value, diagnostics, context);
- case HenshinPackage.ATTRIBUTE:
- return validateAttribute((Attribute)value, diagnostics, context);
- case HenshinPackage.ATTRIBUTE_CONDITION:
- return validateAttributeCondition((AttributeCondition)value, diagnostics, context);
- case HenshinPackage.MAPPING:
- return validateMapping((Mapping)value, diagnostics, context);
- case HenshinPackage.UNARY_UNIT:
- return validateUnaryUnit((UnaryUnit)value, diagnostics, context);
- case HenshinPackage.MULTI_UNIT:
- return validateMultiUnit((MultiUnit)value, diagnostics, context);
- case HenshinPackage.INDEPENDENT_UNIT:
- return validateIndependentUnit((IndependentUnit)value, diagnostics, context);
- case HenshinPackage.SEQUENTIAL_UNIT:
- return validateSequentialUnit((SequentialUnit)value, diagnostics, context);
- case HenshinPackage.CONDITIONAL_UNIT:
- return validateConditionalUnit((ConditionalUnit)value, diagnostics, context);
- case HenshinPackage.PRIORITY_UNIT:
- return validatePriorityUnit((PriorityUnit)value, diagnostics, context);
- case HenshinPackage.ITERATED_UNIT:
- return validateIteratedUnit((IteratedUnit)value, diagnostics, context);
- case HenshinPackage.LOOP_UNIT:
- return validateLoopUnit((LoopUnit)value, diagnostics, context);
- case HenshinPackage.FORMULA:
- return validateFormula((Formula)value, diagnostics, context);
- case HenshinPackage.NESTED_CONDITION:
- return validateNestedCondition((NestedCondition)value, diagnostics, context);
- case HenshinPackage.UNARY_FORMULA:
- return validateUnaryFormula((UnaryFormula)value, diagnostics, context);
- case HenshinPackage.BINARY_FORMULA:
- return validateBinaryFormula((BinaryFormula)value, diagnostics, context);
- case HenshinPackage.AND:
- return validateAnd((And)value, diagnostics, context);
- case HenshinPackage.OR:
- return validateOr((Or)value, diagnostics, context);
- case HenshinPackage.XOR:
- return validateXor((Xor)value, diagnostics, context);
- case HenshinPackage.NOT:
- return validateNot((Not)value, diagnostics, context);
- case HenshinPackage.TRUE:
- return validateTrue((True)value, diagnostics, context);
- case HenshinPackage.PARAMETER_KIND:
- return validateParameterKind((ParameterKind)value, diagnostics, context);
- case HenshinPackage.ACTION:
- return validateAction((Action)value, diagnostics, context);
- default:
- return true;
+ case HenshinPackage.MODEL_ELEMENT:
+ return validateModelElement((ModelElement) value, diagnostics, context);
+ case HenshinPackage.ANNOTATION:
+ return validateAnnotation((Annotation) value, diagnostics, context);
+ case HenshinPackage.NAMED_ELEMENT:
+ return validateNamedElement((NamedElement) value, diagnostics, context);
+ case HenshinPackage.GRAPH_ELEMENT:
+ return validateGraphElement((GraphElement) value, diagnostics, context);
+ case HenshinPackage.MODULE:
+ return validateModule((Module) value, diagnostics, context);
+ case HenshinPackage.UNIT:
+ return validateUnit((Unit) value, diagnostics, context);
+ case HenshinPackage.RULE:
+ return validateRule((Rule) value, diagnostics, context);
+ case HenshinPackage.PARAMETER:
+ return validateParameter((Parameter) value, diagnostics, context);
+ case HenshinPackage.PARAMETER_MAPPING:
+ return validateParameterMapping((ParameterMapping) value, diagnostics, context);
+ case HenshinPackage.GRAPH:
+ return validateGraph((Graph) value, diagnostics, context);
+ case HenshinPackage.NODE:
+ return validateNode((Node) value, diagnostics, context);
+ case HenshinPackage.EDGE:
+ return validateEdge((Edge) value, diagnostics, context);
+ case HenshinPackage.ATTRIBUTE:
+ return validateAttribute((Attribute) value, diagnostics, context);
+ case HenshinPackage.ATTRIBUTE_CONDITION:
+ return validateAttributeCondition((AttributeCondition) value, diagnostics, context);
+ case HenshinPackage.MAPPING:
+ return validateMapping((Mapping) value, diagnostics, context);
+ case HenshinPackage.UNARY_UNIT:
+ return validateUnaryUnit((UnaryUnit) value, diagnostics, context);
+ case HenshinPackage.MULTI_UNIT:
+ return validateMultiUnit((MultiUnit) value, diagnostics, context);
+ case HenshinPackage.INDEPENDENT_UNIT:
+ return validateIndependentUnit((IndependentUnit) value, diagnostics, context);
+ case HenshinPackage.SEQUENTIAL_UNIT:
+ return validateSequentialUnit((SequentialUnit) value, diagnostics, context);
+ case HenshinPackage.CONDITIONAL_UNIT:
+ return validateConditionalUnit((ConditionalUnit) value, diagnostics, context);
+ case HenshinPackage.PRIORITY_UNIT:
+ return validatePriorityUnit((PriorityUnit) value, diagnostics, context);
+ case HenshinPackage.ITERATED_UNIT:
+ return validateIteratedUnit((IteratedUnit) value, diagnostics, context);
+ case HenshinPackage.LOOP_UNIT:
+ return validateLoopUnit((LoopUnit) value, diagnostics, context);
+ case HenshinPackage.FORMULA:
+ return validateFormula((Formula) value, diagnostics, context);
+ case HenshinPackage.NESTED_CONDITION:
+ return validateNestedCondition((NestedCondition) value, diagnostics, context);
+ case HenshinPackage.UNARY_FORMULA:
+ return validateUnaryFormula((UnaryFormula) value, diagnostics, context);
+ case HenshinPackage.BINARY_FORMULA:
+ return validateBinaryFormula((BinaryFormula) value, diagnostics, context);
+ case HenshinPackage.AND:
+ return validateAnd((And) value, diagnostics, context);
+ case HenshinPackage.OR:
+ return validateOr((Or) value, diagnostics, context);
+ case HenshinPackage.XOR:
+ return validateXor((Xor) value, diagnostics, context);
+ case HenshinPackage.NOT:
+ return validateNot((Not) value, diagnostics, context);
+ case HenshinPackage.TRUE:
+ return validateTrue((True) value, diagnostics, context);
+ case HenshinPackage.PARAMETER_KIND:
+ return validateParameterKind((ParameterKind) value, diagnostics, context);
+ case HenshinPackage.ACTION:
+ return validateAction((Action) value, diagnostics, context);
+ default:
+ return true;
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateModelElement(ModelElement modelElement, DiagnosticChain diagnostics,
@@ -253,6 +262,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateAnnotation(Annotation annotation, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -261,6 +271,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateNamedElement(NamedElement namedElement, DiagnosticChain diagnostics,
@@ -270,28 +281,47 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateRule(Rule rule, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(rule, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(rule, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(rule, diagnostics, context);
- 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 &= validateUnit_nameNotEmpty(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_mappingsFromLeft2Right(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_createdNodesNotAbstract(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_createdEdgesNotDerived(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_deletedEdgesNotDerived(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_uniqueNodeNames(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_varParametersOccurOnLeftSide(rule, diagnostics, context);
- if (result || diagnostics != null) result &= validateRule_multiRuleParametersSameKind(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(rule, diagnostics, context);
+ 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 &= validateUnit_nameNotEmpty(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_mappingsFromLeft2Right(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_createdNodesNotAbstract(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_createdEdgesNotDerived(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_deletedEdgesNotDerived(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_uniqueNodeNames(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_varParametersOccurOnLeftSide(rule, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateRule_multiRuleParametersSameKind(rule, diagnostics, context);
return result;
}
@@ -530,8 +560,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the multiRuleParametersSameKind constraint of '<em>Rule</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the multiRuleParametersSameKind constraint of '<em>Rule</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -555,8 +585,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the modeling of opposite '<em>Edge</em>'s. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
+ * Validates the modeling of opposite '<em>Edge</em>'s. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -606,8 +636,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the deletion of containment '<em>Edge</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
+ * Validates the deletion of containment '<em>Edge</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -650,8 +680,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the creation of containment '<em>Edge</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
+ * Validates the creation of containment '<em>Edge</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -696,29 +726,41 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateAttributeCondition(AttributeCondition attributeCondition, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(attributeCondition, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(attributeCondition, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validateAttributeCondition_conditionTextNotEmpty(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validateAttributeCondition_conditionValidJavaScript(attributeCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validateAttributeCondition_conditionAllParametersAreDeclared(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateAttributeCondition_conditionTextNotEmpty(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateAttributeCondition_conditionValidJavaScript(attributeCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateAttributeCondition_conditionAllParametersAreDeclared(attributeCondition, diagnostics,
+ context);
return result;
}
/**
- * Validates the conditionTextNotEmpty constraint of '
- * <em>Attribute Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
+ * Validates the conditionTextNotEmpty constraint of ' <em>Attribute
+ * Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -734,9 +776,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the conditionValidJavaScript constraint of '
- * <em>Attribute Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc
- * -->
+ * Validates the conditionValidJavaScript constraint of ' <em>Attribute
+ * Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -763,6 +804,18 @@ public class HenshinValidator extends EObjectValidator {
if (attributeCondition.getConditionText() != null && !attributeCondition.getConditionText().isEmpty()) {
List<String> undeclared = findUndeclaredNames(attributeCondition.getConditionText(),
attributeCondition.getRule());
+
+ if (!undeclared.isEmpty()) {
+ for (Node n : attributeCondition.getRule().getLhs().getNodes()) {
+ for (Attribute a : n.getAttributes()) {
+ if (a.getType() != null && a.getType().getEType() instanceof EEnum) {
+ for (EEnumLiteral lit : ((EEnum) a.getType().getEType()).getELiterals()) {
+ undeclared.remove(lit.getName());
+ }
+ }
+ }
+ }
+ }
if (!undeclared.isEmpty()) {
if (isJavaScriptExpression(attributeCondition.getConditionText()))
diagnostics.add(createDiagnostic(Diagnostic.WARNING, attributeCondition, AttributeCondition.class,
@@ -782,11 +835,11 @@ public class HenshinValidator extends EObjectValidator {
* errors.
*/
private void validateExpression(String expression, Unit unit) throws ScriptException {
- // If the unit has invalid parameter names (like keywords), this is the primary
+ // If the unit has invalid parameter names (like keywords), this is the primary
// error; directly return to avoid additional feedback that may confuse the user
- if (unitsWithIllegallyNamedParameters.contains(unit))
+ if (unitsWithIllegallyNamedParameters.contains(unit))
return;
-
+
if (expression == null || unit == null) {
return;
}
@@ -834,23 +887,37 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateParameter(Parameter parameter, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(parameter, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(parameter, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameter_nameNotEmpty(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameter_nameNotTypeName(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameter_nameNotKindAlias(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameter_unknownKindDeprecated(parameter, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameter_nameNotKeyword(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameter_nameNotEmpty(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameter_nameNotTypeName(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameter_nameNotKindAlias(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameter_unknownKindDeprecated(parameter, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameter_nameNotKeyword(parameter, diagnostics, context);
return result;
}
@@ -913,8 +980,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the unknownKindDeprecated constraint of '<em>Parameter</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the unknownKindDeprecated constraint of '<em>Parameter</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -922,7 +989,7 @@ public class HenshinValidator extends EObjectValidator {
Map<Object, Object> context) {
if (isSuppressParameterKindDeprecatedWarnings())
return true;
-
+
EObject container = parameter.eContainer();
if (parameter != null && parameter.getKind() == ParameterKind.UNKNOWN
&& !(container instanceof Rule && ((Rule) container).isMultiRule())) {
@@ -975,6 +1042,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateGraph(Graph graph, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -983,6 +1051,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateGraphElement(GraphElement graphElement, DiagnosticChain diagnostics,
@@ -992,6 +1061,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateModule(Module module, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1000,27 +1070,39 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateUnit(Unit unit, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(unit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(unit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(unit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(unit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(unit, diagnostics, context);
return result;
}
/**
- * Validates the nameNotEmpty constraint of '<em>Unit</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
+ * Validates the nameNotEmpty constraint of '<em>Unit</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1089,6 +1171,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateMapping(Mapping mapping, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1097,22 +1180,35 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateNode(Node node, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(node, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(node, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(node, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(node, diagnostics, context);
- if (result || diagnostics != null) result &= validateNode_uniqueAttributeTypes(node, diagnostics, context);
- if (result || diagnostics != null) result &= validateNode_atMostOneContainer(node, diagnostics, context);
- if (result || diagnostics != null) result &= validateNode_NodeDeletionDanglingEdge(node, diagnostics, context);
- if (result || diagnostics != null) result &= validateNode_NodeCreationWithoutContainment(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateNode_uniqueAttributeTypes(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateNode_atMostOneContainer(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateNode_NodeDeletionDanglingEdge(node, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateNode_NodeCreationWithoutContainment(node, diagnostics, context);
return result;
}
@@ -1122,13 +1218,12 @@ public class HenshinValidator extends EObjectValidator {
return preferences.getBoolean(PREF_ENABLE_EXTENDED_CONSISTENCY_CHECK, false);
}
-
private boolean isSuppressParameterKindDeprecatedWarnings() {
// access the global preferences
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(HenshinModelPlugin.PLUGIN_ID);
return preferences.getBoolean(PREF_SUPPRESS_PARAMETERKIND_DEPRECATED_WARNINGS, false);
}
-
+
/**
* Validates the uniqueAttributeTypes constraint of '<em>Node</em>'. <!--
* begin-user-doc --> <!-- end-user-doc -->
@@ -1183,8 +1278,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the consistent deletion of '<em>Node</em>'. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
+ * Validates the consistent deletion of '<em>Node</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1258,26 +1353,37 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateAttribute(Attribute attribute, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(attribute, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(attribute, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validateAttribute_valueValidJavaScript(attribute, diagnostics, context);
- if (result || diagnostics != null) result &= validateAttribute_valueAllParametersAreDeclared(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateAttribute_valueValidJavaScript(attribute, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateAttribute_valueAllParametersAreDeclared(attribute, diagnostics, context);
return result;
}
/**
- * Validates the valueValidJavaScript constraint of '<em>Attribute</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the valueValidJavaScript constraint of '<em>Attribute</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1309,6 +1415,13 @@ public class HenshinValidator extends EObjectValidator {
List<String> undeclared = findUndeclaredNames(attribute.getValue(),
attribute.getNode().getGraph().getRule());
if (!undeclared.isEmpty()) {
+ if (attribute.getType() != null && attribute.getType().getEType() instanceof EEnum) {
+ for (EEnumLiteral lit : ((EEnum) attribute.getType().getEType()).getELiterals()) {
+ undeclared.remove(lit.getName());
+ }
+ }
+ }
+ if (!undeclared.isEmpty()) {
if (isJavaScriptExpression(attribute.getValue()))
diagnostics.add(createDiagnostic(Diagnostic.WARNING, attribute, Attribute.class,
"valueAllParametersAreDeclaredWarning", context, new RuntimeException(undeclared.get(0))));
@@ -1400,27 +1513,45 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateEdge(Edge edge, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(edge, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(edge, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_equalParentGraphs(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_indexValidJavaScript(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_indexAllParametersAreDeclared(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_noContainmentCycles(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_EOppositeContainments(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_oppositeEdgeConsidered(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_noParallelEdgesOfSameType(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_containmentEdgeDeletion(edge, diagnostics, context);
- if (result || diagnostics != null) result &= validateEdge_containmentEdgeCreation(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_equalParentGraphs(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_indexValidJavaScript(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_indexAllParametersAreDeclared(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_noContainmentCycles(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_EOppositeContainments(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_oppositeEdgeConsidered(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_noParallelEdgesOfSameType(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_containmentEdgeDeletion(edge, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateEdge_containmentEdgeCreation(edge, diagnostics, context);
return result;
}
@@ -1457,8 +1588,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the indexAllParametersAreDeclared constraint of '<em>Edge</em>
- * '. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the indexAllParametersAreDeclared constraint of '<em>Edge</em> '.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1520,8 +1651,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the EOpposite constraint of '<em>Edge</em>'. <!--
- * begin-user-doc --> <!-- end-user-doc -->
+ * Validates the EOpposite constraint of '<em>Edge</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1541,155 +1672,242 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateUnaryUnit(UnaryUnit unaryUnit, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(unaryUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(unaryUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(unaryUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(unaryUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(unaryUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateMultiUnit(MultiUnit multiUnit, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(multiUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(multiUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(multiUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(multiUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(multiUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateIndependentUnit(IndependentUnit independentUnit, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(independentUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(independentUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(independentUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(independentUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(independentUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateSequentialUnit(SequentialUnit sequentialUnit, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(sequentialUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(sequentialUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(sequentialUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(sequentialUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(sequentialUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateConditionalUnit(ConditionalUnit conditionalUnit, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(conditionalUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(conditionalUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(conditionalUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(conditionalUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(conditionalUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validatePriorityUnit(PriorityUnit priorityUnit, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(priorityUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(priorityUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(priorityUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(priorityUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(priorityUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateIteratedUnit(IteratedUnit iteratedUnit, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(iteratedUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(iteratedUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateIteratedUnit_iterationsNotEmpty(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateIteratedUnit_iterationsValidJavaScript(iteratedUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateIteratedUnit_iterationsAllParametersAreDeclared(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateIteratedUnit_iterationsNotEmpty(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateIteratedUnit_iterationsValidJavaScript(iteratedUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateIteratedUnit_iterationsAllParametersAreDeclared(iteratedUnit, diagnostics, context);
return result;
}
/**
- * Validates the iterationsNotEmpty constraint of '<em>Iterated Unit</em>'.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the iterationsNotEmpty constraint of '<em>Iterated Unit</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1704,8 +1922,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the iterationsValidJavaScript constraint of '
- * <em>Iterated Unit</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the iterationsValidJavaScript constraint of ' <em>Iterated
+ * Unit</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1721,8 +1939,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the iterationsAllParametersAreDeclared constraint of '
- * <em>Iterated Unit</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the iterationsAllParametersAreDeclared constraint of ' <em>Iterated
+ * Unit</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1746,41 +1964,65 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateLoopUnit(LoopUnit loopUnit, DiagnosticChain diagnostics, Map<Object, Object> context) {
- if (!validate_NoCircularContainment(loopUnit, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(loopUnit, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_nameNotEmpty(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterNamesUnique(loopUnit, diagnostics, context);
- if (result || diagnostics != null) result &= validateUnit_parameterMappingsPointToDirectSubUnit(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_nameNotEmpty(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterNamesUnique(loopUnit, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateUnit_parameterMappingsPointToDirectSubUnit(loopUnit, diagnostics, context);
return result;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateNestedCondition(NestedCondition nestedCondition, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(nestedCondition, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(nestedCondition, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validateNestedCondition_mappingOriginContainedInParentCondition(nestedCondition, diagnostics, context);
- if (result || diagnostics != null) result &= validateNestedCondition_mappingImageContainedInCurrent(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(nestedCondition, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateNestedCondition_mappingOriginContainedInParentCondition(nestedCondition, diagnostics,
+ context);
+ if (result || diagnostics != null)
+ result &= validateNestedCondition_mappingImageContainedInCurrent(nestedCondition, diagnostics, context);
return result;
}
@@ -1806,8 +2048,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the mappingImageContainedInCurrent constraint of '
- * <em>Nested Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Validates the mappingImageContainedInCurrent constraint of ' <em>Nested
+ * Condition</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1825,6 +2067,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateFormula(Formula formula, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1833,6 +2076,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateUnaryFormula(UnaryFormula unaryFormula, DiagnosticChain diagnostics,
@@ -1842,6 +2086,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateBinaryFormula(BinaryFormula binaryFormula, DiagnosticChain diagnostics,
@@ -1851,6 +2096,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateAnd(And and, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1859,6 +2105,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateOr(Or or, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1867,6 +2114,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateNot(Not not, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1874,8 +2122,8 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateTrue(True true_, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1884,6 +2132,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateParameterKind(ParameterKind parameterKind, DiagnosticChain diagnostics,
@@ -1893,6 +2142,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateAction(Action action, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1901,6 +2151,7 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateXor(Xor xor, DiagnosticChain diagnostics, Map<Object, Object> context) {
@@ -1909,31 +2160,42 @@ public class HenshinValidator extends EObjectValidator {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
public boolean validateParameterMapping(ParameterMapping parameterMapping, DiagnosticChain diagnostics,
Map<Object, Object> context) {
- if (!validate_NoCircularContainment(parameterMapping, diagnostics, context)) return false;
+ if (!validate_NoCircularContainment(parameterMapping, diagnostics, context))
+ return false;
boolean result = validate_EveryMultiplicityConforms(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryDataValueConforms(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryProxyResolves(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_UniqueID(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryKeyUnique(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameterMapping_inParameterMappingIsCausal(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameterMapping_outParameterMappingIsCausal(parameterMapping, diagnostics, context);
- if (result || diagnostics != null) result &= validateParameterMapping_varParameterMappingIsCausal(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryDataValueConforms(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryReferenceIsContained(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryBidirectionalReferenceIsPaired(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryProxyResolves(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_UniqueID(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryKeyUnique(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validate_EveryMapEntryUnique(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameterMapping_inParameterMappingIsCausal(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameterMapping_outParameterMappingIsCausal(parameterMapping, diagnostics, context);
+ if (result || diagnostics != null)
+ result &= validateParameterMapping_varParameterMappingIsCausal(parameterMapping, diagnostics, context);
return result;
}
/**
- * Validates the inParameterMappingIsCausal constraint of '
- * <em>Parameter Mapping</em>'. <!-- begin-user-doc --> If the source of a
- * parameter mapping is an in parameter contained in a unit, the target
- * parameter has to be of the kinds in, inout or unknown. <!-- end-user-doc
- * -->
+ * Validates the inParameterMappingIsCausal constraint of ' <em>Parameter
+ * Mapping</em>'. <!-- begin-user-doc --> If the source of a parameter mapping
+ * is an in parameter contained in a unit, the target parameter has to be of the
+ * kinds in, inout or unknown. <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1958,11 +2220,10 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the outParameterMappingIsCausal constraint of '
- * <em>Parameter Mapping</em>'. <!-- begin-user-doc --> If the source of a
- * parameter mapping is an out parameter contained in a unit, tha target
- * parameter has to be of the kinds out, inout, or unknown. <!--
- * end-user-doc -->
+ * Validates the outParameterMappingIsCausal constraint of ' <em>Parameter
+ * Mapping</em>'. <!-- begin-user-doc --> If the source of a parameter mapping
+ * is an out parameter contained in a unit, tha target parameter has to be of
+ * the kinds out, inout, or unknown. <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -1997,11 +2258,10 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Validates the varParameterMappingIsCausal constraint of '
- * <em>Parameter Mapping</em>'. <!-- begin-user-doc --> If the source of a
- * parameter mapping is a var parameter contained in a unit, and the target
- * parameter is of the kind in, the mapping is valid if: <!-- end-user-doc
- * -->
+ * Validates the varParameterMappingIsCausal constraint of ' <em>Parameter
+ * Mapping</em>'. <!-- begin-user-doc --> If the source of a parameter mapping
+ * is a var parameter contained in a unit, and the target parameter is of the
+ * kind in, the mapping is valid if: <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -2063,8 +2323,9 @@ public class HenshinValidator extends EObjectValidator {
}
/**
- * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Returns the resource locator that will be used to fetch messages for this
+ * validator's diagnostics. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @generated
*/
@Override
diff --git a/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/ConflictAnalysis.java b/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/ConflictAnalysis.java
index d00110416..e6ad492f9 100644
--- a/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/ConflictAnalysis.java
+++ b/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/ConflictAnalysis.java
@@ -332,7 +332,15 @@ public class ConflictAnalysis implements MultiGranularAnalysis {
Set<Node> l1 = new HashSet<>(rule1.getLhs().getNodes());
Set<Node> l2 = new HashSet<>(originalR2.getLhs().getNodes());
Set<Node> f = new HashSet<>();
- for (NestedCondition nc : originalR2.getLhs().getNACs())
+ Set<Node> l1InNac = new HashSet<>();
+ Set<Node> l2InNac = new HashSet<>();
+ boolean allowed1 = true;
+ boolean allowed2 = true;
+ boolean nac2Allowed = false;
+ boolean nac1Allowed = false;
+
+ //collect all negative nodes of rule 2
+ for (NestedCondition nc : originalR2.getLhs().getNACs()) {
for (Node fn : nc.getConclusion().getNodes()) {
Node mappedNode = nc.getMappings().getOrigin(fn);
if (mappedNode == null)
@@ -341,20 +349,32 @@ public class ConflictAnalysis implements MultiGranularAnalysis {
l2.remove(mappedNode);
f.add(fn);
}
+ else {
+ l2InNac.add(fn);
+ }
}
+ //if there are negative elements, add l2
if (!f.isEmpty()) {
Map<Node, Node> result = new HashMap<>();
- f.addAll(l2);
+ //f.addAll(l2);
+ f.addAll(l2InNac);
Utils.mapNodes(l1, f, result, true);
- boolean allowed = result.size() < f.size();
- if (!allowed)
- return false;
+ boolean allNodesMapped = result.size() == f.size();
+ if (allNodesMapped) {
+ nac2Allowed = checkValidityOfMapping(result);
+ }
+ else nac2Allowed = true;
}
+ else nac2Allowed = true;
f.clear();
+ l2InNac.clear();
+ allowed1 = allowed1 && nac2Allowed;
+ }
+
l2 = new HashSet<>(originalR2.getLhs().getNodes());
l1 = new HashSet<>(rule1.getLhs().getNodes());
- for (NestedCondition nc : rule1.getLhs().getNACs())
+ for (NestedCondition nc : rule1.getLhs().getNACs()) {
for (Node fn : nc.getConclusion().getNodes()) {
Node mappedNode = nc.getMappings().getOrigin(fn);
if (mappedNode == null)
@@ -363,17 +383,53 @@ public class ConflictAnalysis implements MultiGranularAnalysis {
l1.remove(mappedNode);
f.add(fn);
}
+ else {
+ l1InNac.add(fn);
+ }
}
if (!f.isEmpty()) {
Map<Node, Node> result = new HashMap<>();
- f.addAll(l1);
+ //f.addAll(l1);
+ f.addAll(l1InNac);
Utils.mapNodes(l2, f, result, true);
- boolean allowed = result.size() < f.size();
- if (!allowed)
- return false;
+ boolean allNodesMapped = result.size() == f.size();
+ if (allNodesMapped) {
+ nac1Allowed = checkValidityOfMapping(result);
+ }
+ else nac1Allowed = true;
+ }
+ else nac1Allowed = true;
+ f.clear();
+ l1InNac.clear();
+ allowed2 = allowed2 && nac1Allowed;
+ }
+ return allowed1 && allowed2;
+ }
+
+ private boolean checkValidityOfMapping(Map<Node, Node> result) {
+ Set<Node> mappedNodes = result.keySet();
+ for (Node n : mappedNodes) {
+ if(n.getOutgoing().size() != result.get(n).getOutgoing().size() ||
+ n.getIncoming().size() != result.get(n).getIncoming().size()){
+ return true;
+ }
+ else if (n.getOutgoing().size() == result.get(n).getOutgoing().size()) {
+ for(Edge e: n.getOutgoing()) {
+ if(!result.containsKey(e.getTarget())){
+ return true;
+ }
+ }
+ if (n.getIncoming().size() == result.get(n).getIncoming().size()) {
+ for(Edge e: n.getIncoming()) {
+ if(!result.containsKey(e.getSource())){
+ return true;
+ }
+ }
+ }
+ }
}
- return true;
+ return false;
}
public <T extends Span> Set<T> setRequires(Set<T> spans) {
diff --git a/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/Utils.java b/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/Utils.java
index 69d052efd..685874263 100644
--- a/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/Utils.java
+++ b/plugins/org.eclipse.emf.henshin.multicda.cda/src/org/eclipse/emf/henshin/multicda/cda/Utils.java
@@ -1046,6 +1046,9 @@ public abstract class Utils {
public static Map<Node, Node> mapNodes(Set<Node> nodesOriginal1, Set<Node> nodesOriginal2, Set<Node> nodes2,
Map<Node, Node> result, boolean allActionTypes) {
+
+ //Tries to compute a mapping from nodesOriginal1 to nodesOriginal2
+ //When there is a mapping, result is not empty
if (result == null)
result = new HashMap<>();
for (Node n2 : nodes2) {
@@ -1058,12 +1061,16 @@ public abstract class Utils {
EList<Edge> e1 = n1.getOutgoing(e2.getType());
boolean foundEdge = false;
for (Edge e : e1)
- if ((allActionTypes || e.getAction().getType() == Action.Type.PRESERVE)
- && nodesOriginal1.contains(e.getTarget())) {
- foundEdge = true;
- break;
- }
- found = foundEdge;
+ if (allActionTypes || e.getAction().getType() == Action.Type.PRESERVE) {
+ //&& nodesOriginal1.contains(e.getTarget())
+ if (result.get(e.getTarget()) == null || result.get(e.getTarget())== e2.getTarget()) {
+ foundEdge = true;
+ break;
+ }
+ }
+ if (e1.size() != 0) {
+ found = foundEdge;
+ }
}
if (found)
for (Edge e2 : n2.getIncoming())
@@ -1071,12 +1078,17 @@ public abstract class Utils {
EList<Edge> e1 = n1.getIncoming(e2.getType());
boolean foundEdge = false;
for (Edge e : e1)
- if ((allActionTypes || e.getAction().getType() == Action.Type.PRESERVE)
- && nodesOriginal1.contains(e.getTarget())) {
- foundEdge = true;
- break;
- }
- found = foundEdge;
+ if (allActionTypes || e.getAction().getType() == Action.Type.PRESERVE) {
+ //&& nodesOriginal1.contains(e.getTarget())
+ // in the follwoing: getTarget() should be getSource()
+ if (result.get(e.getSource()) == null || result.get(e.getSource())== e2.getSource()) {
+ foundEdge = true;
+ break;
+ }
+ }
+ if (e1.size() != 0) {
+ found = foundEdge;
+ }
}
if (found) {
result.put(n1, n2);
@@ -1086,7 +1098,9 @@ public abstract class Utils {
return result;
}
mapNodes(nodesOriginal1, nodesOriginal2, remained, result, allActionTypes);
- if (result.size() == nodesOriginal2.size()) {
+ //was nodesOriginal2
+ if (result.size() == Math.min(nodesOriginal1.size(),nodesOriginal2.size())) {
+ //if (result.size() == nodesOriginal2.size() - remained.size()) {
return result;
}
result.remove(n1);

Back to the top