diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2021-06-28 02:45:33 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 2021-06-28 02:47:34 +0200 |
commit | b7db563dc425dbf90e42b1c69fb4d52c41a18503 (patch) | |
tree | 99bf06a66e6d63b9afda017f6f23266cac46def2 /language | |
parent | Add data constant support (diff) | |
download | refinery-b7db563dc425dbf90e42b1c69fb4d52c41a18503.tar.gz refinery-b7db563dc425dbf90e42b1c69fb4d52c41a18503.tar.zst refinery-b7db563dc425dbf90e42b1c69fb4d52c41a18503.zip |
Add scoping tests and simplify implicit nodes
* Do not export implicit nodes to the global scope
* Enum literals must not be quoted
* Plan for the future: unify quoted nodes from the global scope in
post-processing
Diffstat (limited to 'language')
18 files changed, 704 insertions, 681 deletions
diff --git a/language/build.gradle b/language/build.gradle index 855b0a7f..cbdf3c6a 100644 --- a/language/build.gradle +++ b/language/build.gradle | |||
@@ -3,6 +3,7 @@ dependencies { | |||
3 | testRuntime 'org.junit.jupiter:junit-jupiter-engine' | 3 | testRuntime 'org.junit.jupiter:junit-jupiter-engine' |
4 | testCompile "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}" | 4 | testCompile "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}" |
5 | testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}" | 5 | testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}" |
6 | testCompile "org.hamcrest:hamcrest:${hamcrestVersion}" | ||
6 | compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}" | 7 | compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}" |
7 | compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}" | 8 | compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}" |
8 | compile 'org.eclipse.emf:org.eclipse.emf.ecore' | 9 | compile 'org.eclipse.emf:org.eclipse.emf.ecore' |
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 b/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 index a63681c8..da5e95a4 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 +++ b/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 | |||
@@ -43,9 +43,7 @@ Workflow { | |||
43 | validator = { | 43 | validator = { |
44 | generateDeprecationValidation = true | 44 | generateDeprecationValidation = true |
45 | } | 45 | } |
46 | generator = { | 46 | generator = null |
47 | generateXtendStub = true | ||
48 | } | ||
49 | junitSupport = { | 47 | junitSupport = { |
50 | junitVersion = "5" | 48 | junitVersion = "5" |
51 | } | 49 | } |
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext index 7e253ef5..495f50e4 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext +++ b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext | |||
@@ -22,7 +22,7 @@ EnumDeclaration: | |||
22 | ("{" (literals+=EnumLiteral ("," literals+=EnumLiteral)* ("," | ";")?)? "}" | "."); | 22 | ("{" (literals+=EnumLiteral ("," literals+=EnumLiteral)* ("," | ";")?)? "}" | "."); |
23 | 23 | ||
24 | EnumLiteral returns Node: | 24 | EnumLiteral returns Node: |
25 | name=QuotedOrUnquotedId; | 25 | name=Identifier; |
26 | 26 | ||
27 | ReferenceDeclaration: | 27 | ReferenceDeclaration: |
28 | (containment?="contains" | "refers")? | 28 | (containment?="contains" | "refers")? |
@@ -129,11 +129,8 @@ ExactMultiplicity: | |||
129 | UpperBound returns ecore::EInt: | 129 | UpperBound returns ecore::EInt: |
130 | INT | "*"; | 130 | INT | "*"; |
131 | 131 | ||
132 | QuotedOrUnquotedId: | ||
133 | QUOTED_ID | Identifier; | ||
134 | |||
135 | QualifiedName hidden(): | 132 | QualifiedName hidden(): |
136 | QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; | 133 | QUOTED_ID | Identifier ("::" Identifier)*; |
137 | 134 | ||
138 | Identifier: | 135 | Identifier: |
139 | ID | "true" | "false" | "e" | "E"; | 136 | ID | "true" | "false" | "e" | "E"; |
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.java b/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.java new file mode 100644 index 00000000..b6ea3553 --- /dev/null +++ b/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.java | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.26.0.M1 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.generator; | ||
5 | |||
6 | import org.eclipse.emf.ecore.resource.Resource; | ||
7 | import org.eclipse.xtext.generator.AbstractGenerator; | ||
8 | import org.eclipse.xtext.generator.IFileSystemAccess2; | ||
9 | import org.eclipse.xtext.generator.IGeneratorContext; | ||
10 | |||
11 | /** | ||
12 | * Generates code from your model files on save. | ||
13 | * | ||
14 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation | ||
15 | */ | ||
16 | public class ProblemGenerator extends AbstractGenerator { | ||
17 | |||
18 | @Override | ||
19 | public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { | ||
20 | // Iterator<Greeting> filtered = Iterators.filter(resource.getAllContents(), Greeting.class); | ||
21 | // Iterator<String> names = Iterators.transform(filtered, new Function<Greeting, String>() { | ||
22 | // | ||
23 | // @Override | ||
24 | // public String apply(Greeting greeting) { | ||
25 | // return greeting.getName(); | ||
26 | // } | ||
27 | // }); | ||
28 | // fsa.generateFile("greetings.txt", "People to greet: " + IteratorExtensions.join(names, ", ")); | ||
29 | } | ||
30 | } | ||
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend b/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend deleted file mode 100644 index 0930f244..00000000 --- a/language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.25.0 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.generator | ||
5 | |||
6 | import org.eclipse.emf.ecore.resource.Resource | ||
7 | import org.eclipse.xtext.generator.AbstractGenerator | ||
8 | import org.eclipse.xtext.generator.IFileSystemAccess2 | ||
9 | import org.eclipse.xtext.generator.IGeneratorContext | ||
10 | |||
11 | /** | ||
12 | * Generates code from your model files on save. | ||
13 | * | ||
14 | * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation | ||
15 | */ | ||
16 | class ProblemGenerator extends AbstractGenerator { | ||
17 | |||
18 | override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { | ||
19 | // fsa.generateFile('greetings.txt', 'People to greet: ' + | ||
20 | // resource.allContents | ||
21 | // .filter(Greeting) | ||
22 | // .map[name] | ||
23 | // .join(', ')) | ||
24 | } | ||
25 | } | ||
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java b/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java index fc03fa87..56d8ad71 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java +++ b/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java | |||
@@ -73,13 +73,14 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
73 | 73 | ||
74 | protected void installDerivedProblemState(Problem problem, boolean preLinkingPhase) { | 74 | protected void installDerivedProblemState(Problem problem, boolean preLinkingPhase) { |
75 | installNewNodes(problem); | 75 | installNewNodes(problem); |
76 | if (!preLinkingPhase) { | 76 | if (preLinkingPhase) { |
77 | installDerivedNodes(problem); | 77 | return; |
78 | for (Statement statement : problem.getStatements()) { | 78 | } |
79 | if (statement instanceof PredicateDefinition) { | 79 | Set<String> nodeNames = installDerivedNodes(problem); |
80 | PredicateDefinition definition = (PredicateDefinition) statement; | 80 | for (Statement statement : problem.getStatements()) { |
81 | installDerivedPredicateDefinitionState(definition); | 81 | if (statement instanceof PredicateDefinition) { |
82 | } | 82 | PredicateDefinition definition = (PredicateDefinition) statement; |
83 | installDerivedPredicateDefinitionState(definition, nodeNames); | ||
83 | } | 84 | } |
84 | } | 85 | } |
85 | } | 86 | } |
@@ -88,7 +89,7 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
88 | for (Statement statement : problem.getStatements()) { | 89 | for (Statement statement : problem.getStatements()) { |
89 | if (statement instanceof ClassDeclaration) { | 90 | if (statement instanceof ClassDeclaration) { |
90 | ClassDeclaration declaration = (ClassDeclaration) statement; | 91 | ClassDeclaration declaration = (ClassDeclaration) statement; |
91 | if (!declaration.isAbstract()) { | 92 | if (!declaration.isAbstract() && declaration.getNewNode() == null) { |
92 | Node newNode = createNode(NEW_NODE); | 93 | Node newNode = createNode(NEW_NODE); |
93 | declaration.setNewNode(newNode); | 94 | declaration.setNewNode(newNode); |
94 | } | 95 | } |
@@ -96,7 +97,7 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
96 | } | 97 | } |
97 | } | 98 | } |
98 | 99 | ||
99 | protected void installDerivedNodes(Problem problem) { | 100 | protected Set<String> installDerivedNodes(Problem problem) { |
100 | IScope nodeScope = scopeProvider.getScope(problem, ProblemPackage.Literals.ASSERTION__ARGUMENTS); | 101 | IScope nodeScope = scopeProvider.getScope(problem, ProblemPackage.Literals.ASSERTION__ARGUMENTS); |
101 | Set<String> nodeNames = new HashSet<>(); | 102 | Set<String> nodeNames = new HashSet<>(); |
102 | for (Statement statement : problem.getStatements()) { | 103 | for (Statement statement : problem.getStatements()) { |
@@ -142,6 +143,7 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
142 | Node graphNode = createNode(nodeName); | 143 | Node graphNode = createNode(nodeName); |
143 | grapNodes.add(graphNode); | 144 | grapNodes.add(graphNode); |
144 | } | 145 | } |
146 | return nodeNames; | ||
145 | } | 147 | } |
146 | 148 | ||
147 | private void addNodeNames(Set<String> nodeNames, IScope nodeScope, EObject eObject, EStructuralFeature feature, | 149 | private void addNodeNames(Set<String> nodeNames, IScope nodeScope, EObject eObject, EStructuralFeature feature, |
@@ -165,16 +167,17 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
165 | return node; | 167 | return node; |
166 | } | 168 | } |
167 | 169 | ||
168 | protected void installDerivedPredicateDefinitionState(PredicateDefinition definition) { | 170 | protected void installDerivedPredicateDefinitionState(PredicateDefinition definition, Set<String> nodeNames) { |
169 | Set<String> parameterNames = new HashSet<>(); | 171 | Set<String> knownVariables = new HashSet<>(); |
172 | knownVariables.addAll(nodeNames); | ||
170 | for (Parameter parameter : definition.getParameters()) { | 173 | for (Parameter parameter : definition.getParameters()) { |
171 | String name = parameter.getName(); | 174 | String name = parameter.getName(); |
172 | if (name != null) { | 175 | if (name != null) { |
173 | parameterNames.add(name); | 176 | knownVariables.add(name); |
174 | } | 177 | } |
175 | } | 178 | } |
176 | for (Conjunction body : definition.getBodies()) { | 179 | for (Conjunction body : definition.getBodies()) { |
177 | installDeriveConjunctionState(body, parameterNames); | 180 | installDeriveConjunctionState(body, knownVariables); |
178 | } | 181 | } |
179 | } | 182 | } |
180 | 183 | ||
@@ -271,10 +274,9 @@ public class ProblemDerivedStateComputer implements IDerivedStateComputer { | |||
271 | protected void discardDerivedProblemState(Problem problem) { | 274 | protected void discardDerivedProblemState(Problem problem) { |
272 | problem.getNodes().clear(); | 275 | problem.getNodes().clear(); |
273 | for (Statement statement : problem.getStatements()) { | 276 | for (Statement statement : problem.getStatements()) { |
274 | if (statement instanceof ClassDeclaration) { | 277 | // We deliberately don't clean up {@link ClassDeclaration#getNewNode()} nodes, |
275 | ClassDeclaration classDeclaration = (ClassDeclaration) statement; | 278 | // because they have already been exported to the Xtext index. |
276 | classDeclaration.setNewNode(null); | 279 | if (statement instanceof PredicateDefinition) { |
277 | } else if (statement instanceof PredicateDefinition) { | ||
278 | PredicateDefinition definition = (PredicateDefinition) statement; | 280 | PredicateDefinition definition = (PredicateDefinition) statement; |
279 | for (Conjunction body : definition.getBodies()) { | 281 | for (Conjunction body : definition.getBodies()) { |
280 | body.getImplicitVariables().clear(); | 282 | body.getImplicitVariables().clear(); |
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java b/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java index edb25a1c..4d932a92 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java +++ b/language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java | |||
@@ -24,56 +24,70 @@ public class ProblemResourceDescriptionStrategy extends DefaultResourceDescripti | |||
24 | 24 | ||
25 | @Override | 25 | @Override |
26 | public boolean createEObjectDescriptions(EObject eObject, IAcceptor<IEObjectDescription> acceptor) { | 26 | public boolean createEObjectDescriptions(EObject eObject, IAcceptor<IEObjectDescription> acceptor) { |
27 | if (eObject instanceof Variable) { | 27 | if (!shouldExport(eObject)) { |
28 | return false; | 28 | return false; |
29 | } | 29 | } |
30 | if (eObject instanceof NamedElement) { | 30 | if (!(eObject instanceof NamedElement)) { |
31 | NamedElement namedElement = (NamedElement) eObject; | 31 | return true; |
32 | String name = namedElement.getName(); | 32 | } |
33 | if (name == null || name.isEmpty()) { | 33 | NamedElement namedElement = (NamedElement) eObject; |
34 | return true; | 34 | String name = namedElement.getName(); |
35 | } | 35 | if (name == null || name.isEmpty()) { |
36 | Problem problem = EcoreUtil2.getContainerOfType(namedElement, Problem.class); | 36 | return true; |
37 | QualifiedName problemQualifiedName = null; | 37 | } |
38 | if (problem != null) { | 38 | Problem problem = EcoreUtil2.getContainerOfType(namedElement, Problem.class); |
39 | String problemName = problem.getName(); | 39 | QualifiedName problemQualifiedName = null; |
40 | if (problemName != null && !problemName.isEmpty()) { | 40 | if (problem != null) { |
41 | problemQualifiedName = qualifiedNameConverter.toQualifiedName(problemName); | 41 | String problemName = problem.getName(); |
42 | } | 42 | if (problemName != null && !problemName.isEmpty()) { |
43 | } | 43 | problemQualifiedName = qualifiedNameConverter.toQualifiedName(problemName); |
44 | QualifiedName qualifiedName = qualifiedNameConverter.toQualifiedName(namedElement.getName()); | ||
45 | boolean nameExported; | ||
46 | if (shouldExportSimpleName(namedElement)) { | ||
47 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); | ||
48 | nameExported = true; | ||
49 | } else { | ||
50 | nameExported = false; | ||
51 | } | 44 | } |
52 | EObject parent = namedElement.eContainer(); | 45 | } |
53 | while (parent != null && parent != problem) { | 46 | QualifiedName qualifiedName = qualifiedNameConverter.toQualifiedName(namedElement.getName()); |
54 | if (parent instanceof NamedElement) { | 47 | boolean nameExported; |
55 | NamedElement namedParent = (NamedElement) parent; | 48 | if (shouldExportSimpleName(namedElement)) { |
56 | String parentName = namedParent.getName(); | 49 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); |
57 | if (parentName != null || !name.isEmpty()) { | 50 | nameExported = true; |
58 | QualifiedName parentQualifiedName = qualifiedNameConverter.toQualifiedName(parentName); | 51 | } else { |
59 | qualifiedName = parentQualifiedName.append(qualifiedName); | 52 | nameExported = false; |
60 | if (shouldExportSimpleName(parent)) { | 53 | } |
61 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); | 54 | EObject parent = namedElement.eContainer(); |
62 | nameExported = true; | 55 | while (parent != null && parent != problem) { |
63 | } else { | 56 | if (parent instanceof NamedElement) { |
64 | nameExported = false; | 57 | NamedElement namedParent = (NamedElement) parent; |
65 | } | 58 | String parentName = namedParent.getName(); |
59 | if (parentName != null || !name.isEmpty()) { | ||
60 | QualifiedName parentQualifiedName = qualifiedNameConverter.toQualifiedName(parentName); | ||
61 | qualifiedName = parentQualifiedName.append(qualifiedName); | ||
62 | if (shouldExportSimpleName(namedParent)) { | ||
63 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); | ||
64 | nameExported = true; | ||
65 | } else { | ||
66 | nameExported = false; | ||
66 | } | 67 | } |
67 | } | 68 | } |
68 | parent = parent.eContainer(); | ||
69 | } | ||
70 | if (!nameExported) { | ||
71 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); | ||
72 | } | 69 | } |
70 | parent = parent.eContainer(); | ||
71 | } | ||
72 | if (!nameExported) { | ||
73 | acceptEObjectDescription(namedElement, problemQualifiedName, qualifiedName, acceptor); | ||
73 | } | 74 | } |
74 | return true; | 75 | return true; |
75 | } | 76 | } |
76 | 77 | ||
78 | protected boolean shouldExport(EObject eObject) { | ||
79 | if (eObject instanceof Variable) { | ||
80 | // Variables are always private to the containing predicate definition. | ||
81 | return false; | ||
82 | } | ||
83 | if (eObject instanceof Node) { | ||
84 | Node node = (Node) eObject; | ||
85 | // Only enum literals and new nodes are visible across problem files. | ||
86 | return ProblemUtil.isEnumLiteral(node) || ProblemUtil.isNewNode(node); | ||
87 | } | ||
88 | return true; | ||
89 | } | ||
90 | |||
77 | protected boolean shouldExportSimpleName(EObject eObject) { | 91 | protected boolean shouldExportSimpleName(EObject eObject) { |
78 | if (eObject instanceof Node) { | 92 | if (eObject instanceof Node) { |
79 | return !ProblemUtil.isNewNode((Node) eObject); | 93 | return !ProblemUtil.isNewNode((Node) eObject); |
diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java b/language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java index 3748e81d..597085a8 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java +++ b/language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java | |||
@@ -13,6 +13,7 @@ import org.eclipse.viatra.solver.language.ProblemUtil; | |||
13 | import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration; | 13 | import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration; |
14 | import org.eclipse.viatra.solver.language.model.problem.ExistentialQuantifier; | 14 | import org.eclipse.viatra.solver.language.model.problem.ExistentialQuantifier; |
15 | import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition; | 15 | import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition; |
16 | import org.eclipse.viatra.solver.language.model.problem.Problem; | ||
16 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; | 17 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; |
17 | import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration; | 18 | import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration; |
18 | import org.eclipse.viatra.solver.language.model.problem.Relation; | 19 | import org.eclipse.viatra.solver.language.model.problem.Relation; |
@@ -34,14 +35,27 @@ public class ProblemScopeProvider extends AbstractProblemScopeProvider { | |||
34 | @Override | 35 | @Override |
35 | public IScope getScope(EObject context, EReference reference) { | 36 | public IScope getScope(EObject context, EReference reference) { |
36 | IScope scope = super.getScope(context, reference); | 37 | IScope scope = super.getScope(context, reference); |
38 | if (reference == ProblemPackage.Literals.NODE_ASSERTION_ARGUMENT__NODE | ||
39 | || reference == ProblemPackage.Literals.NODE_VALUE_ASSERTION__NODE) { | ||
40 | return getNodesScope(context, scope); | ||
41 | } | ||
37 | if (reference == ProblemPackage.Literals.VARIABLE_OR_NODE_ARGUMENT__VARIABLE_OR_NODE) { | 42 | if (reference == ProblemPackage.Literals.VARIABLE_OR_NODE_ARGUMENT__VARIABLE_OR_NODE) { |
38 | return getVariableScope(context, scope); | 43 | return getVariableScope(context, scope); |
39 | } else if (reference == ProblemPackage.Literals.REFERENCE_DECLARATION__OPPOSITE) { | 44 | } |
45 | if (reference == ProblemPackage.Literals.REFERENCE_DECLARATION__OPPOSITE) { | ||
40 | return getOppositeScope(context, scope); | 46 | return getOppositeScope(context, scope); |
41 | } | 47 | } |
42 | return scope; | 48 | return scope; |
43 | } | 49 | } |
44 | 50 | ||
51 | protected IScope getNodesScope(EObject context, IScope delegateScope) { | ||
52 | Problem problem = EcoreUtil2.getContainerOfType(context, Problem.class); | ||
53 | if (problem == null) { | ||
54 | return delegateScope; | ||
55 | } | ||
56 | return Scopes.scopeFor(problem.getNodes(), delegateScope); | ||
57 | } | ||
58 | |||
45 | protected IScope getVariableScope(EObject context, IScope delegateScope) { | 59 | protected IScope getVariableScope(EObject context, IScope delegateScope) { |
46 | List<Variable> variables = new ArrayList<>(); | 60 | List<Variable> variables = new ArrayList<>(); |
47 | EObject currentContext = context; | 61 | EObject currentContext = context; |
@@ -63,7 +77,7 @@ public class ProblemScopeProvider extends AbstractProblemScopeProvider { | |||
63 | PredicateDefinition definition = (PredicateDefinition) currentContext; | 77 | PredicateDefinition definition = (PredicateDefinition) currentContext; |
64 | variables.addAll(definition.getParameters()); | 78 | variables.addAll(definition.getParameters()); |
65 | } | 79 | } |
66 | return Scopes.scopeFor(variables, delegateScope); | 80 | return Scopes.scopeFor(variables, getNodesScope(context, delegateScope)); |
67 | } | 81 | } |
68 | 82 | ||
69 | protected IScope getOppositeScope(EObject context, IScope delegateScope) { | 83 | protected IScope getOppositeScope(EObject context, IScope delegateScope) { |
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java index 642b465b..24bed771 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java | |||
@@ -7,7 +7,6 @@ import com.google.inject.Binder; | |||
7 | import com.google.inject.Provider; | 7 | import com.google.inject.Provider; |
8 | import com.google.inject.name.Names; | 8 | import com.google.inject.name.Names; |
9 | import java.util.Properties; | 9 | import java.util.Properties; |
10 | import org.eclipse.viatra.solver.language.generator.ProblemGenerator; | ||
11 | import org.eclipse.viatra.solver.language.parser.antlr.ProblemAntlrTokenFileProvider; | 10 | import org.eclipse.viatra.solver.language.parser.antlr.ProblemAntlrTokenFileProvider; |
12 | import org.eclipse.viatra.solver.language.parser.antlr.ProblemParser; | 11 | import org.eclipse.viatra.solver.language.parser.antlr.ProblemParser; |
13 | import org.eclipse.viatra.solver.language.parser.antlr.internal.InternalProblemLexer; | 12 | import org.eclipse.viatra.solver.language.parser.antlr.internal.InternalProblemLexer; |
@@ -19,7 +18,6 @@ import org.eclipse.viatra.solver.language.validation.ProblemConfigurableIssueCod | |||
19 | import org.eclipse.viatra.solver.language.validation.ProblemValidator; | 18 | import org.eclipse.viatra.solver.language.validation.ProblemValidator; |
20 | import org.eclipse.xtext.Constants; | 19 | import org.eclipse.xtext.Constants; |
21 | import org.eclipse.xtext.IGrammarAccess; | 20 | import org.eclipse.xtext.IGrammarAccess; |
22 | import org.eclipse.xtext.generator.IGenerator2; | ||
23 | import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; | 21 | import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; |
24 | import org.eclipse.xtext.naming.IQualifiedNameProvider; | 22 | import org.eclipse.xtext.naming.IQualifiedNameProvider; |
25 | import org.eclipse.xtext.parser.IParser; | 23 | import org.eclipse.xtext.parser.IParser; |
@@ -193,9 +191,4 @@ public abstract class AbstractProblemRuntimeModule extends DefaultRuntimeModule | |||
193 | binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class); | 191 | binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class); |
194 | } | 192 | } |
195 | 193 | ||
196 | // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 | ||
197 | public Class<? extends IGenerator2> bindIGenerator2() { | ||
198 | return ProblemGenerator.class; | ||
199 | } | ||
200 | |||
201 | } | 194 | } |
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin index a5b00fe3..9528b778 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin | |||
Binary files differ | |||
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g index 4ef02d71..f9372e7b 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g | |||
@@ -478,9 +478,9 @@ ruleEnumLiteral returns [EObject current=null] | |||
478 | ( | 478 | ( |
479 | ( | 479 | ( |
480 | { | 480 | { |
481 | newCompositeNode(grammarAccess.getEnumLiteralAccess().getNameQuotedOrUnquotedIdParserRuleCall_0()); | 481 | newCompositeNode(grammarAccess.getEnumLiteralAccess().getNameIdentifierParserRuleCall_0()); |
482 | } | 482 | } |
483 | lv_name_0_0=ruleQuotedOrUnquotedId | 483 | lv_name_0_0=ruleIdentifier |
484 | { | 484 | { |
485 | if ($current==null) { | 485 | if ($current==null) { |
486 | $current = createModelElementForParent(grammarAccess.getEnumLiteralRule()); | 486 | $current = createModelElementForParent(grammarAccess.getEnumLiteralRule()); |
@@ -489,7 +489,7 @@ ruleEnumLiteral returns [EObject current=null] | |||
489 | $current, | 489 | $current, |
490 | "name", | 490 | "name", |
491 | lv_name_0_0, | 491 | lv_name_0_0, |
492 | "org.eclipse.viatra.solver.language.Problem.QuotedOrUnquotedId"); | 492 | "org.eclipse.viatra.solver.language.Problem.Identifier"); |
493 | afterParserOrEnumRuleCall(); | 493 | afterParserOrEnumRuleCall(); |
494 | } | 494 | } |
495 | ) | 495 | ) |
@@ -2097,43 +2097,6 @@ ruleUpperBound returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToke | |||
2097 | ) | 2097 | ) |
2098 | ; | 2098 | ; |
2099 | 2099 | ||
2100 | // Entry rule entryRuleQuotedOrUnquotedId | ||
2101 | entryRuleQuotedOrUnquotedId returns [String current=null]: | ||
2102 | { newCompositeNode(grammarAccess.getQuotedOrUnquotedIdRule()); } | ||
2103 | iv_ruleQuotedOrUnquotedId=ruleQuotedOrUnquotedId | ||
2104 | { $current=$iv_ruleQuotedOrUnquotedId.current.getText(); } | ||
2105 | EOF; | ||
2106 | |||
2107 | // Rule QuotedOrUnquotedId | ||
2108 | ruleQuotedOrUnquotedId returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] | ||
2109 | @init { | ||
2110 | enterRule(); | ||
2111 | } | ||
2112 | @after { | ||
2113 | leaveRule(); | ||
2114 | }: | ||
2115 | ( | ||
2116 | this_QUOTED_ID_0=RULE_QUOTED_ID | ||
2117 | { | ||
2118 | $current.merge(this_QUOTED_ID_0); | ||
2119 | } | ||
2120 | { | ||
2121 | newLeafNode(this_QUOTED_ID_0, grammarAccess.getQuotedOrUnquotedIdAccess().getQUOTED_IDTerminalRuleCall_0()); | ||
2122 | } | ||
2123 | | | ||
2124 | { | ||
2125 | newCompositeNode(grammarAccess.getQuotedOrUnquotedIdAccess().getIdentifierParserRuleCall_1()); | ||
2126 | } | ||
2127 | this_Identifier_1=ruleIdentifier | ||
2128 | { | ||
2129 | $current.merge(this_Identifier_1); | ||
2130 | } | ||
2131 | { | ||
2132 | afterParserOrEnumRuleCall(); | ||
2133 | } | ||
2134 | ) | ||
2135 | ; | ||
2136 | |||
2137 | // Entry rule entryRuleQualifiedName | 2100 | // Entry rule entryRuleQualifiedName |
2138 | entryRuleQualifiedName returns [String current=null]@init { | 2101 | entryRuleQualifiedName returns [String current=null]@init { |
2139 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 2102 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
@@ -2192,20 +2155,6 @@ ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleT | |||
2192 | afterParserOrEnumRuleCall(); | 2155 | afterParserOrEnumRuleCall(); |
2193 | } | 2156 | } |
2194 | )* | 2157 | )* |
2195 | ( | ||
2196 | kw='::' | ||
2197 | { | ||
2198 | $current.merge(kw); | ||
2199 | newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_2_0()); | ||
2200 | } | ||
2201 | this_QUOTED_ID_5=RULE_QUOTED_ID | ||
2202 | { | ||
2203 | $current.merge(this_QUOTED_ID_5); | ||
2204 | } | ||
2205 | { | ||
2206 | newLeafNode(this_QUOTED_ID_5, grammarAccess.getQualifiedNameAccess().getQUOTED_IDTerminalRuleCall_1_2_1()); | ||
2207 | } | ||
2208 | )? | ||
2209 | ) | 2158 | ) |
2210 | ) | 2159 | ) |
2211 | ; | 2160 | ; |
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java index 345610ce..8adc6935 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java | |||
@@ -814,8 +814,8 @@ public class InternalProblemLexer extends Lexer { | |||
814 | try { | 814 | try { |
815 | int _type = RULE_ID; | 815 | int _type = RULE_ID; |
816 | int _channel = DEFAULT_TOKEN_CHANNEL; | 816 | int _channel = DEFAULT_TOKEN_CHANNEL; |
817 | // InternalProblem.g:2478:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) | 817 | // InternalProblem.g:2427:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) |
818 | // InternalProblem.g:2478:11: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* | 818 | // InternalProblem.g:2427:11: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* |
819 | { | 819 | { |
820 | if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { | 820 | if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { |
821 | input.consume(); | 821 | input.consume(); |
@@ -826,7 +826,7 @@ public class InternalProblemLexer extends Lexer { | |||
826 | recover(mse); | 826 | recover(mse); |
827 | throw mse;} | 827 | throw mse;} |
828 | 828 | ||
829 | // InternalProblem.g:2478:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* | 829 | // InternalProblem.g:2427:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* |
830 | loop1: | 830 | loop1: |
831 | do { | 831 | do { |
832 | int alt1=2; | 832 | int alt1=2; |
@@ -875,11 +875,11 @@ public class InternalProblemLexer extends Lexer { | |||
875 | try { | 875 | try { |
876 | int _type = RULE_STRING; | 876 | int _type = RULE_STRING; |
877 | int _channel = DEFAULT_TOKEN_CHANNEL; | 877 | int _channel = DEFAULT_TOKEN_CHANNEL; |
878 | // InternalProblem.g:2480:13: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' ) | 878 | // InternalProblem.g:2429:13: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' ) |
879 | // InternalProblem.g:2480:15: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | 879 | // InternalProblem.g:2429:15: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' |
880 | { | 880 | { |
881 | match('\"'); | 881 | match('\"'); |
882 | // InternalProblem.g:2480:19: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* | 882 | // InternalProblem.g:2429:19: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* |
883 | loop2: | 883 | loop2: |
884 | do { | 884 | do { |
885 | int alt2=3; | 885 | int alt2=3; |
@@ -895,7 +895,7 @@ public class InternalProblemLexer extends Lexer { | |||
895 | 895 | ||
896 | switch (alt2) { | 896 | switch (alt2) { |
897 | case 1 : | 897 | case 1 : |
898 | // InternalProblem.g:2480:20: '\\\\' . | 898 | // InternalProblem.g:2429:20: '\\\\' . |
899 | { | 899 | { |
900 | match('\\'); | 900 | match('\\'); |
901 | matchAny(); | 901 | matchAny(); |
@@ -903,7 +903,7 @@ public class InternalProblemLexer extends Lexer { | |||
903 | } | 903 | } |
904 | break; | 904 | break; |
905 | case 2 : | 905 | case 2 : |
906 | // InternalProblem.g:2480:27: ~ ( ( '\\\\' | '\"' ) ) | 906 | // InternalProblem.g:2429:27: ~ ( ( '\\\\' | '\"' ) ) |
907 | { | 907 | { |
908 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { | 908 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { |
909 | input.consume(); | 909 | input.consume(); |
@@ -940,11 +940,11 @@ public class InternalProblemLexer extends Lexer { | |||
940 | try { | 940 | try { |
941 | int _type = RULE_QUOTED_ID; | 941 | int _type = RULE_QUOTED_ID; |
942 | int _channel = DEFAULT_TOKEN_CHANNEL; | 942 | int _channel = DEFAULT_TOKEN_CHANNEL; |
943 | // InternalProblem.g:2482:16: ( '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) | 943 | // InternalProblem.g:2431:16: ( '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) |
944 | // InternalProblem.g:2482:18: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' | 944 | // InternalProblem.g:2431:18: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' |
945 | { | 945 | { |
946 | match('\''); | 946 | match('\''); |
947 | // InternalProblem.g:2482:23: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* | 947 | // InternalProblem.g:2431:23: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* |
948 | loop3: | 948 | loop3: |
949 | do { | 949 | do { |
950 | int alt3=3; | 950 | int alt3=3; |
@@ -960,7 +960,7 @@ public class InternalProblemLexer extends Lexer { | |||
960 | 960 | ||
961 | switch (alt3) { | 961 | switch (alt3) { |
962 | case 1 : | 962 | case 1 : |
963 | // InternalProblem.g:2482:24: '\\\\' . | 963 | // InternalProblem.g:2431:24: '\\\\' . |
964 | { | 964 | { |
965 | match('\\'); | 965 | match('\\'); |
966 | matchAny(); | 966 | matchAny(); |
@@ -968,7 +968,7 @@ public class InternalProblemLexer extends Lexer { | |||
968 | } | 968 | } |
969 | break; | 969 | break; |
970 | case 2 : | 970 | case 2 : |
971 | // InternalProblem.g:2482:31: ~ ( ( '\\\\' | '\\'' ) ) | 971 | // InternalProblem.g:2431:31: ~ ( ( '\\\\' | '\\'' ) ) |
972 | { | 972 | { |
973 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { | 973 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { |
974 | input.consume(); | 974 | input.consume(); |
@@ -1005,10 +1005,10 @@ public class InternalProblemLexer extends Lexer { | |||
1005 | try { | 1005 | try { |
1006 | int _type = RULE_SL_COMMENT; | 1006 | int _type = RULE_SL_COMMENT; |
1007 | int _channel = DEFAULT_TOKEN_CHANNEL; | 1007 | int _channel = DEFAULT_TOKEN_CHANNEL; |
1008 | // InternalProblem.g:2484:17: ( ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) | 1008 | // InternalProblem.g:2433:17: ( ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) |
1009 | // InternalProblem.g:2484:19: ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? | 1009 | // InternalProblem.g:2433:19: ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? |
1010 | { | 1010 | { |
1011 | // InternalProblem.g:2484:19: ( '%' | '//' ) | 1011 | // InternalProblem.g:2433:19: ( '%' | '//' ) |
1012 | int alt4=2; | 1012 | int alt4=2; |
1013 | int LA4_0 = input.LA(1); | 1013 | int LA4_0 = input.LA(1); |
1014 | 1014 | ||
@@ -1026,14 +1026,14 @@ public class InternalProblemLexer extends Lexer { | |||
1026 | } | 1026 | } |
1027 | switch (alt4) { | 1027 | switch (alt4) { |
1028 | case 1 : | 1028 | case 1 : |
1029 | // InternalProblem.g:2484:20: '%' | 1029 | // InternalProblem.g:2433:20: '%' |
1030 | { | 1030 | { |
1031 | match('%'); | 1031 | match('%'); |
1032 | 1032 | ||
1033 | } | 1033 | } |
1034 | break; | 1034 | break; |
1035 | case 2 : | 1035 | case 2 : |
1036 | // InternalProblem.g:2484:24: '//' | 1036 | // InternalProblem.g:2433:24: '//' |
1037 | { | 1037 | { |
1038 | match("//"); | 1038 | match("//"); |
1039 | 1039 | ||
@@ -1043,7 +1043,7 @@ public class InternalProblemLexer extends Lexer { | |||
1043 | 1043 | ||
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | // InternalProblem.g:2484:30: (~ ( ( '\\n' | '\\r' ) ) )* | 1046 | // InternalProblem.g:2433:30: (~ ( ( '\\n' | '\\r' ) ) )* |
1047 | loop5: | 1047 | loop5: |
1048 | do { | 1048 | do { |
1049 | int alt5=2; | 1049 | int alt5=2; |
@@ -1056,7 +1056,7 @@ public class InternalProblemLexer extends Lexer { | |||
1056 | 1056 | ||
1057 | switch (alt5) { | 1057 | switch (alt5) { |
1058 | case 1 : | 1058 | case 1 : |
1059 | // InternalProblem.g:2484:30: ~ ( ( '\\n' | '\\r' ) ) | 1059 | // InternalProblem.g:2433:30: ~ ( ( '\\n' | '\\r' ) ) |
1060 | { | 1060 | { |
1061 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { | 1061 | if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { |
1062 | input.consume(); | 1062 | input.consume(); |
@@ -1076,7 +1076,7 @@ public class InternalProblemLexer extends Lexer { | |||
1076 | } | 1076 | } |
1077 | } while (true); | 1077 | } while (true); |
1078 | 1078 | ||
1079 | // InternalProblem.g:2484:46: ( ( '\\r' )? '\\n' )? | 1079 | // InternalProblem.g:2433:46: ( ( '\\r' )? '\\n' )? |
1080 | int alt7=2; | 1080 | int alt7=2; |
1081 | int LA7_0 = input.LA(1); | 1081 | int LA7_0 = input.LA(1); |
1082 | 1082 | ||
@@ -1085,9 +1085,9 @@ public class InternalProblemLexer extends Lexer { | |||
1085 | } | 1085 | } |
1086 | switch (alt7) { | 1086 | switch (alt7) { |
1087 | case 1 : | 1087 | case 1 : |
1088 | // InternalProblem.g:2484:47: ( '\\r' )? '\\n' | 1088 | // InternalProblem.g:2433:47: ( '\\r' )? '\\n' |
1089 | { | 1089 | { |
1090 | // InternalProblem.g:2484:47: ( '\\r' )? | 1090 | // InternalProblem.g:2433:47: ( '\\r' )? |
1091 | int alt6=2; | 1091 | int alt6=2; |
1092 | int LA6_0 = input.LA(1); | 1092 | int LA6_0 = input.LA(1); |
1093 | 1093 | ||
@@ -1096,7 +1096,7 @@ public class InternalProblemLexer extends Lexer { | |||
1096 | } | 1096 | } |
1097 | switch (alt6) { | 1097 | switch (alt6) { |
1098 | case 1 : | 1098 | case 1 : |
1099 | // InternalProblem.g:2484:47: '\\r' | 1099 | // InternalProblem.g:2433:47: '\\r' |
1100 | { | 1100 | { |
1101 | match('\r'); | 1101 | match('\r'); |
1102 | 1102 | ||
@@ -1128,10 +1128,10 @@ public class InternalProblemLexer extends Lexer { | |||
1128 | try { | 1128 | try { |
1129 | int _type = RULE_INT; | 1129 | int _type = RULE_INT; |
1130 | int _channel = DEFAULT_TOKEN_CHANNEL; | 1130 | int _channel = DEFAULT_TOKEN_CHANNEL; |
1131 | // InternalProblem.g:2486:10: ( ( '0' .. '9' )+ ) | 1131 | // InternalProblem.g:2435:10: ( ( '0' .. '9' )+ ) |
1132 | // InternalProblem.g:2486:12: ( '0' .. '9' )+ | 1132 | // InternalProblem.g:2435:12: ( '0' .. '9' )+ |
1133 | { | 1133 | { |
1134 | // InternalProblem.g:2486:12: ( '0' .. '9' )+ | 1134 | // InternalProblem.g:2435:12: ( '0' .. '9' )+ |
1135 | int cnt8=0; | 1135 | int cnt8=0; |
1136 | loop8: | 1136 | loop8: |
1137 | do { | 1137 | do { |
@@ -1145,7 +1145,7 @@ public class InternalProblemLexer extends Lexer { | |||
1145 | 1145 | ||
1146 | switch (alt8) { | 1146 | switch (alt8) { |
1147 | case 1 : | 1147 | case 1 : |
1148 | // InternalProblem.g:2486:13: '0' .. '9' | 1148 | // InternalProblem.g:2435:13: '0' .. '9' |
1149 | { | 1149 | { |
1150 | matchRange('0','9'); | 1150 | matchRange('0','9'); |
1151 | 1151 | ||
@@ -1177,12 +1177,12 @@ public class InternalProblemLexer extends Lexer { | |||
1177 | try { | 1177 | try { |
1178 | int _type = RULE_ML_COMMENT; | 1178 | int _type = RULE_ML_COMMENT; |
1179 | int _channel = DEFAULT_TOKEN_CHANNEL; | 1179 | int _channel = DEFAULT_TOKEN_CHANNEL; |
1180 | // InternalProblem.g:2488:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) | 1180 | // InternalProblem.g:2437:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) |
1181 | // InternalProblem.g:2488:19: '/*' ( options {greedy=false; } : . )* '*/' | 1181 | // InternalProblem.g:2437:19: '/*' ( options {greedy=false; } : . )* '*/' |
1182 | { | 1182 | { |
1183 | match("/*"); | 1183 | match("/*"); |
1184 | 1184 | ||
1185 | // InternalProblem.g:2488:24: ( options {greedy=false; } : . )* | 1185 | // InternalProblem.g:2437:24: ( options {greedy=false; } : . )* |
1186 | loop9: | 1186 | loop9: |
1187 | do { | 1187 | do { |
1188 | int alt9=2; | 1188 | int alt9=2; |
@@ -1207,7 +1207,7 @@ public class InternalProblemLexer extends Lexer { | |||
1207 | 1207 | ||
1208 | switch (alt9) { | 1208 | switch (alt9) { |
1209 | case 1 : | 1209 | case 1 : |
1210 | // InternalProblem.g:2488:52: . | 1210 | // InternalProblem.g:2437:52: . |
1211 | { | 1211 | { |
1212 | matchAny(); | 1212 | matchAny(); |
1213 | 1213 | ||
@@ -1237,10 +1237,10 @@ public class InternalProblemLexer extends Lexer { | |||
1237 | try { | 1237 | try { |
1238 | int _type = RULE_WS; | 1238 | int _type = RULE_WS; |
1239 | int _channel = DEFAULT_TOKEN_CHANNEL; | 1239 | int _channel = DEFAULT_TOKEN_CHANNEL; |
1240 | // InternalProblem.g:2490:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) | 1240 | // InternalProblem.g:2439:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) |
1241 | // InternalProblem.g:2490:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ | 1241 | // InternalProblem.g:2439:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ |
1242 | { | 1242 | { |
1243 | // InternalProblem.g:2490:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ | 1243 | // InternalProblem.g:2439:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ |
1244 | int cnt10=0; | 1244 | int cnt10=0; |
1245 | loop10: | 1245 | loop10: |
1246 | do { | 1246 | do { |
@@ -1294,8 +1294,8 @@ public class InternalProblemLexer extends Lexer { | |||
1294 | try { | 1294 | try { |
1295 | int _type = RULE_ANY_OTHER; | 1295 | int _type = RULE_ANY_OTHER; |
1296 | int _channel = DEFAULT_TOKEN_CHANNEL; | 1296 | int _channel = DEFAULT_TOKEN_CHANNEL; |
1297 | // InternalProblem.g:2492:16: ( . ) | 1297 | // InternalProblem.g:2441:16: ( . ) |
1298 | // InternalProblem.g:2492:18: . | 1298 | // InternalProblem.g:2441:18: . |
1299 | { | 1299 | { |
1300 | matchAny(); | 1300 | matchAny(); |
1301 | 1301 | ||
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java index cd8f706a..f0a69c90 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java | |||
@@ -1005,7 +1005,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1005 | int alt12=2; | 1005 | int alt12=2; |
1006 | int LA12_0 = input.LA(1); | 1006 | int LA12_0 = input.LA(1); |
1007 | 1007 | ||
1008 | if ( (LA12_0==RULE_ID||LA12_0==RULE_QUOTED_ID||(LA12_0>=41 && LA12_0<=44)) ) { | 1008 | if ( (LA12_0==RULE_ID||(LA12_0>=41 && LA12_0<=44)) ) { |
1009 | alt12=1; | 1009 | alt12=1; |
1010 | } | 1010 | } |
1011 | switch (alt12) { | 1011 | switch (alt12) { |
@@ -1052,7 +1052,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1052 | if ( (LA10_0==17) ) { | 1052 | if ( (LA10_0==17) ) { |
1053 | int LA10_1 = input.LA(2); | 1053 | int LA10_1 = input.LA(2); |
1054 | 1054 | ||
1055 | if ( (LA10_1==RULE_ID||LA10_1==RULE_QUOTED_ID||(LA10_1>=41 && LA10_1<=44)) ) { | 1055 | if ( (LA10_1==RULE_ID||(LA10_1>=41 && LA10_1<=44)) ) { |
1056 | alt10=1; | 1056 | alt10=1; |
1057 | } | 1057 | } |
1058 | 1058 | ||
@@ -1064,7 +1064,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1064 | case 1 : | 1064 | case 1 : |
1065 | // InternalProblem.g:413:7: otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) | 1065 | // InternalProblem.g:413:7: otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) |
1066 | { | 1066 | { |
1067 | otherlv_4=(Token)match(input,17,FOLLOW_8); | 1067 | otherlv_4=(Token)match(input,17,FOLLOW_3); |
1068 | 1068 | ||
1069 | newLeafNode(otherlv_4, grammarAccess.getEnumDeclarationAccess().getCommaKeyword_2_0_1_1_0()); | 1069 | newLeafNode(otherlv_4, grammarAccess.getEnumDeclarationAccess().getCommaKeyword_2_0_1_1_0()); |
1070 | 1070 | ||
@@ -1230,7 +1230,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1230 | 1230 | ||
1231 | 1231 | ||
1232 | // $ANTLR start "ruleEnumLiteral" | 1232 | // $ANTLR start "ruleEnumLiteral" |
1233 | // InternalProblem.g:471:1: ruleEnumLiteral returns [EObject current=null] : ( (lv_name_0_0= ruleQuotedOrUnquotedId ) ) ; | 1233 | // InternalProblem.g:471:1: ruleEnumLiteral returns [EObject current=null] : ( (lv_name_0_0= ruleIdentifier ) ) ; |
1234 | public final EObject ruleEnumLiteral() throws RecognitionException { | 1234 | public final EObject ruleEnumLiteral() throws RecognitionException { |
1235 | EObject current = null; | 1235 | EObject current = null; |
1236 | 1236 | ||
@@ -1241,20 +1241,20 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1241 | enterRule(); | 1241 | enterRule(); |
1242 | 1242 | ||
1243 | try { | 1243 | try { |
1244 | // InternalProblem.g:477:2: ( ( (lv_name_0_0= ruleQuotedOrUnquotedId ) ) ) | 1244 | // InternalProblem.g:477:2: ( ( (lv_name_0_0= ruleIdentifier ) ) ) |
1245 | // InternalProblem.g:478:2: ( (lv_name_0_0= ruleQuotedOrUnquotedId ) ) | 1245 | // InternalProblem.g:478:2: ( (lv_name_0_0= ruleIdentifier ) ) |
1246 | { | 1246 | { |
1247 | // InternalProblem.g:478:2: ( (lv_name_0_0= ruleQuotedOrUnquotedId ) ) | 1247 | // InternalProblem.g:478:2: ( (lv_name_0_0= ruleIdentifier ) ) |
1248 | // InternalProblem.g:479:3: (lv_name_0_0= ruleQuotedOrUnquotedId ) | 1248 | // InternalProblem.g:479:3: (lv_name_0_0= ruleIdentifier ) |
1249 | { | 1249 | { |
1250 | // InternalProblem.g:479:3: (lv_name_0_0= ruleQuotedOrUnquotedId ) | 1250 | // InternalProblem.g:479:3: (lv_name_0_0= ruleIdentifier ) |
1251 | // InternalProblem.g:480:4: lv_name_0_0= ruleQuotedOrUnquotedId | 1251 | // InternalProblem.g:480:4: lv_name_0_0= ruleIdentifier |
1252 | { | 1252 | { |
1253 | 1253 | ||
1254 | newCompositeNode(grammarAccess.getEnumLiteralAccess().getNameQuotedOrUnquotedIdParserRuleCall_0()); | 1254 | newCompositeNode(grammarAccess.getEnumLiteralAccess().getNameIdentifierParserRuleCall_0()); |
1255 | 1255 | ||
1256 | pushFollow(FOLLOW_2); | 1256 | pushFollow(FOLLOW_2); |
1257 | lv_name_0_0=ruleQuotedOrUnquotedId(); | 1257 | lv_name_0_0=ruleIdentifier(); |
1258 | 1258 | ||
1259 | state._fsp--; | 1259 | state._fsp--; |
1260 | 1260 | ||
@@ -1266,7 +1266,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
1266 | current, | 1266 | current, |
1267 | "name", | 1267 | "name", |
1268 | lv_name_0_0, | 1268 | lv_name_0_0, |
1269 | "org.eclipse.viatra.solver.language.Problem.QuotedOrUnquotedId"); | 1269 | "org.eclipse.viatra.solver.language.Problem.Identifier"); |
1270 | afterParserOrEnumRuleCall(); | 1270 | afterParserOrEnumRuleCall(); |
1271 | 1271 | ||
1272 | 1272 | ||
@@ -4242,19 +4242,26 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
4242 | 4242 | ||
4243 | if ( (LA37_1==RULE_INT) ) { | 4243 | if ( (LA37_1==RULE_INT) ) { |
4244 | switch ( input.LA(3) ) { | 4244 | switch ( input.LA(3) ) { |
4245 | case EOF: | ||
4246 | case 17: | ||
4247 | case 30: | ||
4248 | { | ||
4249 | alt37=1; | ||
4250 | } | ||
4251 | break; | ||
4245 | case 13: | 4252 | case 13: |
4246 | { | 4253 | { |
4247 | int LA37_4 = input.LA(4); | 4254 | int LA37_5 = input.LA(4); |
4248 | 4255 | ||
4249 | if ( (LA37_4==RULE_INT) ) { | 4256 | if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=14 && LA37_5<=15)||LA37_5==21||(LA37_5>=27 && LA37_5<=28)||LA37_5==32||LA37_5==35||(LA37_5>=41 && LA37_5<=44)||LA37_5==47) ) { |
4250 | alt37=2; | ||
4251 | } | ||
4252 | else if ( (LA37_4==EOF||LA37_4==RULE_ID||LA37_4==RULE_QUOTED_ID||(LA37_4>=14 && LA37_4<=15)||LA37_4==21||(LA37_4>=27 && LA37_4<=28)||LA37_4==32||LA37_4==35||(LA37_4>=41 && LA37_4<=44)||LA37_4==47) ) { | ||
4253 | alt37=1; | 4257 | alt37=1; |
4254 | } | 4258 | } |
4259 | else if ( (LA37_5==RULE_INT) ) { | ||
4260 | alt37=2; | ||
4261 | } | ||
4255 | else { | 4262 | else { |
4256 | NoViableAltException nvae = | 4263 | NoViableAltException nvae = |
4257 | new NoViableAltException("", 37, 4, input); | 4264 | new NoViableAltException("", 37, 5, input); |
4258 | 4265 | ||
4259 | throw nvae; | 4266 | throw nvae; |
4260 | } | 4267 | } |
@@ -4266,13 +4273,6 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
4266 | alt37=2; | 4273 | alt37=2; |
4267 | } | 4274 | } |
4268 | break; | 4275 | break; |
4269 | case EOF: | ||
4270 | case 17: | ||
4271 | case 30: | ||
4272 | { | ||
4273 | alt37=1; | ||
4274 | } | ||
4275 | break; | ||
4276 | default: | 4276 | default: |
4277 | NoViableAltException nvae = | 4277 | NoViableAltException nvae = |
4278 | new NoViableAltException("", 37, 2, input); | 4278 | new NoViableAltException("", 37, 2, input); |
@@ -4292,19 +4292,26 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
4292 | case RULE_INT: | 4292 | case RULE_INT: |
4293 | { | 4293 | { |
4294 | switch ( input.LA(2) ) { | 4294 | switch ( input.LA(2) ) { |
4295 | case EOF: | ||
4296 | case 17: | ||
4297 | case 30: | ||
4298 | { | ||
4299 | alt37=1; | ||
4300 | } | ||
4301 | break; | ||
4295 | case 13: | 4302 | case 13: |
4296 | { | 4303 | { |
4297 | int LA37_4 = input.LA(3); | 4304 | int LA37_5 = input.LA(3); |
4298 | 4305 | ||
4299 | if ( (LA37_4==RULE_INT) ) { | 4306 | if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=14 && LA37_5<=15)||LA37_5==21||(LA37_5>=27 && LA37_5<=28)||LA37_5==32||LA37_5==35||(LA37_5>=41 && LA37_5<=44)||LA37_5==47) ) { |
4300 | alt37=2; | ||
4301 | } | ||
4302 | else if ( (LA37_4==EOF||LA37_4==RULE_ID||LA37_4==RULE_QUOTED_ID||(LA37_4>=14 && LA37_4<=15)||LA37_4==21||(LA37_4>=27 && LA37_4<=28)||LA37_4==32||LA37_4==35||(LA37_4>=41 && LA37_4<=44)||LA37_4==47) ) { | ||
4303 | alt37=1; | 4307 | alt37=1; |
4304 | } | 4308 | } |
4309 | else if ( (LA37_5==RULE_INT) ) { | ||
4310 | alt37=2; | ||
4311 | } | ||
4305 | else { | 4312 | else { |
4306 | NoViableAltException nvae = | 4313 | NoViableAltException nvae = |
4307 | new NoViableAltException("", 37, 4, input); | 4314 | new NoViableAltException("", 37, 5, input); |
4308 | 4315 | ||
4309 | throw nvae; | 4316 | throw nvae; |
4310 | } | 4317 | } |
@@ -4316,13 +4323,6 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
4316 | alt37=2; | 4323 | alt37=2; |
4317 | } | 4324 | } |
4318 | break; | 4325 | break; |
4319 | case EOF: | ||
4320 | case 17: | ||
4321 | case 30: | ||
4322 | { | ||
4323 | alt37=1; | ||
4324 | } | ||
4325 | break; | ||
4326 | default: | 4326 | default: |
4327 | NoViableAltException nvae = | 4327 | NoViableAltException nvae = |
4328 | new NoViableAltException("", 37, 2, input); | 4328 | new NoViableAltException("", 37, 2, input); |
@@ -5773,132 +5773,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
5773 | // $ANTLR end "ruleUpperBound" | 5773 | // $ANTLR end "ruleUpperBound" |
5774 | 5774 | ||
5775 | 5775 | ||
5776 | // $ANTLR start "entryRuleQuotedOrUnquotedId" | ||
5777 | // InternalProblem.g:2101:1: entryRuleQuotedOrUnquotedId returns [String current=null] : iv_ruleQuotedOrUnquotedId= ruleQuotedOrUnquotedId EOF ; | ||
5778 | public final String entryRuleQuotedOrUnquotedId() throws RecognitionException { | ||
5779 | String current = null; | ||
5780 | |||
5781 | AntlrDatatypeRuleToken iv_ruleQuotedOrUnquotedId = null; | ||
5782 | |||
5783 | |||
5784 | try { | ||
5785 | // InternalProblem.g:2101:58: (iv_ruleQuotedOrUnquotedId= ruleQuotedOrUnquotedId EOF ) | ||
5786 | // InternalProblem.g:2102:2: iv_ruleQuotedOrUnquotedId= ruleQuotedOrUnquotedId EOF | ||
5787 | { | ||
5788 | newCompositeNode(grammarAccess.getQuotedOrUnquotedIdRule()); | ||
5789 | pushFollow(FOLLOW_1); | ||
5790 | iv_ruleQuotedOrUnquotedId=ruleQuotedOrUnquotedId(); | ||
5791 | |||
5792 | state._fsp--; | ||
5793 | |||
5794 | current =iv_ruleQuotedOrUnquotedId.getText(); | ||
5795 | match(input,EOF,FOLLOW_2); | ||
5796 | |||
5797 | } | ||
5798 | |||
5799 | } | ||
5800 | |||
5801 | catch (RecognitionException re) { | ||
5802 | recover(input,re); | ||
5803 | appendSkippedTokens(); | ||
5804 | } | ||
5805 | finally { | ||
5806 | } | ||
5807 | return current; | ||
5808 | } | ||
5809 | // $ANTLR end "entryRuleQuotedOrUnquotedId" | ||
5810 | |||
5811 | |||
5812 | // $ANTLR start "ruleQuotedOrUnquotedId" | ||
5813 | // InternalProblem.g:2108:1: ruleQuotedOrUnquotedId returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QUOTED_ID_0= RULE_QUOTED_ID | this_Identifier_1= ruleIdentifier ) ; | ||
5814 | public final AntlrDatatypeRuleToken ruleQuotedOrUnquotedId() throws RecognitionException { | ||
5815 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); | ||
5816 | |||
5817 | Token this_QUOTED_ID_0=null; | ||
5818 | AntlrDatatypeRuleToken this_Identifier_1 = null; | ||
5819 | |||
5820 | |||
5821 | |||
5822 | enterRule(); | ||
5823 | |||
5824 | try { | ||
5825 | // InternalProblem.g:2114:2: ( (this_QUOTED_ID_0= RULE_QUOTED_ID | this_Identifier_1= ruleIdentifier ) ) | ||
5826 | // InternalProblem.g:2115:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | this_Identifier_1= ruleIdentifier ) | ||
5827 | { | ||
5828 | // InternalProblem.g:2115:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | this_Identifier_1= ruleIdentifier ) | ||
5829 | int alt43=2; | ||
5830 | int LA43_0 = input.LA(1); | ||
5831 | |||
5832 | if ( (LA43_0==RULE_QUOTED_ID) ) { | ||
5833 | alt43=1; | ||
5834 | } | ||
5835 | else if ( (LA43_0==RULE_ID||(LA43_0>=41 && LA43_0<=44)) ) { | ||
5836 | alt43=2; | ||
5837 | } | ||
5838 | else { | ||
5839 | NoViableAltException nvae = | ||
5840 | new NoViableAltException("", 43, 0, input); | ||
5841 | |||
5842 | throw nvae; | ||
5843 | } | ||
5844 | switch (alt43) { | ||
5845 | case 1 : | ||
5846 | // InternalProblem.g:2116:3: this_QUOTED_ID_0= RULE_QUOTED_ID | ||
5847 | { | ||
5848 | this_QUOTED_ID_0=(Token)match(input,RULE_QUOTED_ID,FOLLOW_2); | ||
5849 | |||
5850 | current.merge(this_QUOTED_ID_0); | ||
5851 | |||
5852 | |||
5853 | newLeafNode(this_QUOTED_ID_0, grammarAccess.getQuotedOrUnquotedIdAccess().getQUOTED_IDTerminalRuleCall_0()); | ||
5854 | |||
5855 | |||
5856 | } | ||
5857 | break; | ||
5858 | case 2 : | ||
5859 | // InternalProblem.g:2124:3: this_Identifier_1= ruleIdentifier | ||
5860 | { | ||
5861 | |||
5862 | newCompositeNode(grammarAccess.getQuotedOrUnquotedIdAccess().getIdentifierParserRuleCall_1()); | ||
5863 | |||
5864 | pushFollow(FOLLOW_2); | ||
5865 | this_Identifier_1=ruleIdentifier(); | ||
5866 | |||
5867 | state._fsp--; | ||
5868 | |||
5869 | |||
5870 | current.merge(this_Identifier_1); | ||
5871 | |||
5872 | |||
5873 | afterParserOrEnumRuleCall(); | ||
5874 | |||
5875 | |||
5876 | } | ||
5877 | break; | ||
5878 | |||
5879 | } | ||
5880 | |||
5881 | |||
5882 | } | ||
5883 | |||
5884 | |||
5885 | leaveRule(); | ||
5886 | |||
5887 | } | ||
5888 | |||
5889 | catch (RecognitionException re) { | ||
5890 | recover(input,re); | ||
5891 | appendSkippedTokens(); | ||
5892 | } | ||
5893 | finally { | ||
5894 | } | ||
5895 | return current; | ||
5896 | } | ||
5897 | // $ANTLR end "ruleQuotedOrUnquotedId" | ||
5898 | |||
5899 | |||
5900 | // $ANTLR start "entryRuleQualifiedName" | 5776 | // $ANTLR start "entryRuleQualifiedName" |
5901 | // InternalProblem.g:2138:1: entryRuleQualifiedName returns [String current=null] : iv_ruleQualifiedName= ruleQualifiedName EOF ; | 5777 | // InternalProblem.g:2101:1: entryRuleQualifiedName returns [String current=null] : iv_ruleQualifiedName= ruleQualifiedName EOF ; |
5902 | public final String entryRuleQualifiedName() throws RecognitionException { | 5778 | public final String entryRuleQualifiedName() throws RecognitionException { |
5903 | String current = null; | 5779 | String current = null; |
5904 | 5780 | ||
@@ -5909,8 +5785,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
5909 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 5785 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
5910 | 5786 | ||
5911 | try { | 5787 | try { |
5912 | // InternalProblem.g:2140:2: (iv_ruleQualifiedName= ruleQualifiedName EOF ) | 5788 | // InternalProblem.g:2103:2: (iv_ruleQualifiedName= ruleQualifiedName EOF ) |
5913 | // InternalProblem.g:2141:2: iv_ruleQualifiedName= ruleQualifiedName EOF | 5789 | // InternalProblem.g:2104:2: iv_ruleQualifiedName= ruleQualifiedName EOF |
5914 | { | 5790 | { |
5915 | newCompositeNode(grammarAccess.getQualifiedNameRule()); | 5791 | newCompositeNode(grammarAccess.getQualifiedNameRule()); |
5916 | pushFollow(FOLLOW_1); | 5792 | pushFollow(FOLLOW_1); |
@@ -5940,13 +5816,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
5940 | 5816 | ||
5941 | 5817 | ||
5942 | // $ANTLR start "ruleQualifiedName" | 5818 | // $ANTLR start "ruleQualifiedName" |
5943 | // InternalProblem.g:2150:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ; | 5819 | // InternalProblem.g:2113:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) ) ; |
5944 | public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException { | 5820 | public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException { |
5945 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); | 5821 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); |
5946 | 5822 | ||
5947 | Token this_QUOTED_ID_0=null; | 5823 | Token this_QUOTED_ID_0=null; |
5948 | Token kw=null; | 5824 | Token kw=null; |
5949 | Token this_QUOTED_ID_5=null; | ||
5950 | AntlrDatatypeRuleToken this_Identifier_1 = null; | 5825 | AntlrDatatypeRuleToken this_Identifier_1 = null; |
5951 | 5826 | ||
5952 | AntlrDatatypeRuleToken this_Identifier_3 = null; | 5827 | AntlrDatatypeRuleToken this_Identifier_3 = null; |
@@ -5957,28 +5832,28 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
5957 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 5832 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
5958 | 5833 | ||
5959 | try { | 5834 | try { |
5960 | // InternalProblem.g:2157:2: ( (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ) | 5835 | // InternalProblem.g:2120:2: ( (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) ) ) |
5961 | // InternalProblem.g:2158:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) | 5836 | // InternalProblem.g:2121:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) ) |
5962 | { | 5837 | { |
5963 | // InternalProblem.g:2158:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) | 5838 | // InternalProblem.g:2121:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) ) |
5964 | int alt46=2; | 5839 | int alt44=2; |
5965 | int LA46_0 = input.LA(1); | 5840 | int LA44_0 = input.LA(1); |
5966 | 5841 | ||
5967 | if ( (LA46_0==RULE_QUOTED_ID) ) { | 5842 | if ( (LA44_0==RULE_QUOTED_ID) ) { |
5968 | alt46=1; | 5843 | alt44=1; |
5969 | } | 5844 | } |
5970 | else if ( (LA46_0==RULE_ID||(LA46_0>=41 && LA46_0<=44)) ) { | 5845 | else if ( (LA44_0==RULE_ID||(LA44_0>=41 && LA44_0<=44)) ) { |
5971 | alt46=2; | 5846 | alt44=2; |
5972 | } | 5847 | } |
5973 | else { | 5848 | else { |
5974 | NoViableAltException nvae = | 5849 | NoViableAltException nvae = |
5975 | new NoViableAltException("", 46, 0, input); | 5850 | new NoViableAltException("", 44, 0, input); |
5976 | 5851 | ||
5977 | throw nvae; | 5852 | throw nvae; |
5978 | } | 5853 | } |
5979 | switch (alt46) { | 5854 | switch (alt44) { |
5980 | case 1 : | 5855 | case 1 : |
5981 | // InternalProblem.g:2159:3: this_QUOTED_ID_0= RULE_QUOTED_ID | 5856 | // InternalProblem.g:2122:3: this_QUOTED_ID_0= RULE_QUOTED_ID |
5982 | { | 5857 | { |
5983 | this_QUOTED_ID_0=(Token)match(input,RULE_QUOTED_ID,FOLLOW_2); | 5858 | this_QUOTED_ID_0=(Token)match(input,RULE_QUOTED_ID,FOLLOW_2); |
5984 | 5859 | ||
@@ -5991,10 +5866,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
5991 | } | 5866 | } |
5992 | break; | 5867 | break; |
5993 | case 2 : | 5868 | case 2 : |
5994 | // InternalProblem.g:2167:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) | 5869 | // InternalProblem.g:2130:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) |
5995 | { | 5870 | { |
5996 | // InternalProblem.g:2167:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) | 5871 | // InternalProblem.g:2130:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* ) |
5997 | // InternalProblem.g:2168:4: this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? | 5872 | // InternalProblem.g:2131:4: this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* |
5998 | { | 5873 | { |
5999 | 5874 | ||
6000 | newCompositeNode(grammarAccess.getQualifiedNameAccess().getIdentifierParserRuleCall_1_0()); | 5875 | newCompositeNode(grammarAccess.getQualifiedNameAccess().getIdentifierParserRuleCall_1_0()); |
@@ -6010,26 +5885,20 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6010 | 5885 | ||
6011 | afterParserOrEnumRuleCall(); | 5886 | afterParserOrEnumRuleCall(); |
6012 | 5887 | ||
6013 | // InternalProblem.g:2178:4: (kw= '::' this_Identifier_3= ruleIdentifier )* | 5888 | // InternalProblem.g:2141:4: (kw= '::' this_Identifier_3= ruleIdentifier )* |
6014 | loop44: | 5889 | loop43: |
6015 | do { | 5890 | do { |
6016 | int alt44=2; | 5891 | int alt43=2; |
6017 | int LA44_0 = input.LA(1); | 5892 | int LA43_0 = input.LA(1); |
6018 | |||
6019 | if ( (LA44_0==40) ) { | ||
6020 | int LA44_1 = input.LA(2); | ||
6021 | |||
6022 | if ( (LA44_1==RULE_ID||(LA44_1>=41 && LA44_1<=44)) ) { | ||
6023 | alt44=1; | ||
6024 | } | ||
6025 | |||
6026 | 5893 | ||
5894 | if ( (LA43_0==40) ) { | ||
5895 | alt43=1; | ||
6027 | } | 5896 | } |
6028 | 5897 | ||
6029 | 5898 | ||
6030 | switch (alt44) { | 5899 | switch (alt43) { |
6031 | case 1 : | 5900 | case 1 : |
6032 | // InternalProblem.g:2179:5: kw= '::' this_Identifier_3= ruleIdentifier | 5901 | // InternalProblem.g:2142:5: kw= '::' this_Identifier_3= ruleIdentifier |
6033 | { | 5902 | { |
6034 | kw=(Token)match(input,40,FOLLOW_3); | 5903 | kw=(Token)match(input,40,FOLLOW_3); |
6035 | 5904 | ||
@@ -6055,39 +5924,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6055 | break; | 5924 | break; |
6056 | 5925 | ||
6057 | default : | 5926 | default : |
6058 | break loop44; | 5927 | break loop43; |
6059 | } | 5928 | } |
6060 | } while (true); | 5929 | } while (true); |
6061 | 5930 | ||
6062 | // InternalProblem.g:2195:4: (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? | ||
6063 | int alt45=2; | ||
6064 | int LA45_0 = input.LA(1); | ||
6065 | |||
6066 | if ( (LA45_0==40) ) { | ||
6067 | alt45=1; | ||
6068 | } | ||
6069 | switch (alt45) { | ||
6070 | case 1 : | ||
6071 | // InternalProblem.g:2196:5: kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID | ||
6072 | { | ||
6073 | kw=(Token)match(input,40,FOLLOW_39); | ||
6074 | |||
6075 | current.merge(kw); | ||
6076 | newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_2_0()); | ||
6077 | |||
6078 | this_QUOTED_ID_5=(Token)match(input,RULE_QUOTED_ID,FOLLOW_2); | ||
6079 | |||
6080 | current.merge(this_QUOTED_ID_5); | ||
6081 | |||
6082 | |||
6083 | newLeafNode(this_QUOTED_ID_5, grammarAccess.getQualifiedNameAccess().getQUOTED_IDTerminalRuleCall_1_2_1()); | ||
6084 | |||
6085 | |||
6086 | } | ||
6087 | break; | ||
6088 | |||
6089 | } | ||
6090 | |||
6091 | 5931 | ||
6092 | } | 5932 | } |
6093 | 5933 | ||
@@ -6120,7 +5960,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6120 | 5960 | ||
6121 | 5961 | ||
6122 | // $ANTLR start "entryRuleIdentifier" | 5962 | // $ANTLR start "entryRuleIdentifier" |
6123 | // InternalProblem.g:2217:1: entryRuleIdentifier returns [String current=null] : iv_ruleIdentifier= ruleIdentifier EOF ; | 5963 | // InternalProblem.g:2166:1: entryRuleIdentifier returns [String current=null] : iv_ruleIdentifier= ruleIdentifier EOF ; |
6124 | public final String entryRuleIdentifier() throws RecognitionException { | 5964 | public final String entryRuleIdentifier() throws RecognitionException { |
6125 | String current = null; | 5965 | String current = null; |
6126 | 5966 | ||
@@ -6128,8 +5968,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6128 | 5968 | ||
6129 | 5969 | ||
6130 | try { | 5970 | try { |
6131 | // InternalProblem.g:2217:50: (iv_ruleIdentifier= ruleIdentifier EOF ) | 5971 | // InternalProblem.g:2166:50: (iv_ruleIdentifier= ruleIdentifier EOF ) |
6132 | // InternalProblem.g:2218:2: iv_ruleIdentifier= ruleIdentifier EOF | 5972 | // InternalProblem.g:2167:2: iv_ruleIdentifier= ruleIdentifier EOF |
6133 | { | 5973 | { |
6134 | newCompositeNode(grammarAccess.getIdentifierRule()); | 5974 | newCompositeNode(grammarAccess.getIdentifierRule()); |
6135 | pushFollow(FOLLOW_1); | 5975 | pushFollow(FOLLOW_1); |
@@ -6156,7 +5996,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6156 | 5996 | ||
6157 | 5997 | ||
6158 | // $ANTLR start "ruleIdentifier" | 5998 | // $ANTLR start "ruleIdentifier" |
6159 | // InternalProblem.g:2224:1: ruleIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ; | 5999 | // InternalProblem.g:2173:1: ruleIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ; |
6160 | public final AntlrDatatypeRuleToken ruleIdentifier() throws RecognitionException { | 6000 | public final AntlrDatatypeRuleToken ruleIdentifier() throws RecognitionException { |
6161 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); | 6001 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); |
6162 | 6002 | ||
@@ -6167,47 +6007,47 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6167 | enterRule(); | 6007 | enterRule(); |
6168 | 6008 | ||
6169 | try { | 6009 | try { |
6170 | // InternalProblem.g:2230:2: ( (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ) | 6010 | // InternalProblem.g:2179:2: ( (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ) |
6171 | // InternalProblem.g:2231:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) | 6011 | // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) |
6172 | { | 6012 | { |
6173 | // InternalProblem.g:2231:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) | 6013 | // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) |
6174 | int alt47=5; | 6014 | int alt45=5; |
6175 | switch ( input.LA(1) ) { | 6015 | switch ( input.LA(1) ) { |
6176 | case RULE_ID: | 6016 | case RULE_ID: |
6177 | { | 6017 | { |
6178 | alt47=1; | 6018 | alt45=1; |
6179 | } | 6019 | } |
6180 | break; | 6020 | break; |
6181 | case 41: | 6021 | case 41: |
6182 | { | 6022 | { |
6183 | alt47=2; | 6023 | alt45=2; |
6184 | } | 6024 | } |
6185 | break; | 6025 | break; |
6186 | case 42: | 6026 | case 42: |
6187 | { | 6027 | { |
6188 | alt47=3; | 6028 | alt45=3; |
6189 | } | 6029 | } |
6190 | break; | 6030 | break; |
6191 | case 43: | 6031 | case 43: |
6192 | { | 6032 | { |
6193 | alt47=4; | 6033 | alt45=4; |
6194 | } | 6034 | } |
6195 | break; | 6035 | break; |
6196 | case 44: | 6036 | case 44: |
6197 | { | 6037 | { |
6198 | alt47=5; | 6038 | alt45=5; |
6199 | } | 6039 | } |
6200 | break; | 6040 | break; |
6201 | default: | 6041 | default: |
6202 | NoViableAltException nvae = | 6042 | NoViableAltException nvae = |
6203 | new NoViableAltException("", 47, 0, input); | 6043 | new NoViableAltException("", 45, 0, input); |
6204 | 6044 | ||
6205 | throw nvae; | 6045 | throw nvae; |
6206 | } | 6046 | } |
6207 | 6047 | ||
6208 | switch (alt47) { | 6048 | switch (alt45) { |
6209 | case 1 : | 6049 | case 1 : |
6210 | // InternalProblem.g:2232:3: this_ID_0= RULE_ID | 6050 | // InternalProblem.g:2181:3: this_ID_0= RULE_ID |
6211 | { | 6051 | { |
6212 | this_ID_0=(Token)match(input,RULE_ID,FOLLOW_2); | 6052 | this_ID_0=(Token)match(input,RULE_ID,FOLLOW_2); |
6213 | 6053 | ||
@@ -6220,7 +6060,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6220 | } | 6060 | } |
6221 | break; | 6061 | break; |
6222 | case 2 : | 6062 | case 2 : |
6223 | // InternalProblem.g:2240:3: kw= 'true' | 6063 | // InternalProblem.g:2189:3: kw= 'true' |
6224 | { | 6064 | { |
6225 | kw=(Token)match(input,41,FOLLOW_2); | 6065 | kw=(Token)match(input,41,FOLLOW_2); |
6226 | 6066 | ||
@@ -6231,7 +6071,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6231 | } | 6071 | } |
6232 | break; | 6072 | break; |
6233 | case 3 : | 6073 | case 3 : |
6234 | // InternalProblem.g:2246:3: kw= 'false' | 6074 | // InternalProblem.g:2195:3: kw= 'false' |
6235 | { | 6075 | { |
6236 | kw=(Token)match(input,42,FOLLOW_2); | 6076 | kw=(Token)match(input,42,FOLLOW_2); |
6237 | 6077 | ||
@@ -6242,7 +6082,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6242 | } | 6082 | } |
6243 | break; | 6083 | break; |
6244 | case 4 : | 6084 | case 4 : |
6245 | // InternalProblem.g:2252:3: kw= 'e' | 6085 | // InternalProblem.g:2201:3: kw= 'e' |
6246 | { | 6086 | { |
6247 | kw=(Token)match(input,43,FOLLOW_2); | 6087 | kw=(Token)match(input,43,FOLLOW_2); |
6248 | 6088 | ||
@@ -6253,7 +6093,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6253 | } | 6093 | } |
6254 | break; | 6094 | break; |
6255 | case 5 : | 6095 | case 5 : |
6256 | // InternalProblem.g:2258:3: kw= 'E' | 6096 | // InternalProblem.g:2207:3: kw= 'E' |
6257 | { | 6097 | { |
6258 | kw=(Token)match(input,44,FOLLOW_2); | 6098 | kw=(Token)match(input,44,FOLLOW_2); |
6259 | 6099 | ||
@@ -6286,7 +6126,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6286 | 6126 | ||
6287 | 6127 | ||
6288 | // $ANTLR start "entryRuleInteger" | 6128 | // $ANTLR start "entryRuleInteger" |
6289 | // InternalProblem.g:2267:1: entryRuleInteger returns [String current=null] : iv_ruleInteger= ruleInteger EOF ; | 6129 | // InternalProblem.g:2216:1: entryRuleInteger returns [String current=null] : iv_ruleInteger= ruleInteger EOF ; |
6290 | public final String entryRuleInteger() throws RecognitionException { | 6130 | public final String entryRuleInteger() throws RecognitionException { |
6291 | String current = null; | 6131 | String current = null; |
6292 | 6132 | ||
@@ -6297,8 +6137,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6297 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 6137 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
6298 | 6138 | ||
6299 | try { | 6139 | try { |
6300 | // InternalProblem.g:2269:2: (iv_ruleInteger= ruleInteger EOF ) | 6140 | // InternalProblem.g:2218:2: (iv_ruleInteger= ruleInteger EOF ) |
6301 | // InternalProblem.g:2270:2: iv_ruleInteger= ruleInteger EOF | 6141 | // InternalProblem.g:2219:2: iv_ruleInteger= ruleInteger EOF |
6302 | { | 6142 | { |
6303 | newCompositeNode(grammarAccess.getIntegerRule()); | 6143 | newCompositeNode(grammarAccess.getIntegerRule()); |
6304 | pushFollow(FOLLOW_1); | 6144 | pushFollow(FOLLOW_1); |
@@ -6328,7 +6168,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6328 | 6168 | ||
6329 | 6169 | ||
6330 | // $ANTLR start "ruleInteger" | 6170 | // $ANTLR start "ruleInteger" |
6331 | // InternalProblem.g:2279:1: ruleInteger returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ) ; | 6171 | // InternalProblem.g:2228:1: ruleInteger returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ) ; |
6332 | public final AntlrDatatypeRuleToken ruleInteger() throws RecognitionException { | 6172 | public final AntlrDatatypeRuleToken ruleInteger() throws RecognitionException { |
6333 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); | 6173 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); |
6334 | 6174 | ||
@@ -6340,22 +6180,22 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6340 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 6180 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
6341 | 6181 | ||
6342 | try { | 6182 | try { |
6343 | // InternalProblem.g:2286:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ) ) | 6183 | // InternalProblem.g:2235:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ) ) |
6344 | // InternalProblem.g:2287:2: ( (kw= '-' )? this_INT_1= RULE_INT ) | 6184 | // InternalProblem.g:2236:2: ( (kw= '-' )? this_INT_1= RULE_INT ) |
6345 | { | 6185 | { |
6346 | // InternalProblem.g:2287:2: ( (kw= '-' )? this_INT_1= RULE_INT ) | 6186 | // InternalProblem.g:2236:2: ( (kw= '-' )? this_INT_1= RULE_INT ) |
6347 | // InternalProblem.g:2288:3: (kw= '-' )? this_INT_1= RULE_INT | 6187 | // InternalProblem.g:2237:3: (kw= '-' )? this_INT_1= RULE_INT |
6348 | { | 6188 | { |
6349 | // InternalProblem.g:2288:3: (kw= '-' )? | 6189 | // InternalProblem.g:2237:3: (kw= '-' )? |
6350 | int alt48=2; | 6190 | int alt46=2; |
6351 | int LA48_0 = input.LA(1); | 6191 | int LA46_0 = input.LA(1); |
6352 | 6192 | ||
6353 | if ( (LA48_0==45) ) { | 6193 | if ( (LA46_0==45) ) { |
6354 | alt48=1; | 6194 | alt46=1; |
6355 | } | 6195 | } |
6356 | switch (alt48) { | 6196 | switch (alt46) { |
6357 | case 1 : | 6197 | case 1 : |
6358 | // InternalProblem.g:2289:4: kw= '-' | 6198 | // InternalProblem.g:2238:4: kw= '-' |
6359 | { | 6199 | { |
6360 | kw=(Token)match(input,45,FOLLOW_17); | 6200 | kw=(Token)match(input,45,FOLLOW_17); |
6361 | 6201 | ||
@@ -6401,7 +6241,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6401 | 6241 | ||
6402 | 6242 | ||
6403 | // $ANTLR start "entryRuleReal" | 6243 | // $ANTLR start "entryRuleReal" |
6404 | // InternalProblem.g:2309:1: entryRuleReal returns [String current=null] : iv_ruleReal= ruleReal EOF ; | 6244 | // InternalProblem.g:2258:1: entryRuleReal returns [String current=null] : iv_ruleReal= ruleReal EOF ; |
6405 | public final String entryRuleReal() throws RecognitionException { | 6245 | public final String entryRuleReal() throws RecognitionException { |
6406 | String current = null; | 6246 | String current = null; |
6407 | 6247 | ||
@@ -6412,8 +6252,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6412 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 6252 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
6413 | 6253 | ||
6414 | try { | 6254 | try { |
6415 | // InternalProblem.g:2311:2: (iv_ruleReal= ruleReal EOF ) | 6255 | // InternalProblem.g:2260:2: (iv_ruleReal= ruleReal EOF ) |
6416 | // InternalProblem.g:2312:2: iv_ruleReal= ruleReal EOF | 6256 | // InternalProblem.g:2261:2: iv_ruleReal= ruleReal EOF |
6417 | { | 6257 | { |
6418 | newCompositeNode(grammarAccess.getRealRule()); | 6258 | newCompositeNode(grammarAccess.getRealRule()); |
6419 | pushFollow(FOLLOW_1); | 6259 | pushFollow(FOLLOW_1); |
@@ -6443,7 +6283,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6443 | 6283 | ||
6444 | 6284 | ||
6445 | // $ANTLR start "ruleReal" | 6285 | // $ANTLR start "ruleReal" |
6446 | // InternalProblem.g:2321:1: ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ; | 6286 | // InternalProblem.g:2270:1: ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ; |
6447 | public final AntlrDatatypeRuleToken ruleReal() throws RecognitionException { | 6287 | public final AntlrDatatypeRuleToken ruleReal() throws RecognitionException { |
6448 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); | 6288 | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); |
6449 | 6289 | ||
@@ -6458,22 +6298,22 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6458 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); | 6298 | HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); |
6459 | 6299 | ||
6460 | try { | 6300 | try { |
6461 | // InternalProblem.g:2328:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ) | 6301 | // InternalProblem.g:2277:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ) |
6462 | // InternalProblem.g:2329:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) | 6302 | // InternalProblem.g:2278:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) |
6463 | { | 6303 | { |
6464 | // InternalProblem.g:2329:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) | 6304 | // InternalProblem.g:2278:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) |
6465 | // InternalProblem.g:2330:3: (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) | 6305 | // InternalProblem.g:2279:3: (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) |
6466 | { | 6306 | { |
6467 | // InternalProblem.g:2330:3: (kw= '-' )? | 6307 | // InternalProblem.g:2279:3: (kw= '-' )? |
6468 | int alt49=2; | 6308 | int alt47=2; |
6469 | int LA49_0 = input.LA(1); | 6309 | int LA47_0 = input.LA(1); |
6470 | 6310 | ||
6471 | if ( (LA49_0==45) ) { | 6311 | if ( (LA47_0==45) ) { |
6472 | alt49=1; | 6312 | alt47=1; |
6473 | } | 6313 | } |
6474 | switch (alt49) { | 6314 | switch (alt47) { |
6475 | case 1 : | 6315 | case 1 : |
6476 | // InternalProblem.g:2331:4: kw= '-' | 6316 | // InternalProblem.g:2280:4: kw= '-' |
6477 | { | 6317 | { |
6478 | kw=(Token)match(input,45,FOLLOW_17); | 6318 | kw=(Token)match(input,45,FOLLOW_17); |
6479 | 6319 | ||
@@ -6486,58 +6326,58 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6486 | 6326 | ||
6487 | } | 6327 | } |
6488 | 6328 | ||
6489 | this_INT_1=(Token)match(input,RULE_INT,FOLLOW_40); | 6329 | this_INT_1=(Token)match(input,RULE_INT,FOLLOW_39); |
6490 | 6330 | ||
6491 | current.merge(this_INT_1); | 6331 | current.merge(this_INT_1); |
6492 | 6332 | ||
6493 | 6333 | ||
6494 | newLeafNode(this_INT_1, grammarAccess.getRealAccess().getINTTerminalRuleCall_1()); | 6334 | newLeafNode(this_INT_1, grammarAccess.getRealAccess().getINTTerminalRuleCall_1()); |
6495 | 6335 | ||
6496 | // InternalProblem.g:2344:3: ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) | 6336 | // InternalProblem.g:2293:3: ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) |
6497 | int alt53=2; | 6337 | int alt51=2; |
6498 | int LA53_0 = input.LA(1); | 6338 | int LA51_0 = input.LA(1); |
6499 | 6339 | ||
6500 | if ( (LA53_0==13) ) { | 6340 | if ( (LA51_0==13) ) { |
6501 | int LA53_1 = input.LA(2); | 6341 | int LA51_1 = input.LA(2); |
6502 | 6342 | ||
6503 | if ( (LA53_1==RULE_INT) ) { | 6343 | if ( (LA51_1==RULE_INT) ) { |
6504 | int LA53_3 = input.LA(3); | 6344 | int LA51_3 = input.LA(3); |
6505 | 6345 | ||
6506 | if ( ((LA53_3>=43 && LA53_3<=44)) ) { | 6346 | if ( (LA51_3==EOF||LA51_3==13||LA51_3==17||LA51_3==30) ) { |
6507 | alt53=2; | 6347 | alt51=1; |
6508 | } | 6348 | } |
6509 | else if ( (LA53_3==EOF||LA53_3==13||LA53_3==17||LA53_3==30) ) { | 6349 | else if ( ((LA51_3>=43 && LA51_3<=44)) ) { |
6510 | alt53=1; | 6350 | alt51=2; |
6511 | } | 6351 | } |
6512 | else { | 6352 | else { |
6513 | NoViableAltException nvae = | 6353 | NoViableAltException nvae = |
6514 | new NoViableAltException("", 53, 3, input); | 6354 | new NoViableAltException("", 51, 3, input); |
6515 | 6355 | ||
6516 | throw nvae; | 6356 | throw nvae; |
6517 | } | 6357 | } |
6518 | } | 6358 | } |
6519 | else { | 6359 | else { |
6520 | NoViableAltException nvae = | 6360 | NoViableAltException nvae = |
6521 | new NoViableAltException("", 53, 1, input); | 6361 | new NoViableAltException("", 51, 1, input); |
6522 | 6362 | ||
6523 | throw nvae; | 6363 | throw nvae; |
6524 | } | 6364 | } |
6525 | } | 6365 | } |
6526 | else if ( ((LA53_0>=43 && LA53_0<=44)) ) { | 6366 | else if ( ((LA51_0>=43 && LA51_0<=44)) ) { |
6527 | alt53=2; | 6367 | alt51=2; |
6528 | } | 6368 | } |
6529 | else { | 6369 | else { |
6530 | NoViableAltException nvae = | 6370 | NoViableAltException nvae = |
6531 | new NoViableAltException("", 53, 0, input); | 6371 | new NoViableAltException("", 51, 0, input); |
6532 | 6372 | ||
6533 | throw nvae; | 6373 | throw nvae; |
6534 | } | 6374 | } |
6535 | switch (alt53) { | 6375 | switch (alt51) { |
6536 | case 1 : | 6376 | case 1 : |
6537 | // InternalProblem.g:2345:4: (kw= '.' this_INT_3= RULE_INT ) | 6377 | // InternalProblem.g:2294:4: (kw= '.' this_INT_3= RULE_INT ) |
6538 | { | 6378 | { |
6539 | // InternalProblem.g:2345:4: (kw= '.' this_INT_3= RULE_INT ) | 6379 | // InternalProblem.g:2294:4: (kw= '.' this_INT_3= RULE_INT ) |
6540 | // InternalProblem.g:2346:5: kw= '.' this_INT_3= RULE_INT | 6380 | // InternalProblem.g:2295:5: kw= '.' this_INT_3= RULE_INT |
6541 | { | 6381 | { |
6542 | kw=(Token)match(input,13,FOLLOW_17); | 6382 | kw=(Token)match(input,13,FOLLOW_17); |
6543 | 6383 | ||
@@ -6558,28 +6398,28 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6558 | } | 6398 | } |
6559 | break; | 6399 | break; |
6560 | case 2 : | 6400 | case 2 : |
6561 | // InternalProblem.g:2360:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) | 6401 | // InternalProblem.g:2309:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) |
6562 | { | 6402 | { |
6563 | // InternalProblem.g:2360:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) | 6403 | // InternalProblem.g:2309:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) |
6564 | // InternalProblem.g:2361:5: (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT | 6404 | // InternalProblem.g:2310:5: (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT |
6565 | { | 6405 | { |
6566 | // InternalProblem.g:2361:5: (kw= '.' this_INT_5= RULE_INT )? | 6406 | // InternalProblem.g:2310:5: (kw= '.' this_INT_5= RULE_INT )? |
6567 | int alt50=2; | 6407 | int alt48=2; |
6568 | int LA50_0 = input.LA(1); | 6408 | int LA48_0 = input.LA(1); |
6569 | 6409 | ||
6570 | if ( (LA50_0==13) ) { | 6410 | if ( (LA48_0==13) ) { |
6571 | alt50=1; | 6411 | alt48=1; |
6572 | } | 6412 | } |
6573 | switch (alt50) { | 6413 | switch (alt48) { |
6574 | case 1 : | 6414 | case 1 : |
6575 | // InternalProblem.g:2362:6: kw= '.' this_INT_5= RULE_INT | 6415 | // InternalProblem.g:2311:6: kw= '.' this_INT_5= RULE_INT |
6576 | { | 6416 | { |
6577 | kw=(Token)match(input,13,FOLLOW_17); | 6417 | kw=(Token)match(input,13,FOLLOW_17); |
6578 | 6418 | ||
6579 | current.merge(kw); | 6419 | current.merge(kw); |
6580 | newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_1_0_0()); | 6420 | newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_1_0_0()); |
6581 | 6421 | ||
6582 | this_INT_5=(Token)match(input,RULE_INT,FOLLOW_41); | 6422 | this_INT_5=(Token)match(input,RULE_INT,FOLLOW_40); |
6583 | 6423 | ||
6584 | current.merge(this_INT_5); | 6424 | current.merge(this_INT_5); |
6585 | 6425 | ||
@@ -6592,27 +6432,27 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6592 | 6432 | ||
6593 | } | 6433 | } |
6594 | 6434 | ||
6595 | // InternalProblem.g:2375:5: (kw= 'e' | kw= 'E' ) | 6435 | // InternalProblem.g:2324:5: (kw= 'e' | kw= 'E' ) |
6596 | int alt51=2; | 6436 | int alt49=2; |
6597 | int LA51_0 = input.LA(1); | 6437 | int LA49_0 = input.LA(1); |
6598 | 6438 | ||
6599 | if ( (LA51_0==43) ) { | 6439 | if ( (LA49_0==43) ) { |
6600 | alt51=1; | 6440 | alt49=1; |
6601 | } | 6441 | } |
6602 | else if ( (LA51_0==44) ) { | 6442 | else if ( (LA49_0==44) ) { |
6603 | alt51=2; | 6443 | alt49=2; |
6604 | } | 6444 | } |
6605 | else { | 6445 | else { |
6606 | NoViableAltException nvae = | 6446 | NoViableAltException nvae = |
6607 | new NoViableAltException("", 51, 0, input); | 6447 | new NoViableAltException("", 49, 0, input); |
6608 | 6448 | ||
6609 | throw nvae; | 6449 | throw nvae; |
6610 | } | 6450 | } |
6611 | switch (alt51) { | 6451 | switch (alt49) { |
6612 | case 1 : | 6452 | case 1 : |
6613 | // InternalProblem.g:2376:6: kw= 'e' | 6453 | // InternalProblem.g:2325:6: kw= 'e' |
6614 | { | 6454 | { |
6615 | kw=(Token)match(input,43,FOLLOW_42); | 6455 | kw=(Token)match(input,43,FOLLOW_41); |
6616 | 6456 | ||
6617 | current.merge(kw); | 6457 | current.merge(kw); |
6618 | newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_0()); | 6458 | newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_0()); |
@@ -6621,9 +6461,9 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6621 | } | 6461 | } |
6622 | break; | 6462 | break; |
6623 | case 2 : | 6463 | case 2 : |
6624 | // InternalProblem.g:2382:6: kw= 'E' | 6464 | // InternalProblem.g:2331:6: kw= 'E' |
6625 | { | 6465 | { |
6626 | kw=(Token)match(input,44,FOLLOW_42); | 6466 | kw=(Token)match(input,44,FOLLOW_41); |
6627 | 6467 | ||
6628 | current.merge(kw); | 6468 | current.merge(kw); |
6629 | newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_1()); | 6469 | newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_1()); |
@@ -6634,19 +6474,19 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6634 | 6474 | ||
6635 | } | 6475 | } |
6636 | 6476 | ||
6637 | // InternalProblem.g:2388:5: (kw= '-' | kw= '+' )? | 6477 | // InternalProblem.g:2337:5: (kw= '-' | kw= '+' )? |
6638 | int alt52=3; | 6478 | int alt50=3; |
6639 | int LA52_0 = input.LA(1); | 6479 | int LA50_0 = input.LA(1); |
6640 | 6480 | ||
6641 | if ( (LA52_0==45) ) { | 6481 | if ( (LA50_0==45) ) { |
6642 | alt52=1; | 6482 | alt50=1; |
6643 | } | 6483 | } |
6644 | else if ( (LA52_0==33) ) { | 6484 | else if ( (LA50_0==33) ) { |
6645 | alt52=2; | 6485 | alt50=2; |
6646 | } | 6486 | } |
6647 | switch (alt52) { | 6487 | switch (alt50) { |
6648 | case 1 : | 6488 | case 1 : |
6649 | // InternalProblem.g:2389:6: kw= '-' | 6489 | // InternalProblem.g:2338:6: kw= '-' |
6650 | { | 6490 | { |
6651 | kw=(Token)match(input,45,FOLLOW_17); | 6491 | kw=(Token)match(input,45,FOLLOW_17); |
6652 | 6492 | ||
@@ -6657,7 +6497,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6657 | } | 6497 | } |
6658 | break; | 6498 | break; |
6659 | case 2 : | 6499 | case 2 : |
6660 | // InternalProblem.g:2395:6: kw= '+' | 6500 | // InternalProblem.g:2344:6: kw= '+' |
6661 | { | 6501 | { |
6662 | kw=(Token)match(input,33,FOLLOW_17); | 6502 | kw=(Token)match(input,33,FOLLOW_17); |
6663 | 6503 | ||
@@ -6712,7 +6552,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6712 | 6552 | ||
6713 | 6553 | ||
6714 | // $ANTLR start "ruleLogicValue" | 6554 | // $ANTLR start "ruleLogicValue" |
6715 | // InternalProblem.g:2417:1: ruleLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ; | 6555 | // InternalProblem.g:2366:1: ruleLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ; |
6716 | public final Enumerator ruleLogicValue() throws RecognitionException { | 6556 | public final Enumerator ruleLogicValue() throws RecognitionException { |
6717 | Enumerator current = null; | 6557 | Enumerator current = null; |
6718 | 6558 | ||
@@ -6724,40 +6564,40 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6724 | enterRule(); | 6564 | enterRule(); |
6725 | 6565 | ||
6726 | try { | 6566 | try { |
6727 | // InternalProblem.g:2423:2: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ) | 6567 | // InternalProblem.g:2372:2: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ) |
6728 | // InternalProblem.g:2424:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) | 6568 | // InternalProblem.g:2373:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) |
6729 | { | 6569 | { |
6730 | // InternalProblem.g:2424:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) | 6570 | // InternalProblem.g:2373:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) |
6731 | int alt54=3; | 6571 | int alt52=3; |
6732 | switch ( input.LA(1) ) { | 6572 | switch ( input.LA(1) ) { |
6733 | case 41: | 6573 | case 41: |
6734 | { | 6574 | { |
6735 | alt54=1; | 6575 | alt52=1; |
6736 | } | 6576 | } |
6737 | break; | 6577 | break; |
6738 | case 42: | 6578 | case 42: |
6739 | { | 6579 | { |
6740 | alt54=2; | 6580 | alt52=2; |
6741 | } | 6581 | } |
6742 | break; | 6582 | break; |
6743 | case 46: | 6583 | case 46: |
6744 | { | 6584 | { |
6745 | alt54=3; | 6585 | alt52=3; |
6746 | } | 6586 | } |
6747 | break; | 6587 | break; |
6748 | default: | 6588 | default: |
6749 | NoViableAltException nvae = | 6589 | NoViableAltException nvae = |
6750 | new NoViableAltException("", 54, 0, input); | 6590 | new NoViableAltException("", 52, 0, input); |
6751 | 6591 | ||
6752 | throw nvae; | 6592 | throw nvae; |
6753 | } | 6593 | } |
6754 | 6594 | ||
6755 | switch (alt54) { | 6595 | switch (alt52) { |
6756 | case 1 : | 6596 | case 1 : |
6757 | // InternalProblem.g:2425:3: (enumLiteral_0= 'true' ) | 6597 | // InternalProblem.g:2374:3: (enumLiteral_0= 'true' ) |
6758 | { | 6598 | { |
6759 | // InternalProblem.g:2425:3: (enumLiteral_0= 'true' ) | 6599 | // InternalProblem.g:2374:3: (enumLiteral_0= 'true' ) |
6760 | // InternalProblem.g:2426:4: enumLiteral_0= 'true' | 6600 | // InternalProblem.g:2375:4: enumLiteral_0= 'true' |
6761 | { | 6601 | { |
6762 | enumLiteral_0=(Token)match(input,41,FOLLOW_2); | 6602 | enumLiteral_0=(Token)match(input,41,FOLLOW_2); |
6763 | 6603 | ||
@@ -6771,10 +6611,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6771 | } | 6611 | } |
6772 | break; | 6612 | break; |
6773 | case 2 : | 6613 | case 2 : |
6774 | // InternalProblem.g:2433:3: (enumLiteral_1= 'false' ) | 6614 | // InternalProblem.g:2382:3: (enumLiteral_1= 'false' ) |
6775 | { | 6615 | { |
6776 | // InternalProblem.g:2433:3: (enumLiteral_1= 'false' ) | 6616 | // InternalProblem.g:2382:3: (enumLiteral_1= 'false' ) |
6777 | // InternalProblem.g:2434:4: enumLiteral_1= 'false' | 6617 | // InternalProblem.g:2383:4: enumLiteral_1= 'false' |
6778 | { | 6618 | { |
6779 | enumLiteral_1=(Token)match(input,42,FOLLOW_2); | 6619 | enumLiteral_1=(Token)match(input,42,FOLLOW_2); |
6780 | 6620 | ||
@@ -6788,10 +6628,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6788 | } | 6628 | } |
6789 | break; | 6629 | break; |
6790 | case 3 : | 6630 | case 3 : |
6791 | // InternalProblem.g:2441:3: (enumLiteral_2= 'unknown' ) | 6631 | // InternalProblem.g:2390:3: (enumLiteral_2= 'unknown' ) |
6792 | { | 6632 | { |
6793 | // InternalProblem.g:2441:3: (enumLiteral_2= 'unknown' ) | 6633 | // InternalProblem.g:2390:3: (enumLiteral_2= 'unknown' ) |
6794 | // InternalProblem.g:2442:4: enumLiteral_2= 'unknown' | 6634 | // InternalProblem.g:2391:4: enumLiteral_2= 'unknown' |
6795 | { | 6635 | { |
6796 | enumLiteral_2=(Token)match(input,46,FOLLOW_2); | 6636 | enumLiteral_2=(Token)match(input,46,FOLLOW_2); |
6797 | 6637 | ||
@@ -6827,7 +6667,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6827 | 6667 | ||
6828 | 6668 | ||
6829 | // $ANTLR start "ruleShortLogicValue" | 6669 | // $ANTLR start "ruleShortLogicValue" |
6830 | // InternalProblem.g:2452:1: ruleShortLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ; | 6670 | // InternalProblem.g:2401:1: ruleShortLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ; |
6831 | public final Enumerator ruleShortLogicValue() throws RecognitionException { | 6671 | public final Enumerator ruleShortLogicValue() throws RecognitionException { |
6832 | Enumerator current = null; | 6672 | Enumerator current = null; |
6833 | 6673 | ||
@@ -6838,31 +6678,31 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6838 | enterRule(); | 6678 | enterRule(); |
6839 | 6679 | ||
6840 | try { | 6680 | try { |
6841 | // InternalProblem.g:2458:2: ( ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ) | 6681 | // InternalProblem.g:2407:2: ( ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ) |
6842 | // InternalProblem.g:2459:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) | 6682 | // InternalProblem.g:2408:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) |
6843 | { | 6683 | { |
6844 | // InternalProblem.g:2459:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) | 6684 | // InternalProblem.g:2408:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) |
6845 | int alt55=2; | 6685 | int alt53=2; |
6846 | int LA55_0 = input.LA(1); | 6686 | int LA53_0 = input.LA(1); |
6847 | 6687 | ||
6848 | if ( (LA55_0==32) ) { | 6688 | if ( (LA53_0==32) ) { |
6849 | alt55=1; | 6689 | alt53=1; |
6850 | } | 6690 | } |
6851 | else if ( (LA55_0==47) ) { | 6691 | else if ( (LA53_0==47) ) { |
6852 | alt55=2; | 6692 | alt53=2; |
6853 | } | 6693 | } |
6854 | else { | 6694 | else { |
6855 | NoViableAltException nvae = | 6695 | NoViableAltException nvae = |
6856 | new NoViableAltException("", 55, 0, input); | 6696 | new NoViableAltException("", 53, 0, input); |
6857 | 6697 | ||
6858 | throw nvae; | 6698 | throw nvae; |
6859 | } | 6699 | } |
6860 | switch (alt55) { | 6700 | switch (alt53) { |
6861 | case 1 : | 6701 | case 1 : |
6862 | // InternalProblem.g:2460:3: (enumLiteral_0= '!' ) | 6702 | // InternalProblem.g:2409:3: (enumLiteral_0= '!' ) |
6863 | { | 6703 | { |
6864 | // InternalProblem.g:2460:3: (enumLiteral_0= '!' ) | 6704 | // InternalProblem.g:2409:3: (enumLiteral_0= '!' ) |
6865 | // InternalProblem.g:2461:4: enumLiteral_0= '!' | 6705 | // InternalProblem.g:2410:4: enumLiteral_0= '!' |
6866 | { | 6706 | { |
6867 | enumLiteral_0=(Token)match(input,32,FOLLOW_2); | 6707 | enumLiteral_0=(Token)match(input,32,FOLLOW_2); |
6868 | 6708 | ||
@@ -6876,10 +6716,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6876 | } | 6716 | } |
6877 | break; | 6717 | break; |
6878 | case 2 : | 6718 | case 2 : |
6879 | // InternalProblem.g:2468:3: (enumLiteral_1= '?' ) | 6719 | // InternalProblem.g:2417:3: (enumLiteral_1= '?' ) |
6880 | { | 6720 | { |
6881 | // InternalProblem.g:2468:3: (enumLiteral_1= '?' ) | 6721 | // InternalProblem.g:2417:3: (enumLiteral_1= '?' ) |
6882 | // InternalProblem.g:2469:4: enumLiteral_1= '?' | 6722 | // InternalProblem.g:2418:4: enumLiteral_1= '?' |
6883 | { | 6723 | { |
6884 | enumLiteral_1=(Token)match(input,47,FOLLOW_2); | 6724 | enumLiteral_1=(Token)match(input,47,FOLLOW_2); |
6885 | 6725 | ||
@@ -6918,11 +6758,11 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6918 | 6758 | ||
6919 | protected DFA3 dfa3 = new DFA3(this); | 6759 | protected DFA3 dfa3 = new DFA3(this); |
6920 | protected DFA35 dfa35 = new DFA35(this); | 6760 | protected DFA35 dfa35 = new DFA35(this); |
6921 | static final String dfa_1s = "\24\uffff"; | 6761 | static final String dfa_1s = "\23\uffff"; |
6922 | static final String dfa_2s = "\1\5\3\uffff\6\35\3\uffff\1\5\6\35"; | 6762 | static final String dfa_2s = "\1\5\3\uffff\6\35\3\uffff\1\5\5\35"; |
6923 | static final String dfa_3s = "\1\57\3\uffff\1\42\5\50\3\uffff\1\54\5\50\1\42"; | 6763 | static final String dfa_3s = "\1\57\3\uffff\1\42\5\50\3\uffff\1\54\5\50"; |
6924 | static final String dfa_4s = "\1\uffff\1\1\1\2\1\3\6\uffff\1\4\1\6\1\5\7\uffff"; | 6764 | static final String dfa_4s = "\1\uffff\1\1\1\2\1\3\6\uffff\1\4\1\6\1\5\6\uffff"; |
6925 | static final String dfa_5s = "\24\uffff}>"; | 6765 | static final String dfa_5s = "\23\uffff}>"; |
6926 | static final String[] dfa_6s = { | 6766 | static final String[] dfa_6s = { |
6927 | "\1\5\1\uffff\1\4\6\uffff\2\1\5\uffff\1\2\5\uffff\2\3\3\uffff\1\12\2\uffff\1\13\5\uffff\1\6\1\7\1\10\1\11\2\uffff\1\12", | 6767 | "\1\5\1\uffff\1\4\6\uffff\2\1\5\uffff\1\2\5\uffff\2\3\3\uffff\1\12\2\uffff\1\13\5\uffff\1\6\1\7\1\10\1\11\2\uffff\1\12", |
6928 | "", | 6768 | "", |
@@ -6937,13 +6777,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6937 | "", | 6777 | "", |
6938 | "", | 6778 | "", |
6939 | "", | 6779 | "", |
6940 | "\1\16\1\uffff\1\23\41\uffff\1\17\1\20\1\21\1\22", | 6780 | "\1\16\43\uffff\1\17\1\20\1\21\1\22", |
6941 | "\1\12\4\uffff\1\14\5\uffff\1\15", | ||
6942 | "\1\12\4\uffff\1\14\5\uffff\1\15", | 6781 | "\1\12\4\uffff\1\14\5\uffff\1\15", |
6943 | "\1\12\4\uffff\1\14\5\uffff\1\15", | 6782 | "\1\12\4\uffff\1\14\5\uffff\1\15", |
6944 | "\1\12\4\uffff\1\14\5\uffff\1\15", | 6783 | "\1\12\4\uffff\1\14\5\uffff\1\15", |
6945 | "\1\12\4\uffff\1\14\5\uffff\1\15", | 6784 | "\1\12\4\uffff\1\14\5\uffff\1\15", |
6946 | "\1\12\4\uffff\1\14" | 6785 | "\1\12\4\uffff\1\14\5\uffff\1\15" |
6947 | }; | 6786 | }; |
6948 | 6787 | ||
6949 | static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); | 6788 | static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); |
@@ -6970,11 +6809,11 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6970 | return "146:2: (this_ClassDeclaration_0= ruleClassDeclaration | this_EnumDeclaration_1= ruleEnumDeclaration | this_PredicateDefinition_2= rulePredicateDefinition | this_Assertion_3= ruleAssertion | this_NodeValueAssertion_4= ruleNodeValueAssertion | this_ScopeDeclaration_5= ruleScopeDeclaration )"; | 6809 | return "146:2: (this_ClassDeclaration_0= ruleClassDeclaration | this_EnumDeclaration_1= ruleEnumDeclaration | this_PredicateDefinition_2= rulePredicateDefinition | this_Assertion_3= ruleAssertion | this_NodeValueAssertion_4= ruleNodeValueAssertion | this_ScopeDeclaration_5= ruleScopeDeclaration )"; |
6971 | } | 6810 | } |
6972 | } | 6811 | } |
6973 | static final String dfa_7s = "\101\uffff"; | 6812 | static final String dfa_7s = "\76\uffff"; |
6974 | static final String dfa_8s = "\1\5\6\35\1\uffff\1\4\1\5\6\21\1\6\1\15\1\21\1\15\6\35\1\4\1\5\3\6\1\uffff\6\21\1\6\1\15\10\21\2\6\1\21\1\5\3\6\7\21\2\6\1\21"; | 6813 | static final String dfa_8s = "\1\5\6\35\1\uffff\1\4\1\5\6\21\1\6\1\15\1\21\1\15\5\35\1\4\1\5\3\6\1\uffff\6\21\1\6\1\15\7\21\2\6\1\21\1\5\3\6\6\21\2\6\1\21"; |
6975 | static final String dfa_9s = "\1\57\1\35\5\50\1\uffff\1\55\1\54\1\36\5\50\1\6\1\54\1\36\1\42\5\50\1\35\1\55\1\54\1\6\2\55\1\uffff\1\36\5\50\1\6\1\54\1\36\5\50\1\36\1\54\2\6\1\36\1\54\1\6\2\55\5\50\1\36\1\54\2\6\1\36"; | 6814 | static final String dfa_9s = "\1\57\1\35\5\50\1\uffff\1\55\1\54\1\36\5\50\1\6\1\54\1\36\1\42\5\50\1\55\1\54\1\6\2\55\1\uffff\1\36\5\50\1\6\1\54\1\36\5\50\1\54\2\6\1\36\1\54\1\6\2\55\5\50\1\54\2\6\1\36"; |
6976 | static final String dfa_10s = "\7\uffff\1\2\27\uffff\1\1\41\uffff"; | 6815 | static final String dfa_10s = "\7\uffff\1\2\26\uffff\1\1\37\uffff"; |
6977 | static final String dfa_11s = "\101\uffff}>"; | 6816 | static final String dfa_11s = "\76\uffff}>"; |
6978 | static final String[] dfa_12s = { | 6817 | static final String[] dfa_12s = { |
6979 | "\1\2\1\uffff\1\1\30\uffff\1\7\10\uffff\1\3\1\4\1\5\1\6\2\uffff\1\7", | 6818 | "\1\2\1\uffff\1\1\30\uffff\1\7\10\uffff\1\3\1\4\1\5\1\6\2\uffff\1\7", |
6980 | "\1\10", | 6819 | "\1\10", |
@@ -6985,62 +6824,59 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
6985 | "\1\10\12\uffff\1\11", | 6824 | "\1\10\12\uffff\1\11", |
6986 | "", | 6825 | "", |
6987 | "\1\22\1\13\1\21\1\12\26\uffff\1\23\12\uffff\1\14\1\15\1\16\1\17\1\20", | 6826 | "\1\22\1\13\1\21\1\12\26\uffff\1\23\12\uffff\1\14\1\15\1\16\1\17\1\20", |
6988 | "\1\24\1\uffff\1\31\41\uffff\1\25\1\26\1\27\1\30", | 6827 | "\1\24\43\uffff\1\25\1\26\1\27\1\30", |
6989 | "\1\32\14\uffff\1\23", | 6828 | "\1\31\14\uffff\1\23", |
6990 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6829 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
6991 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6830 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
6992 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6831 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
6993 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6832 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
6994 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6833 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
6995 | "\1\21", | 6834 | "\1\21", |
6996 | "\1\34\3\uffff\1\32\14\uffff\1\23\14\uffff\1\35\1\36", | 6835 | "\1\33\3\uffff\1\31\14\uffff\1\23\14\uffff\1\34\1\35", |
6997 | "\1\32\14\uffff\1\23", | 6836 | "\1\31\14\uffff\1\23", |
6998 | "\1\7\24\uffff\1\37", | 6837 | "\1\7\24\uffff\1\36", |
6999 | "\1\10\12\uffff\1\11", | 6838 | "\1\10\12\uffff\1\11", |
7000 | "\1\10\12\uffff\1\11", | 6839 | "\1\10\12\uffff\1\11", |
7001 | "\1\10\12\uffff\1\11", | 6840 | "\1\10\12\uffff\1\11", |
7002 | "\1\10\12\uffff\1\11", | 6841 | "\1\10\12\uffff\1\11", |
7003 | "\1\10\12\uffff\1\11", | 6842 | "\1\10\12\uffff\1\11", |
7004 | "\1\10", | 6843 | "\1\47\1\40\1\46\1\37\41\uffff\1\41\1\42\1\43\1\44\1\45", |
7005 | "\1\50\1\41\1\47\1\40\41\uffff\1\42\1\43\1\44\1\45\1\46", | 6844 | "\1\50\43\uffff\1\51\1\52\1\53\1\54", |
7006 | "\1\51\1\uffff\1\56\41\uffff\1\52\1\53\1\54\1\55", | 6845 | "\1\55", |
7007 | "\1\57", | 6846 | "\1\60\32\uffff\1\57\13\uffff\1\56", |
7008 | "\1\62\32\uffff\1\61\13\uffff\1\60", | 6847 | "\1\60\32\uffff\1\57\13\uffff\1\56", |
7009 | "\1\62\32\uffff\1\61\13\uffff\1\60", | ||
7010 | "", | 6848 | "", |
7011 | "\1\32\14\uffff\1\23", | 6849 | "\1\31\14\uffff\1\23", |
7012 | "\1\32\14\uffff\1\23\11\uffff\1\63", | 6850 | "\1\31\14\uffff\1\23\11\uffff\1\61", |
7013 | "\1\32\14\uffff\1\23\11\uffff\1\63", | 6851 | "\1\31\14\uffff\1\23\11\uffff\1\61", |
7014 | "\1\32\14\uffff\1\23\11\uffff\1\63", | 6852 | "\1\31\14\uffff\1\23\11\uffff\1\61", |
7015 | "\1\32\14\uffff\1\23\11\uffff\1\63", | 6853 | "\1\31\14\uffff\1\23\11\uffff\1\61", |
7016 | "\1\32\14\uffff\1\23\11\uffff\1\63", | 6854 | "\1\31\14\uffff\1\23\11\uffff\1\61", |
7017 | "\1\47", | 6855 | "\1\46", |
7018 | "\1\64\3\uffff\1\32\14\uffff\1\23\14\uffff\1\65\1\66", | 6856 | "\1\62\3\uffff\1\31\14\uffff\1\23\14\uffff\1\63\1\64", |
7019 | "\1\32\14\uffff\1\23", | 6857 | "\1\31\14\uffff\1\23", |
7020 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6858 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
7021 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6859 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
7022 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6860 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
7023 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6861 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
7024 | "\1\32\14\uffff\1\23\11\uffff\1\33", | 6862 | "\1\31\14\uffff\1\23\11\uffff\1\32", |
7025 | "\1\32\14\uffff\1\23", | 6863 | "\1\31\14\uffff\1\23\14\uffff\1\34\1\35", |
7026 | "\1\32\14\uffff\1\23\14\uffff\1\35\1\36", | 6864 | "\1\60", |
7027 | "\1\62", | 6865 | "\1\60", |
7028 | "\1\62", | 6866 | "\1\31\14\uffff\1\23", |
7029 | "\1\32\14\uffff\1\23", | 6867 | "\1\65\43\uffff\1\66\1\67\1\70\1\71", |
7030 | "\1\67\1\uffff\1\74\41\uffff\1\70\1\71\1\72\1\73", | 6868 | "\1\72", |
6869 | "\1\75\32\uffff\1\74\13\uffff\1\73", | ||
6870 | "\1\75\32\uffff\1\74\13\uffff\1\73", | ||
6871 | "\1\31\14\uffff\1\23\11\uffff\1\61", | ||
6872 | "\1\31\14\uffff\1\23\11\uffff\1\61", | ||
6873 | "\1\31\14\uffff\1\23\11\uffff\1\61", | ||
6874 | "\1\31\14\uffff\1\23\11\uffff\1\61", | ||
6875 | "\1\31\14\uffff\1\23\11\uffff\1\61", | ||
6876 | "\1\31\14\uffff\1\23\14\uffff\1\63\1\64", | ||
6877 | "\1\75", | ||
7031 | "\1\75", | 6878 | "\1\75", |
7032 | "\1\100\32\uffff\1\77\13\uffff\1\76", | 6879 | "\1\31\14\uffff\1\23" |
7033 | "\1\100\32\uffff\1\77\13\uffff\1\76", | ||
7034 | "\1\32\14\uffff\1\23\11\uffff\1\63", | ||
7035 | "\1\32\14\uffff\1\23\11\uffff\1\63", | ||
7036 | "\1\32\14\uffff\1\23\11\uffff\1\63", | ||
7037 | "\1\32\14\uffff\1\23\11\uffff\1\63", | ||
7038 | "\1\32\14\uffff\1\23\11\uffff\1\63", | ||
7039 | "\1\32\14\uffff\1\23", | ||
7040 | "\1\32\14\uffff\1\23\14\uffff\1\65\1\66", | ||
7041 | "\1\100", | ||
7042 | "\1\100", | ||
7043 | "\1\32\14\uffff\1\23" | ||
7044 | }; | 6880 | }; |
7045 | 6881 | ||
7046 | static final short[] dfa_7 = DFA.unpackEncodedString(dfa_7s); | 6882 | static final short[] dfa_7 = DFA.unpackEncodedString(dfa_7s); |
@@ -7081,7 +6917,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
7081 | public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x00001E0000D000A0L}); | 6917 | public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x00001E0000D000A0L}); |
7082 | public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00001E0000D800A0L}); | 6918 | public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00001E0000D800A0L}); |
7083 | public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000042000L}); | 6919 | public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000042000L}); |
7084 | public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00001E00001000A0L}); | 6920 | public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00001E0000100020L}); |
7085 | public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x00000000001A0000L}); | 6921 | public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x00000000001A0000L}); |
7086 | public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100000L}); | 6922 | public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100000L}); |
7087 | public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x00001E0001000020L}); | 6923 | public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x00001E0001000020L}); |
@@ -7107,9 +6943,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { | |||
7107 | public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000004000000000L}); | 6943 | public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000004000000000L}); |
7108 | public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x0000008000000040L}); | 6944 | public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x0000008000000040L}); |
7109 | public static final BitSet FOLLOW_38 = new BitSet(new long[]{0x0000010000000002L}); | 6945 | public static final BitSet FOLLOW_38 = new BitSet(new long[]{0x0000010000000002L}); |
7110 | public static final BitSet FOLLOW_39 = new BitSet(new long[]{0x0000000000000080L}); | 6946 | public static final BitSet FOLLOW_39 = new BitSet(new long[]{0x0000180000002000L}); |
7111 | public static final BitSet FOLLOW_40 = new BitSet(new long[]{0x0000180000002000L}); | 6947 | public static final BitSet FOLLOW_40 = new BitSet(new long[]{0x0000180000000000L}); |
7112 | public static final BitSet FOLLOW_41 = new BitSet(new long[]{0x0000180000000000L}); | 6948 | public static final BitSet FOLLOW_41 = new BitSet(new long[]{0x0000200200000040L}); |
7113 | public static final BitSet FOLLOW_42 = new BitSet(new long[]{0x0000200200000040L}); | ||
7114 | 6949 | ||
7115 | } \ No newline at end of file | 6950 | } \ No newline at end of file |
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java index 012363db..0aac4924 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java | |||
@@ -246,7 +246,7 @@ public class ProblemSemanticSequencer extends AbstractDelegatingSemanticSequence | |||
246 | * EnumLiteral returns Node | 246 | * EnumLiteral returns Node |
247 | * | 247 | * |
248 | * Constraint: | 248 | * Constraint: |
249 | * name=QuotedOrUnquotedId | 249 | * name=Identifier |
250 | */ | 250 | */ |
251 | protected void sequence_EnumLiteral(ISerializationContext context, Node semanticObject) { | 251 | protected void sequence_EnumLiteral(ISerializationContext context, Node semanticObject) { |
252 | if (errorAcceptor != null) { | 252 | if (errorAcceptor != null) { |
@@ -254,7 +254,7 @@ public class ProblemSemanticSequencer extends AbstractDelegatingSemanticSequence | |||
254 | errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.NAMED_ELEMENT__NAME)); | 254 | errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.NAMED_ELEMENT__NAME)); |
255 | } | 255 | } |
256 | SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); | 256 | SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); |
257 | feeder.accept(grammarAccess.getEnumLiteralAccess().getNameQuotedOrUnquotedIdParserRuleCall_0(), semanticObject.getName()); | 257 | feeder.accept(grammarAccess.getEnumLiteralAccess().getNameIdentifierParserRuleCall_0(), semanticObject.getName()); |
258 | feeder.finish(); | 258 | feeder.finish(); |
259 | } | 259 | } |
260 | 260 | ||
diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java index 2cb37dbc..603f12e3 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java | |||
@@ -305,17 +305,17 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
305 | public class EnumLiteralElements extends AbstractParserRuleElementFinder { | 305 | public class EnumLiteralElements extends AbstractParserRuleElementFinder { |
306 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.EnumLiteral"); | 306 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.EnumLiteral"); |
307 | private final Assignment cNameAssignment = (Assignment)rule.eContents().get(1); | 307 | private final Assignment cNameAssignment = (Assignment)rule.eContents().get(1); |
308 | private final RuleCall cNameQuotedOrUnquotedIdParserRuleCall_0 = (RuleCall)cNameAssignment.eContents().get(0); | 308 | private final RuleCall cNameIdentifierParserRuleCall_0 = (RuleCall)cNameAssignment.eContents().get(0); |
309 | 309 | ||
310 | //EnumLiteral returns Node: | 310 | //EnumLiteral returns Node: |
311 | // name=QuotedOrUnquotedId; | 311 | // name=Identifier; |
312 | @Override public ParserRule getRule() { return rule; } | 312 | @Override public ParserRule getRule() { return rule; } |
313 | 313 | ||
314 | //name=QuotedOrUnquotedId | 314 | //name=Identifier |
315 | public Assignment getNameAssignment() { return cNameAssignment; } | 315 | public Assignment getNameAssignment() { return cNameAssignment; } |
316 | 316 | ||
317 | //QuotedOrUnquotedId | 317 | //Identifier |
318 | public RuleCall getNameQuotedOrUnquotedIdParserRuleCall_0() { return cNameQuotedOrUnquotedIdParserRuleCall_0; } | 318 | public RuleCall getNameIdentifierParserRuleCall_0() { return cNameIdentifierParserRuleCall_0; } |
319 | } | 319 | } |
320 | public class ReferenceDeclarationElements extends AbstractParserRuleElementFinder { | 320 | public class ReferenceDeclarationElements extends AbstractParserRuleElementFinder { |
321 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration"); | 321 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration"); |
@@ -1299,25 +1299,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1299 | //"*" | 1299 | //"*" |
1300 | public Keyword getAsteriskKeyword_1() { return cAsteriskKeyword_1; } | 1300 | public Keyword getAsteriskKeyword_1() { return cAsteriskKeyword_1; } |
1301 | } | 1301 | } |
1302 | public class QuotedOrUnquotedIdElements extends AbstractParserRuleElementFinder { | ||
1303 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.QuotedOrUnquotedId"); | ||
1304 | private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); | ||
1305 | private final RuleCall cQUOTED_IDTerminalRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); | ||
1306 | private final RuleCall cIdentifierParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); | ||
1307 | |||
1308 | //QuotedOrUnquotedId: | ||
1309 | // QUOTED_ID | Identifier; | ||
1310 | @Override public ParserRule getRule() { return rule; } | ||
1311 | |||
1312 | //QUOTED_ID | Identifier | ||
1313 | public Alternatives getAlternatives() { return cAlternatives; } | ||
1314 | |||
1315 | //QUOTED_ID | ||
1316 | public RuleCall getQUOTED_IDTerminalRuleCall_0() { return cQUOTED_IDTerminalRuleCall_0; } | ||
1317 | |||
1318 | //Identifier | ||
1319 | public RuleCall getIdentifierParserRuleCall_1() { return cIdentifierParserRuleCall_1; } | ||
1320 | } | ||
1321 | public class QualifiedNameElements extends AbstractParserRuleElementFinder { | 1302 | public class QualifiedNameElements extends AbstractParserRuleElementFinder { |
1322 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.QualifiedName"); | 1303 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.QualifiedName"); |
1323 | private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); | 1304 | private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); |
@@ -1327,21 +1308,18 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1327 | private final Group cGroup_1_1 = (Group)cGroup_1.eContents().get(1); | 1308 | private final Group cGroup_1_1 = (Group)cGroup_1.eContents().get(1); |
1328 | private final Keyword cColonColonKeyword_1_1_0 = (Keyword)cGroup_1_1.eContents().get(0); | 1309 | private final Keyword cColonColonKeyword_1_1_0 = (Keyword)cGroup_1_1.eContents().get(0); |
1329 | private final RuleCall cIdentifierParserRuleCall_1_1_1 = (RuleCall)cGroup_1_1.eContents().get(1); | 1310 | private final RuleCall cIdentifierParserRuleCall_1_1_1 = (RuleCall)cGroup_1_1.eContents().get(1); |
1330 | private final Group cGroup_1_2 = (Group)cGroup_1.eContents().get(2); | ||
1331 | private final Keyword cColonColonKeyword_1_2_0 = (Keyword)cGroup_1_2.eContents().get(0); | ||
1332 | private final RuleCall cQUOTED_IDTerminalRuleCall_1_2_1 = (RuleCall)cGroup_1_2.eContents().get(1); | ||
1333 | 1311 | ||
1334 | //QualifiedName hidden(): | 1312 | //QualifiedName hidden(): |
1335 | // QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; | 1313 | // QUOTED_ID | Identifier ("::" Identifier)*; |
1336 | @Override public ParserRule getRule() { return rule; } | 1314 | @Override public ParserRule getRule() { return rule; } |
1337 | 1315 | ||
1338 | //QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)? | 1316 | //QUOTED_ID | Identifier ("::" Identifier)* |
1339 | public Alternatives getAlternatives() { return cAlternatives; } | 1317 | public Alternatives getAlternatives() { return cAlternatives; } |
1340 | 1318 | ||
1341 | //QUOTED_ID | 1319 | //QUOTED_ID |
1342 | public RuleCall getQUOTED_IDTerminalRuleCall_0() { return cQUOTED_IDTerminalRuleCall_0; } | 1320 | public RuleCall getQUOTED_IDTerminalRuleCall_0() { return cQUOTED_IDTerminalRuleCall_0; } |
1343 | 1321 | ||
1344 | //Identifier ("::" Identifier)* ("::" QUOTED_ID)? | 1322 | //Identifier ("::" Identifier)* |
1345 | public Group getGroup_1() { return cGroup_1; } | 1323 | public Group getGroup_1() { return cGroup_1; } |
1346 | 1324 | ||
1347 | //Identifier | 1325 | //Identifier |
@@ -1355,15 +1333,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1355 | 1333 | ||
1356 | //Identifier | 1334 | //Identifier |
1357 | public RuleCall getIdentifierParserRuleCall_1_1_1() { return cIdentifierParserRuleCall_1_1_1; } | 1335 | public RuleCall getIdentifierParserRuleCall_1_1_1() { return cIdentifierParserRuleCall_1_1_1; } |
1358 | |||
1359 | //("::" QUOTED_ID)? | ||
1360 | public Group getGroup_1_2() { return cGroup_1_2; } | ||
1361 | |||
1362 | //"::" | ||
1363 | public Keyword getColonColonKeyword_1_2_0() { return cColonColonKeyword_1_2_0; } | ||
1364 | |||
1365 | //QUOTED_ID | ||
1366 | public RuleCall getQUOTED_IDTerminalRuleCall_1_2_1() { return cQUOTED_IDTerminalRuleCall_1_2_1; } | ||
1367 | } | 1336 | } |
1368 | public class IdentifierElements extends AbstractParserRuleElementFinder { | 1337 | public class IdentifierElements extends AbstractParserRuleElementFinder { |
1369 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Identifier"); | 1338 | private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Identifier"); |
@@ -1592,7 +1561,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1592 | private final RangeMultiplicityElements pRangeMultiplicity; | 1561 | private final RangeMultiplicityElements pRangeMultiplicity; |
1593 | private final ExactMultiplicityElements pExactMultiplicity; | 1562 | private final ExactMultiplicityElements pExactMultiplicity; |
1594 | private final UpperBoundElements pUpperBound; | 1563 | private final UpperBoundElements pUpperBound; |
1595 | private final QuotedOrUnquotedIdElements pQuotedOrUnquotedId; | ||
1596 | private final QualifiedNameElements pQualifiedName; | 1564 | private final QualifiedNameElements pQualifiedName; |
1597 | private final IdentifierElements pIdentifier; | 1565 | private final IdentifierElements pIdentifier; |
1598 | private final IntegerElements pInteger; | 1566 | private final IntegerElements pInteger; |
@@ -1645,7 +1613,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1645 | this.pRangeMultiplicity = new RangeMultiplicityElements(); | 1613 | this.pRangeMultiplicity = new RangeMultiplicityElements(); |
1646 | this.pExactMultiplicity = new ExactMultiplicityElements(); | 1614 | this.pExactMultiplicity = new ExactMultiplicityElements(); |
1647 | this.pUpperBound = new UpperBoundElements(); | 1615 | this.pUpperBound = new UpperBoundElements(); |
1648 | this.pQuotedOrUnquotedId = new QuotedOrUnquotedIdElements(); | ||
1649 | this.pQualifiedName = new QualifiedNameElements(); | 1616 | this.pQualifiedName = new QualifiedNameElements(); |
1650 | this.pIdentifier = new IdentifierElements(); | 1617 | this.pIdentifier = new IdentifierElements(); |
1651 | this.pInteger = new IntegerElements(); | 1618 | this.pInteger = new IntegerElements(); |
@@ -1730,7 +1697,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
1730 | } | 1697 | } |
1731 | 1698 | ||
1732 | //EnumLiteral returns Node: | 1699 | //EnumLiteral returns Node: |
1733 | // name=QuotedOrUnquotedId; | 1700 | // name=Identifier; |
1734 | public EnumLiteralElements getEnumLiteralAccess() { | 1701 | public EnumLiteralElements getEnumLiteralAccess() { |
1735 | return pEnumLiteral; | 1702 | return pEnumLiteral; |
1736 | } | 1703 | } |
@@ -2047,18 +2014,8 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE | |||
2047 | return getUpperBoundAccess().getRule(); | 2014 | return getUpperBoundAccess().getRule(); |
2048 | } | 2015 | } |
2049 | 2016 | ||
2050 | //QuotedOrUnquotedId: | ||
2051 | // QUOTED_ID | Identifier; | ||
2052 | public QuotedOrUnquotedIdElements getQuotedOrUnquotedIdAccess() { | ||
2053 | return pQuotedOrUnquotedId; | ||
2054 | } | ||
2055 | |||
2056 | public ParserRule getQuotedOrUnquotedIdRule() { | ||
2057 | return getQuotedOrUnquotedIdAccess().getRule(); | ||
2058 | } | ||
2059 | |||
2060 | //QualifiedName hidden(): | 2017 | //QualifiedName hidden(): |
2061 | // QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; | 2018 | // QUOTED_ID | Identifier ("::" Identifier)*; |
2062 | public QualifiedNameElements getQualifiedNameAccess() { | 2019 | public QualifiedNameElements getQualifiedNameAccess() { |
2063 | return pQualifiedName; | 2020 | return pQualifiedName; |
2064 | } | 2021 | } |
diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend index b007cf8b..9b1bb698 100644 --- a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * generated by Xtext 2.25.0 | 2 | * generated by Xtext 2.26.0.M1 |
3 | */ | 3 | */ |
4 | package org.eclipse.viatra.solver.language.tests | 4 | package org.eclipse.viatra.solver.language.tests |
5 | 5 | ||
diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend new file mode 100644 index 00000000..7872b0f7 --- /dev/null +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.25.0 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.tests | ||
5 | |||
6 | import com.google.inject.Inject | ||
7 | import org.eclipse.viatra.solver.language.model.problem.Problem | ||
8 | import org.eclipse.xtext.testing.InjectWith | ||
9 | import org.eclipse.xtext.testing.extensions.InjectionExtension | ||
10 | import org.eclipse.xtext.testing.util.ParseHelper | ||
11 | import org.junit.jupiter.api.Test | ||
12 | import org.junit.jupiter.api.^extension.ExtendWith | ||
13 | |||
14 | import static org.hamcrest.MatcherAssert.assertThat | ||
15 | import static org.hamcrest.Matchers.* | ||
16 | |||
17 | @ExtendWith(InjectionExtension) | ||
18 | @InjectWith(ProblemInjectorProvider) | ||
19 | class ProblemScopingTest { | ||
20 | @Inject | ||
21 | ParseHelper<Problem> parseHelper | ||
22 | |||
23 | @Inject | ||
24 | extension ProblemTestUtil | ||
25 | |||
26 | @Test | ||
27 | def void builtInArgumentTypeTest() { | ||
28 | val it = parseHelper.parse(''' | ||
29 | pred predicate(node a, data b, int c). | ||
30 | ''').assertNoErrors | ||
31 | assertThat(pred('predicate').param(0).parameterType, equalTo(builtin.findClass('node'))) | ||
32 | assertThat(pred('predicate').param(1).parameterType, equalTo(builtin.findClass('data'))) | ||
33 | assertThat(pred('predicate').param(2).parameterType, equalTo(builtin.findClass('int'))) | ||
34 | } | ||
35 | |||
36 | @Test | ||
37 | def void builtiQualifiedArgumentTypeTest() { | ||
38 | val it = parseHelper.parse(''' | ||
39 | pred predicate(builtin::node a, builtin::data b, builtin::int c). | ||
40 | ''').assertNoErrors | ||
41 | assertThat(pred('predicate').param(0).parameterType, equalTo(builtin.findClass('node'))) | ||
42 | assertThat(pred('predicate').param(1).parameterType, equalTo(builtin.findClass('data'))) | ||
43 | assertThat(pred('predicate').param(2).parameterType, equalTo(builtin.findClass('int'))) | ||
44 | } | ||
45 | |||
46 | @Test | ||
47 | def void implicitNodeInAssertionTest() { | ||
48 | val it = parseHelper.parse(''' | ||
49 | pred predicate(node a, node b). | ||
50 | predicate(a, a). | ||
51 | ?predicate(a, b). | ||
52 | ''').assertNoErrors | ||
53 | assertThat(nodeNames, hasItems('a', 'b')) | ||
54 | assertThat(assertion(0).arg(0).node, equalTo(node('a'))) | ||
55 | assertThat(assertion(0).arg(1).node, equalTo(node('a'))) | ||
56 | assertThat(assertion(1).arg(0).node, equalTo(node('a'))) | ||
57 | assertThat(assertion(1).arg(1).node, equalTo(node('b'))) | ||
58 | } | ||
59 | |||
60 | @Test | ||
61 | def void quotedNodeInAssertionTest() { | ||
62 | val it = parseHelper.parse(''' | ||
63 | pred predicate(node a, node b). | ||
64 | predicate('a', 'a'). | ||
65 | ?predicate('a', 'b'). | ||
66 | ''').assertNoErrors | ||
67 | assertThat(nodeNames, hasItems("'a'", "'b'")) | ||
68 | assertThat(assertion(0).arg(0).node, equalTo(node("'a'"))) | ||
69 | assertThat(assertion(0).arg(1).node, equalTo(node("'a'"))) | ||
70 | assertThat(assertion(1).arg(0).node, equalTo(node("'a'"))) | ||
71 | assertThat(assertion(1).arg(1).node, equalTo(node("'b'"))) | ||
72 | } | ||
73 | |||
74 | @Test | ||
75 | def void builtInNodeInAssertionTest() { | ||
76 | val it = parseHelper.parse(''' | ||
77 | pred predicate(node a). | ||
78 | predicate(int::new). | ||
79 | ''').assertNoErrors | ||
80 | assertThat(nodes, empty) | ||
81 | assertThat(assertion(0).arg(0).node, equalTo(builtin.findClass('int').newNode)) | ||
82 | } | ||
83 | |||
84 | @Test | ||
85 | def void qualifiedBuiltInNodeInAssertionTest() { | ||
86 | val it = parseHelper.parse(''' | ||
87 | pred predicate(node a). | ||
88 | predicate(builtin::int::new). | ||
89 | ''').assertNoErrors | ||
90 | assertThat(nodes, empty) | ||
91 | assertThat(assertion(0).arg(0).node, equalTo(builtin.findClass('int').newNode)) | ||
92 | } | ||
93 | |||
94 | @Test | ||
95 | def void classNewNodeTest() { | ||
96 | val it = parseHelper.parse(''' | ||
97 | class Foo. | ||
98 | pred predicate(node a). | ||
99 | predicate(Foo::new). | ||
100 | ''').assertNoErrors | ||
101 | assertThat(nodes, empty) | ||
102 | assertThat(assertion(0).arg(0).node, equalTo(findClass('Foo').newNode)) | ||
103 | } | ||
104 | |||
105 | |||
106 | @Test | ||
107 | def void qualifiedClassNewNodeTest() { | ||
108 | val it = parseHelper.parse(''' | ||
109 | problem test. | ||
110 | class Foo. | ||
111 | pred predicate(node a). | ||
112 | predicate(test::Foo::new). | ||
113 | ''').assertNoErrors | ||
114 | assertThat(nodes, empty) | ||
115 | assertThat(assertion(0).arg(0).node, equalTo(findClass('Foo').newNode)) | ||
116 | } | ||
117 | |||
118 | @Test | ||
119 | def void newNodeIsNotSpecial() { | ||
120 | val it = parseHelper.parse(''' | ||
121 | class Foo. | ||
122 | pred predicate(node a). | ||
123 | predicate(new). | ||
124 | ''').assertNoErrors | ||
125 | assertThat(nodeNames, hasItem('new')) | ||
126 | assertThat(assertion(0).arg(0).node, not(equalTo(findClass('Foo').newNode))) | ||
127 | } | ||
128 | |||
129 | @Test | ||
130 | def void implicitNodeInPredicateTest() { | ||
131 | val it = parseHelper.parse(''' | ||
132 | pred predicate(node a) :- node(b). | ||
133 | predicate(b). | ||
134 | ''').assertNoErrors | ||
135 | assertThat(nodeNames, hasItem("b")) | ||
136 | assertThat(pred("predicate").conj(0).lit(0).arg(0).node, equalTo(node("b"))) | ||
137 | assertThat(assertion(0).arg(0).node, equalTo(node("b"))) | ||
138 | } | ||
139 | |||
140 | @Test | ||
141 | def void quotedNodeInPredicateTest() { | ||
142 | val it = parseHelper.parse(''' | ||
143 | pred predicate(node a) :- node('b'). | ||
144 | ''').assertNoErrors | ||
145 | assertThat(nodeNames, hasItem("'b'")) | ||
146 | assertThat(pred("predicate").conj(0).lit(0).arg(0).node, equalTo(node("'b'"))) | ||
147 | } | ||
148 | } | ||
diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend new file mode 100644 index 00000000..98b53675 --- /dev/null +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend | |||
@@ -0,0 +1,110 @@ | |||
1 | package org.eclipse.viatra.solver.language.tests | ||
2 | |||
3 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
4 | import org.eclipse.viatra.solver.language.ProblemUtil | ||
5 | import org.eclipse.viatra.solver.language.model.problem.Argument | ||
6 | import org.eclipse.viatra.solver.language.model.problem.Assertion | ||
7 | import org.eclipse.viatra.solver.language.model.problem.AssertionArgument | ||
8 | import org.eclipse.viatra.solver.language.model.problem.Atom | ||
9 | import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration | ||
10 | import org.eclipse.viatra.solver.language.model.problem.Conjunction | ||
11 | import org.eclipse.viatra.solver.language.model.problem.EnumDeclaration | ||
12 | import org.eclipse.viatra.solver.language.model.problem.Literal | ||
13 | import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral | ||
14 | import org.eclipse.viatra.solver.language.model.problem.Node | ||
15 | import org.eclipse.viatra.solver.language.model.problem.NodeAssertionArgument | ||
16 | import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition | ||
17 | import org.eclipse.viatra.solver.language.model.problem.Problem | ||
18 | import org.eclipse.viatra.solver.language.model.problem.Variable | ||
19 | import org.eclipse.viatra.solver.language.model.problem.VariableOrNodeArgument | ||
20 | import org.junit.jupiter.api.Assertions | ||
21 | |||
22 | class ProblemTestUtil { | ||
23 | def builtin(Problem it) { | ||
24 | ProblemUtil.getBuiltInLibrary(it).get | ||
25 | } | ||
26 | |||
27 | def assertNoErrors(Problem it) { | ||
28 | Assertions.assertNotNull(it) | ||
29 | EcoreUtil.resolveAll(it) | ||
30 | val errors = eResource.errors | ||
31 | Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''') | ||
32 | it | ||
33 | } | ||
34 | |||
35 | def nodeNames(Problem it) { | ||
36 | nodes.map[name] | ||
37 | } | ||
38 | |||
39 | def pred(Problem it, String name) { | ||
40 | statements.filter(PredicateDefinition).findFirst[it.name == name] | ||
41 | } | ||
42 | |||
43 | def param(PredicateDefinition it, int i) { | ||
44 | parameters.get(i) | ||
45 | } | ||
46 | |||
47 | def conj(PredicateDefinition it, int i) { | ||
48 | bodies.get(i) | ||
49 | } | ||
50 | |||
51 | def lit(Conjunction it, int i) { | ||
52 | literals.get(i) | ||
53 | } | ||
54 | |||
55 | def negated(Literal it) { | ||
56 | (it as NegativeLiteral).atom | ||
57 | } | ||
58 | |||
59 | def relation(Literal it) { | ||
60 | (it as Atom).relation | ||
61 | } | ||
62 | |||
63 | def arg(Atom it, int i) { | ||
64 | it.arguments.get(i) | ||
65 | } | ||
66 | |||
67 | def arg(Literal it, int i) { | ||
68 | (it as Atom).arg(i) | ||
69 | } | ||
70 | |||
71 | def variable(Argument it) { | ||
72 | (it as VariableOrNodeArgument).variableOrNode as Variable | ||
73 | } | ||
74 | |||
75 | def node(Argument it) { | ||
76 | (it as VariableOrNodeArgument).variableOrNode as Node | ||
77 | } | ||
78 | |||
79 | def assertion(Problem it, int i) { | ||
80 | statements.filter(Assertion).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 findClass(Problem it, String name) { | ||
96 | statements.filter(ClassDeclaration).findFirst[it.name == name] | ||
97 | } | ||
98 | |||
99 | def reference(ClassDeclaration it, String name) { | ||
100 | it.referenceDeclarations.findFirst[it.name == name] | ||
101 | } | ||
102 | |||
103 | def findEnum(Problem it, String name) { | ||
104 | statements.filter(EnumDeclaration).findFirst[it.name == name] | ||
105 | } | ||
106 | |||
107 | def literal(EnumDeclaration it, String name) { | ||
108 | literals.findFirst[it.name == name] | ||
109 | } | ||
110 | } | ||