Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2017-02-26 15:35:01 +0000
committerEd Willink2017-03-11 10:47:14 +0000
commitda121481815276ec528c5ffb2182b1ba220e1487 (patch)
tree5a3430dae154c8bbd7168806e1518c1e46f26aa7
parent5916d33cf6f200efea11e4e50a2886d25ac3169f (diff)
downloadorg.eclipse.qvtd-da121481815276ec528c5ffb2182b1ba220e1487.tar.gz
org.eclipse.qvtd-da121481815276ec528c5ffb2182b1ba220e1487.tar.xz
org.eclipse.qvtd-da121481815276ec528c5ffb2182b1ba220e1487.zip
[512737] Provide opposite navigation for an includes edge
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtm2qvts/ExpressionAnalyzer.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtm2qvts/ExpressionAnalyzer.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtm2qvts/ExpressionAnalyzer.java
index 2a858d510..e92da7564 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtm2qvts/ExpressionAnalyzer.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtm2qvts/ExpressionAnalyzer.java
@@ -70,6 +70,7 @@ import org.eclipse.qvtd.pivot.qvtcore.utilities.QVTcoreHelper;
import org.eclipse.qvtd.pivot.qvtcore.utilities.QVTcoreUtil;
import org.eclipse.qvtd.pivot.qvtschedule.Edge;
import org.eclipse.qvtd.pivot.qvtschedule.NavigableEdge;
+import org.eclipse.qvtd.pivot.qvtschedule.NavigationEdge;
import org.eclipse.qvtd.pivot.qvtschedule.Node;
import org.eclipse.qvtd.pivot.qvtschedule.OperationRegion;
import org.eclipse.qvtd.pivot.qvtschedule.utilities.QVTscheduleConstants;
@@ -127,6 +128,18 @@ public class ExpressionAnalyzer extends AbstractExtendingQVTcoreVisitor<@Nullabl
Node targetNode = analyze(operationCallExp.getOwnedArguments().get(0));
String name = operationCallExp.getReferredOperation().getName();
createPredicateEdge(sourceNode, "«" + name + "»", targetNode);
+ if (sourceNode.isDataType()) { // expecting a CollectionType
+ for (@NonNull Edge edge : RegionUtil.getIncomingEdges(sourceNode)) {
+ if (edge instanceof NavigationEdge) {
+ NavigationEdge navigationEdge = (NavigationEdge)edge;
+ Property property = navigationEdge.getProperty();
+ Property oppositeProperty = property.getOpposite();
+ if ((oppositeProperty != null) && !oppositeProperty.isIsMany()) {
+ createNavigationEdge(targetNode, oppositeProperty, RegionUtil.getSourceNode(navigationEdge), false);
+ }
+ }
+ }
+ }
return null;
}

Back to the top