Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoracio Hoyos2015-04-21 16:03:00 +0000
committerEd Willink2015-04-30 19:47:21 +0000
commit61af6d30b756e541aa119c48055e9b4ba0196f26 (patch)
tree99a96e94f0f2291d701d1d8e52acb8c0bf40f8d8
parent01bdd717e8c96358b38a5d529829b61cad8c8432 (diff)
downloadorg.eclipse.qvtd-61af6d30b756e541aa119c48055e9b4ba0196f26.tar.gz
org.eclipse.qvtd-61af6d30b756e541aa119c48055e9b4ba0196f26.tar.xz
org.eclipse.qvtd-61af6d30b756e541aa119c48055e9b4ba0196f26.zip
[461806] Added a filter to select only DataParameters that are not guarded
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/helpers/QVTsHelpers.eol23
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/helpers/QVTsHelpers.eol b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/helpers/QVTsHelpers.eol
index 01ab84155..5eadafe6d 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/helpers/QVTsHelpers.eol
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/helpers/QVTsHelpers.eol
@@ -110,10 +110,31 @@ operation QVTs!Schedule getAllDatums() : OrderedSet(QVTs!AbstractDatum) {
return classDatums.includingAll(classDatums.propertyDatums.flatten());
}
+/****o* QVTsHelpers/getContextDataParameters
+ * NAME
+ * getContextDataParameters - Get the data parameters available in the context
+ * of the mapping.
+ * FUNCTION
+ * The parameters available are all the DataParameters available in the mapping and
+ * the mapping's predecessors, excluding those that are guarded. A DataParameter
+ * is guarded if there exists a predicate that guards the DataParameter's Variable
+ * or any of its properties
+ * CONTEXT
+ * QVTs!MappingAction The MappingAction
+ * RETURNS
+ * OrderedSet The set of usable parameters.
+ * SEE ALSO
+ */
@cached
operation QVTs!MappingAction getContextDataParameters() : OrderedSet {
- var contextdp = self.getAvailableDataParameters();
+ // Filter guarded DataParameters
+ //self.mapping.println("getContextDataParameters ");
+ //self.getAvailableDataParameters().variable.name.println("getContextDataParameters ");
+ var contextdp = self.getAvailableDataParameters().select(dp | not self.mapping.guardPattern.predicate
+ .exists(p | p.conditionExpression.ownedSource.getAllContentsIncludingSelf()
+ .exists(ex : QVTp!VariableExp | ex.referredVariable = dp.variable)));
+ //contextdp.variable.name.println("getContextDataParameters ");
if (self.parent.isDefined()) {
contextdp.addAll(self.parent.closure(p | p.parent).collect(p | p.getAvailableDataParameters()).flatten());
}

Back to the top