Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo SBH2016-03-18 17:01:44 +0000
committerEd Willink2016-03-23 17:57:07 +0000
commitb80f820f9284739aefb2f0b7e78916a6e79e3ed8 (patch)
treebfb2683807acbe7ff9bc96bc0722deda1a2de6b9
parent6ac7e841573c7c2c44346839f42e638c42304fdb (diff)
downloadorg.eclipse.qvtd-b80f820f9284739aefb2f0b7e78916a6e79e3ed8.tar.gz
org.eclipse.qvtd-b80f820f9284739aefb2f0b7e78916a6e79e3ed8.tar.xz
org.eclipse.qvtd-b80f820f9284739aefb2f0b7e78916a6e79e3ed8.zip
[cs2as] - Partitioned qualified named elements lookup
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2asV2Lookup.ocl38
1 files changed, 21 insertions, 17 deletions
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2asV2Lookup.ocl b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2asV2Lookup.ocl
index f6453e3e0..fd2fc3590 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2asV2Lookup.ocl
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2asV2Lookup.ocl
@@ -4,7 +4,7 @@ import 'EnvExample2.ecore'
import 'classescs2asV2Helpers.ocl'
package ocl
----- Default Environment related functionality
+
context OclElement
-- Domain specific default functionality
def : unqualified_env_Class() : lookup::LookupEnvironment[1] =
@@ -67,30 +67,32 @@ def : _unqualified_env_Package(child : ocl::OclElement) : lookup::LookupEnvironm
context Package
def : _lookupQualifiedPackage(pName : String) : Package[?] =
- let foundPackage = _lookupPackage(_qualified_env(), pName)
+ let foundPackage = _lookupPackage(_qualified_env_Package(), pName)
in if foundPackage->isEmpty()
then null
else foundPackage->first()
endif
+def : _qualified_env_Package() : lookup::LookupEnvironment =
+ let env = lookup::LookupEnvironment{}
+ in env
+ .addElements(ownedPackages)
def : lookupQualifiedPackage(aPathElementCS : cs::PathElementCS) : Package[?] =
_lookupQualifiedPackage(aPathElementCS.name)
def : _lookupQualifiedClass(cName : String) : Class[?] =
- let foundClass = _lookupClass(_qualified_env(), cName)
+ let foundClass = _lookupClass(_qualified_env_Class(), cName)
in if foundClass->isEmpty()
then null
else foundClass->first()
endif
+def : _qualified_env_Class() : lookup::LookupEnvironment =
+ let env = lookup::LookupEnvironment{}
+ in env
+ .addElements(ownedClasses)
def : lookupQualifiedClass(aPathElementCS : cs::PathElementCS) : Class[?] =
_lookupQualifiedClass(aPathElementCS.name)
-
-def : _qualified_env() : lookup::LookupEnvironment =
- let env = lookup::LookupEnvironment{}
- in env
- .addElements(ownedPackages)
-.addElements(ownedClasses)
def : _unqualified_env_Package(child : ocl::OclElement) : lookup::LookupEnvironment =
parentEnv_Package().nestedEnv()
.addElements(ownedPackages)
@@ -103,30 +105,32 @@ def : _unqualified_env_Class(child : ocl::OclElement) : lookup::LookupEnvironmen
context Class
def : _lookupQualifiedOperation(oName : String, args : OrderedSet(Argument)) : Operation[?] =
- let foundOperation = _lookupOperation(_qualified_env(), oName, args)
+ let foundOperation = _lookupOperation(_qualified_env_Operation(), oName, args)
in if foundOperation->isEmpty()
then null
else foundOperation->first()
endif
+def : _qualified_env_Operation() : lookup::LookupEnvironment =
+ let env = lookup::LookupEnvironment{}
+ in env
+ .addElements(ownedOperations)
def : lookupQualifiedOperation(aPathElementCS : cs::PathElementCS, args : OrderedSet(Argument)) : Operation[?] =
_lookupQualifiedOperation(aPathElementCS.name, args)
def : _lookupQualifiedProperty(pName : String) : Property[?] =
- let foundProperty = _lookupProperty(_qualified_env(), pName)
+ let foundProperty = _lookupProperty(_qualified_env_Property(), pName)
in if foundProperty->isEmpty()
then null
else foundProperty->first()
endif
+def : _qualified_env_Property() : lookup::LookupEnvironment =
+ let env = lookup::LookupEnvironment{}
+ in env
+ .addElements(ownedProperties)
def : lookupQualifiedProperty(aPathElementCS : cs::PathElementCS) : Property[?] =
_lookupQualifiedProperty(aPathElementCS.name)
-
-def : _qualified_env() : lookup::LookupEnvironment =
- let env = lookup::LookupEnvironment{}
- in env
- .addElements(ownedOperations)
-.addElements(ownedProperties)
def : _unqualified_env_Operation(child : ocl::OclElement) : lookup::LookupEnvironment =
parentEnv_Operation().nestedEnv()
.addElements(self->closure(superClass).ownedOperations)

Back to the top