diff options
author | 2021-10-19 03:36:26 +0200 | |
---|---|---|
committer | 2021-10-19 03:36:26 +0200 | |
commit | 663274763e56b228efe07363b8ede4ce7bebc251 (patch) | |
tree | da6f8e0404cc03152cad84d8b9dfc8c63f7a6dbf /language-to-store | |
parent | nodeIter moved from private field inside the method (diff) | |
download | refinery-663274763e56b228efe07363b8ede4ce7bebc251.tar.gz refinery-663274763e56b228efe07363b8ede4ce7bebc251.tar.zst refinery-663274763e56b228efe07363b8ede4ce7bebc251.zip |
chore: remove builtin library xtext dependency
Diffstat (limited to 'language-to-store')
3 files changed, 2 insertions, 115 deletions
diff --git a/language-to-store/src/main/java/tools/refinery/language/mapping/PartialModelMapper.java b/language-to-store/src/main/java/tools/refinery/language/mapping/PartialModelMapper.java index 2ace27f4..d37c9ec7 100644 --- a/language-to-store/src/main/java/tools/refinery/language/mapping/PartialModelMapper.java +++ b/language-to-store/src/main/java/tools/refinery/language/mapping/PartialModelMapper.java | |||
@@ -7,7 +7,7 @@ import java.util.Optional; | |||
7 | 7 | ||
8 | import org.eclipse.emf.common.util.EList; | 8 | import org.eclipse.emf.common.util.EList; |
9 | 9 | ||
10 | import tools.refinery.language.ProblemUtil; | 10 | import tools.refinery.language.model.ProblemUtil; |
11 | import tools.refinery.language.model.problem.Assertion; | 11 | import tools.refinery.language.model.problem.Assertion; |
12 | import tools.refinery.language.model.problem.AssertionArgument; | 12 | import tools.refinery.language.model.problem.AssertionArgument; |
13 | import tools.refinery.language.model.problem.ClassDeclaration; | 13 | import tools.refinery.language.model.problem.ClassDeclaration; |
diff --git a/language-to-store/src/test/java/tools/refinery/language/mapping/tests/PartialModelMapperTest.xtend b/language-to-store/src/test/java/tools/refinery/language/mapping/tests/PartialModelMapperTest.xtend index 86dd47ae..dcdea332 100644 --- a/language-to-store/src/test/java/tools/refinery/language/mapping/tests/PartialModelMapperTest.xtend +++ b/language-to-store/src/test/java/tools/refinery/language/mapping/tests/PartialModelMapperTest.xtend | |||
@@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test | |||
10 | import org.junit.jupiter.api.^extension.ExtendWith | 10 | import org.junit.jupiter.api.^extension.ExtendWith |
11 | import tools.refinery.language.mapping.PartialModelMapper | 11 | import tools.refinery.language.mapping.PartialModelMapper |
12 | import tools.refinery.language.model.problem.Problem | 12 | import tools.refinery.language.model.problem.Problem |
13 | import tools.refinery.language.model.tests.ProblemTestUtil | ||
13 | import tools.refinery.language.tests.ProblemInjectorProvider | 14 | import tools.refinery.language.tests.ProblemInjectorProvider |
14 | import tools.refinery.store.model.Tuple | 15 | import tools.refinery.store.model.Tuple |
15 | import tools.refinery.store.model.representation.TruthValue | 16 | import tools.refinery.store.model.representation.TruthValue |
diff --git a/language-to-store/src/test/java/tools/refinery/language/mapping/tests/ProblemTestUtil.xtend b/language-to-store/src/test/java/tools/refinery/language/mapping/tests/ProblemTestUtil.xtend deleted file mode 100644 index b3b8145e..00000000 --- a/language-to-store/src/test/java/tools/refinery/language/mapping/tests/ProblemTestUtil.xtend +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | package tools.refinery.language.mapping.tests | ||
2 | |||
3 | import tools.refinery.language.ProblemUtil | ||
4 | import tools.refinery.language.model.problem.Argument | ||
5 | import tools.refinery.language.model.problem.Assertion | ||
6 | import tools.refinery.language.model.problem.AssertionArgument | ||
7 | import tools.refinery.language.model.problem.Atom | ||
8 | import tools.refinery.language.model.problem.ClassDeclaration | ||
9 | import tools.refinery.language.model.problem.Conjunction | ||
10 | import tools.refinery.language.model.problem.EnumDeclaration | ||
11 | import tools.refinery.language.model.problem.Literal | ||
12 | import tools.refinery.language.model.problem.NegativeLiteral | ||
13 | import tools.refinery.language.model.problem.Node | ||
14 | import tools.refinery.language.model.problem.NodeAssertionArgument | ||
15 | import tools.refinery.language.model.problem.NodeValueAssertion | ||
16 | import tools.refinery.language.model.problem.PredicateDefinition | ||
17 | import tools.refinery.language.model.problem.Problem | ||
18 | import tools.refinery.language.model.problem.UniqueDeclaration | ||
19 | import tools.refinery.language.model.problem.Variable | ||
20 | import tools.refinery.language.model.problem.VariableOrNodeArgument | ||
21 | |||
22 | class ProblemTestUtil { | ||
23 | def builtin(Problem it) { | ||
24 | ProblemUtil.getBuiltInLibrary(it).get | ||
25 | } | ||
26 | |||
27 | def errors(Problem it) { | ||
28 | eResource.errors | ||
29 | } | ||
30 | |||
31 | def nodeNames(Problem it) { | ||
32 | nodes.map[name] | ||
33 | } | ||
34 | |||
35 | def pred(Problem it, String name) { | ||
36 | statements.filter(PredicateDefinition).findFirst[it.name == name] | ||
37 | } | ||
38 | |||
39 | def param(PredicateDefinition it, int i) { | ||
40 | parameters.get(i) | ||
41 | } | ||
42 | |||
43 | def conj(PredicateDefinition it, int i) { | ||
44 | bodies.get(i) | ||
45 | } | ||
46 | |||
47 | def lit(Conjunction it, int i) { | ||
48 | literals.get(i) | ||
49 | } | ||
50 | |||
51 | def negated(Literal it) { | ||
52 | (it as NegativeLiteral).atom | ||
53 | } | ||
54 | |||
55 | def relation(Literal it) { | ||
56 | (it as Atom).relation | ||
57 | } | ||
58 | |||
59 | def arg(Atom it, int i) { | ||
60 | it.arguments.get(i) | ||
61 | } | ||
62 | |||
63 | def arg(Literal it, int i) { | ||
64 | (it as Atom).arg(i) | ||
65 | } | ||
66 | |||
67 | def variable(Argument it) { | ||
68 | (it as VariableOrNodeArgument).variableOrNode as Variable | ||
69 | } | ||
70 | |||
71 | def node(Argument it) { | ||
72 | (it as VariableOrNodeArgument).variableOrNode as Node | ||
73 | } | ||
74 | |||
75 | def assertion(Problem it, int i) { | ||
76 | statements.filter(Assertion).get(i) | ||
77 | } | ||
78 | |||
79 | def nodeValueAssertion(Problem it, int i) { | ||
80 | statements.filter(NodeValueAssertion).get(i) | ||
81 | } | ||
82 | |||
83 | def arg(Assertion it, int i) { | ||
84 | arguments.get(i) | ||
85 | } | ||
86 | |||
87 | def node(AssertionArgument it) { | ||
88 | (it as NodeAssertionArgument).node | ||
89 | } | ||
90 | |||
91 | def node(Problem it, String name) { | ||
92 | nodes.findFirst[it.name == name] | ||
93 | } | ||
94 | |||
95 | def uniqueNode(Problem it, String name) { | ||
96 | statements.filter(UniqueDeclaration).flatMap[nodes].findFirst[it.name == name] | ||
97 | } | ||
98 | |||
99 | def findClass(Problem it, String name) { | ||
100 | statements.filter(ClassDeclaration).findFirst[it.name == name] | ||
101 | } | ||
102 | |||
103 | def reference(ClassDeclaration it, String name) { | ||
104 | it.referenceDeclarations.findFirst[it.name == name] | ||
105 | } | ||
106 | |||
107 | def findEnum(Problem it, String name) { | ||
108 | statements.filter(EnumDeclaration).findFirst[it.name == name] | ||
109 | } | ||
110 | |||
111 | def literal(EnumDeclaration it, String name) { | ||
112 | literals.findFirst[it.name == name] | ||
113 | } | ||
114 | } | ||