Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2019-12-02 18:07:41 +0000
committerEd Willink2019-12-02 18:07:41 +0000
commitcd86b35b3e562327bfc9cb14599a13879ed96412 (patch)
treec2d4d32524f5b9ec3ec2b511dabd011050056186
parent44d8e447cfdcb091b9a54daf219b6aa8e8519c6c (diff)
downloadorg.eclipse.qvtd-cd86b35b3e562327bfc9cb14599a13879ed96412.tar.gz
org.eclipse.qvtd-cd86b35b3e562327bfc9cb14599a13879ed96412.tar.xz
org.eclipse.qvtd-cd86b35b3e562327bfc9cb14599a13879ed96412.zip
bad 12
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
index 5afb08b1b..87b00599f 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
@@ -96,12 +96,6 @@ import org.eclipse.qvtd.runtime.utilities.QVTruntimeLibraryHelper;
public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisitor<@Nullable Node, @NonNull RuleAnalysis>
{
- // private static final @NonNull String @NonNull [] ifArgNames = new @NonNull String[]{QVTscheduleConstants.IF_CONDITION_NAME, QVTscheduleConstants.IF_THEN_NAME, QVTscheduleConstants.IF_ELSE_NAME};
- // private static final @NonNull String @NonNull [] mapArgNames = new @NonNull String[]{"«key»", "«value»"};
- // private static final @NonNull String @NonNull [] nullArgNames = new @NonNull String[]{QVTscheduleConstants.EQUALS_NAME};
- // private static final @NonNull String @NonNull [] rangeArgNames = new @NonNull String[]{"«first»", "«last»"};
- // private static final @NonNull String @NonNull [] srcArgNames = new @NonNull String[]{"«source»", "«arg»"};
-
protected final @NonNull InitUtility resultUtility;
protected final @NonNull ScheduleManager scheduleManager;
protected final @NonNull EnvironmentFactory environmentFactory;
@@ -112,7 +106,6 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
private /*@LazyNonNull*/ ExpressionSynthesizer nullableMatchedExpressionSynthesizer = null;
private /*@LazyNonNull*/ ExpressionSynthesizer nullableConditionalExpressionSynthesizer = null;
private /*@LazyNonNull*/ ExpressionSynthesizer nonNullConditionalExpressionSynthesizer = null;
- // private /*@LazyNonNull*/ OperationDependencyAnalysis operationDependencyAnalysis;
/**
* Map from the non-trivial side of an "=" expression to the known node for a variable on the other side. This avoids the need to create a redundant
@@ -153,7 +146,6 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
this.helper = new QVTbaseHelper(environmentFactory);
this.standardLibraryHelper = scheduleManager.getStandardLibraryHelper();
this.qvtbaseLibraryHelper = scheduleManager.getQVTruntimeLibraryHelper();
- // this.operationDependencyAnalysis = getOperationDependencyAnalysis();
}
protected @NonNull Node createBooleanLiteralNode(boolean booleanValue, @NonNull BooleanLiteralExp booleanLiteralExp) {
@@ -162,6 +154,8 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
}
public @NonNull CastEdge createCastEdge(@NonNull InitUtility utility, @NonNull Node sourceNode, @NonNull ClassDatum classDatum, @NonNull Node castNode) {
+ InitUtility utility2 = getRequiredInitUtility(castNode);
+ assert utility == utility2;
return context.createCastEdge(utility, sourceNode, classDatum, castNode);
}
@@ -235,6 +229,11 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
protected abstract @NonNull ExpressionSynthesizer createExpressionSynthesizer(@NonNull InitUtility initUtility);
+ protected @NonNull IfNode createIfNode(@NonNull IfExp ifExp, @NonNull String name, @NonNull Node@NonNull [] sourceAndArgumentNodes) {
+ InitUtility utility = getRequiredInitUtility(ifExp);
+ return context.createIfNode(!resultUtility.isConditional(), utility, name, ifExp, sourceAndArgumentNodes);
+ }
+
protected @NonNull Edge createIteratedEdge(@NonNull Node sourceNode, @NonNull Node targetNode) {
InitUtility utility = getRequiredInitUtility(targetNode);
return context.createIteratedEdge(utility, sourceNode, targetNode);
@@ -1328,7 +1327,7 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
nodeName = QVTbaseUtil.getName(ifOperation);
}
// Node operationNode = nestedAnalyzer.createOperationNode(nodeName, typedElement, sourceAndArgumentNodes);
- Node operationNode = createIfNode(ifExp, sourceAndArgumentNodes, nodeName);
+ Node operationNode = createIfNode(ifExp, nodeName, sourceAndArgumentNodes);
// org.eclipse.ocl.pivot.Class selfType = standardLibraryHelper.getStandardLibrary().getBooleanType();
Parameter conditionParameter = qvtbaseLibraryHelper.getIfConditionParameter();
Parameter thenParameter = qvtbaseLibraryHelper.getIfThenParameter();
@@ -1340,11 +1339,6 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
return operationNode;
}
- public @NonNull IfNode createIfNode(IfExp ifExp,
- Node[] sourceAndArgumentNodes, String nodeName) {
- return context.createIfNode(!resultUtility.isConditional(), getRequiredInitUtility(ifExp), nodeName, ifExp, sourceAndArgumentNodes);
- }
-
@Override
public @NonNull Node visitIntegerLiteralExp(@NonNull IntegerLiteralExp integerLiteralExp) {
Number numberValue = ClassUtil.nonNullState(integerLiteralExp.getIntegerSymbol());

Back to the top