Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-09-10 11:29:24 +0000
committerEd Willink2016-09-19 11:18:47 +0000
commita3013a055d6aeb06a20d768d3d8324c51b137db8 (patch)
treec14a26485dbd4191167057950fbc694d7e168635
parent4b2b83791a3abf5548663f24bc1c81d0b94ef7eb (diff)
downloadorg.eclipse.qvtd-a3013a055d6aeb06a20d768d3d8324c51b137db8.tar.gz
org.eclipse.qvtd-a3013a055d6aeb06a20d768d3d8324c51b137db8.tar.xz
org.eclipse.qvtd-a3013a055d6aeb06a20d768d3d8324c51b137db8.zip
[500369] Update tests
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/ClassesCS2AS.qvti36
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug456900/ClassesCS2AS.qvti20
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2AS.qvti2
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2ASv2.qvti2
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug459225/ClassesCS2AS.qvti2
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Constructors/Constructors.qvti2
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Dependencies/Dependencies.qvti4
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Expressions/Expressions.qvti22
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphHierarchical/Graph2GraphHierarchical.qvti10
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphMinimal/Graph2GraphMinimal.qvti4
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti12
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti160
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ManualUML2RDBMS/ManualUML2RDBMS.qvti184
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/SimpleUML2RDBMS/SimpleUML2RDBMS.qvti254
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTree.qvti22
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtrelation.tests/test-gen/org/eclipse/qvtd/xtext/qvtrelation2/tests/forward2reverse/Forward2Reverse.java44
16 files changed, 383 insertions, 397 deletions
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/ClassesCS2AS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/ClassesCS2AS.qvti
index aaf8228c8..0fba3c78b 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/ClassesCS2AS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/ClassesCS2AS.qvti
@@ -11,75 +11,75 @@ transformation classescs2as
map mClassCS2Class_LM in classescs2as
{
- check leftCS(classCS : ClassCS) {}
+ check leftCS(in classCS : ClassCS;) {}
new:middle c2c : ClassCS2Class;
set c2c.classCS := classCS;
}
map mRootCS2Root_LM in classescs2as
{
- check leftCS(rootCS : RootCS) {}
+ check leftCS(in rootCS : RootCS;) {}
new:middle r2r : RootCS2Root;
set r2r.rootCS := rootCS;
}
map mPackageCS2Package_LM in classescs2as
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
new:middle p2p : PackageCS2Package;
set p2p.packageCS := packageCS;
}
map mClassCS2Class_MR in classescs2as
{
- check middle(c2c : ClassCS2Class) {}
+ check middle(in c2c : ClassCS2Class;) {}
new:rightAS _'class' : Class;
set c2c._'class' := _'class';
}
map mRootCS2Root_MR in classescs2as
{
- check middle(r2r : RootCS2Root) {}
+ check middle(in r2r : RootCS2Root;) {}
new:rightAS root : Root;
set r2r.root := root;
}
map mPackageCS2Package_MR in classescs2as
{
- check middle(p2p : PackageCS2Package) {}
+ check middle(in p2p : PackageCS2Package;) {}
new:rightAS _'package' : Package;
set p2p._'package' := _'package';
}
map uClass_name in classescs2as
{
- check rightAS(_'class' : Class) {}
- check leftCS(classCS : ClassCS) {}
- where (classCS.ClassCS2Class._'class' = _'class';) {}
+ check rightAS(in _'class' : Class;) {}
+ check leftCS(in classCS : ClassCS;) {}
+ where (check classCS.ClassCS2Class._'class' = _'class';) {}
set _'class'.name := classCS.name;
}
map uRoot_ownedPackages in classescs2as
{
- check rightAS(root : Root) {}
- check leftCS(rootCS : RootCS) {}
- where (rootCS.RootCS2Root.root = root;) {}
+ check rightAS(in root : Root;) {}
+ check leftCS(in rootCS : RootCS;) {}
+ where (check rootCS.RootCS2Root.root = root;) {}
set root.ownedPackages := rootCS.ownedPackages.PackageCS2Package._'package'->asOrderedSet();
}
map uPackage_name in classescs2as
{
- check rightAS(_'package' : Package) {}
- check leftCS(packageCS : PackageCS) {}
- where (packageCS.PackageCS2Package._'package' = _'package';) {}
+ check rightAS(in _'package' : Package;) {}
+ check leftCS(in packageCS : PackageCS;) {}
+ where (check packageCS.PackageCS2Package._'package' = _'package';) {}
set _'package'.name := packageCS.name;
}
map uPackage_ownedClasses in classescs2as
{
- check rightAS(_'package' : Package) {}
- check leftCS(packageCS : PackageCS) {}
- where (packageCS.PackageCS2Package._'package' = _'package';) {}
+ check rightAS(in _'package' : Package;) {}
+ check leftCS(in packageCS : PackageCS;) {}
+ where (check packageCS.PackageCS2Package._'package' = _'package';) {}
set _'package'.ownedClasses := packageCS.ownedClasses.ClassCS2Class._'class'->asOrderedSet();
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug456900/ClassesCS2AS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug456900/ClassesCS2AS.qvti
index 104c79be9..d12faf14d 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug456900/ClassesCS2AS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug456900/ClassesCS2AS.qvti
@@ -9,14 +9,14 @@ transformation classescs2as
map mCreationRootCS2Root in classescs2as
{
- check leftCS(rootCS : RootCS) {}
+ check leftCS(in rootCS : RootCS;) {}
new:rightAS root : Root;
set rootCS.ast := root;
}
map mCreationPackageCS2Package in classescs2as
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
new:rightAS _'package' : Package;
set packageCS.ast := _'package';
}
@@ -24,23 +24,19 @@ map mCreationPackageCS2Package in classescs2as
map uPackage_name in classescs2as
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
enforce rightAS() {
- l1 : classes::Package
- }
- where () {
- l1 := packageCS.ast.oclAsType(classes::Package);
+ var l1 : classes::Package := packageCS.ast.oclAsType(classes::Package);
}
+ where () {}
set l1.name := packageCS.name;
}
map uRoot_ownedPackages in classescs2as
{
- check leftCS(rootCS : RootCS) {}
- enforce rightAS() {z1 : classes::Root}
- where () {
- z1 := rootCS.ast.oclAsType(classes::Root);
- }
+ check leftCS(in rootCS : RootCS;) {}
+ enforce rightAS() {var z1 : classes::Root := rootCS.ast.oclAsType(classes::Root);}
+ where () {}
set z1.ownedPackages :=
rootCS.ownedPackages.ast.oclAsType(classes::Package)->asOrderedSet();
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2AS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2AS.qvti
index 7808b1c23..d923d70e8 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2AS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2AS.qvti
@@ -10,7 +10,7 @@ transformation classescs2as
map createPackage in classescs2as
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
new:rightAS _'package' : Package;
set _'package'.name := if packageCS.hasName()
then packageCS.name
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2ASv2.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2ASv2.qvti
index d0fe0fe8e..705e01043 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2ASv2.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug457239/ClassesCS2ASv2.qvti
@@ -10,7 +10,7 @@ transformation classescs2as
map createPackage in classescs2as
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
new:rightAS _package : Package;
set _package.name := if packageCS.aBooleanElementOp()
--if not packageCS.name.oclIsUndefined()
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug459225/ClassesCS2AS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug459225/ClassesCS2AS.qvti
index c63d3a716..ebad4de83 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug459225/ClassesCS2AS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ClassesCS2AS/bug459225/ClassesCS2AS.qvti
@@ -10,7 +10,7 @@ transformation classescs2as_Bug459225
map createPackage in classescs2as_Bug459225
{
- check leftCS(packageCS : PackageCS) {}
+ check leftCS(in packageCS : PackageCS;) {}
new:rightAS _'package' : Package;
set _'package'.name := if packageCS.hasName()
then packageCS.computeName()
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Constructors/Constructors.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Constructors/Constructors.qvti
index 3ef203fb6..9e524f732 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Constructors/Constructors.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Constructors/Constructors.qvti
@@ -11,7 +11,7 @@ query Constructors::createEPackage(name2 : String) : ecore::EPackage {
}
map ep2ep in Constructors {
- check source (epIn:EPackage) {}
+ check source (in epIn:EPackage;) {}
new:target epOut1 : EPackage := this.createEPackage(epIn.name);
new:target epOut2 : EPackage;
set epOut2.name := epIn.name;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Dependencies/Dependencies.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Dependencies/Dependencies.qvti
index 52d841e3d..70c94f9f3 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Dependencies/Dependencies.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Dependencies/Dependencies.qvti
@@ -7,7 +7,7 @@ transformation Dependencies {
}
map dependenciesLM in Dependencies {
- check source { check ecore::EPackage::eSubpackages enforce ecore::EPackage::eSuperPackage } (dummy:EPackage) {}
+ check source { check ecore::EPackage::eSubpackages enforce ecore::EPackage::eSuperPackage } (in dummy:EPackage;) {}
enforce middle() {}
where () {}
call dependenciesMR {
@@ -17,7 +17,7 @@ map dependenciesLM in Dependencies {
}
map dependenciesMR in Dependencies /*uses ecore::EPackage, ocl::Integer*/ {
- check middle(binaryPrecedence:OclAny, unaryPrecedence:OclAny) { }
+ check middle(in binaryPrecedence:OclAny; in unaryPrecedence:OclAny;) { }
enforce target() {}
where () {}
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Expressions/Expressions.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Expressions/Expressions.qvti
index c1066a4e6..3be27ad6a 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Expressions/Expressions.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Expressions/Expressions.qvti
@@ -7,7 +7,7 @@ transformation Expressions {
}
map expressionsLM in Expressions {
- check source(dummy:EPackage) {}
+ check source(in dummy:EPackage;) {}
enforce middle() {}
where () {}
call expressionsMR {
@@ -18,25 +18,25 @@ map expressionsLM in Expressions {
}
map expressionsMR in Expressions {
- check middle(binaryPrecedence:OclAny, unaryPrecedence:OclAny, notPrecedence:OclAny) { }
+ check middle(in binaryPrecedence:OclAny; in unaryPrecedence:OclAny; in notPrecedence:OclAny;) { }
enforce target() {}
where () {}
}
map expressionsDomains in Expressions {
check middle() {
- s : Integer := 0,
- s_1 : Integer := m,
- s_2 : Integer := t
+ var s : Integer := 0;
+ var s_1 : Integer := m;
+ var s_2 : Integer := t;
}
enforce target() {
- t : Integer := 0,
- t_1 : Integer := s,
- t_2 : Integer := m
+ var t : Integer := 0;
+ var t_1 : Integer := s;
+ var t_2 : Integer := m;
}
where () {
- m : Integer := 0,
- m_1 : Integer := s,
- m_2 : Integer := t
+ var m : Integer := 0;
+ var m_1 : Integer := s;
+ var m_2 : Integer := t;
}
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphHierarchical/Graph2GraphHierarchical.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphHierarchical/Graph2GraphHierarchical.qvti
index 71fd671db..5060897d7 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphHierarchical/Graph2GraphHierarchical.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphHierarchical/Graph2GraphHierarchical.qvti
@@ -17,7 +17,7 @@ map __root__ in CopyGraph {
}
map Graph2Middle in CopyGraph { -- L to M for G
- check upperGraph(g1:Graph) {}
+ check upperGraph(in g1:Graph;) {}
new:middle middleG2G:Graph2Graph;
set middleG2G.graph1 := g1;
set middleG2G.name := g1.name.toLowerCase();
@@ -33,8 +33,8 @@ map Graph2Middle in CopyGraph { -- L to M for G
}
map Node2Middle in CopyGraph { -- L to M for N
- check upperGraph(n1:Node) { }
- enforce middle(middleParent:Graph2Graph) {}
+ check upperGraph(in n1:Node;) { }
+ enforce middle(in middleParent:Graph2Graph;) {}
new:middle n2n:Node2Node;
set n2n.owner := middleParent;
set n2n.node1 := n1;
@@ -42,7 +42,7 @@ map Node2Middle in CopyGraph { -- L to M for N
}
map Middle2Graph in CopyGraph { -- M to R for G
- check middle(g2Gmiddle:Graph2Graph) {}
+ check middle(in g2Gmiddle:Graph2Graph;) {}
new:lowerGraph g2:Graph;
set g2Gmiddle.graph2 := g2;
set g2.name := g2Gmiddle.name;
@@ -54,7 +54,7 @@ map Middle2Graph in CopyGraph { -- M to R for G
}
map Middle2Node in CopyGraph { -- M to R for N
- check middle(n2n:Node2Node) {}
+ check middle(in n2n:Node2Node;) {}
new:lowerGraph n2:Node;
set n2n.node2 := n2;
set n2.graph := n2n.owner.graph2;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphMinimal/Graph2GraphMinimal.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphMinimal/Graph2GraphMinimal.qvti
index 60cf2a2f3..d73482903 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphMinimal/Graph2GraphMinimal.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Graph2GraphMinimal/Graph2GraphMinimal.qvti
@@ -8,7 +8,7 @@ transformation CopyGraphMinimal {
}
map graph2graphLM in CopyGraphMinimal {
- check upperGraph(g1:Graph) {}
+ check upperGraph(in g1:Graph;) {}
new:middle g2g:Graph2Graph;
set g2g.graph1 := g1;
set g2g.name := g1.name;
@@ -18,7 +18,7 @@ map graph2graphLM in CopyGraphMinimal {
}
map graph2graphMR in CopyGraphMinimal {
- check middle(g2gout:Graph2Graph) { }
+ check middle(in g2gout:Graph2Graph;) { }
new:lowerGraph g2:Graph;
set g2gout.graph2 := g2;
set g2.name := g2gout.name;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
index 2c8d4fb47..8a2a2eaed 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
@@ -28,9 +28,9 @@ map __root__ in hsv2hls {
}
map HSV2MiddleRoot in hsv2hls { -- Mapping root nodes L to M
- check hsv(hsvRoot : HSVNode) { }
+ check hsv(in hsvRoot : HSVNode;) { }
where(
- hsvRoot.parent = null;
+ check hsvRoot.parent = null;
) {}
new:middle middleRoot : HSVNode2HLSNode;
set middleRoot.hsv := hsvRoot;
@@ -48,8 +48,8 @@ map HSV2MiddleRoot in hsv2hls { -- Mapping root nodes L to M
}
map HSV2MiddleRecursion in hsv2hls { -- Mapping child nodes L to M
- check hsv(hsvNode : HSVNode) {}
- enforce middle(middleParent : HSVNode2HLSNode) {}
+ check hsv(in hsvNode : HSVNode;) {}
+ enforce middle(in middleParent : HSVNode2HLSNode;) {}
new:middle middleNode : HSVNode2HLSNode;
set middleNode.parent := middleParent;
set middleNode.hsv := hsvNode;
@@ -64,7 +64,7 @@ map HSV2MiddleRecursion in hsv2hls { -- Mapping child nodes L to M
}
map Middle2HLSRoot in hsv2hls { -- Mapping root nodes M to R
- check middle(middleNode : HSVNode2HLSNode) {}
+ check middle(in middleNode : HSVNode2HLSNode;) {}
new:hls hlsNode : HLSNode;
set hlsNode.parent := null;
set middleNode.hls := hlsNode;
@@ -78,7 +78,7 @@ map Middle2HLSRoot in hsv2hls { -- Mapping root nodes M to R
}
map Middle2HLSRecursion in hsv2hls { -- Mapping child nodes M to R
- check middle(middleNode : HSVNode2HLSNode) {}
+ check middle(in middleNode : HSVNode2HLSNode;) {}
new:hls hlsNode : HLSNode;
set hlsNode.parent := middleNode.parent.hls;
set middleNode.hls := hlsNode;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
index 99d873727..4d8e69425 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/KiamaRewrite/KiamaRewrite.qvti
@@ -10,15 +10,15 @@ transformation KiamaRewrite_qvtp_qvtcas
map __root__ in KiamaRewrite_qvtp_qvtcas
{
where () {
- roots : Set(ocl::OclElement) := leftCS.rootObjects(),
- _'«child-NumCS»' : Set(kiamacs::NumCS) := roots->selectByKind(kiamacs::NumCS),
- ji_NumCS1 : Set(kiamacs::NumCS) := _'«child-NumCS»',
- _'«child-PlusCS»' : Set(kiamacs::PlusCS) := roots->selectByKind(kiamacs::PlusCS),
- ji_PlusCS1 : Set(kiamacs::PlusCS) := _'«child-PlusCS»',
- ji_PlusCS_31 : Set(kiamacs::PlusCS) := _'«child-PlusCS»',
- _'«child-TopCS»' : Set(kiamacs::TopCS) := roots->selectByKind(kiamacs::TopCS),
- ji_TopCS1 : Set(kiamacs::TopCS) := _'«child-TopCS»'
- |}
+ var roots : Set(ocl::OclElement) := leftCS.rootObjects();
+ var _'«child-NumCS»' : Set(kiamacs::NumCS) := roots->selectByKind(kiamacs::NumCS);
+ var ji_NumCS1 : Set(kiamacs::NumCS) := _'«child-NumCS»';
+ var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := roots->selectByKind(kiamacs::PlusCS);
+ var ji_PlusCS1 : Set(kiamacs::PlusCS) := _'«child-PlusCS»';
+ var ji_PlusCS_31 : Set(kiamacs::PlusCS) := _'«child-PlusCS»';
+ var _'«child-TopCS»' : Set(kiamacs::TopCS) := roots->selectByKind(kiamacs::TopCS);
+ var ji_TopCS1 : Set(kiamacs::TopCS) := _'«child-TopCS»';
+ }
for loop0 : kiamacs::TopCS in ji_TopCS1 {
call m_TopCS_ast {
lTopCS := loop0;
@@ -88,37 +88,37 @@ map __root__ in KiamaRewrite_qvtp_qvtcas
map m_NumCS_ast in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lNumCS : NumCS) {}
+ check leftCS(in lNumCS : NumCS;) {}
new:rightAS rNum : Num;
set lNumCS.ast := rNum;
}
map m_NumCS_ast_2 in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lNumCS : NumCS) {}
+ check leftCS(in lNumCS : NumCS;) {}
enforce rightAS {
enforce kiamaas::Node::depth }() {}
where () {
- ast : ecore::EObject := lNumCS.ast,
- aNum : kiamaas::Num := ast.oclAsType(kiamaas::Num),
- oclContainer : ocl::OclElement := aNum.oclContainer,
- _'oclIsKindOf\nkiamaas::Top' : Boolean := oclContainer.oclIsKindOf(kiamaas::Top),
- _'if' : Integer := if _'oclIsKindOf\nkiamaas::Top'
+ var ast : ecore::EObject := lNumCS.ast;
+ var aNum : kiamaas::Num := ast.oclAsType(kiamaas::Num);
+ var oclContainer : ocl::OclElement := aNum.oclContainer;
+ var _'oclIsKindOf\nkiamaas::Top' : Boolean := oclContainer.oclIsKindOf(kiamaas::Top);
+ var _'if' : Integer := if _'oclIsKindOf\nkiamaas::Top'
then 0
- else oclContainer.oclAsType(kiamaas::Plus).depth + 1 endif
- |}
+ else oclContainer.oclAsType(kiamaas::Plus).depth + 1 endif;
+ }
set aNum.depth := _'if';
}
map m_NumCS_ast_value_1 in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lNumCS : NumCS) {}
+ check leftCS(in lNumCS : NumCS;) {}
enforce rightAS {
enforce kiamaas::Node::height }() {}
where () {
- ast : ecore::EObject := lNumCS.ast,
- value : ecore::EInt := lNumCS.value,
- aNum : kiamaas::Num := ast.oclAsType(kiamaas::Num)
+ var ast : ecore::EObject := lNumCS.ast;
+ var value : ecore::EInt := lNumCS.value;
+ var aNum : kiamaas::Num := ast.oclAsType(kiamaas::Num);
}
set aNum.height := 0;
set aNum.value := value;
@@ -126,101 +126,101 @@ map m_NumCS_ast_value_1 in KiamaRewrite_qvtp_qvtcas
map m_PlusCS_ast in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lPlusCS : PlusCS) {}
+ check leftCS(in lPlusCS : PlusCS;) {}
enforce rightAS {
check kiamaas::Node::height enforce kiamaas::Node::height }() {}
where () {
- ast : ecore::EObject := lPlusCS.ast,
- aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus),
- left : kiamaas::Node := aPlus.left,
- right : kiamaas::Node := aPlus.right,
- height : ecore::EIntegerObject := left.height,
- height1 : ecore::EIntegerObject := right.height,
- oclAsSet : Set(ecore::EIntegerObject) := height.oclAsSet(),
- including : Set(ecore::EIntegerObject) := oclAsSet->including(height1),
- max : ecore::EIntegerObject := including->max(),
- _'+' : Integer := max + 1
+ var ast : ecore::EObject := lPlusCS.ast;
+ var aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus);
+ var left : kiamaas::Node := aPlus.left;
+ var right : kiamaas::Node := aPlus.right;
+ var height : ecore::EIntegerObject := left.height;
+ var height1 : ecore::EIntegerObject := right.height;
+ var oclAsSet : Set(ecore::EIntegerObject) := height.oclAsSet();
+ var including : Set(ecore::EIntegerObject) := oclAsSet->including(height1);
+ var max : ecore::EIntegerObject := including->max();
+ var _'+' : Integer := max + 1;
}
set aPlus.height := _'+';
}
map m_PlusCS_ast_1 in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lPlusCS : PlusCS) {}
+ check leftCS(in lPlusCS : PlusCS;) {}
enforce rightAS {
check kiamaas::Node::depth enforce kiamaas::Node::depth }() {}
where () {
- ast : ecore::EObject := lPlusCS.ast,
- aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus),
- oclContainer : ocl::OclElement := aPlus.oclContainer,
- _'oclIsKindOf\nkiamaas::Top' : Boolean := oclContainer.oclIsKindOf(kiamaas::Top),
- _'if' : Integer := if _'oclIsKindOf\nkiamaas::Top'
+ var ast : ecore::EObject := lPlusCS.ast;
+ var aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus);
+ var oclContainer : ocl::OclElement := aPlus.oclContainer;
+ var _'oclIsKindOf\nkiamaas::Top' : Boolean := oclContainer.oclIsKindOf(kiamaas::Top);
+ var _'if' : Integer := if _'oclIsKindOf\nkiamaas::Top'
then 0
- else oclContainer.oclAsType(kiamaas::Plus).depth + 1 endif
+ else oclContainer.oclAsType(kiamaas::Plus).depth + 1 endif;
}
set aPlus.depth := _'if';
}
map m_PlusCS_ast_2 in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lPlusCS : PlusCS) {}
+ check leftCS(in lPlusCS : PlusCS;) {}
new:rightAS rPlus : Plus;
set lPlusCS.ast := rPlus;
}
map m_PlusCS_ast_left in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lPlusCS : PlusCS) {}
+ check leftCS(in lPlusCS : PlusCS;) {}
where () {
- ast : ecore::EObject := lPlusCS.ast,
- left : kiamacs::NodeCS := lPlusCS.left,
- aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus),
- ast1 : ecore::EObject := left.ast,
- aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node)
+ var ast : ecore::EObject := lPlusCS.ast;
+ var left : kiamacs::NodeCS := lPlusCS.left;
+ var aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus);
+ var ast1 : ecore::EObject := left.ast;
+ var aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node);
}
set aPlus.left := aNode;
}
map m_PlusCS_ast_right in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lPlusCS : PlusCS) {}
+ check leftCS(in lPlusCS : PlusCS;) {}
where () {
- ast : ecore::EObject := lPlusCS.ast,
- right : kiamacs::NodeCS := lPlusCS.right,
- aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus),
- ast1 : ecore::EObject := right.ast,
- aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node)
+ var ast : ecore::EObject := lPlusCS.ast;
+ var right : kiamacs::NodeCS := lPlusCS.right;
+ var aPlus : kiamaas::Plus := ast.oclAsType(kiamaas::Plus);
+ var ast1 : ecore::EObject := right.ast;
+ var aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node);
}
set aPlus.right := aNode;
}
map m_TopCS_ast in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lTopCS : TopCS) {}
+ check leftCS(in lTopCS : TopCS;) {}
new:rightAS rTop : Top;
set lTopCS.ast := rTop;
}
map m_TopCS_ast_node in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(lTopCS : TopCS) {}
+ check leftCS(in lTopCS : TopCS;) {}
where () {
- ast : ecore::EObject := lTopCS.ast,
- node : kiamacs::NodeCS := lTopCS.node,
- aTop : kiamaas::Top := ast.oclAsType(kiamaas::Top),
- ast1 : ecore::EObject := node.ast,
- aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node)
+ var ast : ecore::EObject := lTopCS.ast;
+ var node : kiamacs::NodeCS := lTopCS.node;
+ var aTop : kiamaas::Top := ast.oclAsType(kiamaas::Top);
+ var ast1 : ecore::EObject := node.ast;
+ var aNode : kiamaas::Node := ast1.oclAsType(kiamaas::Node);
}
set aTop.node := aNode;
}
map r_PlusCS_left in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(_'«parent»' : PlusCS) {}
- where (ji_PlusCS : Set(kiamacs::PlusCS), ji_NumCS : Set(kiamacs::NumCS) |) {
- allChildren : Set(kiamacs::NodeCS) := _'«parent»'.left.oclAsSet(),
- _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS),
- _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS)
+ check leftCS(in _'«parent»' : PlusCS;) {}
+ where (inout ji_PlusCS : Set(kiamacs::PlusCS); inout ji_NumCS : Set(kiamacs::NumCS);) {
+ var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.left.oclAsSet();
+ var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
+ var _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS);
}
add ji_PlusCS += _'«child-PlusCS»';
add ji_NumCS += _'«child-NumCS»';
@@ -235,11 +235,11 @@ map r_PlusCS_left in KiamaRewrite_qvtp_qvtcas
map r_PlusCS_right in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(_'«parent»' : PlusCS) {}
- where (ji_PlusCS : Set(kiamacs::PlusCS), ji_NumCS : Set(kiamacs::NumCS) |) {
- allChildren : Set(kiamacs::NodeCS) := _'«parent»'.right.oclAsSet(),
- _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS),
- _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS)
+ check leftCS(in _'«parent»' : PlusCS;) {}
+ where (inout ji_PlusCS : Set(kiamacs::PlusCS); inout ji_NumCS : Set(kiamacs::NumCS);) {
+ var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.right.oclAsSet();
+ var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
+ var _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS);
}
add ji_PlusCS += _'«child-PlusCS»';
add ji_NumCS += _'«child-NumCS»';
@@ -254,11 +254,11 @@ map r_PlusCS_right in KiamaRewrite_qvtp_qvtcas
map r_TopCS_node in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(_'«parent»' : TopCS) {}
- where (ji_PlusCS : Set(kiamacs::PlusCS), ji_PlusCS_3 : Set(kiamacs::PlusCS), ji_NumCS : Set(kiamacs::NumCS) |) {
- allChildren : Set(kiamacs::NodeCS) := _'«parent»'.node.oclAsSet(),
- _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS),
- _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS)
+ check leftCS(in _'«parent»' : TopCS;) {}
+ where (inout ji_PlusCS : Set(kiamacs::PlusCS); inout ji_PlusCS_3 : Set(kiamacs::PlusCS); inout ji_NumCS : Set(kiamacs::NumCS);) {
+ var allChildren : Set(kiamacs::NodeCS) := _'«parent»'.node.oclAsSet();
+ var _'«child-PlusCS»' : Set(kiamacs::PlusCS) := allChildren->selectByKind(kiamacs::PlusCS);
+ var _'«child-NumCS»' : Set(kiamacs::NumCS) := allChildren->selectByKind(kiamacs::NumCS);
}
add ji_PlusCS += _'«child-PlusCS»';
add ji_PlusCS_3 += _'«child-PlusCS»';
@@ -267,11 +267,11 @@ map r_TopCS_node in KiamaRewrite_qvtp_qvtcas
map r__PlusCS in KiamaRewrite_qvtp_qvtcas
{
- check leftCS(_'«head»' : PlusCS) {}
- where (ji_PlusCS : Set(kiamacs::PlusCS), ji_NumCS : Set(kiamacs::NumCS) |) {
- _'«local»' : Set(kiamacs::PlusCS),
- _'«new»' : Set(kiamacs::PlusCS)
- |}
+ check leftCS(in _'«head»' : PlusCS;) {}
+ where (inout ji_PlusCS : Set(kiamacs::PlusCS); inout ji_NumCS : Set(kiamacs::NumCS);) {
+ out _'«local»' : Set(kiamacs::PlusCS);
+ out _'«new»' : Set(kiamacs::PlusCS);
+ }
call r_PlusCS_left {
ji_NumCS := ji_NumCS;
ji_PlusCS := _'«local»';
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ManualUML2RDBMS/ManualUML2RDBMS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ManualUML2RDBMS/ManualUML2RDBMS.qvti
index 7817eaec0..89bb73e09 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ManualUML2RDBMS/ManualUML2RDBMS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/ManualUML2RDBMS/ManualUML2RDBMS.qvti
@@ -17,7 +17,7 @@ map __root__ in ManualUML2RDBMS {
}
map packageToSchemaLM in ManualUML2RDBMS {
- check uml (p:Package) { }
+ check uml (in p:Package;) { }
new:middle p2s:PackageToSchema;
set p2s.umlPackage := p;
set p2s.name := p.name;
@@ -69,7 +69,7 @@ map packageToSchemaLM in ManualUML2RDBMS {
}
map packageToSchemaMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema) {}
+ check middle (in p2s:PackageToSchema;) {}
new:rdbms s:Schema;
set p2s.schema := s;
call packageToSchemaMR_1 {
@@ -100,17 +100,17 @@ map packageToSchemaMR in ManualUML2RDBMS {
}
map packageToSchemaMR_1 in ManualUML2RDBMS {
- check middle (p2s_1:PackageToSchema) {}
- enforce rdbms (s_1:Schema) {}
+ check middle (in p2s_1:PackageToSchema;) {}
+ enforce rdbms (in s_1:Schema;) {}
set s_1.name := p2s_1.name;
}
map integerToNumberLM in ManualUML2RDBMS {
- check uml (p:Package, prim:PrimitiveDataType) {}
- enforce middle (p2s:PackageToSchema) {}
- where (prim.namespace = p;
- prim.name = 'Integer';
- p2s.umlPackage=p;
+ check uml (in p:Package; in prim:PrimitiveDataType;) {}
+ enforce middle (in p2s:PackageToSchema;) {}
+ where (check prim.namespace = p;
+ check prim.name = 'Integer';
+ check p2s.umlPackage=p;
) {}
new:middle p2n:PrimitiveToName;
set p2n.owner := p2s;
@@ -120,20 +120,20 @@ map integerToNumberLM in ManualUML2RDBMS {
}
map integerToNumberMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema, p2n:PrimitiveToName) {}
+ check middle (in p2s:PackageToSchema; in p2n:PrimitiveToName;) {}
where (
- p2n.owner = p2s;
- p2n.name = 'Integer' + '2' + 'NUMBER';
+ check p2n.owner = p2s;
+ check p2n.name = 'Integer' + '2' + 'NUMBER';
) {}
}
map booleanToBooleanLM in ManualUML2RDBMS {
- check uml (p:Package, prim:PrimitiveDataType) { }
- enforce middle (p2s:PackageToSchema) {}
+ check uml (in p:Package; in prim:PrimitiveDataType;) { }
+ enforce middle (in p2s:PackageToSchema;) {}
where (
- prim.namespace = p;
- prim.name = 'Boolean';
- p2s.umlPackage=p;
+ check prim.namespace = p;
+ check prim.name = 'Boolean';
+ check p2s.umlPackage=p;
) {}
new:middle p2n:PrimitiveToName;
set p2n.owner := p2s;
@@ -143,21 +143,21 @@ map booleanToBooleanLM in ManualUML2RDBMS {
}
map booleanToBooleanMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema, p2n:PrimitiveToName) {}
+ check middle (in p2s:PackageToSchema; in p2n:PrimitiveToName;) {}
enforce rdbms () {}
where (
- p2n.owner = p2s;
- p2n.name = 'Boolean' + '2' + 'BOOLEAN';
+ check p2n.owner = p2s;
+ check p2n.name = 'Boolean' + '2' + 'BOOLEAN';
) {}
}
map stringToVarcharLM in ManualUML2RDBMS {
- check uml (p:Package, prim:PrimitiveDataType) { }
- enforce middle (p2s:PackageToSchema) {}
+ check uml (in p:Package; in prim:PrimitiveDataType;) { }
+ enforce middle (in p2s:PackageToSchema;) {}
where (
- prim.namespace = p;
- prim.name = 'String';
- p2s.umlPackage=p;
+ check prim.namespace = p;
+ check prim.name = 'String';
+ check p2s.umlPackage=p;
) {}
new:middle p2n:PrimitiveToName;
set p2n.owner := p2s;
@@ -167,11 +167,11 @@ map stringToVarcharLM in ManualUML2RDBMS {
}
map stringToVarcharMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema, p2n:PrimitiveToName) {}
+ check middle (in p2s:PackageToSchema; in p2n:PrimitiveToName;) {}
enforce rdbms () {}
where (
- p2n.owner = p2s;
- p2n.name = 'String' + '2' + 'VARCHAR';
+ check p2n.owner = p2s;
+ check p2n.name = 'String' + '2' + 'VARCHAR';
) {}
}
@@ -188,12 +188,12 @@ query ManualUML2RDBMS::getAllForwards(cls : UML::Class[1]) : Set(UML::Associatio
}
map classToTableLM in ManualUML2RDBMS {
- check uml (p:Package, c:Class) { }
- enforce middle (p2s:PackageToSchema) {}
+ check uml (in p:Package; in c:Class;) { }
+ enforce middle (in p2s:PackageToSchema;) {}
where (
- c.kind = 'persistent';
- c.namespace = p;
- p2s.umlPackage=p;
+ check c.kind = 'persistent';
+ check c.namespace = p;
+ check p2s.umlPackage=p;
) {}
new:middle c2t:ClassToTable;
set c2t.owner := p2s;
@@ -223,10 +223,10 @@ map classToTableLM in ManualUML2RDBMS {
}
map classToTableMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema, c2t:ClassToTable) {}
- enforce rdbms (s:Schema) {}
+ check middle (in p2s:PackageToSchema; in c2t:ClassToTable;) {}
+ enforce rdbms (in s:Schema;) {}
where (
- c2t.owner = p2s;
+ check c2t.owner = p2s;
) {}
new:rdbms t:Table;
set t.kind := 'base';
@@ -264,15 +264,15 @@ map classToTableMR in ManualUML2RDBMS {
}
map classToTableMR_1 in ManualUML2RDBMS {
- check middle (c2t_1:ClassToTable) {}
- enforce rdbms (t_1:Table) { }
+ check middle (in c2t_1:ClassToTable;) {}
+ enforce rdbms (in t_1:Table;) { }
set c2t_1.table := t_1;
set t_1.name := c2t_1.name;
}
map classToTableMR_2 in ManualUML2RDBMS {
- check middle (c2t_2:ClassToTable) {}
- enforce rdbms (t_2:Table) {}
+ check middle (in c2t_2:ClassToTable;) {}
+ enforce rdbms (in t_2:Table;) {}
new:rdbms pk:Key;
new:rdbms pc:Column;
set pk.owner := t_2;
@@ -293,30 +293,30 @@ map classToTableMR_2 in ManualUML2RDBMS {
}
map classToTableMR_2_1 in ManualUML2RDBMS {
- check middle (c2t_2_1:ClassToTable) {}
- enforce rdbms (pk_2_1:Key, pc_2_1:Column) {}
+ check middle (in c2t_2_1:ClassToTable;) {}
+ enforce rdbms (in pk_2_1:Key; in pc_2_1:Column;) {}
set c2t_2_1.primaryKey := pk_2_1;
set c2t_2_1.column := pc_2_1;
}
map classToTableMR_2_2 in ManualUML2RDBMS {
check middle () {}
- enforce rdbms (pk_2_2:Key, pc_2_2:Column, t_2_2:Table) {}
+ enforce rdbms (in pk_2_2:Key; in pc_2_2:Column; in t_2_2:Table;) {}
set pc_2_2.name := t_2_2.name+'_tid';
set pk_2_2.name := t_2_2.name+'_pk';
}
map associationToForeignKeyLM in ManualUML2RDBMS {
- check uml (p:Package, sc:Class := a.source, dc:Class := a.destination, a:Association) {
+ check uml (in p:Package; invar sc:Class := a.source; invar dc:Class := a.destination; in a:Association;) {
-- sc.namespace = p;
}
- enforce middle (p2s:PackageToSchema, sc2t:ClassToTable := sc.ClassToTable, dc2t:ClassToTable := dc.ClassToTable) {}
+ enforce middle (in p2s:PackageToSchema; invar sc2t:ClassToTable := sc.ClassToTable; invar dc2t:ClassToTable := dc.ClassToTable;) {}
where (
- a.namespace = p;
- sc.namespace = p;
- -- getAllForwards(sc)->includes(a);
+ check a.namespace = p;
+ check sc.namespace = p;
+ -- getAllForwards(sc)->includes(a);
-- getAllSupers(dc)->includes(a.destination);
- p2s.umlPackage = p;
+ check p2s.umlPackage = p;
) {}
new:middle a2f:AssociationToForeignKey;
set sc2t.owner := p2s;
@@ -335,17 +335,17 @@ map associationToForeignKeyLM in ManualUML2RDBMS {
}
map associationToForeignKeyMR in ManualUML2RDBMS {
- check middle (p2s:PackageToSchema, sc2t:ClassToTable, dc2t:ClassToTable, a2f:AssociationToForeignKey) {}
- enforce rdbms (s:Schema, st:Table, dt:Table, rk:Key) {}
+ check middle (in p2s:PackageToSchema; in sc2t:ClassToTable; in dc2t:ClassToTable; in a2f:AssociationToForeignKey;) {}
+ enforce rdbms (in s:Schema; in st:Table; in dt:Table; in rk:Key;) {}
where (
- a2f.owner = sc2t;
- a2f.referenced = dc2t;
- p2s.schema = s;
+ check a2f.owner = sc2t;
+ check a2f.referenced = dc2t;
+ check p2s.schema = s;
--sc2t.table = st;
--dc2t.table = dt;
-- sc2t := st.ClassToTable;
-- dc2t := dt.ClassToTable;
- st.schema = s;
+ check st.schema = s;
-- rk.owner = dt;
-- rk.kind = 'primary';
) {}
@@ -371,27 +371,26 @@ map associationToForeignKeyMR in ManualUML2RDBMS {
map associationToForeignKeyMR_1 in ManualUML2RDBMS {
check middle () {}
- enforce rdbms (fk:ForeignKey, fc:Column, dt:Table, rk:Key) {}
+ enforce rdbms (in fk:ForeignKey; in fc:Column; in dt:Table; in rk:Key;) {}
set fk.refersTo := rk;
set fc.foreignKeys := OrderedSet(ForeignKey){fk};
set fc.type := rk.column->first().type;
}
map associationToForeignKeyMR_2 in ManualUML2RDBMS {
- check middle (a2f_1:AssociationToForeignKey) {}
- enforce rdbms (fk_1:ForeignKey, fc_1:Column) {}
+ check middle (in a2f_1:AssociationToForeignKey;) {}
+ enforce rdbms (in fk_1:ForeignKey; in fc_1:Column;) {}
set a2f_1.foreignKey := fk_1;
set a2f_1.column := fc_1;
}
map classPrimitiveAttributesLM in ManualUML2RDBMS {
- check uml (c:Class, t:PrimitiveDataType := a.type, a:Attribute) {
- }
- enforce middle (fao:ClassToTable, p2n:PrimitiveToName := t.PrimitiveToName) {}
+ check uml (in c:Class; in a:Attribute; invar t:PrimitiveDataType := a.type;) {}
+ enforce middle (in fao:ClassToTable; invar p2n:PrimitiveToName := t.PrimitiveToName;) {}
where (
- a.owner = c;
+ check a.owner = c;
--getAllAttributes(c)->includes(a);
- fao.umlClass = c;
+ check fao.umlClass = c;
) {}
new:middle atc:AttributeToColumn;
@@ -404,13 +403,12 @@ map classPrimitiveAttributesLM in ManualUML2RDBMS {
}
map classComplexAttributesLM in ManualUML2RDBMS {
- check uml (c:Class, t:Class := a.type, a:Attribute) {
- }
- enforce middle (fao:ClassToTable) {}
+ check uml (in c:Class; in a:Attribute; invar t:Class := a.type;) {}
+ enforce middle (in fao:ClassToTable;) {}
where (
- a.owner = c;
+ check a.owner = c;
--getAllAttributes(c)->includes(a);
- fao.umlClass=c;
+ check fao.umlClass=c;
) {}
new:middle fa:NonLeafAttribute;
set fa._'attribute' := a;
@@ -421,11 +419,11 @@ map classComplexAttributesLM in ManualUML2RDBMS {
}
map complexAttributePrimitiveAttributesLM in ManualUML2RDBMS {
- check uml (c:Class, ca:Attribute) {
+ check uml (in c:Class; in ca:Attribute;) {
}
- enforce middle (fao:NonLeafAttribute := ca.FromAttribute) {}
+ enforce middle (invar fao:NonLeafAttribute := ca.FromAttribute;) {}
where (
- ca.type = c;
+ check ca.type = c;
-- getAllAttributes(c)->includes(a);
) {}
for anAttribute in c.attributes {
@@ -439,9 +437,9 @@ map complexAttributePrimitiveAttributesLM in ManualUML2RDBMS {
}
map complexAttributePrimitiveAttributesLM_1 in ManualUML2RDBMS {
- check uml (c_1:Class, t_1:PrimitiveDataType := a_1.type, a_1:Attribute, ca_1:Attribute) {
- }
- enforce middle (fao_1:NonLeafAttribute, p2n_1:PrimitiveToName := t_1.PrimitiveToName) {}
+ check uml (in c_1:Class; in a_1:Attribute; in ca_1:Attribute; invar t_1:PrimitiveDataType := a_1.type;) {
+ }
+ enforce middle (in fao_1:NonLeafAttribute; invar p2n_1:PrimitiveToName := t_1.PrimitiveToName;) {}
where (
--getAllAttributes(c)->includes(a);
) {}
@@ -455,11 +453,11 @@ map complexAttributePrimitiveAttributesLM_1 in ManualUML2RDBMS {
}
map complexAttributeComplexAttributesLM in ManualUML2RDBMS {
- check uml (c:Class, ca:Attribute) {
+ check uml (in c:Class; in ca:Attribute;) {
}
- enforce middle (fao:NonLeafAttribute := ca.FromAttribute) {}
+ enforce middle (invar fao:NonLeafAttribute := ca.FromAttribute;) {}
where (
- ca.type = c;
+ check ca.type = c;
--getAllAttributes(c)->includes(a);
) {}
for anAttribute in c.attributes {
@@ -473,11 +471,11 @@ map complexAttributeComplexAttributesLM in ManualUML2RDBMS {
}
map complexAttributeComplexAttributesLM_1 in ManualUML2RDBMS {
- check uml (c_1:Class, ca_1:Attribute, t_1:Class := a_1.type, a_1:Attribute) {
- }
- enforce middle (fao_1:NonLeafAttribute) {}
+ check uml (in c_1:Class; in ca_1:Attribute; in a_1:Attribute; invar t_1:Class := a_1.type;) {
+ }
+ enforce middle (in fao_1:NonLeafAttribute;) {}
where (
- a_1.owner = c_1;
+ check a_1.owner = c_1;
--getAllAttributes(c)->includes(a);
) {}
new:middle fa:NonLeafAttribute;
@@ -491,12 +489,12 @@ map complexAttributeComplexAttributesLM_1 in ManualUML2RDBMS {
map attributeColumnsMR in ManualUML2RDBMS {
- check middle (c2t:ClassToTable, a2c:AttributeToColumn, p2n:PrimitiveToName := a2c.type) {}
- enforce rdbms (t:Table, ct:String := p2n.typeName) {}
+ check middle (in c2t:ClassToTable; in a2c:AttributeToColumn; invar p2n:PrimitiveToName := a2c.type;) {}
+ enforce rdbms (in t:Table; invar ct:String := p2n.typeName;) {}
where (
-- c2t.fromAttributes.leafs->includes(a2c); -- need to go deeper in the recursion
-- a2c.owner = c2t; NOT ALL a2c are owned by c2t (complex attributes)
- c2t.table = t;
+ check c2t.table = t;
) {}
new:rdbms c:Column;
set c.owner := t;
@@ -517,16 +515,16 @@ map attributeColumnsMR in ManualUML2RDBMS {
}
map attributeColumnsMR_1 in ManualUML2RDBMS {
- check middle (a2c_1:AttributeToColumn) {}
- enforce rdbms (c_1:Column) {}
+ check middle (in a2c_1:AttributeToColumn;) {}
+ enforce rdbms (in c_1:Column;) {}
set a2c_1.column := c_1;
}
map attributeColumnsMR_2 in ManualUML2RDBMS {
- check middle (p2n_2:PrimitiveToName, a2c_2:AttributeToColumn) {}
- enforce rdbms (c_2:Column, ct_2:String) {}
+ check middle (in p2n_2:PrimitiveToName; in a2c_2:AttributeToColumn;) {}
+ enforce rdbms (in c_2:Column; in ct_2:String;) {}
where (
- a2c_2.type = p2n_2;
+ check a2c_2.type = p2n_2;
) {}
set c_2.type := ct_2;
call attributeColumnsMR_2_1 {
@@ -536,14 +534,14 @@ map attributeColumnsMR_2 in ManualUML2RDBMS {
}
map attributeColumnsMR_2_1 in ManualUML2RDBMS {
- check middle (p2n_2_1:PrimitiveToName) {}
- enforce rdbms (ct_2_1:String) {}
+ check middle (in p2n_2_1:PrimitiveToName;) {}
+ enforce rdbms (in ct_2_1:String;) {}
set p2n_2_1.typeName := ct_2_1;
}
map attributeColumnsMR_3 in ManualUML2RDBMS {
- check middle (a2c_3:AttributeToColumn) {}
- enforce rdbms (c_3:Column) { }
+ check middle (in a2c_3:AttributeToColumn;) {}
+ enforce rdbms (in c_3:Column;) { }
set c_3.name := a2c_3.name;
set c_3.kind := a2c_3.kind;
}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/SimpleUML2RDBMS/SimpleUML2RDBMS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/SimpleUML2RDBMS/SimpleUML2RDBMS.qvti
index 4e867a03e..3e6189d0b 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/SimpleUML2RDBMS/SimpleUML2RDBMS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/SimpleUML2RDBMS/SimpleUML2RDBMS.qvti
@@ -14,7 +14,7 @@ package simpleUML2RDBMS = 'http://simpleUML2RDBMS'
map packageToSchema_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package) {}
+ check uml(in p : Package;) {}
new:middle p2s : PackageToSchema;
set p2s.umlPackage := p;
set p2s.name := p.name;
@@ -22,7 +22,7 @@ map packageToSchema_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map packageToSchema_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check middle(p2s : PackageToSchema) {}
+ check middle(in p2s : PackageToSchema;) {}
new:rdbms s : Schema;
set s.name := p2s.name;
set p2s.schema := s;
@@ -30,12 +30,11 @@ map packageToSchema_MR in simpleUML2RDBMS::SimpleUML2RDBMS
map integerToNumber_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package,
- prim : PrimitiveDataType) {}
- enforce middle(p2s : PackageToSchema) {}
- where (p2s.umlPackage = p;
- prim.namespace = p;
- prim.name = 'Integer';) {}
+ check uml(in p : Package; in prim : PrimitiveDataType;) {}
+ enforce middle(in p2s : PackageToSchema;) {}
+ where (check p2s.umlPackage = p;
+ check prim.namespace = p;
+ check prim.name = 'Integer';) {}
new:middle p2n : IntegerToNumber;
set p2n.owner := p2s;
set p2n._'primitive' := prim;
@@ -44,34 +43,32 @@ map integerToNumber_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map integerToNumber_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check middle(p2s : PackageToSchema,
- p2n : IntegerToNumber) {}
- where (p2n.owner = p2s;) {
- sqlType : String := 'NUMBER'
+ check middle(in p2s : PackageToSchema;
+ in p2n : IntegerToNumber;) {}
+ where (check p2n.owner = p2s;) {
+ var sqlType : String := 'NUMBER';
}
set p2n.typeName := sqlType;
}
map booleanToBoolean_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check middle(p2s : PackageToSchema,
- p2n : BooleanToBoolean) {}
- where (p2n.owner = p2s;) {
- sqlType : String
- |
- sqlType := 'BOOLEAN';
+ check middle(in p2s : PackageToSchema;
+ in p2n : BooleanToBoolean;) {}
+ where (check p2n.owner = p2s;) {
+ var sqlType : String := 'BOOLEAN';
}
set p2n.typeName := sqlType;
}
map booleanToBoolean_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package,
- prim : PrimitiveDataType) {}
- enforce middle(p2s : PackageToSchema) {}
- where (p2s.umlPackage = p;
- prim.namespace = p;
- prim.name = 'Boolean';) {}
+ check uml(in p : Package;
+ in prim : PrimitiveDataType;) {}
+ enforce middle(in p2s : PackageToSchema;) {}
+ where (check p2s.umlPackage = p;
+ check prim.namespace = p;
+ check prim.name = 'Boolean';) {}
new:middle p2n : BooleanToBoolean;
set p2n._'primitive' := prim;
set p2n.name := prim.name + '2' + 'BOOLEAN';
@@ -81,22 +78,22 @@ map booleanToBoolean_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map stringToVarchar_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
enforce rdbms() {}
- check middle(p2s : PackageToSchema,
- p2n : StringToVarchar) {}
- where (p2n.owner = p2s;) {
- sqlType : String := 'VARCHAR'
- |}
+ check middle(in p2s : PackageToSchema;
+ in p2n : StringToVarchar;) {}
+ where (check p2n.owner = p2s;) {
+ var sqlType : String := 'VARCHAR';
+ }
set p2n.typeName := sqlType;
}
map stringToVarchar_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package,
- prim : PrimitiveDataType) {}
- enforce middle(p2s : PackageToSchema) {}
- where (p2s.umlPackage = p;
- prim.namespace = p;
- prim.name = 'String';) {}
+ check uml(in p : Package;
+ in prim : PrimitiveDataType;) {}
+ enforce middle(in p2s : PackageToSchema;) {}
+ where (check p2s.umlPackage = p;
+ check prim.namespace = p;
+ check prim.name = 'String';) {}
new:middle p2n : StringToVarchar;
set p2n.name := prim.name + '2' + 'VARCHAR';
set p2n.owner := p2s;
@@ -105,12 +102,12 @@ map stringToVarchar_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map classToTable_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- enforce rdbms(s : Schema) {}
- check middle(p2s : PackageToSchema,
- c2t : ClassToTable) {}
- where (p2s.schema = s;
- c2t.owner = p2s;) {
- c2t_name : String[?] := c2t.name |}
+ enforce rdbms(in s : Schema;) {}
+ check middle(in p2s : PackageToSchema;
+ in c2t : ClassToTable;) {}
+ where (check p2s.schema = s;
+ check c2t.owner = p2s;) {
+ var c2t_name : String[?] := c2t.name;}
new:rdbms t : Table;
new:rdbms pk : Key;
new:rdbms pc : Column;
@@ -131,12 +128,12 @@ map classToTable_MR in simpleUML2RDBMS::SimpleUML2RDBMS
map classToTable_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package,
- c : Class) {}
- enforce middle(p2s : PackageToSchema) {}
- where (p2s.umlPackage = p;
- c.kind = 'persistent';
- c.namespace = p;) {}
+ check uml(in p : Package;
+ in c : Class;) {}
+ enforce middle(in p2s : PackageToSchema;) {}
+ where (check p2s.umlPackage = p;
+ check c.kind = 'persistent';
+ check c.namespace = p;) {}
new:middle c2t : ClassToTable;
set c2t.owner := p2s;
set c2t.name := c.name;
@@ -145,23 +142,23 @@ map classToTable_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map associationToForeignKey_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- enforce rdbms(s : Schema,
- st : Table,
- dt : Table,
- rk : Key) {}
- check middle(p2s : PackageToSchema,
- sc2t : ClassToTable,
- dc2t : ClassToTable,
- a2f : AssociationToForeignKey) {}
- where (dc2t.table = dt;
- sc2t.owner = p2s;
- p2s.schema = s;
- sc2t.table = st;
- a2f.referenced = dc2t;
- a2f.owner = sc2t;
- rk.kind = 'primary';
- rk.owner = dt;
- st.schema = s;) {}
+ enforce rdbms(in s : Schema;
+ in st : Table;
+ in dt : Table;
+ in rk : Key;) {}
+ check middle(in p2s : PackageToSchema;
+ in sc2t : ClassToTable;
+ in dc2t : ClassToTable;
+ in a2f : AssociationToForeignKey;) {}
+ where (check dc2t.table = dt;
+ check sc2t.owner = p2s;
+ check p2s.schema = s;
+ check sc2t.table = st;
+ check a2f.referenced = dc2t;
+ check a2f.owner = sc2t;
+ check rk.kind = 'primary';
+ check rk.owner = dt;
+ check st.schema = s;) {}
new:rdbms fk : ForeignKey;
new:rdbms fc : Column;
set fk.name := a2f.name;
@@ -177,23 +174,22 @@ map associationToForeignKey_MR in simpleUML2RDBMS::SimpleUML2RDBMS
map associationToForeignKey_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(p : Package,
- sc : Class,
- dc : Class,
- a : Association) {}
- enforce middle(p2s : PackageToSchema,
- sc2t : ClassToTable,
- dc2t : ClassToTable) {}
- where (sc2t.owner = p2s;
- dc2t.umlClass = dc;
- sc2t.umlClass = sc;
- p2s.umlPackage = p;
- a.namespace = p;
- sc.namespace = p;
- a.source = sc;
- a.destination = dc;) {
- a2f_name : String |
- a2f_name := if a.destination = dc and a.source = sc
+ check uml(in p : Package;
+ in sc : Class;
+ in dc : Class;
+ in a : Association;) {}
+ enforce middle(in p2s : PackageToSchema;
+ in sc2t : ClassToTable;
+ in dc2t : ClassToTable;) {}
+ where (check sc2t.owner = p2s;
+ check dc2t.umlClass = dc;
+ check sc2t.umlClass = sc;
+ check p2s.umlPackage = p;
+ check a.namespace = p;
+ check sc.namespace = p;
+ check a.source = sc;
+ check a.destination = dc;) {
+ var a2f_name : String := if a.destination = dc and a.source = sc
then a.name
else if a.destination <> dc and a.source = sc
then dc.name + '_' + a.name
@@ -217,15 +213,15 @@ map associationToForeignKey_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map classPrimitiveAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(t : PrimitiveDataType,
- c : Class,
- a : Attribute) {}
- enforce middle(fao : ClassToTable,
- p2n : PrimitiveToName) {}
- where (fao.umlClass = c;
- p2n._'primitive' = t;
- a.owner = c;
- a.type = t;) {}
+ check uml(in t : PrimitiveDataType;
+ in c : Class;
+ in a : Attribute;) {}
+ enforce middle(in fao : ClassToTable;
+ in p2n : PrimitiveToName;) {}
+ where (check fao.umlClass = c;
+ check p2n._'primitive' = t;
+ check a.owner = c;
+ check a.type = t;) {}
new:middle fa : AttributeToColumn;
set fa.owner := fao;
set fa.type := p2n;
@@ -240,13 +236,13 @@ map classPrimitiveAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map classComplexAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(t : Class,
- c : Class,
- a : Attribute) {}
- enforce middle(fao : ClassToTable) {}
- where (fao.umlClass = c;
- a.owner = c;
- a.type = t;) {}
+ check uml(in t : Class;
+ in c : Class;
+ in a : Attribute;) {}
+ enforce middle(in fao : ClassToTable;) {}
+ where (check fao.umlClass = c;
+ check a.owner = c;
+ check a.type = t;) {}
new:middle fa : NonLeafAttribute;
set fa._'attribute' := a;
set fa.kind := a.kind;
@@ -259,18 +255,18 @@ map classComplexAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map complexAttributePrimitiveAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(ca : Attribute,
- c : Class,
- t : PrimitiveDataType,
- a : Attribute) {}
- enforce middle(fao : NonLeafAttribute,
- p2n : PrimitiveToName) {}
- where (fao._'attribute' = ca;
- p2n._'primitive' = t;
- a.owner = c;
- a.type = t;
- ca.type = c;
- a.owner = c;) {}
+ check uml(in ca : Attribute;
+ in c : Class;
+ in t : PrimitiveDataType;
+ in a : Attribute;) {}
+ enforce middle(in fao : NonLeafAttribute;
+ in p2n : PrimitiveToName;) {}
+ where (check fao._'attribute' = ca;
+ check p2n._'primitive' = t;
+ check a.owner = c;
+ check a.type = t;
+ check ca.type = c;
+ check a.owner = c;) {}
new:middle fa : AttributeToColumn;
set fa.owner := fao;
set fa._'attribute' := a;
@@ -285,16 +281,16 @@ map complexAttributePrimitiveAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map complexAttributeComplexAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
{
- check uml(ca : Attribute,
- c : Class,
- t : Class,
- a : Attribute) {}
- enforce middle(fao : NonLeafAttribute) {}
- where (fao._'attribute' = ca;
- a.owner = c;
- a.owner = c;
- ca.type = c;
- a.type = t;) {}
+ check uml(in ca : Attribute;
+ in c : Class;
+ in t : Class;
+ in a : Attribute;) {}
+ enforce middle(in fao : NonLeafAttribute;) {}
+ where (check fao._'attribute' = ca;
+ check a.owner = c;
+ check a.owner = c;
+ check ca.type = c;
+ check a.type = t;) {}
new:middle fa : NonLeafAttribute;
set fa.owner := fao;
set fa.kind := a.kind;
@@ -308,16 +304,16 @@ map complexAttributeComplexAttributes_LM in simpleUML2RDBMS::SimpleUML2RDBMS
map attributeColumns_MR in simpleUML2RDBMS::SimpleUML2RDBMS
{
- enforce rdbms(t : Table,
- ct : String) {}
- check middle(c2t : ClassToTable,
- p2n : PrimitiveToName,
- a2c : AttributeToColumn) {}
- where (c2t.table = t;
- p2n.typeName = ct;
- a2c.owner = c2t;
- c2t.fromAttributes.leafs->includes(a2c);
- a2c.type = p2n;) {}
+ enforce rdbms(in t : Table;
+ in ct : String;) {}
+ check middle(in c2t : ClassToTable;
+ in p2n : PrimitiveToName;
+ in a2c : AttributeToColumn;) {}
+ where (check c2t.table = t;
+ check p2n.typeName = ct;
+ check a2c.owner = c2t;
+ check c2t.fromAttributes.leafs->includes(a2c);
+ check a2c.type = p2n;) {}
new:rdbms c : Column;
set c.name := a2c.name;
set c.kind := a2c.kind;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTree.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTree.qvti
index cea02a3d0..6452edbb1 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTree.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/Tree2TallTree/Tree2TallTree.qvti
@@ -28,20 +28,20 @@ map __root__ in Tree2TallTree {
}
map Node2MiddleNode in Tree2TallTree {
- check tree(node : Node) {}
+ check tree(in node : Node;) {}
new:tree2talltree node2tallNode : Node2TallNode;
set node2tallNode.node := node;
set node2tallNode.name := node.name;
}
map Edge2MiddleEdge in Tree2TallTree {
- check tree(node : Node) {}
+ check tree(in node : Node;) {}
enforce tree2talltree {
enforce Node2TallNode::parent
- } (node2tallNode : Node2TallNode) {
+ } (in node2tallNode : Node2TallNode;) {
-- realize node2tallNode : Node2TallNode
}
- where(node.parent <> null;) {}
+ where(check node.parent <> null;) {}
set node2tallNode.parent := node.parent.Node2TallNode;
-- node2tallNode.name := node.name;
}
@@ -50,19 +50,15 @@ map MiddleNode2TallNode in Tree2TallTree {
check tree2talltree {
check Node2TallNode::tallNode, Node2TallNode::children
enforce Node2TallNode::tallNode
- } (node2tallNode : Node2TallNode) {}
+ } (in node2tallNode : Node2TallNode;) {}
enforce talltree {
check TallNode::height
enforce TallNode::height
- } () {
- tallNode_name : String,
- tallNode_height : Integer,
- tallNode_children : Set(TallNode)
- }
+ } () {}
where () {
- tallNode_name := node2tallNode.name;
- tallNode_children := node2tallNode.children?.tallNode->asSet();
- tallNode_height := if node2tallNode.children->notEmpty() then node2tallNode.children.tallNode.height->max() + 1 else 0 endif;
+ var tallNode_name : String := node2tallNode.name;
+ var tallNode_children : Set(TallNode) := node2tallNode.children?.tallNode->asSet();
+ var tallNode_height : Integer := if node2tallNode.children->notEmpty() then node2tallNode.children.tallNode.height->max() + 1 else 0 endif;
}
new:talltree tallNode : TallNode;
set node2tallNode.tallNode := tallNode;
diff --git a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/test-gen/org/eclipse/qvtd/xtext/qvtrelation2/tests/forward2reverse/Forward2Reverse.java b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/test-gen/org/eclipse/qvtd/xtext/qvtrelation2/tests/forward2reverse/Forward2Reverse.java
index e3359242a..b6540e530 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/test-gen/org/eclipse/qvtd/xtext/qvtrelation2/tests/forward2reverse/Forward2Reverse.java
+++ b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/test-gen/org/eclipse/qvtd/xtext/qvtrelation2/tests/forward2reverse/Forward2Reverse.java
@@ -107,14 +107,14 @@ public class Forward2Reverse extends AbstractTransformer
*
* map __root__ in Forward2Reverse {
* where ( |)
- * {jm_Telement2element : Set(PForward2Reverse::Telement2element)[*|1] = Set{};
- * jm_Tlist2list : Set(PForward2Reverse::Tlist2list)[*|1] = Set{};
- * _'\u00ABDoublyLinkedList\u00BB' : Set(doublylinkedlist::DoublyLinkedList) = forward.objectsOfKind(doublylinkedlist::DoublyLinkedList)
+ * {_'\u00ABDoublyLinkedList\u00BB' : Set(doublylinkedlist::DoublyLinkedList) = forward.objectsOfKind(doublylinkedlist::DoublyLinkedList)
* ;
+ * ji_DoublyLinkedList : Set(doublylinkedlist::DoublyLinkedList)[*|1] = _'\u00ABDoublyLinkedList\u00BB';
* _'\u00ABElement\u00BB' : Set(doublylinkedlist::Element) = forward.objectsOfKind(doublylinkedlist::Element)
* ;
- * ji_DoublyLinkedList : Set(doublylinkedlist::DoublyLinkedList)[*|1] = _'\u00ABDoublyLinkedList\u00BB';
* ji_Element : Set(doublylinkedlist::Element)[*|1] = _'\u00ABElement\u00BB';
+ * jm_Telement2element : Set(PForward2Reverse::Telement2element)[*|1] = Set{};
+ * jm_Tlist2list : Set(PForward2Reverse::Tlist2list)[*|1] = Set{};
* |}
* }for loop0 : doublylinkedlist::DoublyLinkedList in ji_DoublyLinkedList {
* call _'m_TemptyList2emptyList_DoublyLinkedList.r0' {
@@ -160,8 +160,6 @@ public class Forward2Reverse extends AbstractTransformer
final /*@NonInvalid*/ org.eclipse.ocl.pivot.@org.eclipse.jdt.annotation.NonNull Class TYP_doublylinkedlist_c_c_Element_0 = idResolver.getClass(CLSSid_Element, null);
final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@org.eclipse.jdt.annotation.NonNull SetValue objectsOfKind_0 = ModelObjectsOfKindOperation.INSTANCE.evaluate(executor, SET_CLSSid_Element, models[1/*forward*/], TYP_doublylinkedlist_c_c_Element_0);
// connection variables
- final SetValue.@NonNull Accumulator jm_Telement2element_1 = createUnenforcedSetAccumulatorValue(SET_CLSSid_Telement2element);
- final SetValue.@NonNull Accumulator jm_Tlist2list_1 = createUnenforcedSetAccumulatorValue(SET_CLSSid_Tlist2list);
final SetValue.@NonNull Accumulator ji_DoublyLinkedList = createUnenforcedSetAccumulatorValue(SET_CLSSid_DoublyLinkedList);
for (org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull DoublyLinkedList iterator : ValueUtil.typedIterable(DoublyLinkedList.class, objectsOfKind)) {
ji_DoublyLinkedList.add(iterator);
@@ -170,6 +168,8 @@ public class Forward2Reverse extends AbstractTransformer
for (org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull Element iterator_0 : ValueUtil.typedIterable(Element.class, objectsOfKind_0)) {
ji_Element.add(iterator_0);
}
+ final SetValue.@NonNull Accumulator jm_Telement2element_1 = createUnenforcedSetAccumulatorValue(SET_CLSSid_Telement2element);
+ final SetValue.@NonNull Accumulator jm_Tlist2list_1 = createUnenforcedSetAccumulatorValue(SET_CLSSid_Tlist2list);
// mapping statements
for (org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull DoublyLinkedList loop0 : ValueUtil.typedIterable(DoublyLinkedList.class, ji_DoublyLinkedList)) {
MAP_m_TemptyList2emptyList_DoublyLinkedList_46r0(loop0);
@@ -263,8 +263,8 @@ public class Forward2Reverse extends AbstractTransformer
* |}
* middle (trace : PForward2Reverse::Telement2element[1];
* |)
- * {when_Telement2element : PForward2Reverse::Telement2element[1];
- * when_Tlist2list : PForward2Reverse::Tlist2list[1];
+ * {when_Tlist2list : PForward2Reverse::Tlist2list[1];
+ * when_Telement2element : PForward2Reverse::Telement2element[1];
* |}
* reverse ( |)
* { |}
@@ -349,8 +349,8 @@ public class Forward2Reverse extends AbstractTransformer
* when_Tlist2list := forwardList.Tlist2list;
* reverseList := when_Tlist2list.reverseList;
* }
- * }set reverseElement.list := reverseList;
- * set trace.reverseList := reverseList;
+ * }set trace.reverseList := reverseList;
+ * set reverseElement.list := reverseList;
*
*/
protected boolean MAP_m_Telement2element_Element_46p2(final /*@NonInvalid*/ org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.PForward2Reverse.@org.eclipse.jdt.annotation.NonNull Telement2element trace_0) {
@@ -370,8 +370,8 @@ public class Forward2Reverse extends AbstractTransformer
@SuppressWarnings("null")
final /*@Thrown*/ org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull DoublyLinkedList reverseList = Tlist2list.getReverseList();
// mapping statements
- reverseElement.setList(reverseList);
trace_0.setReverseList(reverseList);
+ reverseElement.setList(reverseList);
final /*@Thrown*/ java.lang.@org.eclipse.jdt.annotation.Nullable Boolean m_Telement2element_Element_p2 = ValueUtil.TRUE_VALUE;
raw_when_Tlist2list = m_Telement2element_Element_p2;
}
@@ -390,12 +390,12 @@ public class Forward2Reverse extends AbstractTransformer
* |)
* { |}
* middle ( |)
- * {trace : PForward2Reverse::Telement2element[1];
- * when_Telement2element : PForward2Reverse::Telement2element[1];
+ * {when_Telement2element : PForward2Reverse::Telement2element[1];
+ * trace : PForward2Reverse::Telement2element[1];
* |}
* reverse ( |)
- * {reverseElement : doublylinkedlist::Element[1];
- * reverseSource : doublylinkedlist::Element[1];
+ * {reverseSource : doublylinkedlist::Element[1];
+ * reverseElement : doublylinkedlist::Element[1];
* |}
* where ( |)
* { |
@@ -468,9 +468,9 @@ public class Forward2Reverse extends AbstractTransformer
* new@reverse reverseList : doublylinkedlist::DoublyLinkedList[1];
* set reverseList.name := listName;
* set trace.listName := listName;
- * set reverseList.headElement := null;
* set trace.forwardList := forwardList;
* set trace.reverseList := reverseList;
+ * set reverseList.headElement := null;
*
*/
protected boolean MAP_m_TemptyList2emptyList_DoublyLinkedList_46r0(final /*@NonInvalid*/ org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull DoublyLinkedList forwardList) {
@@ -492,9 +492,9 @@ public class Forward2Reverse extends AbstractTransformer
// mapping statements
reverseList.setName(name);
trace_3.setListName(name);
- reverseList.setHeadElement(null);
trace_3.setForwardList(forwardList);
trace_3.setReverseList(reverseList);
+ reverseList.setHeadElement(null);
final /*@Thrown*/ java.lang.@org.eclipse.jdt.annotation.Nullable Boolean m_TemptyList2emptyList_DoublyLinkedList_r0 = ValueUtil.TRUE_VALUE;
symbol_7 = m_TemptyList2emptyList_DoublyLinkedList_r0;
}
@@ -629,8 +629,8 @@ public class Forward2Reverse extends AbstractTransformer
* {when_Telement2element : PForward2Reverse::Telement2element[1];
* |}
* reverse ( |)
- * {reverseHead : doublylinkedlist::Element[1];
- * reverseList : doublylinkedlist::DoublyLinkedList[1];
+ * {reverseList : doublylinkedlist::DoublyLinkedList[1];
+ * reverseHead : doublylinkedlist::Element[1];
* |}
* where ( |)
* { |
@@ -639,8 +639,8 @@ public class Forward2Reverse extends AbstractTransformer
* when_Telement2element := forwardHead.Telement2element;
* reverseHead := when_Telement2element.reverseElement;
* }
- * }set reverseList.headElement := reverseHead;
- * set trace.reverseHead := reverseHead;
+ * }set trace.reverseHead := reverseHead;
+ * set reverseList.headElement := reverseHead;
*
*/
protected boolean MAP_m_Tlist2list_DoublyLinkedList_46p2(final /*@NonInvalid*/ org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.PForward2Reverse.@org.eclipse.jdt.annotation.NonNull Tlist2list trace_2) {
@@ -660,8 +660,8 @@ public class Forward2Reverse extends AbstractTransformer
@SuppressWarnings("null")
final /*@Thrown*/ org.eclipse.qvtd.xtext.qvtrelation.tests.forward2reverse.doublylinkedlist.@org.eclipse.jdt.annotation.NonNull Element reverseElement = Telement2element.getReverseElement();
// mapping statements
- reverseList.setHeadElement(reverseElement);
trace_2.setReverseHead(reverseElement);
+ reverseList.setHeadElement(reverseElement);
final /*@Thrown*/ java.lang.@org.eclipse.jdt.annotation.Nullable Boolean m_Tlist2list_DoublyLinkedList_p2 = ValueUtil.TRUE_VALUE;
raw_when_Telement2element = m_Tlist2list_DoublyLinkedList_p2;
}

Back to the top