[498400] Eliminate getMatchableNodes() / isMatchable()
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNode.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNode.java
index bc97bf1..bdaacd8 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNode.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNode.java
@@ -603,11 +603,6 @@
}
@Override
- public boolean isMatchable() {
- return nodeRole.isMatchable();
- }
-
- @Override
public boolean isNavigable() {
return nodeRole.isNavigable();
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNodeRole.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNodeRole.java
index 42aca4f..1298c89 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNodeRole.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractNodeRole.java
@@ -112,7 +112,7 @@
}
@Override
- public boolean isMatchable() {
+ public boolean isLet() {
return false;
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractRegion.java
index 7426abe..6e20a27 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractRegion.java
@@ -145,7 +145,7 @@
}
}
- public static final class IsComputedPredicate implements Predicate<@NonNull Node>
+ /* public static final class IsComputedPredicate implements Predicate<@NonNull Node>
{
public static final @NonNull IsComputedPredicate INSTANCE = new IsComputedPredicate();
@@ -153,7 +153,7 @@
public boolean apply(@NonNull Node node) {
return node.isRealized();
}
- }
+ } */
public static final class IsExpressionEdgePredicate implements Predicate<@NonNull Edge>
{
@@ -175,16 +175,6 @@
}
}
- public static final class IsMatchableNodePredicate implements Predicate<@NonNull Node>
- {
- public static final @NonNull IsMatchableNodePredicate INSTANCE = new IsMatchableNodePredicate();
-
- @Override
- public boolean apply(@NonNull Node node) {
- return node.isMatchable();
- }
- }
-
public static final class IsNavigableNodePredicate implements Predicate<@NonNull Node>
{
public static final @NonNull IsNavigableNodePredicate INSTANCE = new IsNavigableNodePredicate();
@@ -205,6 +195,26 @@
}
}
+ public static final class IsNewNodePredicate implements Predicate<@NonNull Node>
+ {
+ public static final @NonNull IsNewNodePredicate INSTANCE = new IsNewNodePredicate();
+
+ @Override
+ public boolean apply(@NonNull Node node) {
+ return node.isRealized() || node.isSpeculation();
+ }
+ }
+
+ public static final class IsOldNodePredicate implements Predicate<@NonNull Node>
+ {
+ public static final @NonNull IsOldNodePredicate INSTANCE = new IsOldNodePredicate();
+
+ @Override
+ public boolean apply(@NonNull Node node) {
+ return node.isConstant() || node.isLoaded() || node.isPredicated() || node.isSpeculated();
+ }
+ }
+
public static final class IsPatternNodePredicate implements Predicate<@NonNull Node>
{
public static final @NonNull IsPatternNodePredicate INSTANCE = new IsPatternNodePredicate();
@@ -255,16 +265,6 @@
}
}
- public static final class IsRealizedOrSpeculationNodePredicate implements Predicate<@NonNull Node>
- {
- public static final @NonNull IsRealizedOrSpeculationNodePredicate INSTANCE = new IsRealizedOrSpeculationNodePredicate();
-
- @Override
- public boolean apply(@NonNull Node node) {
- return node.isRealized() || node.isSpeculation();
- }
- }
-
public static final class IsRecursionEdgePredicate implements Predicate<@NonNull Edge>
{
public static final @NonNull IsRecursionEdgePredicate INSTANCE = new IsRecursionEdgePredicate();
@@ -966,16 +966,16 @@
SymbolNameBuilder s = null;
Set<@NonNull Node> bestToOneSubRegion = null;
Node bestNamingNode = null;
- for (@NonNull Node node : getRealizedOrSpeculationNodes()) {
- Set<@NonNull Node> toOneSubRegion = computeToOneSubRegion(new HashSet<@NonNull Node>(), node);
+ for (@NonNull Node newNode : getNewNodes()) {
+ Set<@NonNull Node> toOneSubRegion = computeToOneSubRegion(new HashSet<@NonNull Node>(), newNode);
if ((bestToOneSubRegion == null) || (toOneSubRegion.size() > bestToOneSubRegion.size())) {
bestToOneSubRegion = toOneSubRegion;
- bestNamingNode = node;
+ bestNamingNode = newNode;
}
else if ((bestNamingNode != null) && (toOneSubRegion.size() == bestToOneSubRegion.size())) {
- if (ClassUtil.safeCompareTo(bestNamingNode.getCompleteClass().getName(), node.getCompleteClass().getName()) > 0) {
+ if (ClassUtil.safeCompareTo(bestNamingNode.getCompleteClass().getName(), newNode.getCompleteClass().getName()) > 0) {
bestToOneSubRegion = toOneSubRegion;
- bestNamingNode = node;
+ bestNamingNode = newNode;
}
}
}
@@ -1604,9 +1604,9 @@
return Iterables.filter(nodes, IsComposedNodePredicate.INSTANCE);
}
- public final @NonNull Iterable<@NonNull Node> getComputedNodes() {
+ /* public final @NonNull Iterable<@NonNull Node> getComputedNodes() {
return Iterables.filter(nodes, IsComputedPredicate.INSTANCE);
- }
+ } */
/* public final @NonNull Iterable<? extends Edge> getConsumedOrderingEdges() {
@SuppressWarnings("null")
@@ -1774,10 +1774,50 @@
return multiRegion.getMappingRegion(action);
}
- @Override
+ /* @Override
public final @NonNull Iterable<@NonNull Node> getMatchableNodes() {
+ Set<@NonNull Node> matchableNodes1 = Sets.newHashSet(getMatchableNodes1());
+ Set<@NonNull Node> matchableNodes2 = Sets.newHashSet(getMatchableNodes2());
+ if (!matchableNodes1.equals(matchableNodes2)) {
+ StringBuilder s = new StringBuilder();
+ Set<@NonNull Node> extraNodesSet = Sets.newHashSet(matchableNodes2);
+ CompilerUtil.removeAll(extraNodesSet, matchableNodes1);
+ for (@NonNull Node node : extraNodesSet) {
+ s.append("\n extra: ");
+ s.append(node);
+ }
+ Set<@NonNull Node> missingEdgesSet = Sets.newHashSet(matchableNodes1);
+ missingEdgesSet.removeAll(matchableNodes2);
+ for (@NonNull Node node : missingEdgesSet) {
+ s.append("\n missing: ");
+ s.append(node);
+ }
+ // assert false : "Bad getMatchableNodes for " + this + s.toString();
+ System.out.println("Bad getMatchableNodes for " + this + s.toString());
+ }
+ return matchableNodes2;
+ }
+
+ private @NonNull Iterable<@NonNull Node> getMatchableNodes1() {
return Iterables.filter(nodes, IsMatchableNodePredicate.INSTANCE);
}
+ private @NonNull Iterable<@NonNull Node> getMatchableNodes2() {
+ List<@NonNull Node> matchableNodes = new ArrayList<>();
+ for (@NonNull Node node : getNodes()) {
+ if (!node.isRealized()) {
+ if (node.isTrue()) {
+ matchableNodes.add(node);
+ }
+ else if (node.isOperation()) {
+ matchableNodes.add(node);
+ }
+ else if (node.isPattern() && node.isClass()) {
+ matchableNodes.add(node);
+ }
+ }
+ }
+ return matchableNodes;
+ } */
@Override
public @NonNull MultiRegion getMultiRegion() {
@@ -1818,6 +1858,11 @@
// }
@Override
+ public final @NonNull Iterable<@NonNull Node> getNewNodes() {
+ return Iterables.filter(nodes, IsNewNodePredicate.INSTANCE);
+ }
+
+ @Override
public @NonNull Collection<@NonNull Node> getNodes() {
return nodes;
}
@@ -1828,6 +1873,11 @@
}
@Override
+ public final @NonNull Iterable<@NonNull Node> getOldNodes() {
+ return Iterables.filter(nodes, IsOldNodePredicate.INSTANCE);
+ }
+
+ @Override
public @NonNull List<@NonNull DatumConnection> getOutgoingConnections() { // FIXME cache
List<@NonNull DatumConnection> connections = new ArrayList<@NonNull DatumConnection>();
for (@NonNull Node node : getNodes()) {
@@ -1932,11 +1982,6 @@
}
@Override
- public final @NonNull Iterable<@NonNull Node> getRealizedOrSpeculationNodes() {
- return Iterables.filter(nodes, IsRealizedOrSpeculationNodePredicate.INSTANCE);
- }
-
- @Override
public final @NonNull Iterable<@NonNull Edge> getRecursionEdges() {
@NonNull Iterable<@NonNull Edge> filter = Iterables.filter(edges, IsRecursionEdgePredicate.INSTANCE);
return filter;
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
index ce7063d..2085b5a 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
@@ -521,30 +521,30 @@
}
public void registerConsumptionsAndProductions() {
- for (@NonNull Node assignedNode : getComputedNodes()) {
- ClassDatumAnalysis classDatumAnalysis = assignedNode.getClassDatumAnalysis();
- classDatumAnalysis.addProduction(this, assignedNode);
+ for (@NonNull Node newNode : getNewNodes()) {
+ ClassDatumAnalysis classDatumAnalysis = newNode.getClassDatumAnalysis();
+ classDatumAnalysis.addProduction(this, newNode);
ClassDatum classDatum = classDatumAnalysis.getClassDatum();
for (@SuppressWarnings("null")@NonNull AbstractAction consumingAction : classDatum.getRequiredBy()) {
MappingRegion consumingRegion = multiRegion.getMappingRegion(consumingAction);
assert consumingRegion != null;
- for (@NonNull Node consumingNode : consumingRegion.getMatchableNodes()) {
+ for (@NonNull Node consumingNode : consumingRegion.getOldNodes()) {
if (consumingNode.getCompleteClass() == classDatumAnalysis.getCompleteClass()) { // FIXME inheritance
classDatumAnalysis.addConsumption(consumingRegion, consumingNode);
}
}
}
}
- for (@NonNull Node predicatedNode : getMatchableNodes()) {
+ for (@NonNull Node predicatedNode : getOldNodes()) {
ClassDatumAnalysis classDatumAnalysis = predicatedNode.getClassDatumAnalysis();
classDatumAnalysis.addConsumption(this, predicatedNode);
ClassDatum classDatum = classDatumAnalysis.getClassDatum();
for (@SuppressWarnings("null")@NonNull AbstractAction introducingAction : classDatum.getProducedBy()) {
MappingRegion producingRegion = multiRegion.getMappingRegion(introducingAction);
assert producingRegion != null;
- for (@NonNull Node assignedNode : producingRegion.getComputedNodes()) {
- if (assignedNode.getCompleteClass() == classDatumAnalysis.getCompleteClass()) { // FIXME inheritance
- classDatumAnalysis.addProduction(producingRegion, assignedNode);
+ for (@NonNull Node newNode : producingRegion.getNewNodes()) {
+ if (newNode.getCompleteClass() == classDatumAnalysis.getCompleteClass()) { // FIXME inheritance
+ classDatumAnalysis.addProduction(producingRegion, newNode);
}
}
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MappingRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MappingRegion.java
index 0cabf1f..b96c548 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MappingRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/MappingRegion.java
@@ -16,7 +16,7 @@
public interface MappingRegion extends Region
{
- @NonNull Iterable<@NonNull Node> getComputedNodes();
+ // @NonNull Iterable<@NonNull Node> getComputedNodes();
@NonNull Iterable<@NonNull MappingAction> getMappingActions();
void writeDebugGraphs(@Nullable String context);
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Node.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Node.java
index f516dc3..0b94bb8 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Node.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Node.java
@@ -158,15 +158,6 @@
boolean isLoaded();
/**
- * Return true if this node is part of the to-one navigation path that is matched as part of a mapping's predicate.
- *
- * Regions with conflicting isMatchable() nodes cannot be merged.
- *
- * ?? isConstant() || isLoaded() || isPredicated()
- */
- boolean isMatchable();
-
- /**
* Return true if this node is part of the to-one navigation path that is navigated to determine the navigation heads.
*/
boolean isNavigable();
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/NodeRole.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/NodeRole.java
index 5f186db..0af4799 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/NodeRole.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/NodeRole.java
@@ -60,7 +60,7 @@
boolean isIterator();
- boolean isMatchable();
+ boolean isLet();
boolean isNavigable();
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Nodes.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Nodes.java
index c3aee2f..1ec525f 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Nodes.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Nodes.java
@@ -358,7 +358,7 @@
}
@Override
- public boolean isMatchable() {
+ public boolean isLet() {
return true;
}
@@ -387,11 +387,6 @@
}
@Override
- public boolean isMatchable() {
- return true;
- }
-
- @Override
public boolean isNull() {
return true;
}
@@ -484,11 +479,6 @@
}
@Override
- public boolean isMatchable() {
- return phase != Role.Phase.REALIZED;
- }
-
- @Override
public boolean isOperation() {
return true;
}
@@ -695,11 +685,6 @@
}
@Override
- public boolean isMatchable() {
- return isGuard();
- }
-
- @Override
public boolean isNavigable() {
return navigable == NavigableEnum.NAVIGABLE;
}
@@ -792,11 +777,6 @@
}
@Override
- public boolean isMatchable() {
- return true;
- }
-
- @Override
public boolean isPattern() {
return true;
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
index 1b1798b..e73bc39 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/QVTp2QVTs.java
@@ -187,7 +187,7 @@
}
/**
- * Return the nodes with region at which a suitably matching head og annother region might be merged.
+ * Return the nodes with region at which a suitably matching head of another region might be merged.
* The nodes must be bi-directionally one to one to respect 1:N trace node relationships.
*/
protected @NonNull Iterable<@NonNull Node> getMergeableNodes(@NonNull MappingRegion region) {
@@ -198,7 +198,7 @@
return mergeableNodes;
}
private void getMergeableNodes(@NonNull Set<@NonNull Node> mergeableNodes, @NonNull Node node) {
- if (node.isMatchable() && node.isClass() && mergeableNodes.add(node)) {
+ if (isMergeable(node.getNodeRole()) && mergeableNodes.add(node)) {
for (@NonNull NavigationEdge edge : node.getNavigationEdges()) {
if (edge.getOppositeEdge() != null) {
getMergeableNodes(mergeableNodes, edge.getTarget());
@@ -206,6 +206,30 @@
}
}
}
+ private boolean isMergeable(@NonNull NodeRole nodeRole) {
+ if (nodeRole.isRealized() || nodeRole.isSpeculation()) {
+ return false;
+ }
+ if (!nodeRole.isClass()) {
+ return false;
+ }
+ if (nodeRole.isLet()) {
+ return true;
+ }
+ if (nodeRole.isNull()) {
+ return true;
+ }
+ if (nodeRole.isOperation()) {
+ return true;
+ }
+ if (nodeRole.isTrue()) {
+ return true;
+ }
+ if (nodeRole.isPattern()) {
+ return nodeRole.isGuard();
+ }
+ return false;
+ }
/**
* The primary region in a GuardedRegion must be single-headed. It may be multiply-produced, e.g. recursed.
@@ -283,9 +307,9 @@
}
}
}
- for (@NonNull Node assignedNode : secondaryRegion.getComputedNodes()) {
- if (assignedNode.isClass()) { // Ignore nulls, attributes
- ClassDatumAnalysis consumingClassDatumAnalysis = assignedNode.getClassDatumAnalysis();
+ for (@NonNull Node newNode : secondaryRegion.getNewNodes()) {
+ if (newNode.isClass()) { // Ignore nulls, attributes
+ ClassDatumAnalysis consumingClassDatumAnalysis = newNode.getClassDatumAnalysis();
if (toOneReachableClasses.add(consumingClassDatumAnalysis)) {
for (@NonNull MappingRegion consumingRegion : consumingClassDatumAnalysis.getConsumingRegions()) {
if (allConsumingRegions.add(consumingRegion)) {
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Region.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Region.java
index 0947ec4..9971d5f 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Region.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Region.java
@@ -102,11 +102,6 @@
@Nullable ScheduledRegion getInvokingRegion();
@NonNull List<@NonNull DatumConnection> getLoopingConnections();
- /**
- * Return the nodes that are matched or evaluated by the region's predicate.
- */
- @NonNull Iterable<@NonNull Node> getMatchableNodes();
-
@NonNull MultiRegion getMultiRegion();
@Override
@NonNull String getName();
@@ -115,6 +110,11 @@
*/
@NonNull Iterable<@NonNull Node> getNavigableNodes();
@NonNull Iterable<@NonNull NavigationEdge> getNavigationEdges();
+
+ /**
+ * Return all nodes created by this region. i.e. Speculation or Realized nodes.
+ */
+ @NonNull Iterable<@NonNull Node> getNewNodes();
/**
* Return all the next connections from this region to another region.
* Where this is a hierarchical region the connections are those from the hierarchical head to its immediate internal regions.
@@ -124,6 +124,11 @@
@NonNull Collection<@NonNull Node> getNodes();
/**
+ * Return all nodes referenced by this region. i.e. Constant, Loaded, Predicated, Speculated nodes.
+ */
+ @NonNull Iterable<@NonNull Node> getOldNodes();
+
+ /**
* Return all connections from this (hierarchical) region to another (hierarchical) region.
*/
@NonNull Iterable<@NonNull DatumConnection> getOutgoingConnections();
@@ -134,7 +139,6 @@
// @NonNull Iterable<@NonNull Node> getPredicatedOrSpeculatedNodes();
@NonNull Iterable<@NonNull Edge> getRealizedEdges();
@NonNull Iterable<@NonNull NavigationEdge> getRealizedNavigationEdges();
- @NonNull Iterable<@NonNull Node> getRealizedOrSpeculationNodes();
@NonNull Iterable<@NonNull Edge> getRecursionEdges();
@NonNull List<@NonNull NodeConnection> getRootConnections();
@NonNull SchedulerConstants getSchedulerConstants();
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Role.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Role.java
index 714669a..7993532 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Role.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/Role.java
@@ -47,6 +47,8 @@
SPECULATION, // Awaiting other mappings to speculate
SPECULATED, // Known other mappings are speculating
OTHER // Not known, nothing to do with mapping execution.
+ // NEW = REALIZED || SPECULATION
+ // OLD = CONSTANT || LOADED || PREDICATED || SPECULATED
};
/**
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/RootScheduledRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/RootScheduledRegion.java
index d6abb70..83cba8c 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/RootScheduledRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/RootScheduledRegion.java
@@ -321,7 +321,7 @@
// class is part of the input model and is not an internal convenience.
//
for (@NonNull Region region : getRegions()) {
- for (@NonNull Node predicatedNode : region.getMatchableNodes()) {
+ for (@NonNull Node predicatedNode : region.getOldNodes()) {
if (!predicatedNode.isHead()) {
if (!predicatedNode.isLoaded() && !predicatedNode.isConstant() && !predicatedNode.isInternal()) {
if (!isOnlyCastOrRecursed(predicatedNode)) { // FIXME Eliminate cast nodes
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
index 3e96c02..a42632b 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
@@ -1173,10 +1173,10 @@
}
private void createRealizedVariables() {
- for (@NonNull Node node : region.getRealizedOrSpeculationNodes()) {
- if (node.isPattern() && node.isClass()) {
+ for (@NonNull Node newNode : region.getNewNodes()) {
+ if (newNode.isPattern() && newNode.isClass()) {
OCLExpression constructor = null;
- for (Edge edge : node.getIncomingEdges()) {
+ for (Edge edge : newNode.getIncomingEdges()) {
if (edge.isExpression()) {
Node sourceNode = edge.getSource();
if (sourceNode.isOperation()) {
@@ -1184,12 +1184,12 @@
}
}
}
- ClassDatumAnalysis classDatumAnalysis = node.getClassDatumAnalysis();
+ ClassDatumAnalysis classDatumAnalysis = newNode.getClassDatumAnalysis();
BottomPattern bottomPattern = getArea(classDatumAnalysis).getBottomPattern();
- RealizedVariable realizedVariable = QVTimperativeUtil.createRealizedVariable(getSafeName(node), classDatumAnalysis.getCompleteClass().getPrimaryClass());
+ RealizedVariable realizedVariable = QVTimperativeUtil.createRealizedVariable(getSafeName(newNode), classDatumAnalysis.getCompleteClass().getPrimaryClass());
realizedVariable.setOwnedInit(constructor);
bottomPattern.getRealizedVariable().add(realizedVariable);
- Variable oldVariable = node2variable.put(node, realizedVariable);
+ Variable oldVariable = node2variable.put(newNode, realizedVariable);
assert oldVariable == null;
}
}
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/splitter/BodyStage.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/splitter/BodyStage.java
index f144441..3379b91 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/splitter/BodyStage.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/splitter/BodyStage.java
@@ -56,7 +56,7 @@
// this.stages = Lists.newArrayList(stages);
// this.visibleIteratedNodes = computedVisibleIteratedNodes(stages);
this.visibleIteratorNodes = computedVisibleIteratorNodes(stages);
- this.realizedNodes = computeRealizedNodes();
+ this.realizedNodes = computeNewNodes();
//
// Determine the nodes needed to realize the realized nodes.
//
@@ -142,6 +142,13 @@
return nodesList;
}
+ protected @NonNull Iterable<@NonNull Node> computeNewNodes() {
+ Region region = splitter.getRegion();
+ List<@NonNull Node> newNode = Lists.newArrayList(region.getNewNodes());
+ Collections.sort(newNode, NameUtil.NAMEABLE_COMPARATOR);
+ return newNode;
+ }
+
protected @NonNull Iterable<@NonNull Node> computeReachableNodes(@NonNull Iterable<@NonNull Node> requiredNodes) {
Set<@NonNull Node> reachableNodes = SplitterUtil.computeNavigableNodes(allHeadNodes);
// assert reachableNodes.containsAll(requiredNodes);
@@ -153,13 +160,6 @@
return reachableNodesList;
}
- protected @NonNull Iterable<@NonNull Node> computeRealizedNodes() {
- Region region = splitter.getRegion();
- List<@NonNull Node> nodes = Lists.newArrayList(region.getRealizedOrSpeculationNodes());
- Collections.sort(nodes, NameUtil.NAMEABLE_COMPARATOR);
- return nodes;
- }
-
/**
* The required nodes are the sources of all realized navigation edges, and the transitive source
* of all computations terminating in a realized node.