private void gatherCompositionConstraint(PatternCompositionConstraint constraint, PatternModelAcceptor<?> acceptor) throws SpecificationBuilderException { PatternCall call = constraint.getCall(); Pattern patternRef = call.getPatternRef(); List<String> variableNames = getVariableNames(call.getParameters(), acceptor); if (!call.isTransitive()) { if (constraint.isNegative()) acceptor.acceptNegativePatternCall(variableNames, patternRef); else acceptor.acceptPositivePatternCall(variableNames, patternRef); } else { if (call.getParameters().size() != 2) throw new SpecificationBuilderException( "Transitive closure of {1} in pattern {2} is unsupported because called pattern is not binary.", new String[] { CorePatternLanguageHelper.getFullyQualifiedName(patternRef), patternFQN }, "Transitive closure only supported for binary patterns.", pattern); else if (constraint.isNegative()) throw new SpecificationBuilderException("Unsupported negated transitive closure of {1} in pattern {2}", new String[] { CorePatternLanguageHelper.getFullyQualifiedName(patternRef), patternFQN }, "Unsupported negated transitive closure", pattern); else acceptor.acceptBinaryTransitiveClosure(variableNames, patternRef); } }
private boolean isNegativePatternCall(PatternCall call) { return (call.eContainer() instanceof PatternCompositionConstraint && ((PatternCompositionConstraint) call .eContainer()).isNegative()); }
for (ValueReference valueReference : patternCompositionConstraint.getCall().getParameters()) { resultList.addAll(getUnnamedVariablesFromValueReference(valueReference, false));
.isNegative())) { error(String.format(TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION, getFormattedPattern(patternRef)), PatternLanguagePackage.Literals.PATTERN_CALL__TRANSITIVE,
&& recursionCallingLevel < RECURSION_CALLING_LEVEL_LIMIT) { PatternCompositionConstraint patternCompositionConstraint = (PatternCompositionConstraint) constraint; boolean isNegative = patternCompositionConstraint.isNegative(); if (!isNegative) { PatternCall patternCall = patternCompositionConstraint.getCall(); int parameterIndex = 0; for (ValueReference valueReference : patternCall.getParameters()) {
reportStrangeVariableRef(ref, constraint); } else if (parent instanceof PatternCompositionConstraint && ((PatternCompositionConstraint) parent).isNegative()) { return ReferenceType.NEGATIVE; } else if (parent instanceof AggregatedValue) {
if (!patternCompositionConstraint.isNegative()) { for (ValueReference valueReference : patternCompositionConstraint.getCall().getParameters()) { if (!isValueReferenceComputed(valueReference)) { positiveVariables.addAll(CorePatternLanguageHelper for (ValueReference valueReference : patternCompositionConstraint.getCall().getParameters()) { generalVariables.addAll(CorePatternLanguageHelper .getVariablesFromValueReference(valueReference)); if (!patternCompositionConstraint.isNegative()) { for (ValueReference valueReference : patternCompositionConstraint.getCall().getParameters()) { addPositiveVariablesFromValueReference(unnamedRunningVariables, justPositiveUnionFindForVariables, positiveVariables, valueReference);