Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2TargetLookup.ocl16
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/lookup/util/TargetLookupSolver.java9
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedBLookupVisitor.java (renamed from tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedLookupVisitor.java)33
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedCLookupVisitor.java63
4 files changed, 86 insertions, 35 deletions
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2TargetLookup.ocl b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2TargetLookup.ocl
index 874fee4c4..e0850a4da 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2TargetLookup.ocl
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2TargetLookup.ocl
@@ -36,6 +36,13 @@ def : parentEnv_B() : lookup::LookupEnvironment[1] =
let parent = oclContainer() in if parent = null then lookup::LookupEnvironment { } else parent._unqualified_env_B(self) endif
def : parentEnv_C() : lookup::LookupEnvironment[1] =
let parent = oclContainer() in if parent = null then lookup::LookupEnvironment { } else parent._unqualified_env_C(self) endif
+
+def : _qualified_env_B(child : OclElement) : lookup::LookupEnvironment[1] =
+ lookup::LookupEnvironment {}
+
+def : _qualified_env_C(child : OclElement) : lookup::LookupEnvironment[1] =
+ lookup::LookupEnvironment {}
+
-- End of domain specific default functionality
endpackage
@@ -62,16 +69,15 @@ def : _unqualified_env_A2(child : ocl::OclElement) : lookup::LookupEnvironment =
context A1
def : _lookupQualifiedB(bName : String) : B[?] =
- let foundB = _lookupB(_qualified_env(), bName)
+ let foundB = _lookupB(_qualified_env_B(), bName)
in if foundB->isEmpty()
then null
else foundB->first()
endif
def : lookupQualifiedB(aPathElementCS : _source::PathElementCS) : B[?] =
_lookupQualifiedB(aPathElementCS.name)
-
-def : _qualified_env() : lookup::LookupEnvironment =
+def : _qualified_env_B() : lookup::LookupEnvironment =
let env = lookup::LookupEnvironment{}
in env
.addElements(ownsB)
@@ -86,7 +92,7 @@ def : _unqualified_env_B(child : ocl::OclElement) : lookup::LookupEnvironment =
context A2
def : _lookupQualifiedC(cName : String) : C[?] =
- let foundC = _lookupC(_qualified_env(), cName)
+ let foundC = _lookupC(_qualified_env_C(), cName)
in if foundC->isEmpty()
then null
else foundC->first()
@@ -95,7 +101,7 @@ def : lookupQualifiedC(aPathElementCS : _source::PathElementCS) : C[?] =
_lookupQualifiedC(aPathElementCS.name)
-def : _qualified_env() : lookup::LookupEnvironment =
+def : _qualified_env_C() : lookup::LookupEnvironment =
let env = lookup::LookupEnvironment{}
in env
.addElements(ownsC)
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/lookup/util/TargetLookupSolver.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/lookup/util/TargetLookupSolver.java
index 28ff75100..84407693f 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/lookup/util/TargetLookupSolver.java
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/lookup/util/TargetLookupSolver.java
@@ -13,12 +13,13 @@ package example1.target.lookup.util;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.ocl.pivot.evaluation.Executor;
-
-import example1.target.util.TargetQualifiedLookupVisitor;
import example1.target.util.TargetUnqualifiedA1LookupVisitor;
import example1.target.util.TargetUnqualifiedA2LookupVisitor;
import example1.target.util.TargetUnqualifiedBLookupVisitor;
import example1.target.util.TargetUnqualifiedCLookupVisitor;
+import example1.target.util.TargetQualifiedBLookupVisitor;
+import example1.target.util.TargetQualifiedCLookupVisitor;
+
public class TargetLookupSolver {
@@ -31,7 +32,7 @@ public class TargetLookupSolver {
public TargetLookupResult<example1.target.B> _lookupQualifiedB(example1.target.A1 context, java.lang.String bName) {
TargetSingleResultLookupEnvironment _lookupEnv = new TargetSingleResultLookupEnvironment(executor, example1.target.TargetPackage.Literals.B,bName);
- TargetQualifiedLookupVisitor _lookupVisitor = new TargetQualifiedLookupVisitor(_lookupEnv);
+ TargetQualifiedBLookupVisitor _lookupVisitor = new TargetQualifiedBLookupVisitor(_lookupEnv);
context.accept(_lookupVisitor);
return new TargetLookupResultImpl<example1.target.B>
(_lookupEnv.getNamedElementsByKind(example1.target.B.class));
@@ -39,7 +40,7 @@ public class TargetLookupSolver {
public TargetLookupResult<example1.target.C> _lookupQualifiedC(example1.target.A2 context, java.lang.String cName) {
TargetSingleResultLookupEnvironment _lookupEnv = new TargetSingleResultLookupEnvironment(executor, example1.target.TargetPackage.Literals.C,cName);
- TargetQualifiedLookupVisitor _lookupVisitor = new TargetQualifiedLookupVisitor(_lookupEnv);
+ TargetQualifiedCLookupVisitor _lookupVisitor = new TargetQualifiedCLookupVisitor(_lookupEnv);
context.accept(_lookupVisitor);
return new TargetLookupResultImpl<example1.target.C>
(_lookupEnv.getNamedElementsByKind(example1.target.C.class));
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedLookupVisitor.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedBLookupVisitor.java
index 5a43ca9f0..bca434532 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedLookupVisitor.java
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedBLookupVisitor.java
@@ -9,19 +9,17 @@
package example1.target.util;
-import example1.target.B;
-import example1.target.C;
-import example1.target.TargetPackage;
-import example1.target.lookup.EnvironmentPackage;
-import example1.target.lookup.LookupEnvironment;
-import example1.target.util.AbstractTargetCommonLookupVisitor;
-import example1.target.util.Visitable;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.ids.IdManager;
import org.eclipse.ocl.pivot.ids.TypeId;
-public class TargetQualifiedLookupVisitor
+import example1.target.B;
+import example1.target.TargetPackage;
+import example1.target.lookup.EnvironmentPackage;
+import example1.target.lookup.LookupEnvironment;
+
+public class TargetQualifiedBLookupVisitor
extends AbstractTargetCommonLookupVisitor
{
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull NsURIPackageId PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_env_s_1_0 = IdManager.getNsURIPackageId("http://cs2as/tests/example1/env/1.0", null, EnvironmentPackage.eINSTANCE);
@@ -29,19 +27,16 @@ public class TargetQualifiedLookupVisitor
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull RootPackageId PACKid_org_eclipse_ocl_pivot_evaluation = IdManager.getRootPackageId("org.eclipse.ocl.pivot.evaluation");
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull RootPackageId PACKid_org_eclipse_ocl_pivot_ids = IdManager.getRootPackageId("org.eclipse.ocl.pivot.ids");
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_A1 = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("A1", 0);
- public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_A2 = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("A2", 0);
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_B = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("B", 0);
- public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_C = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("C", 0);
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Executor = PACKid_org_eclipse_ocl_pivot_evaluation.getClassId("Executor", 0);
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_IdResolver = PACKid_org_eclipse_ocl_pivot_ids.getClassId("IdResolver", 0);
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_LookupEnvironment = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_env_s_1_0.getClassId("LookupEnvironment", 0);
public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId ORD_CLSSid_B = TypeId.ORDERED_SET.getSpecializedId(CLSSid_B);
- public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId ORD_CLSSid_C = TypeId.ORDERED_SET.getSpecializedId(CLSSid_C);
protected final /*@Thrown*/ org.eclipse.ocl.pivot.evaluation.@org.eclipse.jdt.annotation.NonNull Executor executor;
protected final /*@Thrown*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull IdResolver idResolver;
- public TargetQualifiedLookupVisitor(@NonNull LookupEnvironment context) {
+ public TargetQualifiedBLookupVisitor(@NonNull LookupEnvironment context) {
super(context);
this.executor = context.getExecutor();
this.idResolver = executor.getIdResolver();
@@ -65,18 +60,4 @@ public class TargetQualifiedLookupVisitor
final /*@Thrown*/ example1.target.lookup.@org.eclipse.jdt.annotation.NonNull LookupEnvironment addElements = context.addElements(ownsB);
return addElements;
}
-
- /**
- * visitA2(element : target::A2[1]) : lookup::LookupEnvironment[?]
- *
- * _'null' : lookup::LookupEnvironment[1]
- */
- @Override
- public /*@NonInvalid*/ LookupEnvironment visitA2(final /*@NonInvalid*/ example1.target.@org.eclipse.jdt.annotation.NonNull A2 element_0) {
- @SuppressWarnings("null")
- final /*@Thrown*/ java.util.@org.eclipse.jdt.annotation.NonNull List<C> ownsC = element_0.getOwnsC();
- @SuppressWarnings("null")
- final /*@Thrown*/ example1.target.lookup.@org.eclipse.jdt.annotation.NonNull LookupEnvironment addElements = context.addElements(ownsC);
- return addElements;
- }
}
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedCLookupVisitor.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedCLookupVisitor.java
new file mode 100644
index 000000000..c09fd5ac4
--- /dev/null
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/example1/target/util/TargetQualifiedCLookupVisitor.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * «codeGenHelper.getCopyright(' * ')»
+ *
+ * This code is 100% auto-generated
+ * using: org.eclipse.ocl.examples.autogen.lookup.LookupQualifiedCodeGenerator
+ *
+ * Do not edit it.
+ ********************************************************************************/
+
+package example1.target.util;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.ids.IdManager;
+import org.eclipse.ocl.pivot.ids.TypeId;
+
+import example1.target.C;
+import example1.target.TargetPackage;
+import example1.target.lookup.EnvironmentPackage;
+import example1.target.lookup.LookupEnvironment;
+
+public class TargetQualifiedCLookupVisitor
+ extends AbstractTargetCommonLookupVisitor
+{
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull NsURIPackageId PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_env_s_1_0 = IdManager.getNsURIPackageId("http://cs2as/tests/example1/env/1.0", null, EnvironmentPackage.eINSTANCE);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull NsURIPackageId PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0 = IdManager.getNsURIPackageId("http://cs2as/tests/example1/targetMM/1.0", null, TargetPackage.eINSTANCE);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull RootPackageId PACKid_org_eclipse_ocl_pivot_evaluation = IdManager.getRootPackageId("org.eclipse.ocl.pivot.evaluation");
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull RootPackageId PACKid_org_eclipse_ocl_pivot_ids = IdManager.getRootPackageId("org.eclipse.ocl.pivot.ids");
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_A2 = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("A2", 0);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_C = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_targetMM_s_1_0.getClassId("C", 0);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_Executor = PACKid_org_eclipse_ocl_pivot_evaluation.getClassId("Executor", 0);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_IdResolver = PACKid_org_eclipse_ocl_pivot_ids.getClassId("IdResolver", 0);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull ClassId CLSSid_LookupEnvironment = PACKid_http_c_s_s_cs2as_s_tests_s_example1_s_env_s_1_0.getClassId("LookupEnvironment", 0);
+ public static final /*@NonInvalid*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull CollectionTypeId ORD_CLSSid_C = TypeId.ORDERED_SET.getSpecializedId(CLSSid_C);
+
+ protected final /*@Thrown*/ org.eclipse.ocl.pivot.evaluation.@org.eclipse.jdt.annotation.NonNull Executor executor;
+ protected final /*@Thrown*/ org.eclipse.ocl.pivot.ids.@org.eclipse.jdt.annotation.NonNull IdResolver idResolver;
+
+ public TargetQualifiedCLookupVisitor(@NonNull LookupEnvironment context) {
+ super(context);
+ this.executor = context.getExecutor();
+ this.idResolver = executor.getIdResolver();
+ }
+
+ @Override
+ protected @Nullable LookupEnvironment doVisiting(@NonNull Visitable visitable) {
+ return context;
+ }
+
+ /**
+ * visitA2(element : target::A2[1]) : lookup::LookupEnvironment[?]
+ *
+ * _'null' : lookup::LookupEnvironment[1]
+ */
+ @Override
+ public /*@NonInvalid*/ LookupEnvironment visitA2(final /*@NonInvalid*/ example1.target.@org.eclipse.jdt.annotation.NonNull A2 element) {
+ @SuppressWarnings("null")
+ final /*@Thrown*/ java.util.@org.eclipse.jdt.annotation.NonNull List<C> ownsC = element.getOwnsC();
+ @SuppressWarnings("null")
+ final /*@Thrown*/ example1.target.lookup.@org.eclipse.jdt.annotation.NonNull LookupEnvironment addElements = context.addElements(ownsC);
+ return addElements;
+ }
+}

Back to the top