Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2009-01-12 09:53:39 -0500
committerashatalin2009-01-12 09:53:39 -0500
commitbea7f96f2ea56c539b8ea3d382913e8a5ff53221 (patch)
tree1f1e4160bd4493267907631ee80a7555ab80a771
parent640a717bd493453fa7a4c5750b0fffeb776e78d3 (diff)
downloadorg.eclipse.gmf-tooling-bea7f96f2ea56c539b8ea3d382913e8a5ff53221.tar.gz
org.eclipse.gmf-tooling-bea7f96f2ea56c539b8ea3d382913e8a5ff53221.tar.xz
org.eclipse.gmf-tooling-bea7f96f2ea56c539b8ea3d382913e8a5ff53221.zip
Migrating xpand chain expression QVT compute one.v20090112-0955
-rw-r--r--tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.ext8
-rw-r--r--tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.qvto12
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.ext b/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.ext
index 6e795ae27..4550414ec 100644
--- a/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.ext
+++ b/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.ext
@@ -6,4 +6,12 @@ String chainExpression(ecore::EClass eClass, ecore::EStructuralFeature eFeature)
String nestedChainExpressions(ecore::EClass eClass, ecore::EStructuralFeature eFeature1, ecore::EStructuralFeature eFeature2) :
eClass.eUnset(eFeature1)->eClass.eUnset(eFeature2)->eClass.name
+;
+
+String nestedChainExpressionsWBraces(ecore::EClass eClass, ecore::EStructuralFeature eFeature1, ecore::EStructuralFeature eFeature2, ecore::EStructuralFeature eFeature3) :
+ eClass.eUnset(eFeature1)->(eClass.eUnset(eFeature2)->eClass.eUnset(eFeature3))->eClass.name
+;
+
+String incorrectlyNestedChainExpressions(ecore::EClass eClass, ecore::EStructuralFeature eFeature1, ecore::EStructuralFeature eFeature2, Boolean condition) :
+ condition ? (eClass.eUnset(eFeature1)->eClass.name) : (eClass.eUnset(eFeature2)->eClass.name)
; \ No newline at end of file
diff --git a/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.qvto b/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.qvto
index cef037f7b..023b3ec96 100644
--- a/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.qvto
+++ b/tests/org.eclipse.gmf.tests.xpand.migration/resources/org/eclipse/gmf/tests/xpand/migration/ChainExpression.qvto
@@ -3,9 +3,17 @@ modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
library ChainExpression;
helper chainExpression(eClass : ecore::EClass, eFeature : ecore::EStructuralFeature) : String {
- eClass.eUnset(eFeature); return eClass.name
+ return compute (tmpVar : String) {eClass.eUnset(eFeature); tmpVar = eClass.name}
}
helper nestedChainExpressions(eClass : ecore::EClass, eFeature1 : ecore::EStructuralFeature, eFeature2 : ecore::EStructuralFeature) : String {
- eClass.eUnset(eFeature1); eClass.eUnset(eFeature2); return eClass.name
+ return compute (tmpVar : String) {eClass.eUnset(eFeature1); eClass.eUnset(eFeature2); tmpVar = eClass.name}
+}
+
+helper nestedChainExpressionsWBraces(eClass : ecore::EClass, eFeature1 : ecore::EStructuralFeature, eFeature2 : ecore::EStructuralFeature, eFeature3 : ecore::EStructuralFeature) : String {
+ return compute (tmpVar : String) {eClass.eUnset(eFeature1); compute (tmpVar_1 : OclVoid) {eClass.eUnset(eFeature2); tmpVar_1 = eClass.eUnset(eFeature3)}; tmpVar = eClass.name}
+}
+
+helper incorrectlyNestedChainExpressions(eClass : ecore::EClass, eFeature1 : ecore::EStructuralFeature, eFeature2 : ecore::EStructuralFeature, condition : Boolean) : String {
+ return (if condition then compute (tmpVar : String) {eClass.eUnset(eFeature1); tmpVar = eClass.name} else compute (tmpVar_1 : String) {eClass.eUnset(eFeature2); tmpVar_1 = eClass.name} endif)
} \ No newline at end of file

Back to the top