aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-06-25 17:12:45 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-06-25 17:12:45 +0200
commitbaba88758a0ea5f671ab4a2aeacec374bed938c4 (patch)
tree1be30230a0959ce8d22986d91b1ed2460a328148 /org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language
parentInitial commit (diff)
downloadrefinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.tar.gz
refinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.tar.zst
refinery-baba88758a0ea5f671ab4a2aeacec374bed938c4.zip
Add initial prototype
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language')
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.classpath58
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.gitignore1
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.launch/Generate Problem (problem) Language Infrastructure.launch14
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.project29
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.jdt.core.prefs10
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/build.gradle42
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe254
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext88
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemRuntimeModule.java86
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemStandaloneSetup.java26
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/ProblemValueConverterService.java17
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/UpperBoundValueConverter.java35
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend25
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java13
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java15
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java218
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemLocationInFileProvider.java130
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java39
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemGlobalScopeProvider.java19
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java74
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/validation/ProblemValidator.java25
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/resources/org/eclipse/viatra/solver/language/library.problem4
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java201
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbinbin0 -> 5210 bytes
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/ProblemStandaloneSetupGenerated.java37
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemAntlrTokenFileProvider.java16
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemParser.java40
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g1522
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens65
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java1699
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java4056
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/scoping/AbstractProblemScopeProvider.java9
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java296
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSyntacticSequencer.java77
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java1411
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/AbstractProblemValidator.java19
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/ProblemConfigurableIssueCodesProvider.java22
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend30
-rw-r--r--org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/xtext-gen/org/eclipse/viatra/solver/language/tests/ProblemInjectorProvider.java69
40 files changed, 10593 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.classpath b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.classpath
new file mode 100644
index 00000000..01bce195
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.classpath
@@ -0,0 +1,58 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<classpath>
3 <classpathentry kind="src" output="bin/main" path="src/main/java">
4 <attributes>
5 <attribute name="gradle_scope" value="main"/>
6 <attribute name="gradle_used_by_scope" value="main,test"/>
7 </attributes>
8 </classpathentry>
9 <classpathentry kind="src" output="bin/main" path="src/main/resources">
10 <attributes>
11 <attribute name="gradle_scope" value="main"/>
12 <attribute name="gradle_used_by_scope" value="main,test"/>
13 </attributes>
14 </classpathentry>
15 <classpathentry kind="src" output="bin/main" path="src/main/xtext-gen">
16 <attributes>
17 <attribute name="gradle_scope" value="main"/>
18 <attribute name="gradle_used_by_scope" value="main,test"/>
19 </attributes>
20 </classpathentry>
21 <classpathentry kind="src" output="bin/main" path="src/main/xtend-gen">
22 <attributes>
23 <attribute name="gradle_scope" value="main"/>
24 <attribute name="gradle_used_by_scope" value="main,test"/>
25 </attributes>
26 </classpathentry>
27 <classpathentry kind="src" output="bin/test" path="src/test/java">
28 <attributes>
29 <attribute name="gradle_scope" value="test"/>
30 <attribute name="gradle_used_by_scope" value="test"/>
31 <attribute name="test" value="true"/>
32 </attributes>
33 </classpathentry>
34 <classpathentry kind="src" output="bin/test" path="src/test/resources">
35 <attributes>
36 <attribute name="gradle_scope" value="test"/>
37 <attribute name="gradle_used_by_scope" value="test"/>
38 <attribute name="test" value="true"/>
39 </attributes>
40 </classpathentry>
41 <classpathentry kind="src" output="bin/test" path="src/test/xtext-gen">
42 <attributes>
43 <attribute name="gradle_scope" value="test"/>
44 <attribute name="gradle_used_by_scope" value="test"/>
45 <attribute name="test" value="true"/>
46 </attributes>
47 </classpathentry>
48 <classpathentry kind="src" output="bin/test" path="src/test/xtend-gen">
49 <attributes>
50 <attribute name="gradle_scope" value="test"/>
51 <attribute name="gradle_used_by_scope" value="test"/>
52 <attribute name="test" value="true"/>
53 </attributes>
54 </classpathentry>
55 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
56 <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
57 <classpathentry kind="output" path="bin/default"/>
58</classpath>
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.gitignore b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.gitignore
new file mode 100644
index 00000000..84c048a7
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.gitignore
@@ -0,0 +1 @@
/build/
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.launch/Generate Problem (problem) Language Infrastructure.launch b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.launch/Generate Problem (problem) Language Infrastructure.launch
new file mode 100644
index 00000000..042ecc17
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.launch/Generate Problem (problem) Language Infrastructure.launch
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<launchConfiguration type="org.eclipse.buildship.core.launch.runconfiguration">
3<listAttribute key="arguments"/>
4<stringAttribute key="gradle_distribution" value="GRADLE_DISTRIBUTION(WRAPPER)"/>
5<listAttribute key="jvm_arguments"/>
6<booleanAttribute key="show_console_view" value="true"/>
7<booleanAttribute key="show_execution_view" value="true"/>
8<listAttribute key="tasks">
9<listEntry value="build"/>
10</listAttribute>
11<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/org.eclipse.viatra.solver.language.parent&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.eclipse.viatra.solver.language&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.eclipse.viatra.solver.language.ide&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.eclipse.viatra.solver.language.web&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.eclipse.viatra.solver.language.tests&quot; type=&quot;4&quot;/&gt;&#10;;&lt;/resources&gt;}"/>
12<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
13<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.viatra.solver.language}"/>
14</launchConfiguration>
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.project b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.project
new file mode 100644
index 00000000..bbe16f36
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.project
@@ -0,0 +1,29 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<projectDescription>
3 <name>org.eclipse.viatra.solver.language</name>
4 <comment></comment>
5 <projects>
6 </projects>
7 <buildSpec>
8 <buildCommand>
9 <name>org.eclipse.jdt.core.javabuilder</name>
10 <arguments>
11 </arguments>
12 </buildCommand>
13 <buildCommand>
14 <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
15 <arguments>
16 </arguments>
17 </buildCommand>
18 <buildCommand>
19 <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
20 <arguments>
21 </arguments>
22 </buildCommand>
23 </buildSpec>
24 <natures>
25 <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
26 <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
27 <nature>org.eclipse.jdt.core.javanature</nature>
28 </natures>
29</projectDescription>
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.core.resources.prefs b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..99f26c02
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
1eclipse.preferences.version=1
2encoding/<project>=UTF-8
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..7adc0fb9
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,10 @@
1eclipse.preferences.version=1
2org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4org.eclipse.jdt.core.compiler.compliance=11
5org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
9org.eclipse.jdt.core.compiler.release=enabled
10org.eclipse.jdt.core.compiler.source=11
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/build.gradle b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/build.gradle
new file mode 100644
index 00000000..558f08bb
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/build.gradle
@@ -0,0 +1,42 @@
1dependencies {
2 testCompile 'org.junit.jupiter:junit-jupiter-api'
3 testRuntime 'org.junit.jupiter:junit-jupiter-engine'
4 testCompile "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}"
5 testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}"
6 compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}"
7 compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}"
8 compile 'org.eclipse.emf:org.eclipse.emf.ecore'
9 compile project(':org.eclipse.viatra.solver.language.model')
10}
11
12configurations {
13 mwe2 {
14 extendsFrom compile
15 }
16}
17
18dependencies {
19 mwe2 'org.eclipse.emf:org.eclipse.emf.mwe2.launch'
20 mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}"
21 mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}"
22 mwe2 'org.eclipse.xtext:xtext-antlr-generator'
23}
24
25task generateXtextLanguage(type: JavaExec) {
26 main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'
27 classpath = configurations.mwe2
28 inputs.file "src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2"
29 inputs.file "src/main/java/org/eclipse/viatra/solver/language/Problem.xtext"
30 outputs.dir "src/main/xtext-gen"
31 args += "src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2"
32 args += "-p"
33 args += "rootPath=/${projectDir}/.."
34}
35
36test {
37 useJUnitPlatform()
38}
39
40generateXtext.dependsOn(generateXtextLanguage)
41clean.dependsOn(cleanGenerateXtextLanguage)
42eclipse.classpath.plusConfigurations += [configurations.mwe2]
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2
new file mode 100644
index 00000000..46812355
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2
@@ -0,0 +1,54 @@
1module org.eclipse.viatra.solver.language.GenerateProblem
2
3import org.eclipse.xtext.xtext.generator.*
4import org.eclipse.xtext.xtext.generator.model.project.*
5
6var rootPath = ".."
7
8Workflow {
9 component = XtextGenerator {
10 configuration = {
11 project = StandardProjectConfig {
12 baseName = "org.eclipse.viatra.solver.language"
13 rootPath = rootPath
14 runtimeTest = {
15 enabled = true
16 }
17 web = {
18 enabled = true
19 }
20 mavenLayout = true
21 }
22 code = {
23 encoding = "UTF-8"
24 lineDelimiter = "\n"
25 fileHeader = "/*\n * generated by Xtext \${version}\n */"
26 preferXtendStubs = false
27 }
28 }
29
30 language = StandardLanguage {
31 name = "org.eclipse.viatra.solver.language.Problem"
32 fileExtensions = "problem"
33 referencedResource = "platform:/resource/org.eclipse.viatra.solver.language.model/model/problem.genmodel"
34
35 serializer = {
36 generateStub = false
37 }
38 validator = {
39 // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
40 // Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage
41 generateDeprecationValidation = true
42 }
43 generator = {
44 generateXtendStub = true
45 }
46 junitSupport = {
47 junitVersion = "5"
48 }
49 webSupport = {
50 framework = "CodeMirror"
51 }
52 }
53 }
54}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext
new file mode 100644
index 00000000..81c18d0d
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext
@@ -0,0 +1,88 @@
1grammar org.eclipse.viatra.solver.language.Problem with org.eclipse.xtext.common.Terminals
2
3import "http://www.eclipse.org/emf/2002/Ecore" as ecore
4import "http://www.eclipse.org/viatra/solver/language/model/Problem"
5
6Problem:
7 statements+=Statement*;
8
9Statement:
10 ClassDeclaration | PredicateDefinition | Assertion | ScopeDeclaration;
11
12ClassDeclaration:
13 abstract?="abstract"? "class"
14 name=ID
15 ("extends" (superTypes+=[ClassDeclaration] |
16 "[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]") |
17 referenceDeclarations+=ReferenceDeclaration)?
18 ("," referenceDeclarations+=ReferenceDeclaration)*
19 ".";
20
21ReferenceDeclaration:
22 (containment?="contains" | "refers")
23 referenceType=[ClassDeclaration]
24 "[" multiplicity=Multiplicity "]"
25 name=ID
26 ("opposite" opposite=[ReferenceDeclaration|QualifiedName])?;
27
28PredicateDefinition:
29 (error?="error" "pred"? | "pred")
30 name=ID
31 "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")"
32 (":=" bodies+=Conjunction (";" bodies+=Conjunction)*)?
33 ".";
34
35Parameter:
36 parameterType=[ClassDeclaration] name=ID;
37
38Conjunction:
39 literals+=Literal ("," literals+=Literal)*;
40
41Literal:
42 Atom | NegativeLiteral;
43
44NegativeLiteral:
45 "!" atom=Atom;
46
47Atom:
48 relation=[Relation|QualifiedName]
49 transitiveClosure?="+"?
50 "(" (arguments+=[Variable] ("," arguments+=[Variable])*)? ")";
51
52Assertion:
53 (relation=[Relation|QualifiedName]
54 "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
55 ":" value=LogicValue |
56 value=ShortLogicValue?
57 relation=[Relation|QualifiedName]
58 "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")")
59 ".";
60
61enum LogicValue:
62 TRUE="true" | FALSE="false" | UNKNOWN="unknown";
63
64enum ShortLogicValue returns LogicValue:
65 FALSE="!" | UNKNOWN="?";
66
67ScopeDeclaration:
68 "scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* ".";
69
70TypeScope:
71 targetType=[ClassDeclaration]
72 (increment?="+=" | "=")
73 multiplicity=Multiplicity;
74
75Multiplicity:
76 RangeMultiplicity | ExactMultiplicity;
77
78RangeMultiplicity:
79 lowerBound=INT ".." upperBound=UpperBound;
80
81ExactMultiplicity:
82 exactValue=INT;
83
84UpperBound returns ecore::EInt:
85 INT | "*";
86
87QualifiedName:
88 ID ("::" ID)*;
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemRuntimeModule.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemRuntimeModule.java
new file mode 100644
index 00000000..b2a3218c
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemRuntimeModule.java
@@ -0,0 +1,86 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language;
5
6import org.eclipse.viatra.solver.language.conversion.ProblemValueConverterService;
7import org.eclipse.viatra.solver.language.naming.ProblemQualifiedNameConverter;
8import org.eclipse.viatra.solver.language.naming.ProblemQualifiedNameProvider;
9import org.eclipse.viatra.solver.language.resource.ProblemDerivedStateComputer;
10import org.eclipse.viatra.solver.language.resource.ProblemLocationInFileProvider;
11import org.eclipse.viatra.solver.language.resource.ProblemResourceDescriptionStrategy;
12import org.eclipse.viatra.solver.language.scoping.ProblemGlobalScopeProvider;
13import org.eclipse.xtext.conversion.IValueConverterService;
14import org.eclipse.xtext.naming.IQualifiedNameConverter;
15import org.eclipse.xtext.naming.IQualifiedNameProvider;
16import org.eclipse.xtext.resource.DerivedStateAwareResource;
17import org.eclipse.xtext.resource.DerivedStateAwareResourceDescriptionManager;
18import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
19import org.eclipse.xtext.resource.IDerivedStateComputer;
20import org.eclipse.xtext.resource.ILocationInFileProvider;
21import org.eclipse.xtext.resource.IResourceDescription;
22import org.eclipse.xtext.resource.XtextResource;
23import org.eclipse.xtext.scoping.IGlobalScopeProvider;
24import org.eclipse.xtext.scoping.IScopeProvider;
25import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
26import org.eclipse.xtext.scoping.impl.SimpleLocalScopeProvider;
27import org.eclipse.xtext.validation.IResourceValidator;
28import org.eclipse.xtext.xbase.annotations.validation.DerivedStateAwareResourceValidator;
29
30import com.google.inject.Binder;
31import com.google.inject.name.Names;
32
33/**
34 * Use this class to register components to be used at runtime / without the
35 * Equinox extension registry.
36 */
37public class ProblemRuntimeModule extends AbstractProblemRuntimeModule {
38 public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
39 return ProblemQualifiedNameConverter.class;
40 }
41
42 public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
43 return ProblemQualifiedNameProvider.class;
44 }
45
46 public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
47 return ProblemResourceDescriptionStrategy.class;
48 }
49
50 @Override
51 public Class<? extends IValueConverterService> bindIValueConverterService() {
52 return ProblemValueConverterService.class;
53 }
54
55 @Override
56 public void configureIScopeProviderDelegate(Binder binder) {
57 binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE))
58 .to(SimpleLocalScopeProvider.class);
59 }
60
61 @Override
62 public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
63 return ProblemGlobalScopeProvider.class;
64 }
65
66 @Override
67 public Class<? extends XtextResource> bindXtextResource() {
68 return DerivedStateAwareResource.class;
69 }
70
71 public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
72 return DerivedStateAwareResourceDescriptionManager.class;
73 }
74
75 public Class<? extends IResourceValidator> bindIResourceValidator() {
76 return DerivedStateAwareResourceValidator.class;
77 }
78
79 public Class<? extends IDerivedStateComputer> bindIDerivedStateComputer() {
80 return ProblemDerivedStateComputer.class;
81 }
82
83 public Class<? extends ILocationInFileProvider> bindILocationInFileProvider() {
84 return ProblemLocationInFileProvider.class;
85 }
86}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemStandaloneSetup.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemStandaloneSetup.java
new file mode 100644
index 00000000..5652f859
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/ProblemStandaloneSetup.java
@@ -0,0 +1,26 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language;
5
6import org.eclipse.emf.ecore.EPackage;
7import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
8
9import com.google.inject.Injector;
10
11/**
12 * Initialization support for running Xtext languages without Equinox extension registry.
13 */
14public class ProblemStandaloneSetup extends ProblemStandaloneSetupGenerated {
15
16 public static void doSetup() {
17 new ProblemStandaloneSetup().createInjectorAndDoEMFRegistration();
18 }
19
20 @Override
21 public Injector createInjectorAndDoEMFRegistration() {
22 if (!EPackage.Registry.INSTANCE.containsKey(ProblemPackage.eNS_URI))
23 EPackage.Registry.INSTANCE.put(ProblemPackage.eNS_URI, ProblemPackage.eINSTANCE);
24 return super.createInjectorAndDoEMFRegistration();
25 }
26}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/ProblemValueConverterService.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/ProblemValueConverterService.java
new file mode 100644
index 00000000..4f5fd069
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/ProblemValueConverterService.java
@@ -0,0 +1,17 @@
1package org.eclipse.viatra.solver.language.conversion;
2
3import org.eclipse.xtext.common.services.DefaultTerminalConverters;
4import org.eclipse.xtext.conversion.IValueConverter;
5import org.eclipse.xtext.conversion.ValueConverter;
6
7import com.google.inject.Inject;
8
9public class ProblemValueConverterService extends DefaultTerminalConverters {
10 @Inject
11 private UpperBoundValueConverter upperBoundValueConverter;
12
13 @ValueConverter(rule = "UpperBound")
14 public IValueConverter<Integer> UpperBound() {
15 return upperBoundValueConverter;
16 }
17}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/UpperBoundValueConverter.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/UpperBoundValueConverter.java
new file mode 100644
index 00000000..3111b69b
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/conversion/UpperBoundValueConverter.java
@@ -0,0 +1,35 @@
1package org.eclipse.viatra.solver.language.conversion;
2
3import org.eclipse.xtext.conversion.ValueConverterException;
4import org.eclipse.xtext.conversion.impl.AbstractValueConverter;
5import org.eclipse.xtext.conversion.impl.INTValueConverter;
6import org.eclipse.xtext.nodemodel.INode;
7
8import com.google.inject.Inject;
9import com.google.inject.Singleton;
10
11@Singleton
12public class UpperBoundValueConverter extends AbstractValueConverter<Integer> {
13 public static final String INFINITY = "*";
14
15 @Inject
16 private INTValueConverter intValueConverter;
17
18 @Override
19 public Integer toValue(String string, INode node) throws ValueConverterException {
20 if (INFINITY.equals(string)) {
21 return -1;
22 } else {
23 return intValueConverter.toValue(string, node);
24 }
25 }
26
27 @Override
28 public String toString(Integer value) throws ValueConverterException {
29 if (value < 0) {
30 return INFINITY;
31 } else {
32 return intValueConverter.toString(value);
33 }
34 }
35}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend
new file mode 100644
index 00000000..0930f244
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/generator/ProblemGenerator.xtend
@@ -0,0 +1,25 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language.generator
5
6import org.eclipse.emf.ecore.resource.Resource
7import org.eclipse.xtext.generator.AbstractGenerator
8import org.eclipse.xtext.generator.IFileSystemAccess2
9import 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 */
16class 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/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java
new file mode 100644
index 00000000..ebb7e7b4
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java
@@ -0,0 +1,13 @@
1package org.eclipse.viatra.solver.language.naming;
2
3import org.eclipse.xtext.naming.IQualifiedNameConverter;
4
5import com.google.inject.Singleton;
6
7@Singleton
8public class ProblemQualifiedNameConverter extends IQualifiedNameConverter.DefaultImpl {
9 @Override
10 public String getDelimiter() {
11 return "::";
12 }
13}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java
new file mode 100644
index 00000000..81365724
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java
@@ -0,0 +1,15 @@
1package org.eclipse.viatra.solver.language.naming;
2
3import org.eclipse.viatra.solver.language.model.problem.Node;
4import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
5import org.eclipse.xtext.naming.QualifiedName;
6
7public class ProblemQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {
8 public QualifiedName qualifiedName(Node node) {
9 String name = node.getName();
10 if (name == null || name.isEmpty()) {
11 return null;
12 }
13 return getConverter().toQualifiedName(name);
14 }
15}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java
new file mode 100644
index 00000000..571b5745
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemDerivedStateComputer.java
@@ -0,0 +1,218 @@
1package org.eclipse.viatra.solver.language.resource;
2
3import java.util.HashSet;
4import java.util.List;
5import java.util.Set;
6import java.util.regex.Pattern;
7
8import org.eclipse.emf.ecore.EObject;
9import org.eclipse.viatra.solver.language.model.problem.Assertion;
10import org.eclipse.viatra.solver.language.model.problem.Atom;
11import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration;
12import org.eclipse.viatra.solver.language.model.problem.Conjunction;
13import org.eclipse.viatra.solver.language.model.problem.ExistentialQuantifier;
14import org.eclipse.viatra.solver.language.model.problem.ImplicitVariable;
15import org.eclipse.viatra.solver.language.model.problem.Literal;
16import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral;
17import org.eclipse.viatra.solver.language.model.problem.Node;
18import org.eclipse.viatra.solver.language.model.problem.Parameter;
19import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition;
20import org.eclipse.viatra.solver.language.model.problem.Problem;
21import org.eclipse.viatra.solver.language.model.problem.ProblemFactory;
22import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
23import org.eclipse.viatra.solver.language.model.problem.Statement;
24import org.eclipse.xtext.linking.impl.LinkingHelper;
25import org.eclipse.xtext.naming.IQualifiedNameConverter;
26import org.eclipse.xtext.naming.QualifiedName;
27import org.eclipse.xtext.nodemodel.INode;
28import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
29import org.eclipse.xtext.resource.DerivedStateAwareResource;
30import org.eclipse.xtext.resource.IDerivedStateComputer;
31import org.eclipse.xtext.scoping.IGlobalScopeProvider;
32import org.eclipse.xtext.scoping.IScope;
33
34import com.google.common.base.Predicates;
35import com.google.inject.Inject;
36import com.google.inject.Singleton;
37
38@Singleton
39public class ProblemDerivedStateComputer implements IDerivedStateComputer {
40 public static final String NEW_NODE = "new";
41
42 private static final String ID_REGEX_STRING = "[_a-zA-Z][_0-9a-zA-Z]*";
43
44 private static final Pattern ID_REGEX = Pattern.compile(ID_REGEX_STRING);
45
46 private static final Pattern QUALIFIED_NAME_REGEX = Pattern
47 .compile(ID_REGEX_STRING + "(::" + ID_REGEX_STRING + ")*");
48
49 @Inject
50 private LinkingHelper linkingHelper;
51
52 @Inject
53 private IQualifiedNameConverter qualifiedNameConverter;
54
55 @Inject
56 private IGlobalScopeProvider scopeProvider;
57
58 @Override
59 public void installDerivedState(DerivedStateAwareResource resource, boolean preLinkingPhase) {
60 for (EObject object : resource.getContents()) {
61 if (object instanceof Problem) {
62 installDerivedProblemState((Problem) object, preLinkingPhase);
63 }
64 }
65 }
66
67 protected void installDerivedProblemState(Problem problem, boolean preLinkingPhase) {
68 Set<String> nodeNames = new HashSet<>();
69 if (!preLinkingPhase) {
70 installDerivedNodes(problem);
71 }
72 for (Statement statement : problem.getStatements()) {
73 if (statement instanceof PredicateDefinition) {
74 PredicateDefinition definition = (PredicateDefinition) statement;
75 installDerivedPredicateDefinitionState(definition);
76 }
77 }
78 List<Node> grapNodes = problem.getNodes();
79 for (String nodeName : nodeNames) {
80 Node graphNode = ProblemFactory.eINSTANCE.createNode();
81 graphNode.setName(nodeName);
82 grapNodes.add(graphNode);
83 }
84 }
85
86 protected void installDerivedNodes(Problem problem) {
87 IScope nodeScope = scopeProvider.getScope(problem.eResource(), ProblemPackage.Literals.ASSERTION__ARGUMENTS,
88 Predicates.alwaysTrue());
89 Set<String> nodeNames = new HashSet<>();
90 for (Statement statement : problem.getStatements()) {
91 if (statement instanceof ClassDeclaration) {
92 ClassDeclaration declaration = (ClassDeclaration) statement;
93 if (!declaration.isAbstract()) {
94 String className = declaration.getName();
95 if (validId(className)) {
96 QualifiedName qualifiedName = QualifiedName.create(className, NEW_NODE);
97 String nodeName = qualifiedNameConverter.toString(qualifiedName);
98 nodeNames.add(nodeName);
99 }
100 }
101 }
102 }
103 for (Statement statement : problem.getStatements()) {
104 if (statement instanceof Assertion) {
105 Assertion assertion = (Assertion) statement;
106 List<INode> nodes = NodeModelUtils.findNodesForFeature(assertion,
107 ProblemPackage.Literals.ASSERTION__ARGUMENTS);
108 for (INode node : nodes) {
109 String nodeName = linkingHelper.getCrossRefNodeAsString(node, true);
110 if (validQualifiedName(nodeName)) {
111 QualifiedName qualifiedName = qualifiedNameConverter.toQualifiedName(nodeName);
112 if (nodeScope.getSingleElement(qualifiedName) == null) {
113 nodeNames.add(nodeName);
114 }
115 }
116 }
117 }
118 }
119 List<Node> grapNodes = problem.getNodes();
120 for (String nodeName : nodeNames) {
121 Node graphNode = ProblemFactory.eINSTANCE.createNode();
122 graphNode.setName(nodeName);
123 grapNodes.add(graphNode);
124 }
125 }
126
127 protected void installDerivedPredicateDefinitionState(PredicateDefinition definition) {
128 Set<String> parameterNames = new HashSet<>();
129 for (Parameter parameter : definition.getParameters()) {
130 String name = parameter.getName();
131 if (name != null) {
132 parameterNames.add(name);
133 }
134 }
135 for (Conjunction body : definition.getBodies()) {
136 installDeriveConjunctionState(body, parameterNames);
137 }
138 }
139
140 protected void installDeriveConjunctionState(Conjunction conjunction, Set<String> knownVariables) {
141 Set<String> newVariables = new HashSet<>();
142 for (Literal literal : conjunction.getLiterals()) {
143 if (literal instanceof Atom) {
144 Atom atom = (Atom) literal;
145 collectVariables(atom, knownVariables, newVariables);
146 }
147 }
148 createVariables(conjunction, newVariables);
149 newVariables.addAll(knownVariables);
150 for (Literal literal : conjunction.getLiterals()) {
151 if (literal instanceof NegativeLiteral) {
152 NegativeLiteral negativeLiteral = (NegativeLiteral) literal;
153 installDeriveNegativeLiteralState(negativeLiteral, newVariables);
154 }
155 }
156 }
157
158 protected void installDeriveNegativeLiteralState(NegativeLiteral negativeLiteral, Set<String> knownVariables) {
159 Set<String> newVariables = new HashSet<>();
160 collectVariables(negativeLiteral.getAtom(), knownVariables, newVariables);
161 createVariables(negativeLiteral, newVariables);
162 }
163
164 protected void collectVariables(Atom atom, Set<String> knownVariables, Set<String> newVariables) {
165 List<INode> nodes = NodeModelUtils.findNodesForFeature(atom, ProblemPackage.Literals.ATOM__ARGUMENTS);
166 for (INode node : nodes) {
167 String variableName = linkingHelper.getCrossRefNodeAsString(node, true);
168 if (!knownVariables.contains(variableName)) {
169 newVariables.add(variableName);
170 }
171 }
172 }
173
174 protected void createVariables(ExistentialQuantifier quantifier, Set<String> newVariables) {
175 for (String variableName : newVariables) {
176 if (validId(variableName)) {
177 ImplicitVariable variable = ProblemFactory.eINSTANCE.createImplicitVariable();
178 variable.setName(variableName);
179 quantifier.getImplicitVariables().add(variable);
180 }
181 }
182 }
183
184 @Override
185 public void discardDerivedState(DerivedStateAwareResource resource) {
186 for (EObject object : resource.getContents()) {
187 if (object instanceof Problem) {
188 discardDerivedProblemState((Problem) object);
189 }
190 }
191 }
192
193 protected void discardDerivedProblemState(Problem problem) {
194 problem.getNodes().clear();
195 for (Statement statement : problem.getStatements()) {
196 if (statement instanceof PredicateDefinition) {
197 PredicateDefinition definition = (PredicateDefinition) statement;
198 for (Conjunction body : definition.getBodies()) {
199 body.getImplicitVariables().clear();
200 for (Literal literal : body.getLiterals()) {
201 if (literal instanceof NegativeLiteral) {
202 NegativeLiteral negativeLiteral = (NegativeLiteral) literal;
203 negativeLiteral.getImplicitVariables().clear();
204 }
205 }
206 }
207 }
208 }
209 }
210
211 protected static boolean validId(String name) {
212 return name != null && ID_REGEX.matcher(name).matches();
213 }
214
215 protected static boolean validQualifiedName(String name) {
216 return name != null && QUALIFIED_NAME_REGEX.matcher(name).matches();
217 }
218}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemLocationInFileProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemLocationInFileProvider.java
new file mode 100644
index 00000000..dfffc7ef
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemLocationInFileProvider.java
@@ -0,0 +1,130 @@
1package org.eclipse.viatra.solver.language.resource;
2
3import java.util.Iterator;
4
5import org.eclipse.emf.ecore.EObject;
6import org.eclipse.viatra.solver.language.model.problem.Assertion;
7import org.eclipse.viatra.solver.language.model.problem.Atom;
8import org.eclipse.viatra.solver.language.model.problem.Conjunction;
9import org.eclipse.viatra.solver.language.model.problem.ImplicitVariable;
10import org.eclipse.viatra.solver.language.model.problem.Literal;
11import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral;
12import org.eclipse.viatra.solver.language.model.problem.Node;
13import org.eclipse.viatra.solver.language.model.problem.Problem;
14import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
15import org.eclipse.viatra.solver.language.model.problem.Statement;
16import org.eclipse.xtext.EcoreUtil2;
17import org.eclipse.xtext.naming.IQualifiedNameProvider;
18import org.eclipse.xtext.naming.QualifiedName;
19import org.eclipse.xtext.resource.DefaultLocationInFileProvider;
20import org.eclipse.xtext.resource.IEObjectDescription;
21import org.eclipse.xtext.scoping.IScope;
22import org.eclipse.xtext.scoping.IScopeProvider;
23import org.eclipse.xtext.util.ITextRegion;
24
25import com.google.inject.Inject;
26
27public class ProblemLocationInFileProvider extends DefaultLocationInFileProvider {
28 @Inject
29 private IQualifiedNameProvider qualifiedNameProvider;
30
31 @Inject
32 private IScopeProvider scopeProvider;
33
34 @Override
35 protected ITextRegion doGetTextRegion(EObject obj, RegionDescription query) {
36 if (obj instanceof Node) {
37 return getNodeTextRegion((Node) obj, query);
38 }
39 if (obj instanceof ImplicitVariable) {
40 return getVariableTextRegion((ImplicitVariable) obj, query);
41 }
42 return super.doGetTextRegion(obj, query);
43 }
44
45 protected ITextRegion getNodeTextRegion(Node node, RegionDescription query) {
46 ITextRegion newNodeRegion = getNewNodeTextRegion(node, query);
47 if (newNodeRegion != null) {
48 return newNodeRegion;
49 }
50 return getNodeFirstReferenceTextRegion(node, query);
51 }
52
53 protected ITextRegion getNewNodeTextRegion(Node node, RegionDescription query) {
54 QualifiedName nodeName = qualifiedNameProvider.getFullyQualifiedName(node);
55 if (nodeName == null || nodeName.getSegmentCount() <= 1) {
56 return null;
57 }
58 if (ProblemDerivedStateComputer.NEW_NODE.equals(nodeName.getLastSegment())) {
59 QualifiedName className = nodeName.skipLast(1);
60 IScope classScope = scopeProvider.getScope(node, ProblemPackage.Literals.ASSERTION__RELATION);
61 IEObjectDescription description = classScope.getSingleElement(className);
62 if (description == null) {
63 return null;
64 }
65 EObject classDeclaration = description.getEObjectOrProxy();
66 if (!classDeclaration.eIsProxy()) {
67 return doGetTextRegion(classDeclaration, query);
68 }
69 }
70 return null;
71 }
72
73 protected ITextRegion getNodeFirstReferenceTextRegion(Node node, RegionDescription query) {
74 Problem problem = EcoreUtil2.getContainerOfType(node, Problem.class);
75 if (problem == null) {
76 return ITextRegion.EMPTY_REGION;
77 }
78 for (Statement statement : problem.getStatements()) {
79 if (statement instanceof Assertion) {
80 Assertion assertion = (Assertion) statement;
81 int index = assertion.getArguments().indexOf(node);
82 if (index >= 0) {
83 return doGetLocationOfFeature(assertion, ProblemPackage.Literals.ASSERTION__ARGUMENTS, index,
84 query);
85 }
86 }
87 }
88 return ITextRegion.EMPTY_REGION;
89 }
90
91 protected ITextRegion getVariableTextRegion(ImplicitVariable variable, RegionDescription query) {
92 EObject container = variable.eContainer();
93 if (container instanceof Conjunction) {
94 return getFirstReferenceToVariableInConjunction(variable, (Conjunction) container, query);
95 }
96 if (container instanceof NegativeLiteral) {
97 return getFirstReferenceToVariableInNegativeLiteral(variable, (NegativeLiteral) container, query);
98 }
99 return ITextRegion.EMPTY_REGION;
100 }
101
102 protected ITextRegion getFirstReferenceToVariableInConjunction(ImplicitVariable variable, Conjunction conjunction,
103 RegionDescription query) {
104 Iterator<Literal> iterator = conjunction.getLiterals().iterator();
105 ITextRegion found = ITextRegion.EMPTY_REGION;
106 while (found == ITextRegion.EMPTY_REGION && iterator.hasNext()) {
107 Literal literal = iterator.next();
108 if (literal instanceof Atom) {
109 found = getFirstReferenceToVariableInAtom(variable, (Atom) literal, query);
110 } else if (literal instanceof NegativeLiteral) {
111 found = getFirstReferenceToVariableInNegativeLiteral(variable, (NegativeLiteral) literal, query);
112 }
113 }
114 return found;
115 }
116
117 protected ITextRegion getFirstReferenceToVariableInNegativeLiteral(ImplicitVariable variable,
118 NegativeLiteral literal, RegionDescription query) {
119 return getFirstReferenceToVariableInAtom(variable, literal.getAtom(), query);
120 }
121
122 protected ITextRegion getFirstReferenceToVariableInAtom(ImplicitVariable variable, Atom atom,
123 RegionDescription query) {
124 int index = atom.getArguments().indexOf(variable);
125 if (index >= 0) {
126 return doGetLocationOfFeature(atom, ProblemPackage.Literals.ATOM__ARGUMENTS, index, query);
127 }
128 return ITextRegion.EMPTY_REGION;
129 }
130}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java
new file mode 100644
index 00000000..7b37ffd6
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/resource/ProblemResourceDescriptionStrategy.java
@@ -0,0 +1,39 @@
1package org.eclipse.viatra.solver.language.resource;
2
3import org.eclipse.emf.ecore.EObject;
4import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration;
5import org.eclipse.viatra.solver.language.model.problem.Variable;
6import org.eclipse.xtext.naming.QualifiedName;
7import org.eclipse.xtext.resource.IEObjectDescription;
8import org.eclipse.xtext.resource.impl.AliasedEObjectDescription;
9import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionStrategy;
10import org.eclipse.xtext.util.IAcceptor;
11
12import com.google.inject.Singleton;
13
14@Singleton
15public class ProblemResourceDescriptionStrategy extends DefaultResourceDescriptionStrategy {
16 @Override
17 public boolean createEObjectDescriptions(EObject eObject, IAcceptor<IEObjectDescription> acceptor) {
18 IAcceptor<IEObjectDescription> wrappedAcceptor;
19 if (eObject instanceof Variable) {
20 return false;
21 }
22 if (eObject instanceof ReferenceDeclaration) {
23 wrappedAcceptor = new IAcceptor<IEObjectDescription>() {
24 public void accept(IEObjectDescription description) {
25 acceptor.accept(description);
26 QualifiedName qualifiedName = description.getQualifiedName();
27 if (qualifiedName.getSegmentCount() >= 2) {
28 QualifiedName simpleName = QualifiedName.create(qualifiedName.getLastSegment());
29 IEObjectDescription aliasedDescription = new AliasedEObjectDescription(simpleName, description);
30 acceptor.accept(aliasedDescription);
31 }
32 };
33 };
34 } else {
35 wrappedAcceptor = acceptor;
36 }
37 return super.createEObjectDescriptions(eObject, wrappedAcceptor);
38 }
39}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemGlobalScopeProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemGlobalScopeProvider.java
new file mode 100644
index 00000000..cf01999a
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemGlobalScopeProvider.java
@@ -0,0 +1,19 @@
1package org.eclipse.viatra.solver.language.scoping;
2
3import java.util.LinkedHashSet;
4
5import org.eclipse.emf.common.util.URI;
6import org.eclipse.emf.ecore.resource.Resource;
7import org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider;
8
9public class ProblemGlobalScopeProvider extends ImportUriGlobalScopeProvider {
10 public static final URI LIBRARY_URI = URI.createURI(ProblemGlobalScopeProvider.class.getClassLoader()
11 .getResource("org/eclipse/viatra/solver/language/library.problem").toString());
12
13 @Override
14 protected LinkedHashSet<URI> getImportedUris(Resource resource) {
15 LinkedHashSet<URI> importedUris = super.getImportedUris(resource);
16 importedUris.add(LIBRARY_URI);
17 return importedUris;
18 }
19}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java
new file mode 100644
index 00000000..254284a8
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/scoping/ProblemScopeProvider.java
@@ -0,0 +1,74 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language.scoping;
5
6import java.util.ArrayList;
7import java.util.List;
8
9import org.eclipse.emf.ecore.EObject;
10import org.eclipse.emf.ecore.EReference;
11import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration;
12import org.eclipse.viatra.solver.language.model.problem.ExistentialQuantifier;
13import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition;
14import org.eclipse.viatra.solver.language.model.problem.Problem;
15import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
16import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration;
17import org.eclipse.viatra.solver.language.model.problem.Statement;
18import org.eclipse.viatra.solver.language.model.problem.Variable;
19import org.eclipse.xtext.EcoreUtil2;
20import org.eclipse.xtext.naming.QualifiedName;
21import org.eclipse.xtext.scoping.IScope;
22import org.eclipse.xtext.scoping.Scopes;
23
24import com.google.common.collect.ImmutableList;
25
26/**
27 * This class contains custom scoping description.
28 *
29 * See
30 * https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
31 * on how and when to use it.
32 */
33public class ProblemScopeProvider extends AbstractProblemScopeProvider {
34
35 @Override
36 public IScope getScope(EObject context, EReference reference) {
37 IScope scope = super.getScope(context, reference);
38 if (reference == ProblemPackage.Literals.ATOM__ARGUMENTS) {
39 return getVariableScope(context, scope);
40 } else if (EcoreUtil2.isAssignableFrom(reference.getEReferenceType(),
41 ProblemPackage.Literals.REFERENCE_DECLARATION)) {
42 Problem problem = EcoreUtil2.getContainerOfType(context, Problem.class);
43 if (problem == null) {
44 return scope;
45 }
46 ImmutableList.Builder<ReferenceDeclaration> builder = ImmutableList.builder();
47 for (Statement statement : problem.getStatements()) {
48 if (statement instanceof ClassDeclaration) {
49 ClassDeclaration classDeclaration = (ClassDeclaration) statement;
50 builder.addAll(classDeclaration.getReferenceDeclarations());
51 }
52 }
53 return Scopes.scopeFor(builder.build(), scope);
54 }
55 return scope;
56 }
57
58 protected IScope getVariableScope(EObject context, IScope delegateScope) {
59 List<Variable> variables = new ArrayList<>();
60 EObject currentContext = context;
61 while (currentContext != null && !(currentContext instanceof PredicateDefinition)) {
62 if (currentContext instanceof ExistentialQuantifier) {
63 ExistentialQuantifier quantifier = (ExistentialQuantifier) currentContext;
64 variables.addAll(quantifier.getImplicitVariables());
65 }
66 currentContext = currentContext.eContainer();
67 }
68 if (currentContext instanceof PredicateDefinition) {
69 PredicateDefinition definition = (PredicateDefinition) currentContext;
70 variables.addAll(definition.getParameters());
71 }
72 return Scopes.scopeFor(variables);
73 }
74}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/validation/ProblemValidator.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/validation/ProblemValidator.java
new file mode 100644
index 00000000..2b17e222
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/validation/ProblemValidator.java
@@ -0,0 +1,25 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language.validation;
5
6
7/**
8 * This class contains custom validation rules.
9 *
10 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
11 */
12public class ProblemValidator extends AbstractProblemValidator {
13
14// public static final String INVALID_NAME = "invalidName";
15//
16// @Check
17// public void checkGreetingStartsWithCapital(Greeting greeting) {
18// if (!Character.isUpperCase(greeting.getName().charAt(0))) {
19// warning("Name should start with a capital",
20// ProblemPackage.Literals.GREETING__NAME,
21// INVALID_NAME);
22// }
23// }
24
25}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/resources/org/eclipse/viatra/solver/language/library.problem b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/resources/org/eclipse/viatra/solver/language/library.problem
new file mode 100644
index 00000000..77f26b70
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/resources/org/eclipse/viatra/solver/language/library.problem
@@ -0,0 +1,4 @@
1abstract class node
2 refers node[0..*] equals opposite equals.
3
4predicate exists(node node). \ No newline at end of file
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java
new file mode 100644
index 00000000..642b465b
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/AbstractProblemRuntimeModule.java
@@ -0,0 +1,201 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language;
5
6import com.google.inject.Binder;
7import com.google.inject.Provider;
8import com.google.inject.name.Names;
9import java.util.Properties;
10import org.eclipse.viatra.solver.language.generator.ProblemGenerator;
11import org.eclipse.viatra.solver.language.parser.antlr.ProblemAntlrTokenFileProvider;
12import org.eclipse.viatra.solver.language.parser.antlr.ProblemParser;
13import org.eclipse.viatra.solver.language.parser.antlr.internal.InternalProblemLexer;
14import org.eclipse.viatra.solver.language.scoping.ProblemScopeProvider;
15import org.eclipse.viatra.solver.language.serializer.ProblemSemanticSequencer;
16import org.eclipse.viatra.solver.language.serializer.ProblemSyntacticSequencer;
17import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
18import org.eclipse.viatra.solver.language.validation.ProblemConfigurableIssueCodesProvider;
19import org.eclipse.viatra.solver.language.validation.ProblemValidator;
20import org.eclipse.xtext.Constants;
21import org.eclipse.xtext.IGrammarAccess;
22import org.eclipse.xtext.generator.IGenerator2;
23import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
24import org.eclipse.xtext.naming.IQualifiedNameProvider;
25import org.eclipse.xtext.parser.IParser;
26import org.eclipse.xtext.parser.ITokenToStringConverter;
27import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
28import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
29import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
30import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
31import org.eclipse.xtext.parser.antlr.Lexer;
32import org.eclipse.xtext.parser.antlr.LexerBindings;
33import org.eclipse.xtext.parser.antlr.LexerProvider;
34import org.eclipse.xtext.resource.IContainer;
35import org.eclipse.xtext.resource.IResourceDescriptions;
36import org.eclipse.xtext.resource.containers.IAllContainersState;
37import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider;
38import org.eclipse.xtext.resource.containers.StateBasedContainerManager;
39import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
40import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions;
41import org.eclipse.xtext.scoping.IGlobalScopeProvider;
42import org.eclipse.xtext.scoping.IScopeProvider;
43import org.eclipse.xtext.scoping.IgnoreCaseLinking;
44import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
45import org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider;
46import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider;
47import org.eclipse.xtext.serializer.ISerializer;
48import org.eclipse.xtext.serializer.impl.Serializer;
49import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
50import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
51import org.eclipse.xtext.service.DefaultRuntimeModule;
52import org.eclipse.xtext.service.SingletonBinding;
53import org.eclipse.xtext.validation.ConfigurableIssueCodesProvider;
54
55/**
56 * Manual modifications go to {@link ProblemRuntimeModule}.
57 */
58@SuppressWarnings("all")
59public abstract class AbstractProblemRuntimeModule extends DefaultRuntimeModule {
60
61 protected Properties properties = null;
62
63 @Override
64 public void configure(Binder binder) {
65 properties = tryBindProperties(binder, "org/eclipse/viatra/solver/language/Problem.properties");
66 super.configure(binder);
67 }
68
69 public void configureLanguageName(Binder binder) {
70 binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.viatra.solver.language.Problem");
71 }
72
73 public void configureFileExtensions(Binder binder) {
74 if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
75 binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("problem");
76 }
77
78 // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
79 public ClassLoader bindClassLoaderToInstance() {
80 return getClass().getClassLoader();
81 }
82
83 // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
84 public Class<? extends IGrammarAccess> bindIGrammarAccess() {
85 return ProblemGrammarAccess.class;
86 }
87
88 // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
89 public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
90 return ProblemSemanticSequencer.class;
91 }
92
93 // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
94 public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
95 return ProblemSyntacticSequencer.class;
96 }
97
98 // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
99 public Class<? extends ISerializer> bindISerializer() {
100 return Serializer.class;
101 }
102
103 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
104 public Class<? extends IParser> bindIParser() {
105 return ProblemParser.class;
106 }
107
108 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
109 public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
110 return AntlrTokenToStringConverter.class;
111 }
112
113 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
114 public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
115 return ProblemAntlrTokenFileProvider.class;
116 }
117
118 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
119 public Class<? extends Lexer> bindLexer() {
120 return InternalProblemLexer.class;
121 }
122
123 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
124 public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
125 return AntlrTokenDefProvider.class;
126 }
127
128 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
129 public Provider<? extends InternalProblemLexer> provideInternalProblemLexer() {
130 return LexerProvider.create(InternalProblemLexer.class);
131 }
132
133 // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
134 public void configureRuntimeLexer(Binder binder) {
135 binder.bind(Lexer.class)
136 .annotatedWith(Names.named(LexerBindings.RUNTIME))
137 .to(InternalProblemLexer.class);
138 }
139
140 // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
141 @SingletonBinding(eager=true)
142 public Class<? extends ProblemValidator> bindProblemValidator() {
143 return ProblemValidator.class;
144 }
145
146 // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
147 public Class<? extends ConfigurableIssueCodesProvider> bindConfigurableIssueCodesProvider() {
148 return ProblemConfigurableIssueCodesProvider.class;
149 }
150
151 // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
152 public Class<? extends IScopeProvider> bindIScopeProvider() {
153 return ProblemScopeProvider.class;
154 }
155
156 // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
157 public void configureIScopeProviderDelegate(Binder binder) {
158 binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class);
159 }
160
161 // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
162 public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
163 return DefaultGlobalScopeProvider.class;
164 }
165
166 // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
167 public void configureIgnoreCaseLinking(Binder binder) {
168 binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false);
169 }
170
171 // contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
172 public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
173 return DefaultDeclarativeQualifiedNameProvider.class;
174 }
175
176 // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
177 public Class<? extends IContainer.Manager> bindIContainer$Manager() {
178 return StateBasedContainerManager.class;
179 }
180
181 // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
182 public Class<? extends IAllContainersState.Provider> bindIAllContainersState$Provider() {
183 return ResourceSetBasedAllContainersStateProvider.class;
184 }
185
186 // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
187 public void configureIResourceDescriptions(Binder binder) {
188 binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class);
189 }
190
191 // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
192 public void configureIResourceDescriptionsPersisted(Binder binder) {
193 binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class);
194 }
195
196 // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2
197 public Class<? extends IGenerator2> bindIGenerator2() {
198 return ProblemGenerator.class;
199 }
200
201}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin
new file mode 100644
index 00000000..d16365d7
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin
Binary files differ
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/ProblemStandaloneSetupGenerated.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/ProblemStandaloneSetupGenerated.java
new file mode 100644
index 00000000..0366f9cd
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/ProblemStandaloneSetupGenerated.java
@@ -0,0 +1,37 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language;
5
6import com.google.inject.Guice;
7import com.google.inject.Injector;
8import org.eclipse.emf.ecore.resource.Resource;
9import org.eclipse.xtext.ISetup;
10import org.eclipse.xtext.common.TerminalsStandaloneSetup;
11import org.eclipse.xtext.resource.IResourceFactory;
12import org.eclipse.xtext.resource.IResourceServiceProvider;
13
14@SuppressWarnings("all")
15public class ProblemStandaloneSetupGenerated implements ISetup {
16
17 @Override
18 public Injector createInjectorAndDoEMFRegistration() {
19 TerminalsStandaloneSetup.doSetup();
20
21 Injector injector = createInjector();
22 register(injector);
23 return injector;
24 }
25
26 public Injector createInjector() {
27 return Guice.createInjector(new ProblemRuntimeModule());
28 }
29
30 public void register(Injector injector) {
31 IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
32 IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
33
34 Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("problem", resourceFactory);
35 IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("problem", serviceProvider);
36 }
37}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemAntlrTokenFileProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemAntlrTokenFileProvider.java
new file mode 100644
index 00000000..b7ecf3f6
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemAntlrTokenFileProvider.java
@@ -0,0 +1,16 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.parser.antlr;
5
6import java.io.InputStream;
7import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
8
9public class ProblemAntlrTokenFileProvider implements IAntlrTokenFileProvider {
10
11 @Override
12 public InputStream getAntlrTokenFile() {
13 ClassLoader classLoader = getClass().getClassLoader();
14 return classLoader.getResourceAsStream("org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens");
15 }
16}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemParser.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemParser.java
new file mode 100644
index 00000000..3af86cab
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/ProblemParser.java
@@ -0,0 +1,40 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.parser.antlr;
5
6import com.google.inject.Inject;
7import org.eclipse.viatra.solver.language.parser.antlr.internal.InternalProblemParser;
8import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
9import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
10import org.eclipse.xtext.parser.antlr.XtextTokenStream;
11
12public class ProblemParser extends AbstractAntlrParser {
13
14 @Inject
15 private ProblemGrammarAccess grammarAccess;
16
17 @Override
18 protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
19 tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
20 }
21
22
23 @Override
24 protected InternalProblemParser createParser(XtextTokenStream stream) {
25 return new InternalProblemParser(stream, getGrammarAccess());
26 }
27
28 @Override
29 protected String getDefaultRuleName() {
30 return "Problem";
31 }
32
33 public ProblemGrammarAccess getGrammarAccess() {
34 return this.grammarAccess;
35 }
36
37 public void setGrammarAccess(ProblemGrammarAccess grammarAccess) {
38 this.grammarAccess = grammarAccess;
39 }
40}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g
new file mode 100644
index 00000000..61b76835
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g
@@ -0,0 +1,1522 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4grammar InternalProblem;
5
6options {
7 superClass=AbstractInternalAntlrParser;
8}
9
10@lexer::header {
11package org.eclipse.viatra.solver.language.parser.antlr.internal;
12
13// Hack: Use our own Lexer superclass by means of import.
14// Currently there is no other way to specify the superclass for the lexer.
15import org.eclipse.xtext.parser.antlr.Lexer;
16}
17
18@parser::header {
19package org.eclipse.viatra.solver.language.parser.antlr.internal;
20
21import org.eclipse.xtext.*;
22import org.eclipse.xtext.parser.*;
23import org.eclipse.xtext.parser.impl.*;
24import org.eclipse.emf.ecore.util.EcoreUtil;
25import org.eclipse.emf.ecore.EObject;
26import org.eclipse.emf.common.util.Enumerator;
27import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
28import org.eclipse.xtext.parser.antlr.XtextTokenStream;
29import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
30import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
31import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
32
33}
34
35@parser::members {
36
37 private ProblemGrammarAccess grammarAccess;
38
39 public InternalProblemParser(TokenStream input, ProblemGrammarAccess grammarAccess) {
40 this(input);
41 this.grammarAccess = grammarAccess;
42 registerRules(grammarAccess.getGrammar());
43 }
44
45 @Override
46 protected String getFirstRuleName() {
47 return "Problem";
48 }
49
50 @Override
51 protected ProblemGrammarAccess getGrammarAccess() {
52 return grammarAccess;
53 }
54
55}
56
57@rulecatch {
58 catch (RecognitionException re) {
59 recover(input,re);
60 appendSkippedTokens();
61 }
62}
63
64// Entry rule entryRuleProblem
65entryRuleProblem returns [EObject current=null]:
66 { newCompositeNode(grammarAccess.getProblemRule()); }
67 iv_ruleProblem=ruleProblem
68 { $current=$iv_ruleProblem.current; }
69 EOF;
70
71// Rule Problem
72ruleProblem returns [EObject current=null]
73@init {
74 enterRule();
75}
76@after {
77 leaveRule();
78}:
79 (
80 (
81 {
82 newCompositeNode(grammarAccess.getProblemAccess().getStatementsStatementParserRuleCall_0());
83 }
84 lv_statements_0_0=ruleStatement
85 {
86 if ($current==null) {
87 $current = createModelElementForParent(grammarAccess.getProblemRule());
88 }
89 add(
90 $current,
91 "statements",
92 lv_statements_0_0,
93 "org.eclipse.viatra.solver.language.Problem.Statement");
94 afterParserOrEnumRuleCall();
95 }
96 )
97 )*
98;
99
100// Entry rule entryRuleStatement
101entryRuleStatement returns [EObject current=null]:
102 { newCompositeNode(grammarAccess.getStatementRule()); }
103 iv_ruleStatement=ruleStatement
104 { $current=$iv_ruleStatement.current; }
105 EOF;
106
107// Rule Statement
108ruleStatement returns [EObject current=null]
109@init {
110 enterRule();
111}
112@after {
113 leaveRule();
114}:
115 (
116 {
117 newCompositeNode(grammarAccess.getStatementAccess().getClassDeclarationParserRuleCall_0());
118 }
119 this_ClassDeclaration_0=ruleClassDeclaration
120 {
121 $current = $this_ClassDeclaration_0.current;
122 afterParserOrEnumRuleCall();
123 }
124 |
125 {
126 newCompositeNode(grammarAccess.getStatementAccess().getPredicateDefinitionParserRuleCall_1());
127 }
128 this_PredicateDefinition_1=rulePredicateDefinition
129 {
130 $current = $this_PredicateDefinition_1.current;
131 afterParserOrEnumRuleCall();
132 }
133 |
134 {
135 newCompositeNode(grammarAccess.getStatementAccess().getAssertionParserRuleCall_2());
136 }
137 this_Assertion_2=ruleAssertion
138 {
139 $current = $this_Assertion_2.current;
140 afterParserOrEnumRuleCall();
141 }
142 |
143 {
144 newCompositeNode(grammarAccess.getStatementAccess().getScopeDeclarationParserRuleCall_3());
145 }
146 this_ScopeDeclaration_3=ruleScopeDeclaration
147 {
148 $current = $this_ScopeDeclaration_3.current;
149 afterParserOrEnumRuleCall();
150 }
151 )
152;
153
154// Entry rule entryRuleClassDeclaration
155entryRuleClassDeclaration returns [EObject current=null]:
156 { newCompositeNode(grammarAccess.getClassDeclarationRule()); }
157 iv_ruleClassDeclaration=ruleClassDeclaration
158 { $current=$iv_ruleClassDeclaration.current; }
159 EOF;
160
161// Rule ClassDeclaration
162ruleClassDeclaration returns [EObject current=null]
163@init {
164 enterRule();
165}
166@after {
167 leaveRule();
168}:
169 (
170 (
171 (
172 lv_abstract_0_0='abstract'
173 {
174 newLeafNode(lv_abstract_0_0, grammarAccess.getClassDeclarationAccess().getAbstractAbstractKeyword_0_0());
175 }
176 {
177 if ($current==null) {
178 $current = createModelElement(grammarAccess.getClassDeclarationRule());
179 }
180 setWithLastConsumed($current, "abstract", lv_abstract_0_0 != null, "abstract");
181 }
182 )
183 )?
184 otherlv_1='class'
185 {
186 newLeafNode(otherlv_1, grammarAccess.getClassDeclarationAccess().getClassKeyword_1());
187 }
188 (
189 (
190 lv_name_2_0=RULE_ID
191 {
192 newLeafNode(lv_name_2_0, grammarAccess.getClassDeclarationAccess().getNameIDTerminalRuleCall_2_0());
193 }
194 {
195 if ($current==null) {
196 $current = createModelElement(grammarAccess.getClassDeclarationRule());
197 }
198 setWithLastConsumed(
199 $current,
200 "name",
201 lv_name_2_0,
202 "org.eclipse.xtext.common.Terminals.ID");
203 }
204 )
205 )
206 (
207 (
208 otherlv_3='extends'
209 {
210 newLeafNode(otherlv_3, grammarAccess.getClassDeclarationAccess().getExtendsKeyword_3_0_0());
211 }
212 (
213 (
214 (
215 {
216 if ($current==null) {
217 $current = createModelElement(grammarAccess.getClassDeclarationRule());
218 }
219 }
220 otherlv_4=RULE_ID
221 {
222 newLeafNode(otherlv_4, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_0_0());
223 }
224 )
225 )
226 |
227 (
228 otherlv_5='['
229 {
230 newLeafNode(otherlv_5, grammarAccess.getClassDeclarationAccess().getLeftSquareBracketKeyword_3_0_1_1_0());
231 }
232 (
233 (
234 (
235 {
236 if ($current==null) {
237 $current = createModelElement(grammarAccess.getClassDeclarationRule());
238 }
239 }
240 otherlv_6=RULE_ID
241 {
242 newLeafNode(otherlv_6, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0());
243 }
244 )
245 )
246 (
247 otherlv_7=','
248 {
249 newLeafNode(otherlv_7, grammarAccess.getClassDeclarationAccess().getCommaKeyword_3_0_1_1_1_1_0());
250 }
251 (
252 (
253 {
254 if ($current==null) {
255 $current = createModelElement(grammarAccess.getClassDeclarationRule());
256 }
257 }
258 otherlv_8=RULE_ID
259 {
260 newLeafNode(otherlv_8, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0());
261 }
262 )
263 )
264 )*
265 )?
266 otherlv_9=']'
267 {
268 newLeafNode(otherlv_9, grammarAccess.getClassDeclarationAccess().getRightSquareBracketKeyword_3_0_1_1_2());
269 }
270 )
271 )
272 )
273 |
274 (
275 (
276 {
277 newCompositeNode(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsReferenceDeclarationParserRuleCall_3_1_0());
278 }
279 lv_referenceDeclarations_10_0=ruleReferenceDeclaration
280 {
281 if ($current==null) {
282 $current = createModelElementForParent(grammarAccess.getClassDeclarationRule());
283 }
284 add(
285 $current,
286 "referenceDeclarations",
287 lv_referenceDeclarations_10_0,
288 "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration");
289 afterParserOrEnumRuleCall();
290 }
291 )
292 )
293 )?
294 (
295 otherlv_11=','
296 {
297 newLeafNode(otherlv_11, grammarAccess.getClassDeclarationAccess().getCommaKeyword_4_0());
298 }
299 (
300 (
301 {
302 newCompositeNode(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsReferenceDeclarationParserRuleCall_4_1_0());
303 }
304 lv_referenceDeclarations_12_0=ruleReferenceDeclaration
305 {
306 if ($current==null) {
307 $current = createModelElementForParent(grammarAccess.getClassDeclarationRule());
308 }
309 add(
310 $current,
311 "referenceDeclarations",
312 lv_referenceDeclarations_12_0,
313 "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration");
314 afterParserOrEnumRuleCall();
315 }
316 )
317 )
318 )*
319 otherlv_13='.'
320 {
321 newLeafNode(otherlv_13, grammarAccess.getClassDeclarationAccess().getFullStopKeyword_5());
322 }
323 )
324;
325
326// Entry rule entryRuleReferenceDeclaration
327entryRuleReferenceDeclaration returns [EObject current=null]:
328 { newCompositeNode(grammarAccess.getReferenceDeclarationRule()); }
329 iv_ruleReferenceDeclaration=ruleReferenceDeclaration
330 { $current=$iv_ruleReferenceDeclaration.current; }
331 EOF;
332
333// Rule ReferenceDeclaration
334ruleReferenceDeclaration returns [EObject current=null]
335@init {
336 enterRule();
337}
338@after {
339 leaveRule();
340}:
341 (
342 (
343 (
344 (
345 lv_containment_0_0='contains'
346 {
347 newLeafNode(lv_containment_0_0, grammarAccess.getReferenceDeclarationAccess().getContainmentContainsKeyword_0_0_0());
348 }
349 {
350 if ($current==null) {
351 $current = createModelElement(grammarAccess.getReferenceDeclarationRule());
352 }
353 setWithLastConsumed($current, "containment", lv_containment_0_0 != null, "contains");
354 }
355 )
356 )
357 |
358 otherlv_1='refers'
359 {
360 newLeafNode(otherlv_1, grammarAccess.getReferenceDeclarationAccess().getRefersKeyword_0_1());
361 }
362 )
363 (
364 (
365 {
366 if ($current==null) {
367 $current = createModelElement(grammarAccess.getReferenceDeclarationRule());
368 }
369 }
370 otherlv_2=RULE_ID
371 {
372 newLeafNode(otherlv_2, grammarAccess.getReferenceDeclarationAccess().getReferenceTypeClassDeclarationCrossReference_1_0());
373 }
374 )
375 )
376 otherlv_3='['
377 {
378 newLeafNode(otherlv_3, grammarAccess.getReferenceDeclarationAccess().getLeftSquareBracketKeyword_2());
379 }
380 (
381 (
382 {
383 newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getMultiplicityMultiplicityParserRuleCall_3_0());
384 }
385 lv_multiplicity_4_0=ruleMultiplicity
386 {
387 if ($current==null) {
388 $current = createModelElementForParent(grammarAccess.getReferenceDeclarationRule());
389 }
390 set(
391 $current,
392 "multiplicity",
393 lv_multiplicity_4_0,
394 "org.eclipse.viatra.solver.language.Problem.Multiplicity");
395 afterParserOrEnumRuleCall();
396 }
397 )
398 )
399 otherlv_5=']'
400 {
401 newLeafNode(otherlv_5, grammarAccess.getReferenceDeclarationAccess().getRightSquareBracketKeyword_4());
402 }
403 (
404 (
405 lv_name_6_0=RULE_ID
406 {
407 newLeafNode(lv_name_6_0, grammarAccess.getReferenceDeclarationAccess().getNameIDTerminalRuleCall_5_0());
408 }
409 {
410 if ($current==null) {
411 $current = createModelElement(grammarAccess.getReferenceDeclarationRule());
412 }
413 setWithLastConsumed(
414 $current,
415 "name",
416 lv_name_6_0,
417 "org.eclipse.xtext.common.Terminals.ID");
418 }
419 )
420 )
421 (
422 otherlv_7='opposite'
423 {
424 newLeafNode(otherlv_7, grammarAccess.getReferenceDeclarationAccess().getOppositeKeyword_6_0());
425 }
426 (
427 (
428 {
429 if ($current==null) {
430 $current = createModelElement(grammarAccess.getReferenceDeclarationRule());
431 }
432 }
433 {
434 newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getOppositeReferenceDeclarationCrossReference_6_1_0());
435 }
436 ruleQualifiedName
437 {
438 afterParserOrEnumRuleCall();
439 }
440 )
441 )
442 )?
443 )
444;
445
446// Entry rule entryRulePredicateDefinition
447entryRulePredicateDefinition returns [EObject current=null]:
448 { newCompositeNode(grammarAccess.getPredicateDefinitionRule()); }
449 iv_rulePredicateDefinition=rulePredicateDefinition
450 { $current=$iv_rulePredicateDefinition.current; }
451 EOF;
452
453// Rule PredicateDefinition
454rulePredicateDefinition returns [EObject current=null]
455@init {
456 enterRule();
457}
458@after {
459 leaveRule();
460}:
461 (
462 (
463 (
464 (
465 (
466 lv_error_0_0='error'
467 {
468 newLeafNode(lv_error_0_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_0_0_0());
469 }
470 {
471 if ($current==null) {
472 $current = createModelElement(grammarAccess.getPredicateDefinitionRule());
473 }
474 setWithLastConsumed($current, "error", lv_error_0_0 != null, "error");
475 }
476 )
477 )
478 (
479 otherlv_1='pred'
480 {
481 newLeafNode(otherlv_1, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1());
482 }
483 )?
484 )
485 |
486 otherlv_2='pred'
487 {
488 newLeafNode(otherlv_2, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_1());
489 }
490 )
491 (
492 (
493 lv_name_3_0=RULE_ID
494 {
495 newLeafNode(lv_name_3_0, grammarAccess.getPredicateDefinitionAccess().getNameIDTerminalRuleCall_1_0());
496 }
497 {
498 if ($current==null) {
499 $current = createModelElement(grammarAccess.getPredicateDefinitionRule());
500 }
501 setWithLastConsumed(
502 $current,
503 "name",
504 lv_name_3_0,
505 "org.eclipse.xtext.common.Terminals.ID");
506 }
507 )
508 )
509 otherlv_4='('
510 {
511 newLeafNode(otherlv_4, grammarAccess.getPredicateDefinitionAccess().getLeftParenthesisKeyword_2());
512 }
513 (
514 (
515 (
516 {
517 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_0_0());
518 }
519 lv_parameters_5_0=ruleParameter
520 {
521 if ($current==null) {
522 $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
523 }
524 add(
525 $current,
526 "parameters",
527 lv_parameters_5_0,
528 "org.eclipse.viatra.solver.language.Problem.Parameter");
529 afterParserOrEnumRuleCall();
530 }
531 )
532 )
533 (
534 otherlv_6=','
535 {
536 newLeafNode(otherlv_6, grammarAccess.getPredicateDefinitionAccess().getCommaKeyword_3_1_0());
537 }
538 (
539 (
540 {
541 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_1_1_0());
542 }
543 lv_parameters_7_0=ruleParameter
544 {
545 if ($current==null) {
546 $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
547 }
548 add(
549 $current,
550 "parameters",
551 lv_parameters_7_0,
552 "org.eclipse.viatra.solver.language.Problem.Parameter");
553 afterParserOrEnumRuleCall();
554 }
555 )
556 )
557 )*
558 )?
559 otherlv_8=')'
560 {
561 newLeafNode(otherlv_8, grammarAccess.getPredicateDefinitionAccess().getRightParenthesisKeyword_4());
562 }
563 (
564 otherlv_9=':='
565 {
566 newLeafNode(otherlv_9, grammarAccess.getPredicateDefinitionAccess().getColonEqualsSignKeyword_5_0());
567 }
568 (
569 (
570 {
571 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_1_0());
572 }
573 lv_bodies_10_0=ruleConjunction
574 {
575 if ($current==null) {
576 $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
577 }
578 add(
579 $current,
580 "bodies",
581 lv_bodies_10_0,
582 "org.eclipse.viatra.solver.language.Problem.Conjunction");
583 afterParserOrEnumRuleCall();
584 }
585 )
586 )
587 (
588 otherlv_11=';'
589 {
590 newLeafNode(otherlv_11, grammarAccess.getPredicateDefinitionAccess().getSemicolonKeyword_5_2_0());
591 }
592 (
593 (
594 {
595 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_2_1_0());
596 }
597 lv_bodies_12_0=ruleConjunction
598 {
599 if ($current==null) {
600 $current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
601 }
602 add(
603 $current,
604 "bodies",
605 lv_bodies_12_0,
606 "org.eclipse.viatra.solver.language.Problem.Conjunction");
607 afterParserOrEnumRuleCall();
608 }
609 )
610 )
611 )*
612 )?
613 otherlv_13='.'
614 {
615 newLeafNode(otherlv_13, grammarAccess.getPredicateDefinitionAccess().getFullStopKeyword_6());
616 }
617 )
618;
619
620// Entry rule entryRuleParameter
621entryRuleParameter returns [EObject current=null]:
622 { newCompositeNode(grammarAccess.getParameterRule()); }
623 iv_ruleParameter=ruleParameter
624 { $current=$iv_ruleParameter.current; }
625 EOF;
626
627// Rule Parameter
628ruleParameter returns [EObject current=null]
629@init {
630 enterRule();
631}
632@after {
633 leaveRule();
634}:
635 (
636 (
637 (
638 {
639 if ($current==null) {
640 $current = createModelElement(grammarAccess.getParameterRule());
641 }
642 }
643 otherlv_0=RULE_ID
644 {
645 newLeafNode(otherlv_0, grammarAccess.getParameterAccess().getParameterTypeClassDeclarationCrossReference_0_0());
646 }
647 )
648 )
649 (
650 (
651 lv_name_1_0=RULE_ID
652 {
653 newLeafNode(lv_name_1_0, grammarAccess.getParameterAccess().getNameIDTerminalRuleCall_1_0());
654 }
655 {
656 if ($current==null) {
657 $current = createModelElement(grammarAccess.getParameterRule());
658 }
659 setWithLastConsumed(
660 $current,
661 "name",
662 lv_name_1_0,
663 "org.eclipse.xtext.common.Terminals.ID");
664 }
665 )
666 )
667 )
668;
669
670// Entry rule entryRuleConjunction
671entryRuleConjunction returns [EObject current=null]:
672 { newCompositeNode(grammarAccess.getConjunctionRule()); }
673 iv_ruleConjunction=ruleConjunction
674 { $current=$iv_ruleConjunction.current; }
675 EOF;
676
677// Rule Conjunction
678ruleConjunction returns [EObject current=null]
679@init {
680 enterRule();
681}
682@after {
683 leaveRule();
684}:
685 (
686 (
687 (
688 {
689 newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_0_0());
690 }
691 lv_literals_0_0=ruleLiteral
692 {
693 if ($current==null) {
694 $current = createModelElementForParent(grammarAccess.getConjunctionRule());
695 }
696 add(
697 $current,
698 "literals",
699 lv_literals_0_0,
700 "org.eclipse.viatra.solver.language.Problem.Literal");
701 afterParserOrEnumRuleCall();
702 }
703 )
704 )
705 (
706 otherlv_1=','
707 {
708 newLeafNode(otherlv_1, grammarAccess.getConjunctionAccess().getCommaKeyword_1_0());
709 }
710 (
711 (
712 {
713 newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_1_1_0());
714 }
715 lv_literals_2_0=ruleLiteral
716 {
717 if ($current==null) {
718 $current = createModelElementForParent(grammarAccess.getConjunctionRule());
719 }
720 add(
721 $current,
722 "literals",
723 lv_literals_2_0,
724 "org.eclipse.viatra.solver.language.Problem.Literal");
725 afterParserOrEnumRuleCall();
726 }
727 )
728 )
729 )*
730 )
731;
732
733// Entry rule entryRuleLiteral
734entryRuleLiteral returns [EObject current=null]:
735 { newCompositeNode(grammarAccess.getLiteralRule()); }
736 iv_ruleLiteral=ruleLiteral
737 { $current=$iv_ruleLiteral.current; }
738 EOF;
739
740// Rule Literal
741ruleLiteral returns [EObject current=null]
742@init {
743 enterRule();
744}
745@after {
746 leaveRule();
747}:
748 (
749 {
750 newCompositeNode(grammarAccess.getLiteralAccess().getAtomParserRuleCall_0());
751 }
752 this_Atom_0=ruleAtom
753 {
754 $current = $this_Atom_0.current;
755 afterParserOrEnumRuleCall();
756 }
757 |
758 {
759 newCompositeNode(grammarAccess.getLiteralAccess().getNegativeLiteralParserRuleCall_1());
760 }
761 this_NegativeLiteral_1=ruleNegativeLiteral
762 {
763 $current = $this_NegativeLiteral_1.current;
764 afterParserOrEnumRuleCall();
765 }
766 )
767;
768
769// Entry rule entryRuleNegativeLiteral
770entryRuleNegativeLiteral returns [EObject current=null]:
771 { newCompositeNode(grammarAccess.getNegativeLiteralRule()); }
772 iv_ruleNegativeLiteral=ruleNegativeLiteral
773 { $current=$iv_ruleNegativeLiteral.current; }
774 EOF;
775
776// Rule NegativeLiteral
777ruleNegativeLiteral returns [EObject current=null]
778@init {
779 enterRule();
780}
781@after {
782 leaveRule();
783}:
784 (
785 otherlv_0='!'
786 {
787 newLeafNode(otherlv_0, grammarAccess.getNegativeLiteralAccess().getExclamationMarkKeyword_0());
788 }
789 (
790 (
791 {
792 newCompositeNode(grammarAccess.getNegativeLiteralAccess().getAtomAtomParserRuleCall_1_0());
793 }
794 lv_atom_1_0=ruleAtom
795 {
796 if ($current==null) {
797 $current = createModelElementForParent(grammarAccess.getNegativeLiteralRule());
798 }
799 set(
800 $current,
801 "atom",
802 lv_atom_1_0,
803 "org.eclipse.viatra.solver.language.Problem.Atom");
804 afterParserOrEnumRuleCall();
805 }
806 )
807 )
808 )
809;
810
811// Entry rule entryRuleAtom
812entryRuleAtom returns [EObject current=null]:
813 { newCompositeNode(grammarAccess.getAtomRule()); }
814 iv_ruleAtom=ruleAtom
815 { $current=$iv_ruleAtom.current; }
816 EOF;
817
818// Rule Atom
819ruleAtom returns [EObject current=null]
820@init {
821 enterRule();
822}
823@after {
824 leaveRule();
825}:
826 (
827 (
828 (
829 {
830 if ($current==null) {
831 $current = createModelElement(grammarAccess.getAtomRule());
832 }
833 }
834 {
835 newCompositeNode(grammarAccess.getAtomAccess().getRelationRelationCrossReference_0_0());
836 }
837 ruleQualifiedName
838 {
839 afterParserOrEnumRuleCall();
840 }
841 )
842 )
843 (
844 (
845 lv_transitiveClosure_1_0='+'
846 {
847 newLeafNode(lv_transitiveClosure_1_0, grammarAccess.getAtomAccess().getTransitiveClosurePlusSignKeyword_1_0());
848 }
849 {
850 if ($current==null) {
851 $current = createModelElement(grammarAccess.getAtomRule());
852 }
853 setWithLastConsumed($current, "transitiveClosure", lv_transitiveClosure_1_0 != null, "+");
854 }
855 )
856 )?
857 otherlv_2='('
858 {
859 newLeafNode(otherlv_2, grammarAccess.getAtomAccess().getLeftParenthesisKeyword_2());
860 }
861 (
862 (
863 (
864 {
865 if ($current==null) {
866 $current = createModelElement(grammarAccess.getAtomRule());
867 }
868 }
869 otherlv_3=RULE_ID
870 {
871 newLeafNode(otherlv_3, grammarAccess.getAtomAccess().getArgumentsVariableCrossReference_3_0_0());
872 }
873 )
874 )
875 (
876 otherlv_4=','
877 {
878 newLeafNode(otherlv_4, grammarAccess.getAtomAccess().getCommaKeyword_3_1_0());
879 }
880 (
881 (
882 {
883 if ($current==null) {
884 $current = createModelElement(grammarAccess.getAtomRule());
885 }
886 }
887 otherlv_5=RULE_ID
888 {
889 newLeafNode(otherlv_5, grammarAccess.getAtomAccess().getArgumentsVariableCrossReference_3_1_1_0());
890 }
891 )
892 )
893 )*
894 )?
895 otherlv_6=')'
896 {
897 newLeafNode(otherlv_6, grammarAccess.getAtomAccess().getRightParenthesisKeyword_4());
898 }
899 )
900;
901
902// Entry rule entryRuleAssertion
903entryRuleAssertion returns [EObject current=null]:
904 { newCompositeNode(grammarAccess.getAssertionRule()); }
905 iv_ruleAssertion=ruleAssertion
906 { $current=$iv_ruleAssertion.current; }
907 EOF;
908
909// Rule Assertion
910ruleAssertion returns [EObject current=null]
911@init {
912 enterRule();
913}
914@after {
915 leaveRule();
916}:
917 (
918 (
919 (
920 (
921 (
922 {
923 if ($current==null) {
924 $current = createModelElement(grammarAccess.getAssertionRule());
925 }
926 }
927 {
928 newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_0_0_0());
929 }
930 ruleQualifiedName
931 {
932 afterParserOrEnumRuleCall();
933 }
934 )
935 )
936 otherlv_1='('
937 {
938 newLeafNode(otherlv_1, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_0_1());
939 }
940 (
941 (
942 (
943 {
944 if ($current==null) {
945 $current = createModelElement(grammarAccess.getAssertionRule());
946 }
947 }
948 {
949 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_0_0());
950 }
951 ruleQualifiedName
952 {
953 afterParserOrEnumRuleCall();
954 }
955 )
956 )
957 (
958 otherlv_3=','
959 {
960 newLeafNode(otherlv_3, grammarAccess.getAssertionAccess().getCommaKeyword_0_0_2_1_0());
961 }
962 (
963 (
964 {
965 if ($current==null) {
966 $current = createModelElement(grammarAccess.getAssertionRule());
967 }
968 }
969 {
970 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_1_1_0());
971 }
972 ruleQualifiedName
973 {
974 afterParserOrEnumRuleCall();
975 }
976 )
977 )
978 )*
979 )?
980 otherlv_5=')'
981 {
982 newLeafNode(otherlv_5, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_0_3());
983 }
984 otherlv_6=':'
985 {
986 newLeafNode(otherlv_6, grammarAccess.getAssertionAccess().getColonKeyword_0_0_4());
987 }
988 (
989 (
990 {
991 newCompositeNode(grammarAccess.getAssertionAccess().getValueLogicValueEnumRuleCall_0_0_5_0());
992 }
993 lv_value_7_0=ruleLogicValue
994 {
995 if ($current==null) {
996 $current = createModelElementForParent(grammarAccess.getAssertionRule());
997 }
998 set(
999 $current,
1000 "value",
1001 lv_value_7_0,
1002 "org.eclipse.viatra.solver.language.Problem.LogicValue");
1003 afterParserOrEnumRuleCall();
1004 }
1005 )
1006 )
1007 )
1008 |
1009 (
1010 (
1011 (
1012 {
1013 newCompositeNode(grammarAccess.getAssertionAccess().getValueShortLogicValueEnumRuleCall_0_1_0_0());
1014 }
1015 lv_value_8_0=ruleShortLogicValue
1016 {
1017 if ($current==null) {
1018 $current = createModelElementForParent(grammarAccess.getAssertionRule());
1019 }
1020 set(
1021 $current,
1022 "value",
1023 lv_value_8_0,
1024 "org.eclipse.viatra.solver.language.Problem.ShortLogicValue");
1025 afterParserOrEnumRuleCall();
1026 }
1027 )
1028 )?
1029 (
1030 (
1031 {
1032 if ($current==null) {
1033 $current = createModelElement(grammarAccess.getAssertionRule());
1034 }
1035 }
1036 {
1037 newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_1_1_0());
1038 }
1039 ruleQualifiedName
1040 {
1041 afterParserOrEnumRuleCall();
1042 }
1043 )
1044 )
1045 otherlv_10='('
1046 {
1047 newLeafNode(otherlv_10, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_1_2());
1048 }
1049 (
1050 (
1051 (
1052 {
1053 if ($current==null) {
1054 $current = createModelElement(grammarAccess.getAssertionRule());
1055 }
1056 }
1057 {
1058 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_0_0());
1059 }
1060 ruleQualifiedName
1061 {
1062 afterParserOrEnumRuleCall();
1063 }
1064 )
1065 )
1066 (
1067 otherlv_12=','
1068 {
1069 newLeafNode(otherlv_12, grammarAccess.getAssertionAccess().getCommaKeyword_0_1_3_1_0());
1070 }
1071 (
1072 (
1073 {
1074 if ($current==null) {
1075 $current = createModelElement(grammarAccess.getAssertionRule());
1076 }
1077 }
1078 {
1079 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_1_1_0());
1080 }
1081 ruleQualifiedName
1082 {
1083 afterParserOrEnumRuleCall();
1084 }
1085 )
1086 )
1087 )*
1088 )?
1089 otherlv_14=')'
1090 {
1091 newLeafNode(otherlv_14, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_1_4());
1092 }
1093 )
1094 )
1095 otherlv_15='.'
1096 {
1097 newLeafNode(otherlv_15, grammarAccess.getAssertionAccess().getFullStopKeyword_1());
1098 }
1099 )
1100;
1101
1102// Entry rule entryRuleScopeDeclaration
1103entryRuleScopeDeclaration returns [EObject current=null]:
1104 { newCompositeNode(grammarAccess.getScopeDeclarationRule()); }
1105 iv_ruleScopeDeclaration=ruleScopeDeclaration
1106 { $current=$iv_ruleScopeDeclaration.current; }
1107 EOF;
1108
1109// Rule ScopeDeclaration
1110ruleScopeDeclaration returns [EObject current=null]
1111@init {
1112 enterRule();
1113}
1114@after {
1115 leaveRule();
1116}:
1117 (
1118 otherlv_0='scope'
1119 {
1120 newLeafNode(otherlv_0, grammarAccess.getScopeDeclarationAccess().getScopeKeyword_0());
1121 }
1122 (
1123 (
1124 {
1125 newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_1_0());
1126 }
1127 lv_typeScopes_1_0=ruleTypeScope
1128 {
1129 if ($current==null) {
1130 $current = createModelElementForParent(grammarAccess.getScopeDeclarationRule());
1131 }
1132 add(
1133 $current,
1134 "typeScopes",
1135 lv_typeScopes_1_0,
1136 "org.eclipse.viatra.solver.language.Problem.TypeScope");
1137 afterParserOrEnumRuleCall();
1138 }
1139 )
1140 )
1141 (
1142 otherlv_2=','
1143 {
1144 newLeafNode(otherlv_2, grammarAccess.getScopeDeclarationAccess().getCommaKeyword_2_0());
1145 }
1146 (
1147 (
1148 {
1149 newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_2_1_0());
1150 }
1151 lv_typeScopes_3_0=ruleTypeScope
1152 {
1153 if ($current==null) {
1154 $current = createModelElementForParent(grammarAccess.getScopeDeclarationRule());
1155 }
1156 add(
1157 $current,
1158 "typeScopes",
1159 lv_typeScopes_3_0,
1160 "org.eclipse.viatra.solver.language.Problem.TypeScope");
1161 afterParserOrEnumRuleCall();
1162 }
1163 )
1164 )
1165 )*
1166 otherlv_4='.'
1167 {
1168 newLeafNode(otherlv_4, grammarAccess.getScopeDeclarationAccess().getFullStopKeyword_3());
1169 }
1170 )
1171;
1172
1173// Entry rule entryRuleTypeScope
1174entryRuleTypeScope returns [EObject current=null]:
1175 { newCompositeNode(grammarAccess.getTypeScopeRule()); }
1176 iv_ruleTypeScope=ruleTypeScope
1177 { $current=$iv_ruleTypeScope.current; }
1178 EOF;
1179
1180// Rule TypeScope
1181ruleTypeScope returns [EObject current=null]
1182@init {
1183 enterRule();
1184}
1185@after {
1186 leaveRule();
1187}:
1188 (
1189 (
1190 (
1191 {
1192 if ($current==null) {
1193 $current = createModelElement(grammarAccess.getTypeScopeRule());
1194 }
1195 }
1196 otherlv_0=RULE_ID
1197 {
1198 newLeafNode(otherlv_0, grammarAccess.getTypeScopeAccess().getTargetTypeClassDeclarationCrossReference_0_0());
1199 }
1200 )
1201 )
1202 (
1203 (
1204 (
1205 lv_increment_1_0='+='
1206 {
1207 newLeafNode(lv_increment_1_0, grammarAccess.getTypeScopeAccess().getIncrementPlusSignEqualsSignKeyword_1_0_0());
1208 }
1209 {
1210 if ($current==null) {
1211 $current = createModelElement(grammarAccess.getTypeScopeRule());
1212 }
1213 setWithLastConsumed($current, "increment", lv_increment_1_0 != null, "+=");
1214 }
1215 )
1216 )
1217 |
1218 otherlv_2='='
1219 {
1220 newLeafNode(otherlv_2, grammarAccess.getTypeScopeAccess().getEqualsSignKeyword_1_1());
1221 }
1222 )
1223 (
1224 (
1225 {
1226 newCompositeNode(grammarAccess.getTypeScopeAccess().getMultiplicityMultiplicityParserRuleCall_2_0());
1227 }
1228 lv_multiplicity_3_0=ruleMultiplicity
1229 {
1230 if ($current==null) {
1231 $current = createModelElementForParent(grammarAccess.getTypeScopeRule());
1232 }
1233 set(
1234 $current,
1235 "multiplicity",
1236 lv_multiplicity_3_0,
1237 "org.eclipse.viatra.solver.language.Problem.Multiplicity");
1238 afterParserOrEnumRuleCall();
1239 }
1240 )
1241 )
1242 )
1243;
1244
1245// Entry rule entryRuleMultiplicity
1246entryRuleMultiplicity returns [EObject current=null]:
1247 { newCompositeNode(grammarAccess.getMultiplicityRule()); }
1248 iv_ruleMultiplicity=ruleMultiplicity
1249 { $current=$iv_ruleMultiplicity.current; }
1250 EOF;
1251
1252// Rule Multiplicity
1253ruleMultiplicity returns [EObject current=null]
1254@init {
1255 enterRule();
1256}
1257@after {
1258 leaveRule();
1259}:
1260 (
1261 {
1262 newCompositeNode(grammarAccess.getMultiplicityAccess().getRangeMultiplicityParserRuleCall_0());
1263 }
1264 this_RangeMultiplicity_0=ruleRangeMultiplicity
1265 {
1266 $current = $this_RangeMultiplicity_0.current;
1267 afterParserOrEnumRuleCall();
1268 }
1269 |
1270 {
1271 newCompositeNode(grammarAccess.getMultiplicityAccess().getExactMultiplicityParserRuleCall_1());
1272 }
1273 this_ExactMultiplicity_1=ruleExactMultiplicity
1274 {
1275 $current = $this_ExactMultiplicity_1.current;
1276 afterParserOrEnumRuleCall();
1277 }
1278 )
1279;
1280
1281// Entry rule entryRuleRangeMultiplicity
1282entryRuleRangeMultiplicity returns [EObject current=null]:
1283 { newCompositeNode(grammarAccess.getRangeMultiplicityRule()); }
1284 iv_ruleRangeMultiplicity=ruleRangeMultiplicity
1285 { $current=$iv_ruleRangeMultiplicity.current; }
1286 EOF;
1287
1288// Rule RangeMultiplicity
1289ruleRangeMultiplicity returns [EObject current=null]
1290@init {
1291 enterRule();
1292}
1293@after {
1294 leaveRule();
1295}:
1296 (
1297 (
1298 (
1299 lv_lowerBound_0_0=RULE_INT
1300 {
1301 newLeafNode(lv_lowerBound_0_0, grammarAccess.getRangeMultiplicityAccess().getLowerBoundINTTerminalRuleCall_0_0());
1302 }
1303 {
1304 if ($current==null) {
1305 $current = createModelElement(grammarAccess.getRangeMultiplicityRule());
1306 }
1307 setWithLastConsumed(
1308 $current,
1309 "lowerBound",
1310 lv_lowerBound_0_0,
1311 "org.eclipse.xtext.common.Terminals.INT");
1312 }
1313 )
1314 )
1315 otherlv_1='..'
1316 {
1317 newLeafNode(otherlv_1, grammarAccess.getRangeMultiplicityAccess().getFullStopFullStopKeyword_1());
1318 }
1319 (
1320 (
1321 {
1322 newCompositeNode(grammarAccess.getRangeMultiplicityAccess().getUpperBoundUpperBoundParserRuleCall_2_0());
1323 }
1324 lv_upperBound_2_0=ruleUpperBound
1325 {
1326 if ($current==null) {
1327 $current = createModelElementForParent(grammarAccess.getRangeMultiplicityRule());
1328 }
1329 set(
1330 $current,
1331 "upperBound",
1332 lv_upperBound_2_0,
1333 "org.eclipse.viatra.solver.language.Problem.UpperBound");
1334 afterParserOrEnumRuleCall();
1335 }
1336 )
1337 )
1338 )
1339;
1340
1341// Entry rule entryRuleExactMultiplicity
1342entryRuleExactMultiplicity returns [EObject current=null]:
1343 { newCompositeNode(grammarAccess.getExactMultiplicityRule()); }
1344 iv_ruleExactMultiplicity=ruleExactMultiplicity
1345 { $current=$iv_ruleExactMultiplicity.current; }
1346 EOF;
1347
1348// Rule ExactMultiplicity
1349ruleExactMultiplicity returns [EObject current=null]
1350@init {
1351 enterRule();
1352}
1353@after {
1354 leaveRule();
1355}:
1356 (
1357 (
1358 lv_exactValue_0_0=RULE_INT
1359 {
1360 newLeafNode(lv_exactValue_0_0, grammarAccess.getExactMultiplicityAccess().getExactValueINTTerminalRuleCall_0());
1361 }
1362 {
1363 if ($current==null) {
1364 $current = createModelElement(grammarAccess.getExactMultiplicityRule());
1365 }
1366 setWithLastConsumed(
1367 $current,
1368 "exactValue",
1369 lv_exactValue_0_0,
1370 "org.eclipse.xtext.common.Terminals.INT");
1371 }
1372 )
1373 )
1374;
1375
1376// Entry rule entryRuleUpperBound
1377entryRuleUpperBound returns [String current=null]:
1378 { newCompositeNode(grammarAccess.getUpperBoundRule()); }
1379 iv_ruleUpperBound=ruleUpperBound
1380 { $current=$iv_ruleUpperBound.current.getText(); }
1381 EOF;
1382
1383// Rule UpperBound
1384ruleUpperBound returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
1385@init {
1386 enterRule();
1387}
1388@after {
1389 leaveRule();
1390}:
1391 (
1392 this_INT_0=RULE_INT
1393 {
1394 $current.merge(this_INT_0);
1395 }
1396 {
1397 newLeafNode(this_INT_0, grammarAccess.getUpperBoundAccess().getINTTerminalRuleCall_0());
1398 }
1399 |
1400 kw='*'
1401 {
1402 $current.merge(kw);
1403 newLeafNode(kw, grammarAccess.getUpperBoundAccess().getAsteriskKeyword_1());
1404 }
1405 )
1406;
1407
1408// Entry rule entryRuleQualifiedName
1409entryRuleQualifiedName returns [String current=null]:
1410 { newCompositeNode(grammarAccess.getQualifiedNameRule()); }
1411 iv_ruleQualifiedName=ruleQualifiedName
1412 { $current=$iv_ruleQualifiedName.current.getText(); }
1413 EOF;
1414
1415// Rule QualifiedName
1416ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
1417@init {
1418 enterRule();
1419}
1420@after {
1421 leaveRule();
1422}:
1423 (
1424 this_ID_0=RULE_ID
1425 {
1426 $current.merge(this_ID_0);
1427 }
1428 {
1429 newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0());
1430 }
1431 (
1432 kw='::'
1433 {
1434 $current.merge(kw);
1435 newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_0());
1436 }
1437 this_ID_2=RULE_ID
1438 {
1439 $current.merge(this_ID_2);
1440 }
1441 {
1442 newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1());
1443 }
1444 )*
1445 )
1446;
1447
1448// Rule LogicValue
1449ruleLogicValue returns [Enumerator current=null]
1450@init {
1451 enterRule();
1452}
1453@after {
1454 leaveRule();
1455}:
1456 (
1457 (
1458 enumLiteral_0='true'
1459 {
1460 $current = grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
1461 newLeafNode(enumLiteral_0, grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0());
1462 }
1463 )
1464 |
1465 (
1466 enumLiteral_1='false'
1467 {
1468 $current = grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
1469 newLeafNode(enumLiteral_1, grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1());
1470 }
1471 )
1472 |
1473 (
1474 enumLiteral_2='unknown'
1475 {
1476 $current = grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
1477 newLeafNode(enumLiteral_2, grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2());
1478 }
1479 )
1480 )
1481;
1482
1483// Rule ShortLogicValue
1484ruleShortLogicValue returns [Enumerator current=null]
1485@init {
1486 enterRule();
1487}
1488@after {
1489 leaveRule();
1490}:
1491 (
1492 (
1493 enumLiteral_0='!'
1494 {
1495 $current = grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
1496 newLeafNode(enumLiteral_0, grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0());
1497 }
1498 )
1499 |
1500 (
1501 enumLiteral_1='?'
1502 {
1503 $current = grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
1504 newLeafNode(enumLiteral_1, grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1());
1505 }
1506 )
1507 )
1508;
1509
1510RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
1511
1512RULE_INT : ('0'..'9')+;
1513
1514RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
1515
1516RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
1517
1518RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
1519
1520RULE_WS : (' '|'\t'|'\r'|'\n')+;
1521
1522RULE_ANY_OTHER : .;
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens
new file mode 100644
index 00000000..22ef662c
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens
@@ -0,0 +1,65 @@
1'!'=27
2'('=23
3')'=24
4'*'=34
5'+'=28
6'+='=31
7','=15
8'.'=17
9'..'=33
10':'=29
11'::'=35
12':='=25
13';'=26
14'='=32
15'?'=39
16'['=14
17']'=16
18'abstract'=11
19'class'=12
20'contains'=18
21'error'=21
22'extends'=13
23'false'=37
24'opposite'=20
25'pred'=22
26'refers'=19
27'scope'=30
28'true'=36
29'unknown'=38
30RULE_ANY_OTHER=10
31RULE_ID=4
32RULE_INT=5
33RULE_ML_COMMENT=7
34RULE_SL_COMMENT=8
35RULE_STRING=6
36RULE_WS=9
37T__11=11
38T__12=12
39T__13=13
40T__14=14
41T__15=15
42T__16=16
43T__17=17
44T__18=18
45T__19=19
46T__20=20
47T__21=21
48T__22=22
49T__23=23
50T__24=24
51T__25=25
52T__26=26
53T__27=27
54T__28=28
55T__29=29
56T__30=30
57T__31=31
58T__32=32
59T__33=33
60T__34=34
61T__35=35
62T__36=36
63T__37=37
64T__38=38
65T__39=39
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java
new file mode 100644
index 00000000..a0b530c8
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java
@@ -0,0 +1,1699 @@
1package org.eclipse.viatra.solver.language.parser.antlr.internal;
2
3// Hack: Use our own Lexer superclass by means of import.
4// Currently there is no other way to specify the superclass for the lexer.
5import org.eclipse.xtext.parser.antlr.Lexer;
6
7
8import org.antlr.runtime.*;
9import java.util.Stack;
10import java.util.List;
11import java.util.ArrayList;
12
13@SuppressWarnings("all")
14public class InternalProblemLexer extends Lexer {
15 public static final int RULE_STRING=6;
16 public static final int RULE_SL_COMMENT=8;
17 public static final int T__19=19;
18 public static final int T__15=15;
19 public static final int T__37=37;
20 public static final int T__16=16;
21 public static final int T__38=38;
22 public static final int T__17=17;
23 public static final int T__39=39;
24 public static final int T__18=18;
25 public static final int T__11=11;
26 public static final int T__33=33;
27 public static final int T__12=12;
28 public static final int T__34=34;
29 public static final int T__13=13;
30 public static final int T__35=35;
31 public static final int T__14=14;
32 public static final int T__36=36;
33 public static final int EOF=-1;
34 public static final int T__30=30;
35 public static final int T__31=31;
36 public static final int T__32=32;
37 public static final int RULE_ID=4;
38 public static final int RULE_WS=9;
39 public static final int RULE_ANY_OTHER=10;
40 public static final int T__26=26;
41 public static final int T__27=27;
42 public static final int T__28=28;
43 public static final int RULE_INT=5;
44 public static final int T__29=29;
45 public static final int T__22=22;
46 public static final int RULE_ML_COMMENT=7;
47 public static final int T__23=23;
48 public static final int T__24=24;
49 public static final int T__25=25;
50 public static final int T__20=20;
51 public static final int T__21=21;
52
53 // delegates
54 // delegators
55
56 public InternalProblemLexer() {;}
57 public InternalProblemLexer(CharStream input) {
58 this(input, new RecognizerSharedState());
59 }
60 public InternalProblemLexer(CharStream input, RecognizerSharedState state) {
61 super(input,state);
62
63 }
64 public String getGrammarFileName() { return "InternalProblem.g"; }
65
66 // $ANTLR start "T__11"
67 public final void mT__11() throws RecognitionException {
68 try {
69 int _type = T__11;
70 int _channel = DEFAULT_TOKEN_CHANNEL;
71 // InternalProblem.g:11:7: ( 'abstract' )
72 // InternalProblem.g:11:9: 'abstract'
73 {
74 match("abstract");
75
76
77 }
78
79 state.type = _type;
80 state.channel = _channel;
81 }
82 finally {
83 }
84 }
85 // $ANTLR end "T__11"
86
87 // $ANTLR start "T__12"
88 public final void mT__12() throws RecognitionException {
89 try {
90 int _type = T__12;
91 int _channel = DEFAULT_TOKEN_CHANNEL;
92 // InternalProblem.g:12:7: ( 'class' )
93 // InternalProblem.g:12:9: 'class'
94 {
95 match("class");
96
97
98 }
99
100 state.type = _type;
101 state.channel = _channel;
102 }
103 finally {
104 }
105 }
106 // $ANTLR end "T__12"
107
108 // $ANTLR start "T__13"
109 public final void mT__13() throws RecognitionException {
110 try {
111 int _type = T__13;
112 int _channel = DEFAULT_TOKEN_CHANNEL;
113 // InternalProblem.g:13:7: ( 'extends' )
114 // InternalProblem.g:13:9: 'extends'
115 {
116 match("extends");
117
118
119 }
120
121 state.type = _type;
122 state.channel = _channel;
123 }
124 finally {
125 }
126 }
127 // $ANTLR end "T__13"
128
129 // $ANTLR start "T__14"
130 public final void mT__14() throws RecognitionException {
131 try {
132 int _type = T__14;
133 int _channel = DEFAULT_TOKEN_CHANNEL;
134 // InternalProblem.g:14:7: ( '[' )
135 // InternalProblem.g:14:9: '['
136 {
137 match('[');
138
139 }
140
141 state.type = _type;
142 state.channel = _channel;
143 }
144 finally {
145 }
146 }
147 // $ANTLR end "T__14"
148
149 // $ANTLR start "T__15"
150 public final void mT__15() throws RecognitionException {
151 try {
152 int _type = T__15;
153 int _channel = DEFAULT_TOKEN_CHANNEL;
154 // InternalProblem.g:15:7: ( ',' )
155 // InternalProblem.g:15:9: ','
156 {
157 match(',');
158
159 }
160
161 state.type = _type;
162 state.channel = _channel;
163 }
164 finally {
165 }
166 }
167 // $ANTLR end "T__15"
168
169 // $ANTLR start "T__16"
170 public final void mT__16() throws RecognitionException {
171 try {
172 int _type = T__16;
173 int _channel = DEFAULT_TOKEN_CHANNEL;
174 // InternalProblem.g:16:7: ( ']' )
175 // InternalProblem.g:16:9: ']'
176 {
177 match(']');
178
179 }
180
181 state.type = _type;
182 state.channel = _channel;
183 }
184 finally {
185 }
186 }
187 // $ANTLR end "T__16"
188
189 // $ANTLR start "T__17"
190 public final void mT__17() throws RecognitionException {
191 try {
192 int _type = T__17;
193 int _channel = DEFAULT_TOKEN_CHANNEL;
194 // InternalProblem.g:17:7: ( '.' )
195 // InternalProblem.g:17:9: '.'
196 {
197 match('.');
198
199 }
200
201 state.type = _type;
202 state.channel = _channel;
203 }
204 finally {
205 }
206 }
207 // $ANTLR end "T__17"
208
209 // $ANTLR start "T__18"
210 public final void mT__18() throws RecognitionException {
211 try {
212 int _type = T__18;
213 int _channel = DEFAULT_TOKEN_CHANNEL;
214 // InternalProblem.g:18:7: ( 'contains' )
215 // InternalProblem.g:18:9: 'contains'
216 {
217 match("contains");
218
219
220 }
221
222 state.type = _type;
223 state.channel = _channel;
224 }
225 finally {
226 }
227 }
228 // $ANTLR end "T__18"
229
230 // $ANTLR start "T__19"
231 public final void mT__19() throws RecognitionException {
232 try {
233 int _type = T__19;
234 int _channel = DEFAULT_TOKEN_CHANNEL;
235 // InternalProblem.g:19:7: ( 'refers' )
236 // InternalProblem.g:19:9: 'refers'
237 {
238 match("refers");
239
240
241 }
242
243 state.type = _type;
244 state.channel = _channel;
245 }
246 finally {
247 }
248 }
249 // $ANTLR end "T__19"
250
251 // $ANTLR start "T__20"
252 public final void mT__20() throws RecognitionException {
253 try {
254 int _type = T__20;
255 int _channel = DEFAULT_TOKEN_CHANNEL;
256 // InternalProblem.g:20:7: ( 'opposite' )
257 // InternalProblem.g:20:9: 'opposite'
258 {
259 match("opposite");
260
261
262 }
263
264 state.type = _type;
265 state.channel = _channel;
266 }
267 finally {
268 }
269 }
270 // $ANTLR end "T__20"
271
272 // $ANTLR start "T__21"
273 public final void mT__21() throws RecognitionException {
274 try {
275 int _type = T__21;
276 int _channel = DEFAULT_TOKEN_CHANNEL;
277 // InternalProblem.g:21:7: ( 'error' )
278 // InternalProblem.g:21:9: 'error'
279 {
280 match("error");
281
282
283 }
284
285 state.type = _type;
286 state.channel = _channel;
287 }
288 finally {
289 }
290 }
291 // $ANTLR end "T__21"
292
293 // $ANTLR start "T__22"
294 public final void mT__22() throws RecognitionException {
295 try {
296 int _type = T__22;
297 int _channel = DEFAULT_TOKEN_CHANNEL;
298 // InternalProblem.g:22:7: ( 'pred' )
299 // InternalProblem.g:22:9: 'pred'
300 {
301 match("pred");
302
303
304 }
305
306 state.type = _type;
307 state.channel = _channel;
308 }
309 finally {
310 }
311 }
312 // $ANTLR end "T__22"
313
314 // $ANTLR start "T__23"
315 public final void mT__23() throws RecognitionException {
316 try {
317 int _type = T__23;
318 int _channel = DEFAULT_TOKEN_CHANNEL;
319 // InternalProblem.g:23:7: ( '(' )
320 // InternalProblem.g:23:9: '('
321 {
322 match('(');
323
324 }
325
326 state.type = _type;
327 state.channel = _channel;
328 }
329 finally {
330 }
331 }
332 // $ANTLR end "T__23"
333
334 // $ANTLR start "T__24"
335 public final void mT__24() throws RecognitionException {
336 try {
337 int _type = T__24;
338 int _channel = DEFAULT_TOKEN_CHANNEL;
339 // InternalProblem.g:24:7: ( ')' )
340 // InternalProblem.g:24:9: ')'
341 {
342 match(')');
343
344 }
345
346 state.type = _type;
347 state.channel = _channel;
348 }
349 finally {
350 }
351 }
352 // $ANTLR end "T__24"
353
354 // $ANTLR start "T__25"
355 public final void mT__25() throws RecognitionException {
356 try {
357 int _type = T__25;
358 int _channel = DEFAULT_TOKEN_CHANNEL;
359 // InternalProblem.g:25:7: ( ':=' )
360 // InternalProblem.g:25:9: ':='
361 {
362 match(":=");
363
364
365 }
366
367 state.type = _type;
368 state.channel = _channel;
369 }
370 finally {
371 }
372 }
373 // $ANTLR end "T__25"
374
375 // $ANTLR start "T__26"
376 public final void mT__26() throws RecognitionException {
377 try {
378 int _type = T__26;
379 int _channel = DEFAULT_TOKEN_CHANNEL;
380 // InternalProblem.g:26:7: ( ';' )
381 // InternalProblem.g:26:9: ';'
382 {
383 match(';');
384
385 }
386
387 state.type = _type;
388 state.channel = _channel;
389 }
390 finally {
391 }
392 }
393 // $ANTLR end "T__26"
394
395 // $ANTLR start "T__27"
396 public final void mT__27() throws RecognitionException {
397 try {
398 int _type = T__27;
399 int _channel = DEFAULT_TOKEN_CHANNEL;
400 // InternalProblem.g:27:7: ( '!' )
401 // InternalProblem.g:27:9: '!'
402 {
403 match('!');
404
405 }
406
407 state.type = _type;
408 state.channel = _channel;
409 }
410 finally {
411 }
412 }
413 // $ANTLR end "T__27"
414
415 // $ANTLR start "T__28"
416 public final void mT__28() throws RecognitionException {
417 try {
418 int _type = T__28;
419 int _channel = DEFAULT_TOKEN_CHANNEL;
420 // InternalProblem.g:28:7: ( '+' )
421 // InternalProblem.g:28:9: '+'
422 {
423 match('+');
424
425 }
426
427 state.type = _type;
428 state.channel = _channel;
429 }
430 finally {
431 }
432 }
433 // $ANTLR end "T__28"
434
435 // $ANTLR start "T__29"
436 public final void mT__29() throws RecognitionException {
437 try {
438 int _type = T__29;
439 int _channel = DEFAULT_TOKEN_CHANNEL;
440 // InternalProblem.g:29:7: ( ':' )
441 // InternalProblem.g:29:9: ':'
442 {
443 match(':');
444
445 }
446
447 state.type = _type;
448 state.channel = _channel;
449 }
450 finally {
451 }
452 }
453 // $ANTLR end "T__29"
454
455 // $ANTLR start "T__30"
456 public final void mT__30() throws RecognitionException {
457 try {
458 int _type = T__30;
459 int _channel = DEFAULT_TOKEN_CHANNEL;
460 // InternalProblem.g:30:7: ( 'scope' )
461 // InternalProblem.g:30:9: 'scope'
462 {
463 match("scope");
464
465
466 }
467
468 state.type = _type;
469 state.channel = _channel;
470 }
471 finally {
472 }
473 }
474 // $ANTLR end "T__30"
475
476 // $ANTLR start "T__31"
477 public final void mT__31() throws RecognitionException {
478 try {
479 int _type = T__31;
480 int _channel = DEFAULT_TOKEN_CHANNEL;
481 // InternalProblem.g:31:7: ( '+=' )
482 // InternalProblem.g:31:9: '+='
483 {
484 match("+=");
485
486
487 }
488
489 state.type = _type;
490 state.channel = _channel;
491 }
492 finally {
493 }
494 }
495 // $ANTLR end "T__31"
496
497 // $ANTLR start "T__32"
498 public final void mT__32() throws RecognitionException {
499 try {
500 int _type = T__32;
501 int _channel = DEFAULT_TOKEN_CHANNEL;
502 // InternalProblem.g:32:7: ( '=' )
503 // InternalProblem.g:32:9: '='
504 {
505 match('=');
506
507 }
508
509 state.type = _type;
510 state.channel = _channel;
511 }
512 finally {
513 }
514 }
515 // $ANTLR end "T__32"
516
517 // $ANTLR start "T__33"
518 public final void mT__33() throws RecognitionException {
519 try {
520 int _type = T__33;
521 int _channel = DEFAULT_TOKEN_CHANNEL;
522 // InternalProblem.g:33:7: ( '..' )
523 // InternalProblem.g:33:9: '..'
524 {
525 match("..");
526
527
528 }
529
530 state.type = _type;
531 state.channel = _channel;
532 }
533 finally {
534 }
535 }
536 // $ANTLR end "T__33"
537
538 // $ANTLR start "T__34"
539 public final void mT__34() throws RecognitionException {
540 try {
541 int _type = T__34;
542 int _channel = DEFAULT_TOKEN_CHANNEL;
543 // InternalProblem.g:34:7: ( '*' )
544 // InternalProblem.g:34:9: '*'
545 {
546 match('*');
547
548 }
549
550 state.type = _type;
551 state.channel = _channel;
552 }
553 finally {
554 }
555 }
556 // $ANTLR end "T__34"
557
558 // $ANTLR start "T__35"
559 public final void mT__35() throws RecognitionException {
560 try {
561 int _type = T__35;
562 int _channel = DEFAULT_TOKEN_CHANNEL;
563 // InternalProblem.g:35:7: ( '::' )
564 // InternalProblem.g:35:9: '::'
565 {
566 match("::");
567
568
569 }
570
571 state.type = _type;
572 state.channel = _channel;
573 }
574 finally {
575 }
576 }
577 // $ANTLR end "T__35"
578
579 // $ANTLR start "T__36"
580 public final void mT__36() throws RecognitionException {
581 try {
582 int _type = T__36;
583 int _channel = DEFAULT_TOKEN_CHANNEL;
584 // InternalProblem.g:36:7: ( 'true' )
585 // InternalProblem.g:36:9: 'true'
586 {
587 match("true");
588
589
590 }
591
592 state.type = _type;
593 state.channel = _channel;
594 }
595 finally {
596 }
597 }
598 // $ANTLR end "T__36"
599
600 // $ANTLR start "T__37"
601 public final void mT__37() throws RecognitionException {
602 try {
603 int _type = T__37;
604 int _channel = DEFAULT_TOKEN_CHANNEL;
605 // InternalProblem.g:37:7: ( 'false' )
606 // InternalProblem.g:37:9: 'false'
607 {
608 match("false");
609
610
611 }
612
613 state.type = _type;
614 state.channel = _channel;
615 }
616 finally {
617 }
618 }
619 // $ANTLR end "T__37"
620
621 // $ANTLR start "T__38"
622 public final void mT__38() throws RecognitionException {
623 try {
624 int _type = T__38;
625 int _channel = DEFAULT_TOKEN_CHANNEL;
626 // InternalProblem.g:38:7: ( 'unknown' )
627 // InternalProblem.g:38:9: 'unknown'
628 {
629 match("unknown");
630
631
632 }
633
634 state.type = _type;
635 state.channel = _channel;
636 }
637 finally {
638 }
639 }
640 // $ANTLR end "T__38"
641
642 // $ANTLR start "T__39"
643 public final void mT__39() throws RecognitionException {
644 try {
645 int _type = T__39;
646 int _channel = DEFAULT_TOKEN_CHANNEL;
647 // InternalProblem.g:39:7: ( '?' )
648 // InternalProblem.g:39:9: '?'
649 {
650 match('?');
651
652 }
653
654 state.type = _type;
655 state.channel = _channel;
656 }
657 finally {
658 }
659 }
660 // $ANTLR end "T__39"
661
662 // $ANTLR start "RULE_ID"
663 public final void mRULE_ID() throws RecognitionException {
664 try {
665 int _type = RULE_ID;
666 int _channel = DEFAULT_TOKEN_CHANNEL;
667 // InternalProblem.g:1510:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
668 // InternalProblem.g:1510:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
669 {
670 // InternalProblem.g:1510:11: ( '^' )?
671 int alt1=2;
672 int LA1_0 = input.LA(1);
673
674 if ( (LA1_0=='^') ) {
675 alt1=1;
676 }
677 switch (alt1) {
678 case 1 :
679 // InternalProblem.g:1510:11: '^'
680 {
681 match('^');
682
683 }
684 break;
685
686 }
687
688 if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
689 input.consume();
690
691 }
692 else {
693 MismatchedSetException mse = new MismatchedSetException(null,input);
694 recover(mse);
695 throw mse;}
696
697 // InternalProblem.g:1510:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
698 loop2:
699 do {
700 int alt2=2;
701 int LA2_0 = input.LA(1);
702
703 if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
704 alt2=1;
705 }
706
707
708 switch (alt2) {
709 case 1 :
710 // InternalProblem.g:
711 {
712 if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
713 input.consume();
714
715 }
716 else {
717 MismatchedSetException mse = new MismatchedSetException(null,input);
718 recover(mse);
719 throw mse;}
720
721
722 }
723 break;
724
725 default :
726 break loop2;
727 }
728 } while (true);
729
730
731 }
732
733 state.type = _type;
734 state.channel = _channel;
735 }
736 finally {
737 }
738 }
739 // $ANTLR end "RULE_ID"
740
741 // $ANTLR start "RULE_INT"
742 public final void mRULE_INT() throws RecognitionException {
743 try {
744 int _type = RULE_INT;
745 int _channel = DEFAULT_TOKEN_CHANNEL;
746 // InternalProblem.g:1512:10: ( ( '0' .. '9' )+ )
747 // InternalProblem.g:1512:12: ( '0' .. '9' )+
748 {
749 // InternalProblem.g:1512:12: ( '0' .. '9' )+
750 int cnt3=0;
751 loop3:
752 do {
753 int alt3=2;
754 int LA3_0 = input.LA(1);
755
756 if ( ((LA3_0>='0' && LA3_0<='9')) ) {
757 alt3=1;
758 }
759
760
761 switch (alt3) {
762 case 1 :
763 // InternalProblem.g:1512:13: '0' .. '9'
764 {
765 matchRange('0','9');
766
767 }
768 break;
769
770 default :
771 if ( cnt3 >= 1 ) break loop3;
772 EarlyExitException eee =
773 new EarlyExitException(3, input);
774 throw eee;
775 }
776 cnt3++;
777 } while (true);
778
779
780 }
781
782 state.type = _type;
783 state.channel = _channel;
784 }
785 finally {
786 }
787 }
788 // $ANTLR end "RULE_INT"
789
790 // $ANTLR start "RULE_STRING"
791 public final void mRULE_STRING() throws RecognitionException {
792 try {
793 int _type = RULE_STRING;
794 int _channel = DEFAULT_TOKEN_CHANNEL;
795 // InternalProblem.g:1514:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
796 // InternalProblem.g:1514:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
797 {
798 // InternalProblem.g:1514:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
799 int alt6=2;
800 int LA6_0 = input.LA(1);
801
802 if ( (LA6_0=='\"') ) {
803 alt6=1;
804 }
805 else if ( (LA6_0=='\'') ) {
806 alt6=2;
807 }
808 else {
809 NoViableAltException nvae =
810 new NoViableAltException("", 6, 0, input);
811
812 throw nvae;
813 }
814 switch (alt6) {
815 case 1 :
816 // InternalProblem.g:1514:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
817 {
818 match('\"');
819 // InternalProblem.g:1514:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
820 loop4:
821 do {
822 int alt4=3;
823 int LA4_0 = input.LA(1);
824
825 if ( (LA4_0=='\\') ) {
826 alt4=1;
827 }
828 else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
829 alt4=2;
830 }
831
832
833 switch (alt4) {
834 case 1 :
835 // InternalProblem.g:1514:21: '\\\\' .
836 {
837 match('\\');
838 matchAny();
839
840 }
841 break;
842 case 2 :
843 // InternalProblem.g:1514:28: ~ ( ( '\\\\' | '\"' ) )
844 {
845 if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
846 input.consume();
847
848 }
849 else {
850 MismatchedSetException mse = new MismatchedSetException(null,input);
851 recover(mse);
852 throw mse;}
853
854
855 }
856 break;
857
858 default :
859 break loop4;
860 }
861 } while (true);
862
863 match('\"');
864
865 }
866 break;
867 case 2 :
868 // InternalProblem.g:1514:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
869 {
870 match('\'');
871 // InternalProblem.g:1514:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
872 loop5:
873 do {
874 int alt5=3;
875 int LA5_0 = input.LA(1);
876
877 if ( (LA5_0=='\\') ) {
878 alt5=1;
879 }
880 else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
881 alt5=2;
882 }
883
884
885 switch (alt5) {
886 case 1 :
887 // InternalProblem.g:1514:54: '\\\\' .
888 {
889 match('\\');
890 matchAny();
891
892 }
893 break;
894 case 2 :
895 // InternalProblem.g:1514:61: ~ ( ( '\\\\' | '\\'' ) )
896 {
897 if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
898 input.consume();
899
900 }
901 else {
902 MismatchedSetException mse = new MismatchedSetException(null,input);
903 recover(mse);
904 throw mse;}
905
906
907 }
908 break;
909
910 default :
911 break loop5;
912 }
913 } while (true);
914
915 match('\'');
916
917 }
918 break;
919
920 }
921
922
923 }
924
925 state.type = _type;
926 state.channel = _channel;
927 }
928 finally {
929 }
930 }
931 // $ANTLR end "RULE_STRING"
932
933 // $ANTLR start "RULE_ML_COMMENT"
934 public final void mRULE_ML_COMMENT() throws RecognitionException {
935 try {
936 int _type = RULE_ML_COMMENT;
937 int _channel = DEFAULT_TOKEN_CHANNEL;
938 // InternalProblem.g:1516:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
939 // InternalProblem.g:1516:19: '/*' ( options {greedy=false; } : . )* '*/'
940 {
941 match("/*");
942
943 // InternalProblem.g:1516:24: ( options {greedy=false; } : . )*
944 loop7:
945 do {
946 int alt7=2;
947 int LA7_0 = input.LA(1);
948
949 if ( (LA7_0=='*') ) {
950 int LA7_1 = input.LA(2);
951
952 if ( (LA7_1=='/') ) {
953 alt7=2;
954 }
955 else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
956 alt7=1;
957 }
958
959
960 }
961 else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
962 alt7=1;
963 }
964
965
966 switch (alt7) {
967 case 1 :
968 // InternalProblem.g:1516:52: .
969 {
970 matchAny();
971
972 }
973 break;
974
975 default :
976 break loop7;
977 }
978 } while (true);
979
980 match("*/");
981
982
983 }
984
985 state.type = _type;
986 state.channel = _channel;
987 }
988 finally {
989 }
990 }
991 // $ANTLR end "RULE_ML_COMMENT"
992
993 // $ANTLR start "RULE_SL_COMMENT"
994 public final void mRULE_SL_COMMENT() throws RecognitionException {
995 try {
996 int _type = RULE_SL_COMMENT;
997 int _channel = DEFAULT_TOKEN_CHANNEL;
998 // InternalProblem.g:1518:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
999 // InternalProblem.g:1518:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
1000 {
1001 match("//");
1002
1003 // InternalProblem.g:1518:24: (~ ( ( '\\n' | '\\r' ) ) )*
1004 loop8:
1005 do {
1006 int alt8=2;
1007 int LA8_0 = input.LA(1);
1008
1009 if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
1010 alt8=1;
1011 }
1012
1013
1014 switch (alt8) {
1015 case 1 :
1016 // InternalProblem.g:1518:24: ~ ( ( '\\n' | '\\r' ) )
1017 {
1018 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') ) {
1019 input.consume();
1020
1021 }
1022 else {
1023 MismatchedSetException mse = new MismatchedSetException(null,input);
1024 recover(mse);
1025 throw mse;}
1026
1027
1028 }
1029 break;
1030
1031 default :
1032 break loop8;
1033 }
1034 } while (true);
1035
1036 // InternalProblem.g:1518:40: ( ( '\\r' )? '\\n' )?
1037 int alt10=2;
1038 int LA10_0 = input.LA(1);
1039
1040 if ( (LA10_0=='\n'||LA10_0=='\r') ) {
1041 alt10=1;
1042 }
1043 switch (alt10) {
1044 case 1 :
1045 // InternalProblem.g:1518:41: ( '\\r' )? '\\n'
1046 {
1047 // InternalProblem.g:1518:41: ( '\\r' )?
1048 int alt9=2;
1049 int LA9_0 = input.LA(1);
1050
1051 if ( (LA9_0=='\r') ) {
1052 alt9=1;
1053 }
1054 switch (alt9) {
1055 case 1 :
1056 // InternalProblem.g:1518:41: '\\r'
1057 {
1058 match('\r');
1059
1060 }
1061 break;
1062
1063 }
1064
1065 match('\n');
1066
1067 }
1068 break;
1069
1070 }
1071
1072
1073 }
1074
1075 state.type = _type;
1076 state.channel = _channel;
1077 }
1078 finally {
1079 }
1080 }
1081 // $ANTLR end "RULE_SL_COMMENT"
1082
1083 // $ANTLR start "RULE_WS"
1084 public final void mRULE_WS() throws RecognitionException {
1085 try {
1086 int _type = RULE_WS;
1087 int _channel = DEFAULT_TOKEN_CHANNEL;
1088 // InternalProblem.g:1520:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
1089 // InternalProblem.g:1520:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
1090 {
1091 // InternalProblem.g:1520:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
1092 int cnt11=0;
1093 loop11:
1094 do {
1095 int alt11=2;
1096 int LA11_0 = input.LA(1);
1097
1098 if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
1099 alt11=1;
1100 }
1101
1102
1103 switch (alt11) {
1104 case 1 :
1105 // InternalProblem.g:
1106 {
1107 if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
1108 input.consume();
1109
1110 }
1111 else {
1112 MismatchedSetException mse = new MismatchedSetException(null,input);
1113 recover(mse);
1114 throw mse;}
1115
1116
1117 }
1118 break;
1119
1120 default :
1121 if ( cnt11 >= 1 ) break loop11;
1122 EarlyExitException eee =
1123 new EarlyExitException(11, input);
1124 throw eee;
1125 }
1126 cnt11++;
1127 } while (true);
1128
1129
1130 }
1131
1132 state.type = _type;
1133 state.channel = _channel;
1134 }
1135 finally {
1136 }
1137 }
1138 // $ANTLR end "RULE_WS"
1139
1140 // $ANTLR start "RULE_ANY_OTHER"
1141 public final void mRULE_ANY_OTHER() throws RecognitionException {
1142 try {
1143 int _type = RULE_ANY_OTHER;
1144 int _channel = DEFAULT_TOKEN_CHANNEL;
1145 // InternalProblem.g:1522:16: ( . )
1146 // InternalProblem.g:1522:18: .
1147 {
1148 matchAny();
1149
1150 }
1151
1152 state.type = _type;
1153 state.channel = _channel;
1154 }
1155 finally {
1156 }
1157 }
1158 // $ANTLR end "RULE_ANY_OTHER"
1159
1160 public void mTokens() throws RecognitionException {
1161 // InternalProblem.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
1162 int alt12=36;
1163 alt12 = dfa12.predict(input);
1164 switch (alt12) {
1165 case 1 :
1166 // InternalProblem.g:1:10: T__11
1167 {
1168 mT__11();
1169
1170 }
1171 break;
1172 case 2 :
1173 // InternalProblem.g:1:16: T__12
1174 {
1175 mT__12();
1176
1177 }
1178 break;
1179 case 3 :
1180 // InternalProblem.g:1:22: T__13
1181 {
1182 mT__13();
1183
1184 }
1185 break;
1186 case 4 :
1187 // InternalProblem.g:1:28: T__14
1188 {
1189 mT__14();
1190
1191 }
1192 break;
1193 case 5 :
1194 // InternalProblem.g:1:34: T__15
1195 {
1196 mT__15();
1197
1198 }
1199 break;
1200 case 6 :
1201 // InternalProblem.g:1:40: T__16
1202 {
1203 mT__16();
1204
1205 }
1206 break;
1207 case 7 :
1208 // InternalProblem.g:1:46: T__17
1209 {
1210 mT__17();
1211
1212 }
1213 break;
1214 case 8 :
1215 // InternalProblem.g:1:52: T__18
1216 {
1217 mT__18();
1218
1219 }
1220 break;
1221 case 9 :
1222 // InternalProblem.g:1:58: T__19
1223 {
1224 mT__19();
1225
1226 }
1227 break;
1228 case 10 :
1229 // InternalProblem.g:1:64: T__20
1230 {
1231 mT__20();
1232
1233 }
1234 break;
1235 case 11 :
1236 // InternalProblem.g:1:70: T__21
1237 {
1238 mT__21();
1239
1240 }
1241 break;
1242 case 12 :
1243 // InternalProblem.g:1:76: T__22
1244 {
1245 mT__22();
1246
1247 }
1248 break;
1249 case 13 :
1250 // InternalProblem.g:1:82: T__23
1251 {
1252 mT__23();
1253
1254 }
1255 break;
1256 case 14 :
1257 // InternalProblem.g:1:88: T__24
1258 {
1259 mT__24();
1260
1261 }
1262 break;
1263 case 15 :
1264 // InternalProblem.g:1:94: T__25
1265 {
1266 mT__25();
1267
1268 }
1269 break;
1270 case 16 :
1271 // InternalProblem.g:1:100: T__26
1272 {
1273 mT__26();
1274
1275 }
1276 break;
1277 case 17 :
1278 // InternalProblem.g:1:106: T__27
1279 {
1280 mT__27();
1281
1282 }
1283 break;
1284 case 18 :
1285 // InternalProblem.g:1:112: T__28
1286 {
1287 mT__28();
1288
1289 }
1290 break;
1291 case 19 :
1292 // InternalProblem.g:1:118: T__29
1293 {
1294 mT__29();
1295
1296 }
1297 break;
1298 case 20 :
1299 // InternalProblem.g:1:124: T__30
1300 {
1301 mT__30();
1302
1303 }
1304 break;
1305 case 21 :
1306 // InternalProblem.g:1:130: T__31
1307 {
1308 mT__31();
1309
1310 }
1311 break;
1312 case 22 :
1313 // InternalProblem.g:1:136: T__32
1314 {
1315 mT__32();
1316
1317 }
1318 break;
1319 case 23 :
1320 // InternalProblem.g:1:142: T__33
1321 {
1322 mT__33();
1323
1324 }
1325 break;
1326 case 24 :
1327 // InternalProblem.g:1:148: T__34
1328 {
1329 mT__34();
1330
1331 }
1332 break;
1333 case 25 :
1334 // InternalProblem.g:1:154: T__35
1335 {
1336 mT__35();
1337
1338 }
1339 break;
1340 case 26 :
1341 // InternalProblem.g:1:160: T__36
1342 {
1343 mT__36();
1344
1345 }
1346 break;
1347 case 27 :
1348 // InternalProblem.g:1:166: T__37
1349 {
1350 mT__37();
1351
1352 }
1353 break;
1354 case 28 :
1355 // InternalProblem.g:1:172: T__38
1356 {
1357 mT__38();
1358
1359 }
1360 break;
1361 case 29 :
1362 // InternalProblem.g:1:178: T__39
1363 {
1364 mT__39();
1365
1366 }
1367 break;
1368 case 30 :
1369 // InternalProblem.g:1:184: RULE_ID
1370 {
1371 mRULE_ID();
1372
1373 }
1374 break;
1375 case 31 :
1376 // InternalProblem.g:1:192: RULE_INT
1377 {
1378 mRULE_INT();
1379
1380 }
1381 break;
1382 case 32 :
1383 // InternalProblem.g:1:201: RULE_STRING
1384 {
1385 mRULE_STRING();
1386
1387 }
1388 break;
1389 case 33 :
1390 // InternalProblem.g:1:213: RULE_ML_COMMENT
1391 {
1392 mRULE_ML_COMMENT();
1393
1394 }
1395 break;
1396 case 34 :
1397 // InternalProblem.g:1:229: RULE_SL_COMMENT
1398 {
1399 mRULE_SL_COMMENT();
1400
1401 }
1402 break;
1403 case 35 :
1404 // InternalProblem.g:1:245: RULE_WS
1405 {
1406 mRULE_WS();
1407
1408 }
1409 break;
1410 case 36 :
1411 // InternalProblem.g:1:253: RULE_ANY_OTHER
1412 {
1413 mRULE_ANY_OTHER();
1414
1415 }
1416 break;
1417
1418 }
1419
1420 }
1421
1422
1423 protected DFA12 dfa12 = new DFA12(this);
1424 static final String DFA12_eotS =
1425 "\1\uffff\3\41\3\uffff\1\52\3\41\2\uffff\1\62\2\uffff\1\66\1\41\2\uffff\3\41\1\uffff\1\37\2\uffff\3\37\2\uffff\1\41\1\uffff\4\41\5\uffff\3\41\11\uffff\1\41\2\uffff\3\41\6\uffff\23\41\1\142\1\41\1\144\3\41\1\150\2\41\1\153\2\41\1\uffff\1\156\1\uffff\1\157\2\41\1\uffff\2\41\1\uffff\1\164\1\41\2\uffff\3\41\1\171\1\uffff\1\41\1\173\1\174\1\175\1\uffff\1\176\4\uffff";
1426 static final String DFA12_eofS =
1427 "\177\uffff";
1428 static final String DFA12_minS =
1429 "\1\0\1\142\1\154\1\162\3\uffff\1\56\1\145\1\160\1\162\2\uffff\1\72\2\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\163\1\uffff\1\141\1\156\1\164\1\162\5\uffff\1\146\1\160\1\145\11\uffff\1\157\2\uffff\1\165\1\154\1\153\6\uffff\1\164\1\163\1\164\1\145\1\157\1\145\1\157\1\144\1\160\1\145\1\163\1\156\1\162\1\163\1\141\1\156\2\162\1\163\1\60\1\145\1\60\1\145\1\157\1\141\1\60\1\151\1\144\1\60\1\163\1\151\1\uffff\1\60\1\uffff\1\60\1\167\1\143\1\uffff\1\156\1\163\1\uffff\1\60\1\164\2\uffff\1\156\1\164\1\163\1\60\1\uffff\1\145\3\60\1\uffff\1\60\4\uffff";
1430 static final String DFA12_maxS =
1431 "\1\uffff\1\142\1\157\1\170\3\uffff\1\56\1\145\1\160\1\162\2\uffff\1\75\2\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\163\1\uffff\1\141\1\156\1\164\1\162\5\uffff\1\146\1\160\1\145\11\uffff\1\157\2\uffff\1\165\1\154\1\153\6\uffff\1\164\1\163\1\164\1\145\1\157\1\145\1\157\1\144\1\160\1\145\1\163\1\156\1\162\1\163\1\141\1\156\2\162\1\163\1\172\1\145\1\172\1\145\1\157\1\141\1\172\1\151\1\144\1\172\1\163\1\151\1\uffff\1\172\1\uffff\1\172\1\167\1\143\1\uffff\1\156\1\163\1\uffff\1\172\1\164\2\uffff\1\156\1\164\1\163\1\172\1\uffff\1\145\3\172\1\uffff\1\172\4\uffff";
1432 static final String DFA12_acceptS =
1433 "\4\uffff\1\4\1\5\1\6\4\uffff\1\15\1\16\1\uffff\1\20\1\21\2\uffff\1\26\1\30\3\uffff\1\35\1\uffff\1\36\1\37\3\uffff\1\43\1\44\1\uffff\1\36\4\uffff\1\4\1\5\1\6\1\27\1\7\3\uffff\1\15\1\16\1\17\1\31\1\23\1\20\1\21\1\25\1\22\1\uffff\1\26\1\30\3\uffff\1\35\1\37\1\40\1\41\1\42\1\43\37\uffff\1\14\1\uffff\1\32\3\uffff\1\2\2\uffff\1\13\2\uffff\1\24\1\33\4\uffff\1\11\4\uffff\1\3\1\uffff\1\34\1\1\1\10\1\12";
1434 static final String DFA12_specialS =
1435 "\1\1\32\uffff\1\2\1\0\142\uffff}>";
1436 static final String[] DFA12_transitionS = {
1437 "\11\37\2\36\2\37\1\36\22\37\1\36\1\17\1\33\4\37\1\34\1\13\1\14\1\23\1\20\1\5\1\37\1\7\1\35\12\32\1\15\1\16\1\37\1\22\1\37\1\27\1\37\32\31\1\4\1\37\1\6\1\30\1\31\1\37\1\1\1\31\1\2\1\31\1\3\1\25\10\31\1\11\1\12\1\31\1\10\1\21\1\24\1\26\5\31\uff85\37",
1438 "\1\40",
1439 "\1\42\2\uffff\1\43",
1440 "\1\45\5\uffff\1\44",
1441 "",
1442 "",
1443 "",
1444 "\1\51",
1445 "\1\53",
1446 "\1\54",
1447 "\1\55",
1448 "",
1449 "",
1450 "\1\61\2\uffff\1\60",
1451 "",
1452 "",
1453 "\1\65",
1454 "\1\67",
1455 "",
1456 "",
1457 "\1\72",
1458 "\1\73",
1459 "\1\74",
1460 "",
1461 "\32\41\4\uffff\1\41\1\uffff\32\41",
1462 "",
1463 "",
1464 "\0\77",
1465 "\0\77",
1466 "\1\100\4\uffff\1\101",
1467 "",
1468 "",
1469 "\1\103",
1470 "",
1471 "\1\104",
1472 "\1\105",
1473 "\1\106",
1474 "\1\107",
1475 "",
1476 "",
1477 "",
1478 "",
1479 "",
1480 "\1\110",
1481 "\1\111",
1482 "\1\112",
1483 "",
1484 "",
1485 "",
1486 "",
1487 "",
1488 "",
1489 "",
1490 "",
1491 "",
1492 "\1\113",
1493 "",
1494 "",
1495 "\1\114",
1496 "\1\115",
1497 "\1\116",
1498 "",
1499 "",
1500 "",
1501 "",
1502 "",
1503 "",
1504 "\1\117",
1505 "\1\120",
1506 "\1\121",
1507 "\1\122",
1508 "\1\123",
1509 "\1\124",
1510 "\1\125",
1511 "\1\126",
1512 "\1\127",
1513 "\1\130",
1514 "\1\131",
1515 "\1\132",
1516 "\1\133",
1517 "\1\134",
1518 "\1\135",
1519 "\1\136",
1520 "\1\137",
1521 "\1\140",
1522 "\1\141",
1523 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1524 "\1\143",
1525 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1526 "\1\145",
1527 "\1\146",
1528 "\1\147",
1529 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1530 "\1\151",
1531 "\1\152",
1532 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1533 "\1\154",
1534 "\1\155",
1535 "",
1536 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1537 "",
1538 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1539 "\1\160",
1540 "\1\161",
1541 "",
1542 "\1\162",
1543 "\1\163",
1544 "",
1545 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1546 "\1\165",
1547 "",
1548 "",
1549 "\1\166",
1550 "\1\167",
1551 "\1\170",
1552 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1553 "",
1554 "\1\172",
1555 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1556 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1557 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1558 "",
1559 "\12\41\7\uffff\32\41\4\uffff\1\41\1\uffff\32\41",
1560 "",
1561 "",
1562 "",
1563 ""
1564 };
1565
1566 static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
1567 static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
1568 static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
1569 static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
1570 static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
1571 static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
1572 static final short[][] DFA12_transition;
1573
1574 static {
1575 int numStates = DFA12_transitionS.length;
1576 DFA12_transition = new short[numStates][];
1577 for (int i=0; i<numStates; i++) {
1578 DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
1579 }
1580 }
1581
1582 class DFA12 extends DFA {
1583
1584 public DFA12(BaseRecognizer recognizer) {
1585 this.recognizer = recognizer;
1586 this.decisionNumber = 12;
1587 this.eot = DFA12_eot;
1588 this.eof = DFA12_eof;
1589 this.min = DFA12_min;
1590 this.max = DFA12_max;
1591 this.accept = DFA12_accept;
1592 this.special = DFA12_special;
1593 this.transition = DFA12_transition;
1594 }
1595 public String getDescription() {
1596 return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
1597 }
1598 public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
1599 IntStream input = _input;
1600 int _s = s;
1601 switch ( s ) {
1602 case 0 :
1603 int LA12_28 = input.LA(1);
1604
1605 s = -1;
1606 if ( ((LA12_28>='\u0000' && LA12_28<='\uFFFF')) ) {s = 63;}
1607
1608 else s = 31;
1609
1610 if ( s>=0 ) return s;
1611 break;
1612 case 1 :
1613 int LA12_0 = input.LA(1);
1614
1615 s = -1;
1616 if ( (LA12_0=='a') ) {s = 1;}
1617
1618 else if ( (LA12_0=='c') ) {s = 2;}
1619
1620 else if ( (LA12_0=='e') ) {s = 3;}
1621
1622 else if ( (LA12_0=='[') ) {s = 4;}
1623
1624 else if ( (LA12_0==',') ) {s = 5;}
1625
1626 else if ( (LA12_0==']') ) {s = 6;}
1627
1628 else if ( (LA12_0=='.') ) {s = 7;}
1629
1630 else if ( (LA12_0=='r') ) {s = 8;}
1631
1632 else if ( (LA12_0=='o') ) {s = 9;}
1633
1634 else if ( (LA12_0=='p') ) {s = 10;}
1635
1636 else if ( (LA12_0=='(') ) {s = 11;}
1637
1638 else if ( (LA12_0==')') ) {s = 12;}
1639
1640 else if ( (LA12_0==':') ) {s = 13;}
1641
1642 else if ( (LA12_0==';') ) {s = 14;}
1643
1644 else if ( (LA12_0=='!') ) {s = 15;}
1645
1646 else if ( (LA12_0=='+') ) {s = 16;}
1647
1648 else if ( (LA12_0=='s') ) {s = 17;}
1649
1650 else if ( (LA12_0=='=') ) {s = 18;}
1651
1652 else if ( (LA12_0=='*') ) {s = 19;}
1653
1654 else if ( (LA12_0=='t') ) {s = 20;}
1655
1656 else if ( (LA12_0=='f') ) {s = 21;}
1657
1658 else if ( (LA12_0=='u') ) {s = 22;}
1659
1660 else if ( (LA12_0=='?') ) {s = 23;}
1661
1662 else if ( (LA12_0=='^') ) {s = 24;}
1663
1664 else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='b'||LA12_0=='d'||(LA12_0>='g' && LA12_0<='n')||LA12_0=='q'||(LA12_0>='v' && LA12_0<='z')) ) {s = 25;}
1665
1666 else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 26;}
1667
1668 else if ( (LA12_0=='\"') ) {s = 27;}
1669
1670 else if ( (LA12_0=='\'') ) {s = 28;}
1671
1672 else if ( (LA12_0=='/') ) {s = 29;}
1673
1674 else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 30;}
1675
1676 else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||(LA12_0>='#' && LA12_0<='&')||LA12_0=='-'||LA12_0=='<'||LA12_0=='>'||LA12_0=='@'||LA12_0=='\\'||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 31;}
1677
1678 if ( s>=0 ) return s;
1679 break;
1680 case 2 :
1681 int LA12_27 = input.LA(1);
1682
1683 s = -1;
1684 if ( ((LA12_27>='\u0000' && LA12_27<='\uFFFF')) ) {s = 63;}
1685
1686 else s = 31;
1687
1688 if ( s>=0 ) return s;
1689 break;
1690 }
1691 NoViableAltException nvae =
1692 new NoViableAltException(getDescription(), 12, _s, input);
1693 error(nvae);
1694 throw nvae;
1695 }
1696 }
1697
1698
1699} \ No newline at end of file
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java
new file mode 100644
index 00000000..9bfeb079
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java
@@ -0,0 +1,4056 @@
1package org.eclipse.viatra.solver.language.parser.antlr.internal;
2
3import org.eclipse.xtext.*;
4import org.eclipse.xtext.parser.*;
5import org.eclipse.xtext.parser.impl.*;
6import org.eclipse.emf.ecore.util.EcoreUtil;
7import org.eclipse.emf.ecore.EObject;
8import org.eclipse.emf.common.util.Enumerator;
9import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
10import org.eclipse.xtext.parser.antlr.XtextTokenStream;
11import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
12import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
13import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
14
15
16
17import org.antlr.runtime.*;
18import java.util.Stack;
19import java.util.List;
20import java.util.ArrayList;
21
22@SuppressWarnings("all")
23public class InternalProblemParser extends AbstractInternalAntlrParser {
24 public static final String[] tokenNames = new String[] {
25 "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'abstract'", "'class'", "'extends'", "'['", "','", "']'", "'.'", "'contains'", "'refers'", "'opposite'", "'error'", "'pred'", "'('", "')'", "':='", "';'", "'!'", "'+'", "':'", "'scope'", "'+='", "'='", "'..'", "'*'", "'::'", "'true'", "'false'", "'unknown'", "'?'"
26 };
27 public static final int RULE_STRING=6;
28 public static final int RULE_SL_COMMENT=8;
29 public static final int T__19=19;
30 public static final int T__15=15;
31 public static final int T__37=37;
32 public static final int T__16=16;
33 public static final int T__38=38;
34 public static final int T__17=17;
35 public static final int T__39=39;
36 public static final int T__18=18;
37 public static final int T__11=11;
38 public static final int T__33=33;
39 public static final int T__12=12;
40 public static final int T__34=34;
41 public static final int T__13=13;
42 public static final int T__35=35;
43 public static final int T__14=14;
44 public static final int T__36=36;
45 public static final int EOF=-1;
46 public static final int T__30=30;
47 public static final int T__31=31;
48 public static final int T__32=32;
49 public static final int RULE_ID=4;
50 public static final int RULE_WS=9;
51 public static final int RULE_ANY_OTHER=10;
52 public static final int T__26=26;
53 public static final int T__27=27;
54 public static final int T__28=28;
55 public static final int RULE_INT=5;
56 public static final int T__29=29;
57 public static final int T__22=22;
58 public static final int RULE_ML_COMMENT=7;
59 public static final int T__23=23;
60 public static final int T__24=24;
61 public static final int T__25=25;
62 public static final int T__20=20;
63 public static final int T__21=21;
64
65 // delegates
66 // delegators
67
68
69 public InternalProblemParser(TokenStream input) {
70 this(input, new RecognizerSharedState());
71 }
72 public InternalProblemParser(TokenStream input, RecognizerSharedState state) {
73 super(input, state);
74
75 }
76
77
78 public String[] getTokenNames() { return InternalProblemParser.tokenNames; }
79 public String getGrammarFileName() { return "InternalProblem.g"; }
80
81
82
83 private ProblemGrammarAccess grammarAccess;
84
85 public InternalProblemParser(TokenStream input, ProblemGrammarAccess grammarAccess) {
86 this(input);
87 this.grammarAccess = grammarAccess;
88 registerRules(grammarAccess.getGrammar());
89 }
90
91 @Override
92 protected String getFirstRuleName() {
93 return "Problem";
94 }
95
96 @Override
97 protected ProblemGrammarAccess getGrammarAccess() {
98 return grammarAccess;
99 }
100
101
102
103
104 // $ANTLR start "entryRuleProblem"
105 // InternalProblem.g:65:1: entryRuleProblem returns [EObject current=null] : iv_ruleProblem= ruleProblem EOF ;
106 public final EObject entryRuleProblem() throws RecognitionException {
107 EObject current = null;
108
109 EObject iv_ruleProblem = null;
110
111
112 try {
113 // InternalProblem.g:65:48: (iv_ruleProblem= ruleProblem EOF )
114 // InternalProblem.g:66:2: iv_ruleProblem= ruleProblem EOF
115 {
116 newCompositeNode(grammarAccess.getProblemRule());
117 pushFollow(FOLLOW_1);
118 iv_ruleProblem=ruleProblem();
119
120 state._fsp--;
121
122 current =iv_ruleProblem;
123 match(input,EOF,FOLLOW_2);
124
125 }
126
127 }
128
129 catch (RecognitionException re) {
130 recover(input,re);
131 appendSkippedTokens();
132 }
133 finally {
134 }
135 return current;
136 }
137 // $ANTLR end "entryRuleProblem"
138
139
140 // $ANTLR start "ruleProblem"
141 // InternalProblem.g:72:1: ruleProblem returns [EObject current=null] : ( (lv_statements_0_0= ruleStatement ) )* ;
142 public final EObject ruleProblem() throws RecognitionException {
143 EObject current = null;
144
145 EObject lv_statements_0_0 = null;
146
147
148
149 enterRule();
150
151 try {
152 // InternalProblem.g:78:2: ( ( (lv_statements_0_0= ruleStatement ) )* )
153 // InternalProblem.g:79:2: ( (lv_statements_0_0= ruleStatement ) )*
154 {
155 // InternalProblem.g:79:2: ( (lv_statements_0_0= ruleStatement ) )*
156 loop1:
157 do {
158 int alt1=2;
159 int LA1_0 = input.LA(1);
160
161 if ( (LA1_0==RULE_ID||(LA1_0>=11 && LA1_0<=12)||(LA1_0>=21 && LA1_0<=22)||LA1_0==27||LA1_0==30||LA1_0==39) ) {
162 alt1=1;
163 }
164
165
166 switch (alt1) {
167 case 1 :
168 // InternalProblem.g:80:3: (lv_statements_0_0= ruleStatement )
169 {
170 // InternalProblem.g:80:3: (lv_statements_0_0= ruleStatement )
171 // InternalProblem.g:81:4: lv_statements_0_0= ruleStatement
172 {
173
174 newCompositeNode(grammarAccess.getProblemAccess().getStatementsStatementParserRuleCall_0());
175
176 pushFollow(FOLLOW_3);
177 lv_statements_0_0=ruleStatement();
178
179 state._fsp--;
180
181
182 if (current==null) {
183 current = createModelElementForParent(grammarAccess.getProblemRule());
184 }
185 add(
186 current,
187 "statements",
188 lv_statements_0_0,
189 "org.eclipse.viatra.solver.language.Problem.Statement");
190 afterParserOrEnumRuleCall();
191
192
193 }
194
195
196 }
197 break;
198
199 default :
200 break loop1;
201 }
202 } while (true);
203
204
205 }
206
207
208 leaveRule();
209
210 }
211
212 catch (RecognitionException re) {
213 recover(input,re);
214 appendSkippedTokens();
215 }
216 finally {
217 }
218 return current;
219 }
220 // $ANTLR end "ruleProblem"
221
222
223 // $ANTLR start "entryRuleStatement"
224 // InternalProblem.g:101:1: entryRuleStatement returns [EObject current=null] : iv_ruleStatement= ruleStatement EOF ;
225 public final EObject entryRuleStatement() throws RecognitionException {
226 EObject current = null;
227
228 EObject iv_ruleStatement = null;
229
230
231 try {
232 // InternalProblem.g:101:50: (iv_ruleStatement= ruleStatement EOF )
233 // InternalProblem.g:102:2: iv_ruleStatement= ruleStatement EOF
234 {
235 newCompositeNode(grammarAccess.getStatementRule());
236 pushFollow(FOLLOW_1);
237 iv_ruleStatement=ruleStatement();
238
239 state._fsp--;
240
241 current =iv_ruleStatement;
242 match(input,EOF,FOLLOW_2);
243
244 }
245
246 }
247
248 catch (RecognitionException re) {
249 recover(input,re);
250 appendSkippedTokens();
251 }
252 finally {
253 }
254 return current;
255 }
256 // $ANTLR end "entryRuleStatement"
257
258
259 // $ANTLR start "ruleStatement"
260 // InternalProblem.g:108:1: ruleStatement returns [EObject current=null] : (this_ClassDeclaration_0= ruleClassDeclaration | this_PredicateDefinition_1= rulePredicateDefinition | this_Assertion_2= ruleAssertion | this_ScopeDeclaration_3= ruleScopeDeclaration ) ;
261 public final EObject ruleStatement() throws RecognitionException {
262 EObject current = null;
263
264 EObject this_ClassDeclaration_0 = null;
265
266 EObject this_PredicateDefinition_1 = null;
267
268 EObject this_Assertion_2 = null;
269
270 EObject this_ScopeDeclaration_3 = null;
271
272
273
274 enterRule();
275
276 try {
277 // InternalProblem.g:114:2: ( (this_ClassDeclaration_0= ruleClassDeclaration | this_PredicateDefinition_1= rulePredicateDefinition | this_Assertion_2= ruleAssertion | this_ScopeDeclaration_3= ruleScopeDeclaration ) )
278 // InternalProblem.g:115:2: (this_ClassDeclaration_0= ruleClassDeclaration | this_PredicateDefinition_1= rulePredicateDefinition | this_Assertion_2= ruleAssertion | this_ScopeDeclaration_3= ruleScopeDeclaration )
279 {
280 // InternalProblem.g:115:2: (this_ClassDeclaration_0= ruleClassDeclaration | this_PredicateDefinition_1= rulePredicateDefinition | this_Assertion_2= ruleAssertion | this_ScopeDeclaration_3= ruleScopeDeclaration )
281 int alt2=4;
282 switch ( input.LA(1) ) {
283 case 11:
284 case 12:
285 {
286 alt2=1;
287 }
288 break;
289 case 21:
290 case 22:
291 {
292 alt2=2;
293 }
294 break;
295 case RULE_ID:
296 case 27:
297 case 39:
298 {
299 alt2=3;
300 }
301 break;
302 case 30:
303 {
304 alt2=4;
305 }
306 break;
307 default:
308 NoViableAltException nvae =
309 new NoViableAltException("", 2, 0, input);
310
311 throw nvae;
312 }
313
314 switch (alt2) {
315 case 1 :
316 // InternalProblem.g:116:3: this_ClassDeclaration_0= ruleClassDeclaration
317 {
318
319 newCompositeNode(grammarAccess.getStatementAccess().getClassDeclarationParserRuleCall_0());
320
321 pushFollow(FOLLOW_2);
322 this_ClassDeclaration_0=ruleClassDeclaration();
323
324 state._fsp--;
325
326
327 current = this_ClassDeclaration_0;
328 afterParserOrEnumRuleCall();
329
330
331 }
332 break;
333 case 2 :
334 // InternalProblem.g:125:3: this_PredicateDefinition_1= rulePredicateDefinition
335 {
336
337 newCompositeNode(grammarAccess.getStatementAccess().getPredicateDefinitionParserRuleCall_1());
338
339 pushFollow(FOLLOW_2);
340 this_PredicateDefinition_1=rulePredicateDefinition();
341
342 state._fsp--;
343
344
345 current = this_PredicateDefinition_1;
346 afterParserOrEnumRuleCall();
347
348
349 }
350 break;
351 case 3 :
352 // InternalProblem.g:134:3: this_Assertion_2= ruleAssertion
353 {
354
355 newCompositeNode(grammarAccess.getStatementAccess().getAssertionParserRuleCall_2());
356
357 pushFollow(FOLLOW_2);
358 this_Assertion_2=ruleAssertion();
359
360 state._fsp--;
361
362
363 current = this_Assertion_2;
364 afterParserOrEnumRuleCall();
365
366
367 }
368 break;
369 case 4 :
370 // InternalProblem.g:143:3: this_ScopeDeclaration_3= ruleScopeDeclaration
371 {
372
373 newCompositeNode(grammarAccess.getStatementAccess().getScopeDeclarationParserRuleCall_3());
374
375 pushFollow(FOLLOW_2);
376 this_ScopeDeclaration_3=ruleScopeDeclaration();
377
378 state._fsp--;
379
380
381 current = this_ScopeDeclaration_3;
382 afterParserOrEnumRuleCall();
383
384
385 }
386 break;
387
388 }
389
390
391 }
392
393
394 leaveRule();
395
396 }
397
398 catch (RecognitionException re) {
399 recover(input,re);
400 appendSkippedTokens();
401 }
402 finally {
403 }
404 return current;
405 }
406 // $ANTLR end "ruleStatement"
407
408
409 // $ANTLR start "entryRuleClassDeclaration"
410 // InternalProblem.g:155:1: entryRuleClassDeclaration returns [EObject current=null] : iv_ruleClassDeclaration= ruleClassDeclaration EOF ;
411 public final EObject entryRuleClassDeclaration() throws RecognitionException {
412 EObject current = null;
413
414 EObject iv_ruleClassDeclaration = null;
415
416
417 try {
418 // InternalProblem.g:155:57: (iv_ruleClassDeclaration= ruleClassDeclaration EOF )
419 // InternalProblem.g:156:2: iv_ruleClassDeclaration= ruleClassDeclaration EOF
420 {
421 newCompositeNode(grammarAccess.getClassDeclarationRule());
422 pushFollow(FOLLOW_1);
423 iv_ruleClassDeclaration=ruleClassDeclaration();
424
425 state._fsp--;
426
427 current =iv_ruleClassDeclaration;
428 match(input,EOF,FOLLOW_2);
429
430 }
431
432 }
433
434 catch (RecognitionException re) {
435 recover(input,re);
436 appendSkippedTokens();
437 }
438 finally {
439 }
440 return current;
441 }
442 // $ANTLR end "entryRuleClassDeclaration"
443
444
445 // $ANTLR start "ruleClassDeclaration"
446 // InternalProblem.g:162:1: ruleClassDeclaration returns [EObject current=null] : ( ( (lv_abstract_0_0= 'abstract' ) )? otherlv_1= 'class' ( (lv_name_2_0= RULE_ID ) ) ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )? (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )* otherlv_13= '.' ) ;
447 public final EObject ruleClassDeclaration() throws RecognitionException {
448 EObject current = null;
449
450 Token lv_abstract_0_0=null;
451 Token otherlv_1=null;
452 Token lv_name_2_0=null;
453 Token otherlv_3=null;
454 Token otherlv_4=null;
455 Token otherlv_5=null;
456 Token otherlv_6=null;
457 Token otherlv_7=null;
458 Token otherlv_8=null;
459 Token otherlv_9=null;
460 Token otherlv_11=null;
461 Token otherlv_13=null;
462 EObject lv_referenceDeclarations_10_0 = null;
463
464 EObject lv_referenceDeclarations_12_0 = null;
465
466
467
468 enterRule();
469
470 try {
471 // InternalProblem.g:168:2: ( ( ( (lv_abstract_0_0= 'abstract' ) )? otherlv_1= 'class' ( (lv_name_2_0= RULE_ID ) ) ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )? (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )* otherlv_13= '.' ) )
472 // InternalProblem.g:169:2: ( ( (lv_abstract_0_0= 'abstract' ) )? otherlv_1= 'class' ( (lv_name_2_0= RULE_ID ) ) ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )? (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )* otherlv_13= '.' )
473 {
474 // InternalProblem.g:169:2: ( ( (lv_abstract_0_0= 'abstract' ) )? otherlv_1= 'class' ( (lv_name_2_0= RULE_ID ) ) ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )? (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )* otherlv_13= '.' )
475 // InternalProblem.g:170:3: ( (lv_abstract_0_0= 'abstract' ) )? otherlv_1= 'class' ( (lv_name_2_0= RULE_ID ) ) ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )? (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )* otherlv_13= '.'
476 {
477 // InternalProblem.g:170:3: ( (lv_abstract_0_0= 'abstract' ) )?
478 int alt3=2;
479 int LA3_0 = input.LA(1);
480
481 if ( (LA3_0==11) ) {
482 alt3=1;
483 }
484 switch (alt3) {
485 case 1 :
486 // InternalProblem.g:171:4: (lv_abstract_0_0= 'abstract' )
487 {
488 // InternalProblem.g:171:4: (lv_abstract_0_0= 'abstract' )
489 // InternalProblem.g:172:5: lv_abstract_0_0= 'abstract'
490 {
491 lv_abstract_0_0=(Token)match(input,11,FOLLOW_4);
492
493 newLeafNode(lv_abstract_0_0, grammarAccess.getClassDeclarationAccess().getAbstractAbstractKeyword_0_0());
494
495
496 if (current==null) {
497 current = createModelElement(grammarAccess.getClassDeclarationRule());
498 }
499 setWithLastConsumed(current, "abstract", lv_abstract_0_0 != null, "abstract");
500
501
502 }
503
504
505 }
506 break;
507
508 }
509
510 otherlv_1=(Token)match(input,12,FOLLOW_5);
511
512 newLeafNode(otherlv_1, grammarAccess.getClassDeclarationAccess().getClassKeyword_1());
513
514 // InternalProblem.g:188:3: ( (lv_name_2_0= RULE_ID ) )
515 // InternalProblem.g:189:4: (lv_name_2_0= RULE_ID )
516 {
517 // InternalProblem.g:189:4: (lv_name_2_0= RULE_ID )
518 // InternalProblem.g:190:5: lv_name_2_0= RULE_ID
519 {
520 lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_6);
521
522 newLeafNode(lv_name_2_0, grammarAccess.getClassDeclarationAccess().getNameIDTerminalRuleCall_2_0());
523
524
525 if (current==null) {
526 current = createModelElement(grammarAccess.getClassDeclarationRule());
527 }
528 setWithLastConsumed(
529 current,
530 "name",
531 lv_name_2_0,
532 "org.eclipse.xtext.common.Terminals.ID");
533
534
535 }
536
537
538 }
539
540 // InternalProblem.g:206:3: ( (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) ) | ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) ) )?
541 int alt7=3;
542 int LA7_0 = input.LA(1);
543
544 if ( (LA7_0==13) ) {
545 alt7=1;
546 }
547 else if ( ((LA7_0>=18 && LA7_0<=19)) ) {
548 alt7=2;
549 }
550 switch (alt7) {
551 case 1 :
552 // InternalProblem.g:207:4: (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) )
553 {
554 // InternalProblem.g:207:4: (otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) ) )
555 // InternalProblem.g:208:5: otherlv_3= 'extends' ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) )
556 {
557 otherlv_3=(Token)match(input,13,FOLLOW_7);
558
559 newLeafNode(otherlv_3, grammarAccess.getClassDeclarationAccess().getExtendsKeyword_3_0_0());
560
561 // InternalProblem.g:212:5: ( ( (otherlv_4= RULE_ID ) ) | (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' ) )
562 int alt6=2;
563 int LA6_0 = input.LA(1);
564
565 if ( (LA6_0==RULE_ID) ) {
566 alt6=1;
567 }
568 else if ( (LA6_0==14) ) {
569 alt6=2;
570 }
571 else {
572 NoViableAltException nvae =
573 new NoViableAltException("", 6, 0, input);
574
575 throw nvae;
576 }
577 switch (alt6) {
578 case 1 :
579 // InternalProblem.g:213:6: ( (otherlv_4= RULE_ID ) )
580 {
581 // InternalProblem.g:213:6: ( (otherlv_4= RULE_ID ) )
582 // InternalProblem.g:214:7: (otherlv_4= RULE_ID )
583 {
584 // InternalProblem.g:214:7: (otherlv_4= RULE_ID )
585 // InternalProblem.g:215:8: otherlv_4= RULE_ID
586 {
587
588 if (current==null) {
589 current = createModelElement(grammarAccess.getClassDeclarationRule());
590 }
591
592 otherlv_4=(Token)match(input,RULE_ID,FOLLOW_8);
593
594 newLeafNode(otherlv_4, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_0_0());
595
596
597 }
598
599
600 }
601
602
603 }
604 break;
605 case 2 :
606 // InternalProblem.g:227:6: (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' )
607 {
608 // InternalProblem.g:227:6: (otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']' )
609 // InternalProblem.g:228:7: otherlv_5= '[' ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )? otherlv_9= ']'
610 {
611 otherlv_5=(Token)match(input,14,FOLLOW_9);
612
613 newLeafNode(otherlv_5, grammarAccess.getClassDeclarationAccess().getLeftSquareBracketKeyword_3_0_1_1_0());
614
615 // InternalProblem.g:232:7: ( ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )* )?
616 int alt5=2;
617 int LA5_0 = input.LA(1);
618
619 if ( (LA5_0==RULE_ID) ) {
620 alt5=1;
621 }
622 switch (alt5) {
623 case 1 :
624 // InternalProblem.g:233:8: ( (otherlv_6= RULE_ID ) ) (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )*
625 {
626 // InternalProblem.g:233:8: ( (otherlv_6= RULE_ID ) )
627 // InternalProblem.g:234:9: (otherlv_6= RULE_ID )
628 {
629 // InternalProblem.g:234:9: (otherlv_6= RULE_ID )
630 // InternalProblem.g:235:10: otherlv_6= RULE_ID
631 {
632
633 if (current==null) {
634 current = createModelElement(grammarAccess.getClassDeclarationRule());
635 }
636
637 otherlv_6=(Token)match(input,RULE_ID,FOLLOW_10);
638
639 newLeafNode(otherlv_6, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0());
640
641
642 }
643
644
645 }
646
647 // InternalProblem.g:246:8: (otherlv_7= ',' ( (otherlv_8= RULE_ID ) ) )*
648 loop4:
649 do {
650 int alt4=2;
651 int LA4_0 = input.LA(1);
652
653 if ( (LA4_0==15) ) {
654 alt4=1;
655 }
656
657
658 switch (alt4) {
659 case 1 :
660 // InternalProblem.g:247:9: otherlv_7= ',' ( (otherlv_8= RULE_ID ) )
661 {
662 otherlv_7=(Token)match(input,15,FOLLOW_5);
663
664 newLeafNode(otherlv_7, grammarAccess.getClassDeclarationAccess().getCommaKeyword_3_0_1_1_1_1_0());
665
666 // InternalProblem.g:251:9: ( (otherlv_8= RULE_ID ) )
667 // InternalProblem.g:252:10: (otherlv_8= RULE_ID )
668 {
669 // InternalProblem.g:252:10: (otherlv_8= RULE_ID )
670 // InternalProblem.g:253:11: otherlv_8= RULE_ID
671 {
672
673 if (current==null) {
674 current = createModelElement(grammarAccess.getClassDeclarationRule());
675 }
676
677 otherlv_8=(Token)match(input,RULE_ID,FOLLOW_10);
678
679 newLeafNode(otherlv_8, grammarAccess.getClassDeclarationAccess().getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0());
680
681
682 }
683
684
685 }
686
687
688 }
689 break;
690
691 default :
692 break loop4;
693 }
694 } while (true);
695
696
697 }
698 break;
699
700 }
701
702 otherlv_9=(Token)match(input,16,FOLLOW_8);
703
704 newLeafNode(otherlv_9, grammarAccess.getClassDeclarationAccess().getRightSquareBracketKeyword_3_0_1_1_2());
705
706
707 }
708
709
710 }
711 break;
712
713 }
714
715
716 }
717
718
719 }
720 break;
721 case 2 :
722 // InternalProblem.g:274:4: ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) )
723 {
724 // InternalProblem.g:274:4: ( (lv_referenceDeclarations_10_0= ruleReferenceDeclaration ) )
725 // InternalProblem.g:275:5: (lv_referenceDeclarations_10_0= ruleReferenceDeclaration )
726 {
727 // InternalProblem.g:275:5: (lv_referenceDeclarations_10_0= ruleReferenceDeclaration )
728 // InternalProblem.g:276:6: lv_referenceDeclarations_10_0= ruleReferenceDeclaration
729 {
730
731 newCompositeNode(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsReferenceDeclarationParserRuleCall_3_1_0());
732
733 pushFollow(FOLLOW_8);
734 lv_referenceDeclarations_10_0=ruleReferenceDeclaration();
735
736 state._fsp--;
737
738
739 if (current==null) {
740 current = createModelElementForParent(grammarAccess.getClassDeclarationRule());
741 }
742 add(
743 current,
744 "referenceDeclarations",
745 lv_referenceDeclarations_10_0,
746 "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration");
747 afterParserOrEnumRuleCall();
748
749
750 }
751
752
753 }
754
755
756 }
757 break;
758
759 }
760
761 // InternalProblem.g:294:3: (otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) ) )*
762 loop8:
763 do {
764 int alt8=2;
765 int LA8_0 = input.LA(1);
766
767 if ( (LA8_0==15) ) {
768 alt8=1;
769 }
770
771
772 switch (alt8) {
773 case 1 :
774 // InternalProblem.g:295:4: otherlv_11= ',' ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) )
775 {
776 otherlv_11=(Token)match(input,15,FOLLOW_11);
777
778 newLeafNode(otherlv_11, grammarAccess.getClassDeclarationAccess().getCommaKeyword_4_0());
779
780 // InternalProblem.g:299:4: ( (lv_referenceDeclarations_12_0= ruleReferenceDeclaration ) )
781 // InternalProblem.g:300:5: (lv_referenceDeclarations_12_0= ruleReferenceDeclaration )
782 {
783 // InternalProblem.g:300:5: (lv_referenceDeclarations_12_0= ruleReferenceDeclaration )
784 // InternalProblem.g:301:6: lv_referenceDeclarations_12_0= ruleReferenceDeclaration
785 {
786
787 newCompositeNode(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsReferenceDeclarationParserRuleCall_4_1_0());
788
789 pushFollow(FOLLOW_8);
790 lv_referenceDeclarations_12_0=ruleReferenceDeclaration();
791
792 state._fsp--;
793
794
795 if (current==null) {
796 current = createModelElementForParent(grammarAccess.getClassDeclarationRule());
797 }
798 add(
799 current,
800 "referenceDeclarations",
801 lv_referenceDeclarations_12_0,
802 "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration");
803 afterParserOrEnumRuleCall();
804
805
806 }
807
808
809 }
810
811
812 }
813 break;
814
815 default :
816 break loop8;
817 }
818 } while (true);
819
820 otherlv_13=(Token)match(input,17,FOLLOW_2);
821
822 newLeafNode(otherlv_13, grammarAccess.getClassDeclarationAccess().getFullStopKeyword_5());
823
824
825 }
826
827
828 }
829
830
831 leaveRule();
832
833 }
834
835 catch (RecognitionException re) {
836 recover(input,re);
837 appendSkippedTokens();
838 }
839 finally {
840 }
841 return current;
842 }
843 // $ANTLR end "ruleClassDeclaration"
844
845
846 // $ANTLR start "entryRuleReferenceDeclaration"
847 // InternalProblem.g:327:1: entryRuleReferenceDeclaration returns [EObject current=null] : iv_ruleReferenceDeclaration= ruleReferenceDeclaration EOF ;
848 public final EObject entryRuleReferenceDeclaration() throws RecognitionException {
849 EObject current = null;
850
851 EObject iv_ruleReferenceDeclaration = null;
852
853
854 try {
855 // InternalProblem.g:327:61: (iv_ruleReferenceDeclaration= ruleReferenceDeclaration EOF )
856 // InternalProblem.g:328:2: iv_ruleReferenceDeclaration= ruleReferenceDeclaration EOF
857 {
858 newCompositeNode(grammarAccess.getReferenceDeclarationRule());
859 pushFollow(FOLLOW_1);
860 iv_ruleReferenceDeclaration=ruleReferenceDeclaration();
861
862 state._fsp--;
863
864 current =iv_ruleReferenceDeclaration;
865 match(input,EOF,FOLLOW_2);
866
867 }
868
869 }
870
871 catch (RecognitionException re) {
872 recover(input,re);
873 appendSkippedTokens();
874 }
875 finally {
876 }
877 return current;
878 }
879 // $ANTLR end "entryRuleReferenceDeclaration"
880
881
882 // $ANTLR start "ruleReferenceDeclaration"
883 // InternalProblem.g:334:1: ruleReferenceDeclaration returns [EObject current=null] : ( ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' ) ( (otherlv_2= RULE_ID ) ) otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' ( (lv_name_6_0= RULE_ID ) ) (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )? ) ;
884 public final EObject ruleReferenceDeclaration() throws RecognitionException {
885 EObject current = null;
886
887 Token lv_containment_0_0=null;
888 Token otherlv_1=null;
889 Token otherlv_2=null;
890 Token otherlv_3=null;
891 Token otherlv_5=null;
892 Token lv_name_6_0=null;
893 Token otherlv_7=null;
894 EObject lv_multiplicity_4_0 = null;
895
896
897
898 enterRule();
899
900 try {
901 // InternalProblem.g:340:2: ( ( ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' ) ( (otherlv_2= RULE_ID ) ) otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' ( (lv_name_6_0= RULE_ID ) ) (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )? ) )
902 // InternalProblem.g:341:2: ( ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' ) ( (otherlv_2= RULE_ID ) ) otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' ( (lv_name_6_0= RULE_ID ) ) (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )? )
903 {
904 // InternalProblem.g:341:2: ( ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' ) ( (otherlv_2= RULE_ID ) ) otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' ( (lv_name_6_0= RULE_ID ) ) (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )? )
905 // InternalProblem.g:342:3: ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' ) ( (otherlv_2= RULE_ID ) ) otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' ( (lv_name_6_0= RULE_ID ) ) (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )?
906 {
907 // InternalProblem.g:342:3: ( ( (lv_containment_0_0= 'contains' ) ) | otherlv_1= 'refers' )
908 int alt9=2;
909 int LA9_0 = input.LA(1);
910
911 if ( (LA9_0==18) ) {
912 alt9=1;
913 }
914 else if ( (LA9_0==19) ) {
915 alt9=2;
916 }
917 else {
918 NoViableAltException nvae =
919 new NoViableAltException("", 9, 0, input);
920
921 throw nvae;
922 }
923 switch (alt9) {
924 case 1 :
925 // InternalProblem.g:343:4: ( (lv_containment_0_0= 'contains' ) )
926 {
927 // InternalProblem.g:343:4: ( (lv_containment_0_0= 'contains' ) )
928 // InternalProblem.g:344:5: (lv_containment_0_0= 'contains' )
929 {
930 // InternalProblem.g:344:5: (lv_containment_0_0= 'contains' )
931 // InternalProblem.g:345:6: lv_containment_0_0= 'contains'
932 {
933 lv_containment_0_0=(Token)match(input,18,FOLLOW_5);
934
935 newLeafNode(lv_containment_0_0, grammarAccess.getReferenceDeclarationAccess().getContainmentContainsKeyword_0_0_0());
936
937
938 if (current==null) {
939 current = createModelElement(grammarAccess.getReferenceDeclarationRule());
940 }
941 setWithLastConsumed(current, "containment", lv_containment_0_0 != null, "contains");
942
943
944 }
945
946
947 }
948
949
950 }
951 break;
952 case 2 :
953 // InternalProblem.g:358:4: otherlv_1= 'refers'
954 {
955 otherlv_1=(Token)match(input,19,FOLLOW_5);
956
957 newLeafNode(otherlv_1, grammarAccess.getReferenceDeclarationAccess().getRefersKeyword_0_1());
958
959
960 }
961 break;
962
963 }
964
965 // InternalProblem.g:363:3: ( (otherlv_2= RULE_ID ) )
966 // InternalProblem.g:364:4: (otherlv_2= RULE_ID )
967 {
968 // InternalProblem.g:364:4: (otherlv_2= RULE_ID )
969 // InternalProblem.g:365:5: otherlv_2= RULE_ID
970 {
971
972 if (current==null) {
973 current = createModelElement(grammarAccess.getReferenceDeclarationRule());
974 }
975
976 otherlv_2=(Token)match(input,RULE_ID,FOLLOW_12);
977
978 newLeafNode(otherlv_2, grammarAccess.getReferenceDeclarationAccess().getReferenceTypeClassDeclarationCrossReference_1_0());
979
980
981 }
982
983
984 }
985
986 otherlv_3=(Token)match(input,14,FOLLOW_13);
987
988 newLeafNode(otherlv_3, grammarAccess.getReferenceDeclarationAccess().getLeftSquareBracketKeyword_2());
989
990 // InternalProblem.g:380:3: ( (lv_multiplicity_4_0= ruleMultiplicity ) )
991 // InternalProblem.g:381:4: (lv_multiplicity_4_0= ruleMultiplicity )
992 {
993 // InternalProblem.g:381:4: (lv_multiplicity_4_0= ruleMultiplicity )
994 // InternalProblem.g:382:5: lv_multiplicity_4_0= ruleMultiplicity
995 {
996
997 newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getMultiplicityMultiplicityParserRuleCall_3_0());
998
999 pushFollow(FOLLOW_14);
1000 lv_multiplicity_4_0=ruleMultiplicity();
1001
1002 state._fsp--;
1003
1004
1005 if (current==null) {
1006 current = createModelElementForParent(grammarAccess.getReferenceDeclarationRule());
1007 }
1008 set(
1009 current,
1010 "multiplicity",
1011 lv_multiplicity_4_0,
1012 "org.eclipse.viatra.solver.language.Problem.Multiplicity");
1013 afterParserOrEnumRuleCall();
1014
1015
1016 }
1017
1018
1019 }
1020
1021 otherlv_5=(Token)match(input,16,FOLLOW_5);
1022
1023 newLeafNode(otherlv_5, grammarAccess.getReferenceDeclarationAccess().getRightSquareBracketKeyword_4());
1024
1025 // InternalProblem.g:403:3: ( (lv_name_6_0= RULE_ID ) )
1026 // InternalProblem.g:404:4: (lv_name_6_0= RULE_ID )
1027 {
1028 // InternalProblem.g:404:4: (lv_name_6_0= RULE_ID )
1029 // InternalProblem.g:405:5: lv_name_6_0= RULE_ID
1030 {
1031 lv_name_6_0=(Token)match(input,RULE_ID,FOLLOW_15);
1032
1033 newLeafNode(lv_name_6_0, grammarAccess.getReferenceDeclarationAccess().getNameIDTerminalRuleCall_5_0());
1034
1035
1036 if (current==null) {
1037 current = createModelElement(grammarAccess.getReferenceDeclarationRule());
1038 }
1039 setWithLastConsumed(
1040 current,
1041 "name",
1042 lv_name_6_0,
1043 "org.eclipse.xtext.common.Terminals.ID");
1044
1045
1046 }
1047
1048
1049 }
1050
1051 // InternalProblem.g:421:3: (otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) )?
1052 int alt10=2;
1053 int LA10_0 = input.LA(1);
1054
1055 if ( (LA10_0==20) ) {
1056 alt10=1;
1057 }
1058 switch (alt10) {
1059 case 1 :
1060 // InternalProblem.g:422:4: otherlv_7= 'opposite' ( ( ruleQualifiedName ) )
1061 {
1062 otherlv_7=(Token)match(input,20,FOLLOW_5);
1063
1064 newLeafNode(otherlv_7, grammarAccess.getReferenceDeclarationAccess().getOppositeKeyword_6_0());
1065
1066 // InternalProblem.g:426:4: ( ( ruleQualifiedName ) )
1067 // InternalProblem.g:427:5: ( ruleQualifiedName )
1068 {
1069 // InternalProblem.g:427:5: ( ruleQualifiedName )
1070 // InternalProblem.g:428:6: ruleQualifiedName
1071 {
1072
1073 if (current==null) {
1074 current = createModelElement(grammarAccess.getReferenceDeclarationRule());
1075 }
1076
1077
1078 newCompositeNode(grammarAccess.getReferenceDeclarationAccess().getOppositeReferenceDeclarationCrossReference_6_1_0());
1079
1080 pushFollow(FOLLOW_2);
1081 ruleQualifiedName();
1082
1083 state._fsp--;
1084
1085
1086 afterParserOrEnumRuleCall();
1087
1088
1089 }
1090
1091
1092 }
1093
1094
1095 }
1096 break;
1097
1098 }
1099
1100
1101 }
1102
1103
1104 }
1105
1106
1107 leaveRule();
1108
1109 }
1110
1111 catch (RecognitionException re) {
1112 recover(input,re);
1113 appendSkippedTokens();
1114 }
1115 finally {
1116 }
1117 return current;
1118 }
1119 // $ANTLR end "ruleReferenceDeclaration"
1120
1121
1122 // $ANTLR start "entryRulePredicateDefinition"
1123 // InternalProblem.g:447:1: entryRulePredicateDefinition returns [EObject current=null] : iv_rulePredicateDefinition= rulePredicateDefinition EOF ;
1124 public final EObject entryRulePredicateDefinition() throws RecognitionException {
1125 EObject current = null;
1126
1127 EObject iv_rulePredicateDefinition = null;
1128
1129
1130 try {
1131 // InternalProblem.g:447:60: (iv_rulePredicateDefinition= rulePredicateDefinition EOF )
1132 // InternalProblem.g:448:2: iv_rulePredicateDefinition= rulePredicateDefinition EOF
1133 {
1134 newCompositeNode(grammarAccess.getPredicateDefinitionRule());
1135 pushFollow(FOLLOW_1);
1136 iv_rulePredicateDefinition=rulePredicateDefinition();
1137
1138 state._fsp--;
1139
1140 current =iv_rulePredicateDefinition;
1141 match(input,EOF,FOLLOW_2);
1142
1143 }
1144
1145 }
1146
1147 catch (RecognitionException re) {
1148 recover(input,re);
1149 appendSkippedTokens();
1150 }
1151 finally {
1152 }
1153 return current;
1154 }
1155 // $ANTLR end "entryRulePredicateDefinition"
1156
1157
1158 // $ANTLR start "rulePredicateDefinition"
1159 // InternalProblem.g:454:1: rulePredicateDefinition returns [EObject current=null] : ( ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' ) ( (lv_name_3_0= RULE_ID ) ) otherlv_4= '(' ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )? otherlv_8= ')' (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )? otherlv_13= '.' ) ;
1160 public final EObject rulePredicateDefinition() throws RecognitionException {
1161 EObject current = null;
1162
1163 Token lv_error_0_0=null;
1164 Token otherlv_1=null;
1165 Token otherlv_2=null;
1166 Token lv_name_3_0=null;
1167 Token otherlv_4=null;
1168 Token otherlv_6=null;
1169 Token otherlv_8=null;
1170 Token otherlv_9=null;
1171 Token otherlv_11=null;
1172 Token otherlv_13=null;
1173 EObject lv_parameters_5_0 = null;
1174
1175 EObject lv_parameters_7_0 = null;
1176
1177 EObject lv_bodies_10_0 = null;
1178
1179 EObject lv_bodies_12_0 = null;
1180
1181
1182
1183 enterRule();
1184
1185 try {
1186 // InternalProblem.g:460:2: ( ( ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' ) ( (lv_name_3_0= RULE_ID ) ) otherlv_4= '(' ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )? otherlv_8= ')' (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )? otherlv_13= '.' ) )
1187 // InternalProblem.g:461:2: ( ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' ) ( (lv_name_3_0= RULE_ID ) ) otherlv_4= '(' ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )? otherlv_8= ')' (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )? otherlv_13= '.' )
1188 {
1189 // InternalProblem.g:461:2: ( ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' ) ( (lv_name_3_0= RULE_ID ) ) otherlv_4= '(' ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )? otherlv_8= ')' (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )? otherlv_13= '.' )
1190 // InternalProblem.g:462:3: ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' ) ( (lv_name_3_0= RULE_ID ) ) otherlv_4= '(' ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )? otherlv_8= ')' (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )? otherlv_13= '.'
1191 {
1192 // InternalProblem.g:462:3: ( ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? ) | otherlv_2= 'pred' )
1193 int alt12=2;
1194 int LA12_0 = input.LA(1);
1195
1196 if ( (LA12_0==21) ) {
1197 alt12=1;
1198 }
1199 else if ( (LA12_0==22) ) {
1200 alt12=2;
1201 }
1202 else {
1203 NoViableAltException nvae =
1204 new NoViableAltException("", 12, 0, input);
1205
1206 throw nvae;
1207 }
1208 switch (alt12) {
1209 case 1 :
1210 // InternalProblem.g:463:4: ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? )
1211 {
1212 // InternalProblem.g:463:4: ( ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )? )
1213 // InternalProblem.g:464:5: ( (lv_error_0_0= 'error' ) ) (otherlv_1= 'pred' )?
1214 {
1215 // InternalProblem.g:464:5: ( (lv_error_0_0= 'error' ) )
1216 // InternalProblem.g:465:6: (lv_error_0_0= 'error' )
1217 {
1218 // InternalProblem.g:465:6: (lv_error_0_0= 'error' )
1219 // InternalProblem.g:466:7: lv_error_0_0= 'error'
1220 {
1221 lv_error_0_0=(Token)match(input,21,FOLLOW_16);
1222
1223 newLeafNode(lv_error_0_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_0_0_0());
1224
1225
1226 if (current==null) {
1227 current = createModelElement(grammarAccess.getPredicateDefinitionRule());
1228 }
1229 setWithLastConsumed(current, "error", lv_error_0_0 != null, "error");
1230
1231
1232 }
1233
1234
1235 }
1236
1237 // InternalProblem.g:478:5: (otherlv_1= 'pred' )?
1238 int alt11=2;
1239 int LA11_0 = input.LA(1);
1240
1241 if ( (LA11_0==22) ) {
1242 alt11=1;
1243 }
1244 switch (alt11) {
1245 case 1 :
1246 // InternalProblem.g:479:6: otherlv_1= 'pred'
1247 {
1248 otherlv_1=(Token)match(input,22,FOLLOW_5);
1249
1250 newLeafNode(otherlv_1, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1());
1251
1252
1253 }
1254 break;
1255
1256 }
1257
1258
1259 }
1260
1261
1262 }
1263 break;
1264 case 2 :
1265 // InternalProblem.g:486:4: otherlv_2= 'pred'
1266 {
1267 otherlv_2=(Token)match(input,22,FOLLOW_5);
1268
1269 newLeafNode(otherlv_2, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_1());
1270
1271
1272 }
1273 break;
1274
1275 }
1276
1277 // InternalProblem.g:491:3: ( (lv_name_3_0= RULE_ID ) )
1278 // InternalProblem.g:492:4: (lv_name_3_0= RULE_ID )
1279 {
1280 // InternalProblem.g:492:4: (lv_name_3_0= RULE_ID )
1281 // InternalProblem.g:493:5: lv_name_3_0= RULE_ID
1282 {
1283 lv_name_3_0=(Token)match(input,RULE_ID,FOLLOW_17);
1284
1285 newLeafNode(lv_name_3_0, grammarAccess.getPredicateDefinitionAccess().getNameIDTerminalRuleCall_1_0());
1286
1287
1288 if (current==null) {
1289 current = createModelElement(grammarAccess.getPredicateDefinitionRule());
1290 }
1291 setWithLastConsumed(
1292 current,
1293 "name",
1294 lv_name_3_0,
1295 "org.eclipse.xtext.common.Terminals.ID");
1296
1297
1298 }
1299
1300
1301 }
1302
1303 otherlv_4=(Token)match(input,23,FOLLOW_18);
1304
1305 newLeafNode(otherlv_4, grammarAccess.getPredicateDefinitionAccess().getLeftParenthesisKeyword_2());
1306
1307 // InternalProblem.g:513:3: ( ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )* )?
1308 int alt14=2;
1309 int LA14_0 = input.LA(1);
1310
1311 if ( (LA14_0==RULE_ID) ) {
1312 alt14=1;
1313 }
1314 switch (alt14) {
1315 case 1 :
1316 // InternalProblem.g:514:4: ( (lv_parameters_5_0= ruleParameter ) ) (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )*
1317 {
1318 // InternalProblem.g:514:4: ( (lv_parameters_5_0= ruleParameter ) )
1319 // InternalProblem.g:515:5: (lv_parameters_5_0= ruleParameter )
1320 {
1321 // InternalProblem.g:515:5: (lv_parameters_5_0= ruleParameter )
1322 // InternalProblem.g:516:6: lv_parameters_5_0= ruleParameter
1323 {
1324
1325 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_0_0());
1326
1327 pushFollow(FOLLOW_19);
1328 lv_parameters_5_0=ruleParameter();
1329
1330 state._fsp--;
1331
1332
1333 if (current==null) {
1334 current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
1335 }
1336 add(
1337 current,
1338 "parameters",
1339 lv_parameters_5_0,
1340 "org.eclipse.viatra.solver.language.Problem.Parameter");
1341 afterParserOrEnumRuleCall();
1342
1343
1344 }
1345
1346
1347 }
1348
1349 // InternalProblem.g:533:4: (otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) )*
1350 loop13:
1351 do {
1352 int alt13=2;
1353 int LA13_0 = input.LA(1);
1354
1355 if ( (LA13_0==15) ) {
1356 alt13=1;
1357 }
1358
1359
1360 switch (alt13) {
1361 case 1 :
1362 // InternalProblem.g:534:5: otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) )
1363 {
1364 otherlv_6=(Token)match(input,15,FOLLOW_5);
1365
1366 newLeafNode(otherlv_6, grammarAccess.getPredicateDefinitionAccess().getCommaKeyword_3_1_0());
1367
1368 // InternalProblem.g:538:5: ( (lv_parameters_7_0= ruleParameter ) )
1369 // InternalProblem.g:539:6: (lv_parameters_7_0= ruleParameter )
1370 {
1371 // InternalProblem.g:539:6: (lv_parameters_7_0= ruleParameter )
1372 // InternalProblem.g:540:7: lv_parameters_7_0= ruleParameter
1373 {
1374
1375 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getParametersParameterParserRuleCall_3_1_1_0());
1376
1377 pushFollow(FOLLOW_19);
1378 lv_parameters_7_0=ruleParameter();
1379
1380 state._fsp--;
1381
1382
1383 if (current==null) {
1384 current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
1385 }
1386 add(
1387 current,
1388 "parameters",
1389 lv_parameters_7_0,
1390 "org.eclipse.viatra.solver.language.Problem.Parameter");
1391 afterParserOrEnumRuleCall();
1392
1393
1394 }
1395
1396
1397 }
1398
1399
1400 }
1401 break;
1402
1403 default :
1404 break loop13;
1405 }
1406 } while (true);
1407
1408
1409 }
1410 break;
1411
1412 }
1413
1414 otherlv_8=(Token)match(input,24,FOLLOW_20);
1415
1416 newLeafNode(otherlv_8, grammarAccess.getPredicateDefinitionAccess().getRightParenthesisKeyword_4());
1417
1418 // InternalProblem.g:563:3: (otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* )?
1419 int alt16=2;
1420 int LA16_0 = input.LA(1);
1421
1422 if ( (LA16_0==25) ) {
1423 alt16=1;
1424 }
1425 switch (alt16) {
1426 case 1 :
1427 // InternalProblem.g:564:4: otherlv_9= ':=' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )*
1428 {
1429 otherlv_9=(Token)match(input,25,FOLLOW_21);
1430
1431 newLeafNode(otherlv_9, grammarAccess.getPredicateDefinitionAccess().getColonEqualsSignKeyword_5_0());
1432
1433 // InternalProblem.g:568:4: ( (lv_bodies_10_0= ruleConjunction ) )
1434 // InternalProblem.g:569:5: (lv_bodies_10_0= ruleConjunction )
1435 {
1436 // InternalProblem.g:569:5: (lv_bodies_10_0= ruleConjunction )
1437 // InternalProblem.g:570:6: lv_bodies_10_0= ruleConjunction
1438 {
1439
1440 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_1_0());
1441
1442 pushFollow(FOLLOW_22);
1443 lv_bodies_10_0=ruleConjunction();
1444
1445 state._fsp--;
1446
1447
1448 if (current==null) {
1449 current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
1450 }
1451 add(
1452 current,
1453 "bodies",
1454 lv_bodies_10_0,
1455 "org.eclipse.viatra.solver.language.Problem.Conjunction");
1456 afterParserOrEnumRuleCall();
1457
1458
1459 }
1460
1461
1462 }
1463
1464 // InternalProblem.g:587:4: (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )*
1465 loop15:
1466 do {
1467 int alt15=2;
1468 int LA15_0 = input.LA(1);
1469
1470 if ( (LA15_0==26) ) {
1471 alt15=1;
1472 }
1473
1474
1475 switch (alt15) {
1476 case 1 :
1477 // InternalProblem.g:588:5: otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) )
1478 {
1479 otherlv_11=(Token)match(input,26,FOLLOW_21);
1480
1481 newLeafNode(otherlv_11, grammarAccess.getPredicateDefinitionAccess().getSemicolonKeyword_5_2_0());
1482
1483 // InternalProblem.g:592:5: ( (lv_bodies_12_0= ruleConjunction ) )
1484 // InternalProblem.g:593:6: (lv_bodies_12_0= ruleConjunction )
1485 {
1486 // InternalProblem.g:593:6: (lv_bodies_12_0= ruleConjunction )
1487 // InternalProblem.g:594:7: lv_bodies_12_0= ruleConjunction
1488 {
1489
1490 newCompositeNode(grammarAccess.getPredicateDefinitionAccess().getBodiesConjunctionParserRuleCall_5_2_1_0());
1491
1492 pushFollow(FOLLOW_22);
1493 lv_bodies_12_0=ruleConjunction();
1494
1495 state._fsp--;
1496
1497
1498 if (current==null) {
1499 current = createModelElementForParent(grammarAccess.getPredicateDefinitionRule());
1500 }
1501 add(
1502 current,
1503 "bodies",
1504 lv_bodies_12_0,
1505 "org.eclipse.viatra.solver.language.Problem.Conjunction");
1506 afterParserOrEnumRuleCall();
1507
1508
1509 }
1510
1511
1512 }
1513
1514
1515 }
1516 break;
1517
1518 default :
1519 break loop15;
1520 }
1521 } while (true);
1522
1523
1524 }
1525 break;
1526
1527 }
1528
1529 otherlv_13=(Token)match(input,17,FOLLOW_2);
1530
1531 newLeafNode(otherlv_13, grammarAccess.getPredicateDefinitionAccess().getFullStopKeyword_6());
1532
1533
1534 }
1535
1536
1537 }
1538
1539
1540 leaveRule();
1541
1542 }
1543
1544 catch (RecognitionException re) {
1545 recover(input,re);
1546 appendSkippedTokens();
1547 }
1548 finally {
1549 }
1550 return current;
1551 }
1552 // $ANTLR end "rulePredicateDefinition"
1553
1554
1555 // $ANTLR start "entryRuleParameter"
1556 // InternalProblem.g:621:1: entryRuleParameter returns [EObject current=null] : iv_ruleParameter= ruleParameter EOF ;
1557 public final EObject entryRuleParameter() throws RecognitionException {
1558 EObject current = null;
1559
1560 EObject iv_ruleParameter = null;
1561
1562
1563 try {
1564 // InternalProblem.g:621:50: (iv_ruleParameter= ruleParameter EOF )
1565 // InternalProblem.g:622:2: iv_ruleParameter= ruleParameter EOF
1566 {
1567 newCompositeNode(grammarAccess.getParameterRule());
1568 pushFollow(FOLLOW_1);
1569 iv_ruleParameter=ruleParameter();
1570
1571 state._fsp--;
1572
1573 current =iv_ruleParameter;
1574 match(input,EOF,FOLLOW_2);
1575
1576 }
1577
1578 }
1579
1580 catch (RecognitionException re) {
1581 recover(input,re);
1582 appendSkippedTokens();
1583 }
1584 finally {
1585 }
1586 return current;
1587 }
1588 // $ANTLR end "entryRuleParameter"
1589
1590
1591 // $ANTLR start "ruleParameter"
1592 // InternalProblem.g:628:1: ruleParameter returns [EObject current=null] : ( ( (otherlv_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) ) ;
1593 public final EObject ruleParameter() throws RecognitionException {
1594 EObject current = null;
1595
1596 Token otherlv_0=null;
1597 Token lv_name_1_0=null;
1598
1599
1600 enterRule();
1601
1602 try {
1603 // InternalProblem.g:634:2: ( ( ( (otherlv_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) ) )
1604 // InternalProblem.g:635:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) )
1605 {
1606 // InternalProblem.g:635:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) )
1607 // InternalProblem.g:636:3: ( (otherlv_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) )
1608 {
1609 // InternalProblem.g:636:3: ( (otherlv_0= RULE_ID ) )
1610 // InternalProblem.g:637:4: (otherlv_0= RULE_ID )
1611 {
1612 // InternalProblem.g:637:4: (otherlv_0= RULE_ID )
1613 // InternalProblem.g:638:5: otherlv_0= RULE_ID
1614 {
1615
1616 if (current==null) {
1617 current = createModelElement(grammarAccess.getParameterRule());
1618 }
1619
1620 otherlv_0=(Token)match(input,RULE_ID,FOLLOW_5);
1621
1622 newLeafNode(otherlv_0, grammarAccess.getParameterAccess().getParameterTypeClassDeclarationCrossReference_0_0());
1623
1624
1625 }
1626
1627
1628 }
1629
1630 // InternalProblem.g:649:3: ( (lv_name_1_0= RULE_ID ) )
1631 // InternalProblem.g:650:4: (lv_name_1_0= RULE_ID )
1632 {
1633 // InternalProblem.g:650:4: (lv_name_1_0= RULE_ID )
1634 // InternalProblem.g:651:5: lv_name_1_0= RULE_ID
1635 {
1636 lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_2);
1637
1638 newLeafNode(lv_name_1_0, grammarAccess.getParameterAccess().getNameIDTerminalRuleCall_1_0());
1639
1640
1641 if (current==null) {
1642 current = createModelElement(grammarAccess.getParameterRule());
1643 }
1644 setWithLastConsumed(
1645 current,
1646 "name",
1647 lv_name_1_0,
1648 "org.eclipse.xtext.common.Terminals.ID");
1649
1650
1651 }
1652
1653
1654 }
1655
1656
1657 }
1658
1659
1660 }
1661
1662
1663 leaveRule();
1664
1665 }
1666
1667 catch (RecognitionException re) {
1668 recover(input,re);
1669 appendSkippedTokens();
1670 }
1671 finally {
1672 }
1673 return current;
1674 }
1675 // $ANTLR end "ruleParameter"
1676
1677
1678 // $ANTLR start "entryRuleConjunction"
1679 // InternalProblem.g:671:1: entryRuleConjunction returns [EObject current=null] : iv_ruleConjunction= ruleConjunction EOF ;
1680 public final EObject entryRuleConjunction() throws RecognitionException {
1681 EObject current = null;
1682
1683 EObject iv_ruleConjunction = null;
1684
1685
1686 try {
1687 // InternalProblem.g:671:52: (iv_ruleConjunction= ruleConjunction EOF )
1688 // InternalProblem.g:672:2: iv_ruleConjunction= ruleConjunction EOF
1689 {
1690 newCompositeNode(grammarAccess.getConjunctionRule());
1691 pushFollow(FOLLOW_1);
1692 iv_ruleConjunction=ruleConjunction();
1693
1694 state._fsp--;
1695
1696 current =iv_ruleConjunction;
1697 match(input,EOF,FOLLOW_2);
1698
1699 }
1700
1701 }
1702
1703 catch (RecognitionException re) {
1704 recover(input,re);
1705 appendSkippedTokens();
1706 }
1707 finally {
1708 }
1709 return current;
1710 }
1711 // $ANTLR end "entryRuleConjunction"
1712
1713
1714 // $ANTLR start "ruleConjunction"
1715 // InternalProblem.g:678:1: ruleConjunction returns [EObject current=null] : ( ( (lv_literals_0_0= ruleLiteral ) ) (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )* ) ;
1716 public final EObject ruleConjunction() throws RecognitionException {
1717 EObject current = null;
1718
1719 Token otherlv_1=null;
1720 EObject lv_literals_0_0 = null;
1721
1722 EObject lv_literals_2_0 = null;
1723
1724
1725
1726 enterRule();
1727
1728 try {
1729 // InternalProblem.g:684:2: ( ( ( (lv_literals_0_0= ruleLiteral ) ) (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )* ) )
1730 // InternalProblem.g:685:2: ( ( (lv_literals_0_0= ruleLiteral ) ) (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )* )
1731 {
1732 // InternalProblem.g:685:2: ( ( (lv_literals_0_0= ruleLiteral ) ) (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )* )
1733 // InternalProblem.g:686:3: ( (lv_literals_0_0= ruleLiteral ) ) (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )*
1734 {
1735 // InternalProblem.g:686:3: ( (lv_literals_0_0= ruleLiteral ) )
1736 // InternalProblem.g:687:4: (lv_literals_0_0= ruleLiteral )
1737 {
1738 // InternalProblem.g:687:4: (lv_literals_0_0= ruleLiteral )
1739 // InternalProblem.g:688:5: lv_literals_0_0= ruleLiteral
1740 {
1741
1742 newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_0_0());
1743
1744 pushFollow(FOLLOW_23);
1745 lv_literals_0_0=ruleLiteral();
1746
1747 state._fsp--;
1748
1749
1750 if (current==null) {
1751 current = createModelElementForParent(grammarAccess.getConjunctionRule());
1752 }
1753 add(
1754 current,
1755 "literals",
1756 lv_literals_0_0,
1757 "org.eclipse.viatra.solver.language.Problem.Literal");
1758 afterParserOrEnumRuleCall();
1759
1760
1761 }
1762
1763
1764 }
1765
1766 // InternalProblem.g:705:3: (otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) )*
1767 loop17:
1768 do {
1769 int alt17=2;
1770 int LA17_0 = input.LA(1);
1771
1772 if ( (LA17_0==15) ) {
1773 alt17=1;
1774 }
1775
1776
1777 switch (alt17) {
1778 case 1 :
1779 // InternalProblem.g:706:4: otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) )
1780 {
1781 otherlv_1=(Token)match(input,15,FOLLOW_21);
1782
1783 newLeafNode(otherlv_1, grammarAccess.getConjunctionAccess().getCommaKeyword_1_0());
1784
1785 // InternalProblem.g:710:4: ( (lv_literals_2_0= ruleLiteral ) )
1786 // InternalProblem.g:711:5: (lv_literals_2_0= ruleLiteral )
1787 {
1788 // InternalProblem.g:711:5: (lv_literals_2_0= ruleLiteral )
1789 // InternalProblem.g:712:6: lv_literals_2_0= ruleLiteral
1790 {
1791
1792 newCompositeNode(grammarAccess.getConjunctionAccess().getLiteralsLiteralParserRuleCall_1_1_0());
1793
1794 pushFollow(FOLLOW_23);
1795 lv_literals_2_0=ruleLiteral();
1796
1797 state._fsp--;
1798
1799
1800 if (current==null) {
1801 current = createModelElementForParent(grammarAccess.getConjunctionRule());
1802 }
1803 add(
1804 current,
1805 "literals",
1806 lv_literals_2_0,
1807 "org.eclipse.viatra.solver.language.Problem.Literal");
1808 afterParserOrEnumRuleCall();
1809
1810
1811 }
1812
1813
1814 }
1815
1816
1817 }
1818 break;
1819
1820 default :
1821 break loop17;
1822 }
1823 } while (true);
1824
1825
1826 }
1827
1828
1829 }
1830
1831
1832 leaveRule();
1833
1834 }
1835
1836 catch (RecognitionException re) {
1837 recover(input,re);
1838 appendSkippedTokens();
1839 }
1840 finally {
1841 }
1842 return current;
1843 }
1844 // $ANTLR end "ruleConjunction"
1845
1846
1847 // $ANTLR start "entryRuleLiteral"
1848 // InternalProblem.g:734:1: entryRuleLiteral returns [EObject current=null] : iv_ruleLiteral= ruleLiteral EOF ;
1849 public final EObject entryRuleLiteral() throws RecognitionException {
1850 EObject current = null;
1851
1852 EObject iv_ruleLiteral = null;
1853
1854
1855 try {
1856 // InternalProblem.g:734:48: (iv_ruleLiteral= ruleLiteral EOF )
1857 // InternalProblem.g:735:2: iv_ruleLiteral= ruleLiteral EOF
1858 {
1859 newCompositeNode(grammarAccess.getLiteralRule());
1860 pushFollow(FOLLOW_1);
1861 iv_ruleLiteral=ruleLiteral();
1862
1863 state._fsp--;
1864
1865 current =iv_ruleLiteral;
1866 match(input,EOF,FOLLOW_2);
1867
1868 }
1869
1870 }
1871
1872 catch (RecognitionException re) {
1873 recover(input,re);
1874 appendSkippedTokens();
1875 }
1876 finally {
1877 }
1878 return current;
1879 }
1880 // $ANTLR end "entryRuleLiteral"
1881
1882
1883 // $ANTLR start "ruleLiteral"
1884 // InternalProblem.g:741:1: ruleLiteral returns [EObject current=null] : (this_Atom_0= ruleAtom | this_NegativeLiteral_1= ruleNegativeLiteral ) ;
1885 public final EObject ruleLiteral() throws RecognitionException {
1886 EObject current = null;
1887
1888 EObject this_Atom_0 = null;
1889
1890 EObject this_NegativeLiteral_1 = null;
1891
1892
1893
1894 enterRule();
1895
1896 try {
1897 // InternalProblem.g:747:2: ( (this_Atom_0= ruleAtom | this_NegativeLiteral_1= ruleNegativeLiteral ) )
1898 // InternalProblem.g:748:2: (this_Atom_0= ruleAtom | this_NegativeLiteral_1= ruleNegativeLiteral )
1899 {
1900 // InternalProblem.g:748:2: (this_Atom_0= ruleAtom | this_NegativeLiteral_1= ruleNegativeLiteral )
1901 int alt18=2;
1902 int LA18_0 = input.LA(1);
1903
1904 if ( (LA18_0==RULE_ID) ) {
1905 alt18=1;
1906 }
1907 else if ( (LA18_0==27) ) {
1908 alt18=2;
1909 }
1910 else {
1911 NoViableAltException nvae =
1912 new NoViableAltException("", 18, 0, input);
1913
1914 throw nvae;
1915 }
1916 switch (alt18) {
1917 case 1 :
1918 // InternalProblem.g:749:3: this_Atom_0= ruleAtom
1919 {
1920
1921 newCompositeNode(grammarAccess.getLiteralAccess().getAtomParserRuleCall_0());
1922
1923 pushFollow(FOLLOW_2);
1924 this_Atom_0=ruleAtom();
1925
1926 state._fsp--;
1927
1928
1929 current = this_Atom_0;
1930 afterParserOrEnumRuleCall();
1931
1932
1933 }
1934 break;
1935 case 2 :
1936 // InternalProblem.g:758:3: this_NegativeLiteral_1= ruleNegativeLiteral
1937 {
1938
1939 newCompositeNode(grammarAccess.getLiteralAccess().getNegativeLiteralParserRuleCall_1());
1940
1941 pushFollow(FOLLOW_2);
1942 this_NegativeLiteral_1=ruleNegativeLiteral();
1943
1944 state._fsp--;
1945
1946
1947 current = this_NegativeLiteral_1;
1948 afterParserOrEnumRuleCall();
1949
1950
1951 }
1952 break;
1953
1954 }
1955
1956
1957 }
1958
1959
1960 leaveRule();
1961
1962 }
1963
1964 catch (RecognitionException re) {
1965 recover(input,re);
1966 appendSkippedTokens();
1967 }
1968 finally {
1969 }
1970 return current;
1971 }
1972 // $ANTLR end "ruleLiteral"
1973
1974
1975 // $ANTLR start "entryRuleNegativeLiteral"
1976 // InternalProblem.g:770:1: entryRuleNegativeLiteral returns [EObject current=null] : iv_ruleNegativeLiteral= ruleNegativeLiteral EOF ;
1977 public final EObject entryRuleNegativeLiteral() throws RecognitionException {
1978 EObject current = null;
1979
1980 EObject iv_ruleNegativeLiteral = null;
1981
1982
1983 try {
1984 // InternalProblem.g:770:56: (iv_ruleNegativeLiteral= ruleNegativeLiteral EOF )
1985 // InternalProblem.g:771:2: iv_ruleNegativeLiteral= ruleNegativeLiteral EOF
1986 {
1987 newCompositeNode(grammarAccess.getNegativeLiteralRule());
1988 pushFollow(FOLLOW_1);
1989 iv_ruleNegativeLiteral=ruleNegativeLiteral();
1990
1991 state._fsp--;
1992
1993 current =iv_ruleNegativeLiteral;
1994 match(input,EOF,FOLLOW_2);
1995
1996 }
1997
1998 }
1999
2000 catch (RecognitionException re) {
2001 recover(input,re);
2002 appendSkippedTokens();
2003 }
2004 finally {
2005 }
2006 return current;
2007 }
2008 // $ANTLR end "entryRuleNegativeLiteral"
2009
2010
2011 // $ANTLR start "ruleNegativeLiteral"
2012 // InternalProblem.g:777:1: ruleNegativeLiteral returns [EObject current=null] : (otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) ) ;
2013 public final EObject ruleNegativeLiteral() throws RecognitionException {
2014 EObject current = null;
2015
2016 Token otherlv_0=null;
2017 EObject lv_atom_1_0 = null;
2018
2019
2020
2021 enterRule();
2022
2023 try {
2024 // InternalProblem.g:783:2: ( (otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) ) )
2025 // InternalProblem.g:784:2: (otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) )
2026 {
2027 // InternalProblem.g:784:2: (otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) )
2028 // InternalProblem.g:785:3: otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) )
2029 {
2030 otherlv_0=(Token)match(input,27,FOLLOW_5);
2031
2032 newLeafNode(otherlv_0, grammarAccess.getNegativeLiteralAccess().getExclamationMarkKeyword_0());
2033
2034 // InternalProblem.g:789:3: ( (lv_atom_1_0= ruleAtom ) )
2035 // InternalProblem.g:790:4: (lv_atom_1_0= ruleAtom )
2036 {
2037 // InternalProblem.g:790:4: (lv_atom_1_0= ruleAtom )
2038 // InternalProblem.g:791:5: lv_atom_1_0= ruleAtom
2039 {
2040
2041 newCompositeNode(grammarAccess.getNegativeLiteralAccess().getAtomAtomParserRuleCall_1_0());
2042
2043 pushFollow(FOLLOW_2);
2044 lv_atom_1_0=ruleAtom();
2045
2046 state._fsp--;
2047
2048
2049 if (current==null) {
2050 current = createModelElementForParent(grammarAccess.getNegativeLiteralRule());
2051 }
2052 set(
2053 current,
2054 "atom",
2055 lv_atom_1_0,
2056 "org.eclipse.viatra.solver.language.Problem.Atom");
2057 afterParserOrEnumRuleCall();
2058
2059
2060 }
2061
2062
2063 }
2064
2065
2066 }
2067
2068
2069 }
2070
2071
2072 leaveRule();
2073
2074 }
2075
2076 catch (RecognitionException re) {
2077 recover(input,re);
2078 appendSkippedTokens();
2079 }
2080 finally {
2081 }
2082 return current;
2083 }
2084 // $ANTLR end "ruleNegativeLiteral"
2085
2086
2087 // $ANTLR start "entryRuleAtom"
2088 // InternalProblem.g:812:1: entryRuleAtom returns [EObject current=null] : iv_ruleAtom= ruleAtom EOF ;
2089 public final EObject entryRuleAtom() throws RecognitionException {
2090 EObject current = null;
2091
2092 EObject iv_ruleAtom = null;
2093
2094
2095 try {
2096 // InternalProblem.g:812:45: (iv_ruleAtom= ruleAtom EOF )
2097 // InternalProblem.g:813:2: iv_ruleAtom= ruleAtom EOF
2098 {
2099 newCompositeNode(grammarAccess.getAtomRule());
2100 pushFollow(FOLLOW_1);
2101 iv_ruleAtom=ruleAtom();
2102
2103 state._fsp--;
2104
2105 current =iv_ruleAtom;
2106 match(input,EOF,FOLLOW_2);
2107
2108 }
2109
2110 }
2111
2112 catch (RecognitionException re) {
2113 recover(input,re);
2114 appendSkippedTokens();
2115 }
2116 finally {
2117 }
2118 return current;
2119 }
2120 // $ANTLR end "entryRuleAtom"
2121
2122
2123 // $ANTLR start "ruleAtom"
2124 // InternalProblem.g:819:1: ruleAtom returns [EObject current=null] : ( ( ( ruleQualifiedName ) ) ( (lv_transitiveClosure_1_0= '+' ) )? otherlv_2= '(' ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )? otherlv_6= ')' ) ;
2125 public final EObject ruleAtom() throws RecognitionException {
2126 EObject current = null;
2127
2128 Token lv_transitiveClosure_1_0=null;
2129 Token otherlv_2=null;
2130 Token otherlv_3=null;
2131 Token otherlv_4=null;
2132 Token otherlv_5=null;
2133 Token otherlv_6=null;
2134
2135
2136 enterRule();
2137
2138 try {
2139 // InternalProblem.g:825:2: ( ( ( ( ruleQualifiedName ) ) ( (lv_transitiveClosure_1_0= '+' ) )? otherlv_2= '(' ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )? otherlv_6= ')' ) )
2140 // InternalProblem.g:826:2: ( ( ( ruleQualifiedName ) ) ( (lv_transitiveClosure_1_0= '+' ) )? otherlv_2= '(' ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )? otherlv_6= ')' )
2141 {
2142 // InternalProblem.g:826:2: ( ( ( ruleQualifiedName ) ) ( (lv_transitiveClosure_1_0= '+' ) )? otherlv_2= '(' ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )? otherlv_6= ')' )
2143 // InternalProblem.g:827:3: ( ( ruleQualifiedName ) ) ( (lv_transitiveClosure_1_0= '+' ) )? otherlv_2= '(' ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )? otherlv_6= ')'
2144 {
2145 // InternalProblem.g:827:3: ( ( ruleQualifiedName ) )
2146 // InternalProblem.g:828:4: ( ruleQualifiedName )
2147 {
2148 // InternalProblem.g:828:4: ( ruleQualifiedName )
2149 // InternalProblem.g:829:5: ruleQualifiedName
2150 {
2151
2152 if (current==null) {
2153 current = createModelElement(grammarAccess.getAtomRule());
2154 }
2155
2156
2157 newCompositeNode(grammarAccess.getAtomAccess().getRelationRelationCrossReference_0_0());
2158
2159 pushFollow(FOLLOW_24);
2160 ruleQualifiedName();
2161
2162 state._fsp--;
2163
2164
2165 afterParserOrEnumRuleCall();
2166
2167
2168 }
2169
2170
2171 }
2172
2173 // InternalProblem.g:843:3: ( (lv_transitiveClosure_1_0= '+' ) )?
2174 int alt19=2;
2175 int LA19_0 = input.LA(1);
2176
2177 if ( (LA19_0==28) ) {
2178 alt19=1;
2179 }
2180 switch (alt19) {
2181 case 1 :
2182 // InternalProblem.g:844:4: (lv_transitiveClosure_1_0= '+' )
2183 {
2184 // InternalProblem.g:844:4: (lv_transitiveClosure_1_0= '+' )
2185 // InternalProblem.g:845:5: lv_transitiveClosure_1_0= '+'
2186 {
2187 lv_transitiveClosure_1_0=(Token)match(input,28,FOLLOW_17);
2188
2189 newLeafNode(lv_transitiveClosure_1_0, grammarAccess.getAtomAccess().getTransitiveClosurePlusSignKeyword_1_0());
2190
2191
2192 if (current==null) {
2193 current = createModelElement(grammarAccess.getAtomRule());
2194 }
2195 setWithLastConsumed(current, "transitiveClosure", lv_transitiveClosure_1_0 != null, "+");
2196
2197
2198 }
2199
2200
2201 }
2202 break;
2203
2204 }
2205
2206 otherlv_2=(Token)match(input,23,FOLLOW_18);
2207
2208 newLeafNode(otherlv_2, grammarAccess.getAtomAccess().getLeftParenthesisKeyword_2());
2209
2210 // InternalProblem.g:861:3: ( ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )* )?
2211 int alt21=2;
2212 int LA21_0 = input.LA(1);
2213
2214 if ( (LA21_0==RULE_ID) ) {
2215 alt21=1;
2216 }
2217 switch (alt21) {
2218 case 1 :
2219 // InternalProblem.g:862:4: ( (otherlv_3= RULE_ID ) ) (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )*
2220 {
2221 // InternalProblem.g:862:4: ( (otherlv_3= RULE_ID ) )
2222 // InternalProblem.g:863:5: (otherlv_3= RULE_ID )
2223 {
2224 // InternalProblem.g:863:5: (otherlv_3= RULE_ID )
2225 // InternalProblem.g:864:6: otherlv_3= RULE_ID
2226 {
2227
2228 if (current==null) {
2229 current = createModelElement(grammarAccess.getAtomRule());
2230 }
2231
2232 otherlv_3=(Token)match(input,RULE_ID,FOLLOW_19);
2233
2234 newLeafNode(otherlv_3, grammarAccess.getAtomAccess().getArgumentsVariableCrossReference_3_0_0());
2235
2236
2237 }
2238
2239
2240 }
2241
2242 // InternalProblem.g:875:4: (otherlv_4= ',' ( (otherlv_5= RULE_ID ) ) )*
2243 loop20:
2244 do {
2245 int alt20=2;
2246 int LA20_0 = input.LA(1);
2247
2248 if ( (LA20_0==15) ) {
2249 alt20=1;
2250 }
2251
2252
2253 switch (alt20) {
2254 case 1 :
2255 // InternalProblem.g:876:5: otherlv_4= ',' ( (otherlv_5= RULE_ID ) )
2256 {
2257 otherlv_4=(Token)match(input,15,FOLLOW_5);
2258
2259 newLeafNode(otherlv_4, grammarAccess.getAtomAccess().getCommaKeyword_3_1_0());
2260
2261 // InternalProblem.g:880:5: ( (otherlv_5= RULE_ID ) )
2262 // InternalProblem.g:881:6: (otherlv_5= RULE_ID )
2263 {
2264 // InternalProblem.g:881:6: (otherlv_5= RULE_ID )
2265 // InternalProblem.g:882:7: otherlv_5= RULE_ID
2266 {
2267
2268 if (current==null) {
2269 current = createModelElement(grammarAccess.getAtomRule());
2270 }
2271
2272 otherlv_5=(Token)match(input,RULE_ID,FOLLOW_19);
2273
2274 newLeafNode(otherlv_5, grammarAccess.getAtomAccess().getArgumentsVariableCrossReference_3_1_1_0());
2275
2276
2277 }
2278
2279
2280 }
2281
2282
2283 }
2284 break;
2285
2286 default :
2287 break loop20;
2288 }
2289 } while (true);
2290
2291
2292 }
2293 break;
2294
2295 }
2296
2297 otherlv_6=(Token)match(input,24,FOLLOW_2);
2298
2299 newLeafNode(otherlv_6, grammarAccess.getAtomAccess().getRightParenthesisKeyword_4());
2300
2301
2302 }
2303
2304
2305 }
2306
2307
2308 leaveRule();
2309
2310 }
2311
2312 catch (RecognitionException re) {
2313 recover(input,re);
2314 appendSkippedTokens();
2315 }
2316 finally {
2317 }
2318 return current;
2319 }
2320 // $ANTLR end "ruleAtom"
2321
2322
2323 // $ANTLR start "entryRuleAssertion"
2324 // InternalProblem.g:903:1: entryRuleAssertion returns [EObject current=null] : iv_ruleAssertion= ruleAssertion EOF ;
2325 public final EObject entryRuleAssertion() throws RecognitionException {
2326 EObject current = null;
2327
2328 EObject iv_ruleAssertion = null;
2329
2330
2331 try {
2332 // InternalProblem.g:903:50: (iv_ruleAssertion= ruleAssertion EOF )
2333 // InternalProblem.g:904:2: iv_ruleAssertion= ruleAssertion EOF
2334 {
2335 newCompositeNode(grammarAccess.getAssertionRule());
2336 pushFollow(FOLLOW_1);
2337 iv_ruleAssertion=ruleAssertion();
2338
2339 state._fsp--;
2340
2341 current =iv_ruleAssertion;
2342 match(input,EOF,FOLLOW_2);
2343
2344 }
2345
2346 }
2347
2348 catch (RecognitionException re) {
2349 recover(input,re);
2350 appendSkippedTokens();
2351 }
2352 finally {
2353 }
2354 return current;
2355 }
2356 // $ANTLR end "entryRuleAssertion"
2357
2358
2359 // $ANTLR start "ruleAssertion"
2360 // InternalProblem.g:910:1: ruleAssertion returns [EObject current=null] : ( ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) ) otherlv_15= '.' ) ;
2361 public final EObject ruleAssertion() throws RecognitionException {
2362 EObject current = null;
2363
2364 Token otherlv_1=null;
2365 Token otherlv_3=null;
2366 Token otherlv_5=null;
2367 Token otherlv_6=null;
2368 Token otherlv_10=null;
2369 Token otherlv_12=null;
2370 Token otherlv_14=null;
2371 Token otherlv_15=null;
2372 Enumerator lv_value_7_0 = null;
2373
2374 Enumerator lv_value_8_0 = null;
2375
2376
2377
2378 enterRule();
2379
2380 try {
2381 // InternalProblem.g:916:2: ( ( ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) ) otherlv_15= '.' ) )
2382 // InternalProblem.g:917:2: ( ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) ) otherlv_15= '.' )
2383 {
2384 // InternalProblem.g:917:2: ( ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) ) otherlv_15= '.' )
2385 // InternalProblem.g:918:3: ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) ) otherlv_15= '.'
2386 {
2387 // InternalProblem.g:918:3: ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) )
2388 int alt27=2;
2389 alt27 = dfa27.predict(input);
2390 switch (alt27) {
2391 case 1 :
2392 // InternalProblem.g:919:4: ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) )
2393 {
2394 // InternalProblem.g:919:4: ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) )
2395 // InternalProblem.g:920:5: ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) )
2396 {
2397 // InternalProblem.g:920:5: ( ( ruleQualifiedName ) )
2398 // InternalProblem.g:921:6: ( ruleQualifiedName )
2399 {
2400 // InternalProblem.g:921:6: ( ruleQualifiedName )
2401 // InternalProblem.g:922:7: ruleQualifiedName
2402 {
2403
2404 if (current==null) {
2405 current = createModelElement(grammarAccess.getAssertionRule());
2406 }
2407
2408
2409 newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_0_0_0());
2410
2411 pushFollow(FOLLOW_17);
2412 ruleQualifiedName();
2413
2414 state._fsp--;
2415
2416
2417 afterParserOrEnumRuleCall();
2418
2419
2420 }
2421
2422
2423 }
2424
2425 otherlv_1=(Token)match(input,23,FOLLOW_18);
2426
2427 newLeafNode(otherlv_1, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_0_1());
2428
2429 // InternalProblem.g:940:5: ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )?
2430 int alt23=2;
2431 int LA23_0 = input.LA(1);
2432
2433 if ( (LA23_0==RULE_ID) ) {
2434 alt23=1;
2435 }
2436 switch (alt23) {
2437 case 1 :
2438 // InternalProblem.g:941:6: ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )*
2439 {
2440 // InternalProblem.g:941:6: ( ( ruleQualifiedName ) )
2441 // InternalProblem.g:942:7: ( ruleQualifiedName )
2442 {
2443 // InternalProblem.g:942:7: ( ruleQualifiedName )
2444 // InternalProblem.g:943:8: ruleQualifiedName
2445 {
2446
2447 if (current==null) {
2448 current = createModelElement(grammarAccess.getAssertionRule());
2449 }
2450
2451
2452 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_0_0());
2453
2454 pushFollow(FOLLOW_19);
2455 ruleQualifiedName();
2456
2457 state._fsp--;
2458
2459
2460 afterParserOrEnumRuleCall();
2461
2462
2463 }
2464
2465
2466 }
2467
2468 // InternalProblem.g:957:6: (otherlv_3= ',' ( ( ruleQualifiedName ) ) )*
2469 loop22:
2470 do {
2471 int alt22=2;
2472 int LA22_0 = input.LA(1);
2473
2474 if ( (LA22_0==15) ) {
2475 alt22=1;
2476 }
2477
2478
2479 switch (alt22) {
2480 case 1 :
2481 // InternalProblem.g:958:7: otherlv_3= ',' ( ( ruleQualifiedName ) )
2482 {
2483 otherlv_3=(Token)match(input,15,FOLLOW_5);
2484
2485 newLeafNode(otherlv_3, grammarAccess.getAssertionAccess().getCommaKeyword_0_0_2_1_0());
2486
2487 // InternalProblem.g:962:7: ( ( ruleQualifiedName ) )
2488 // InternalProblem.g:963:8: ( ruleQualifiedName )
2489 {
2490 // InternalProblem.g:963:8: ( ruleQualifiedName )
2491 // InternalProblem.g:964:9: ruleQualifiedName
2492 {
2493
2494 if (current==null) {
2495 current = createModelElement(grammarAccess.getAssertionRule());
2496 }
2497
2498
2499 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_0_2_1_1_0());
2500
2501 pushFollow(FOLLOW_19);
2502 ruleQualifiedName();
2503
2504 state._fsp--;
2505
2506
2507 afterParserOrEnumRuleCall();
2508
2509
2510 }
2511
2512
2513 }
2514
2515
2516 }
2517 break;
2518
2519 default :
2520 break loop22;
2521 }
2522 } while (true);
2523
2524
2525 }
2526 break;
2527
2528 }
2529
2530 otherlv_5=(Token)match(input,24,FOLLOW_25);
2531
2532 newLeafNode(otherlv_5, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_0_3());
2533
2534 otherlv_6=(Token)match(input,29,FOLLOW_26);
2535
2536 newLeafNode(otherlv_6, grammarAccess.getAssertionAccess().getColonKeyword_0_0_4());
2537
2538 // InternalProblem.g:988:5: ( (lv_value_7_0= ruleLogicValue ) )
2539 // InternalProblem.g:989:6: (lv_value_7_0= ruleLogicValue )
2540 {
2541 // InternalProblem.g:989:6: (lv_value_7_0= ruleLogicValue )
2542 // InternalProblem.g:990:7: lv_value_7_0= ruleLogicValue
2543 {
2544
2545 newCompositeNode(grammarAccess.getAssertionAccess().getValueLogicValueEnumRuleCall_0_0_5_0());
2546
2547 pushFollow(FOLLOW_27);
2548 lv_value_7_0=ruleLogicValue();
2549
2550 state._fsp--;
2551
2552
2553 if (current==null) {
2554 current = createModelElementForParent(grammarAccess.getAssertionRule());
2555 }
2556 set(
2557 current,
2558 "value",
2559 lv_value_7_0,
2560 "org.eclipse.viatra.solver.language.Problem.LogicValue");
2561 afterParserOrEnumRuleCall();
2562
2563
2564 }
2565
2566
2567 }
2568
2569
2570 }
2571
2572
2573 }
2574 break;
2575 case 2 :
2576 // InternalProblem.g:1009:4: ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' )
2577 {
2578 // InternalProblem.g:1009:4: ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' )
2579 // InternalProblem.g:1010:5: ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')'
2580 {
2581 // InternalProblem.g:1010:5: ( (lv_value_8_0= ruleShortLogicValue ) )?
2582 int alt24=2;
2583 int LA24_0 = input.LA(1);
2584
2585 if ( (LA24_0==27||LA24_0==39) ) {
2586 alt24=1;
2587 }
2588 switch (alt24) {
2589 case 1 :
2590 // InternalProblem.g:1011:6: (lv_value_8_0= ruleShortLogicValue )
2591 {
2592 // InternalProblem.g:1011:6: (lv_value_8_0= ruleShortLogicValue )
2593 // InternalProblem.g:1012:7: lv_value_8_0= ruleShortLogicValue
2594 {
2595
2596 newCompositeNode(grammarAccess.getAssertionAccess().getValueShortLogicValueEnumRuleCall_0_1_0_0());
2597
2598 pushFollow(FOLLOW_5);
2599 lv_value_8_0=ruleShortLogicValue();
2600
2601 state._fsp--;
2602
2603
2604 if (current==null) {
2605 current = createModelElementForParent(grammarAccess.getAssertionRule());
2606 }
2607 set(
2608 current,
2609 "value",
2610 lv_value_8_0,
2611 "org.eclipse.viatra.solver.language.Problem.ShortLogicValue");
2612 afterParserOrEnumRuleCall();
2613
2614
2615 }
2616
2617
2618 }
2619 break;
2620
2621 }
2622
2623 // InternalProblem.g:1029:5: ( ( ruleQualifiedName ) )
2624 // InternalProblem.g:1030:6: ( ruleQualifiedName )
2625 {
2626 // InternalProblem.g:1030:6: ( ruleQualifiedName )
2627 // InternalProblem.g:1031:7: ruleQualifiedName
2628 {
2629
2630 if (current==null) {
2631 current = createModelElement(grammarAccess.getAssertionRule());
2632 }
2633
2634
2635 newCompositeNode(grammarAccess.getAssertionAccess().getRelationRelationCrossReference_0_1_1_0());
2636
2637 pushFollow(FOLLOW_17);
2638 ruleQualifiedName();
2639
2640 state._fsp--;
2641
2642
2643 afterParserOrEnumRuleCall();
2644
2645
2646 }
2647
2648
2649 }
2650
2651 otherlv_10=(Token)match(input,23,FOLLOW_18);
2652
2653 newLeafNode(otherlv_10, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_1_2());
2654
2655 // InternalProblem.g:1049:5: ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )?
2656 int alt26=2;
2657 int LA26_0 = input.LA(1);
2658
2659 if ( (LA26_0==RULE_ID) ) {
2660 alt26=1;
2661 }
2662 switch (alt26) {
2663 case 1 :
2664 // InternalProblem.g:1050:6: ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )*
2665 {
2666 // InternalProblem.g:1050:6: ( ( ruleQualifiedName ) )
2667 // InternalProblem.g:1051:7: ( ruleQualifiedName )
2668 {
2669 // InternalProblem.g:1051:7: ( ruleQualifiedName )
2670 // InternalProblem.g:1052:8: ruleQualifiedName
2671 {
2672
2673 if (current==null) {
2674 current = createModelElement(grammarAccess.getAssertionRule());
2675 }
2676
2677
2678 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_0_0());
2679
2680 pushFollow(FOLLOW_19);
2681 ruleQualifiedName();
2682
2683 state._fsp--;
2684
2685
2686 afterParserOrEnumRuleCall();
2687
2688
2689 }
2690
2691
2692 }
2693
2694 // InternalProblem.g:1066:6: (otherlv_12= ',' ( ( ruleQualifiedName ) ) )*
2695 loop25:
2696 do {
2697 int alt25=2;
2698 int LA25_0 = input.LA(1);
2699
2700 if ( (LA25_0==15) ) {
2701 alt25=1;
2702 }
2703
2704
2705 switch (alt25) {
2706 case 1 :
2707 // InternalProblem.g:1067:7: otherlv_12= ',' ( ( ruleQualifiedName ) )
2708 {
2709 otherlv_12=(Token)match(input,15,FOLLOW_5);
2710
2711 newLeafNode(otherlv_12, grammarAccess.getAssertionAccess().getCommaKeyword_0_1_3_1_0());
2712
2713 // InternalProblem.g:1071:7: ( ( ruleQualifiedName ) )
2714 // InternalProblem.g:1072:8: ( ruleQualifiedName )
2715 {
2716 // InternalProblem.g:1072:8: ( ruleQualifiedName )
2717 // InternalProblem.g:1073:9: ruleQualifiedName
2718 {
2719
2720 if (current==null) {
2721 current = createModelElement(grammarAccess.getAssertionRule());
2722 }
2723
2724
2725 newCompositeNode(grammarAccess.getAssertionAccess().getArgumentsNodeCrossReference_0_1_3_1_1_0());
2726
2727 pushFollow(FOLLOW_19);
2728 ruleQualifiedName();
2729
2730 state._fsp--;
2731
2732
2733 afterParserOrEnumRuleCall();
2734
2735
2736 }
2737
2738
2739 }
2740
2741
2742 }
2743 break;
2744
2745 default :
2746 break loop25;
2747 }
2748 } while (true);
2749
2750
2751 }
2752 break;
2753
2754 }
2755
2756 otherlv_14=(Token)match(input,24,FOLLOW_27);
2757
2758 newLeafNode(otherlv_14, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_1_4());
2759
2760
2761 }
2762
2763
2764 }
2765 break;
2766
2767 }
2768
2769 otherlv_15=(Token)match(input,17,FOLLOW_2);
2770
2771 newLeafNode(otherlv_15, grammarAccess.getAssertionAccess().getFullStopKeyword_1());
2772
2773
2774 }
2775
2776
2777 }
2778
2779
2780 leaveRule();
2781
2782 }
2783
2784 catch (RecognitionException re) {
2785 recover(input,re);
2786 appendSkippedTokens();
2787 }
2788 finally {
2789 }
2790 return current;
2791 }
2792 // $ANTLR end "ruleAssertion"
2793
2794
2795 // $ANTLR start "entryRuleScopeDeclaration"
2796 // InternalProblem.g:1103:1: entryRuleScopeDeclaration returns [EObject current=null] : iv_ruleScopeDeclaration= ruleScopeDeclaration EOF ;
2797 public final EObject entryRuleScopeDeclaration() throws RecognitionException {
2798 EObject current = null;
2799
2800 EObject iv_ruleScopeDeclaration = null;
2801
2802
2803 try {
2804 // InternalProblem.g:1103:57: (iv_ruleScopeDeclaration= ruleScopeDeclaration EOF )
2805 // InternalProblem.g:1104:2: iv_ruleScopeDeclaration= ruleScopeDeclaration EOF
2806 {
2807 newCompositeNode(grammarAccess.getScopeDeclarationRule());
2808 pushFollow(FOLLOW_1);
2809 iv_ruleScopeDeclaration=ruleScopeDeclaration();
2810
2811 state._fsp--;
2812
2813 current =iv_ruleScopeDeclaration;
2814 match(input,EOF,FOLLOW_2);
2815
2816 }
2817
2818 }
2819
2820 catch (RecognitionException re) {
2821 recover(input,re);
2822 appendSkippedTokens();
2823 }
2824 finally {
2825 }
2826 return current;
2827 }
2828 // $ANTLR end "entryRuleScopeDeclaration"
2829
2830
2831 // $ANTLR start "ruleScopeDeclaration"
2832 // InternalProblem.g:1110:1: ruleScopeDeclaration returns [EObject current=null] : (otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' ) ;
2833 public final EObject ruleScopeDeclaration() throws RecognitionException {
2834 EObject current = null;
2835
2836 Token otherlv_0=null;
2837 Token otherlv_2=null;
2838 Token otherlv_4=null;
2839 EObject lv_typeScopes_1_0 = null;
2840
2841 EObject lv_typeScopes_3_0 = null;
2842
2843
2844
2845 enterRule();
2846
2847 try {
2848 // InternalProblem.g:1116:2: ( (otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' ) )
2849 // InternalProblem.g:1117:2: (otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' )
2850 {
2851 // InternalProblem.g:1117:2: (otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' )
2852 // InternalProblem.g:1118:3: otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.'
2853 {
2854 otherlv_0=(Token)match(input,30,FOLLOW_5);
2855
2856 newLeafNode(otherlv_0, grammarAccess.getScopeDeclarationAccess().getScopeKeyword_0());
2857
2858 // InternalProblem.g:1122:3: ( (lv_typeScopes_1_0= ruleTypeScope ) )
2859 // InternalProblem.g:1123:4: (lv_typeScopes_1_0= ruleTypeScope )
2860 {
2861 // InternalProblem.g:1123:4: (lv_typeScopes_1_0= ruleTypeScope )
2862 // InternalProblem.g:1124:5: lv_typeScopes_1_0= ruleTypeScope
2863 {
2864
2865 newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_1_0());
2866
2867 pushFollow(FOLLOW_8);
2868 lv_typeScopes_1_0=ruleTypeScope();
2869
2870 state._fsp--;
2871
2872
2873 if (current==null) {
2874 current = createModelElementForParent(grammarAccess.getScopeDeclarationRule());
2875 }
2876 add(
2877 current,
2878 "typeScopes",
2879 lv_typeScopes_1_0,
2880 "org.eclipse.viatra.solver.language.Problem.TypeScope");
2881 afterParserOrEnumRuleCall();
2882
2883
2884 }
2885
2886
2887 }
2888
2889 // InternalProblem.g:1141:3: (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )*
2890 loop28:
2891 do {
2892 int alt28=2;
2893 int LA28_0 = input.LA(1);
2894
2895 if ( (LA28_0==15) ) {
2896 alt28=1;
2897 }
2898
2899
2900 switch (alt28) {
2901 case 1 :
2902 // InternalProblem.g:1142:4: otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) )
2903 {
2904 otherlv_2=(Token)match(input,15,FOLLOW_5);
2905
2906 newLeafNode(otherlv_2, grammarAccess.getScopeDeclarationAccess().getCommaKeyword_2_0());
2907
2908 // InternalProblem.g:1146:4: ( (lv_typeScopes_3_0= ruleTypeScope ) )
2909 // InternalProblem.g:1147:5: (lv_typeScopes_3_0= ruleTypeScope )
2910 {
2911 // InternalProblem.g:1147:5: (lv_typeScopes_3_0= ruleTypeScope )
2912 // InternalProblem.g:1148:6: lv_typeScopes_3_0= ruleTypeScope
2913 {
2914
2915 newCompositeNode(grammarAccess.getScopeDeclarationAccess().getTypeScopesTypeScopeParserRuleCall_2_1_0());
2916
2917 pushFollow(FOLLOW_8);
2918 lv_typeScopes_3_0=ruleTypeScope();
2919
2920 state._fsp--;
2921
2922
2923 if (current==null) {
2924 current = createModelElementForParent(grammarAccess.getScopeDeclarationRule());
2925 }
2926 add(
2927 current,
2928 "typeScopes",
2929 lv_typeScopes_3_0,
2930 "org.eclipse.viatra.solver.language.Problem.TypeScope");
2931 afterParserOrEnumRuleCall();
2932
2933
2934 }
2935
2936
2937 }
2938
2939
2940 }
2941 break;
2942
2943 default :
2944 break loop28;
2945 }
2946 } while (true);
2947
2948 otherlv_4=(Token)match(input,17,FOLLOW_2);
2949
2950 newLeafNode(otherlv_4, grammarAccess.getScopeDeclarationAccess().getFullStopKeyword_3());
2951
2952
2953 }
2954
2955
2956 }
2957
2958
2959 leaveRule();
2960
2961 }
2962
2963 catch (RecognitionException re) {
2964 recover(input,re);
2965 appendSkippedTokens();
2966 }
2967 finally {
2968 }
2969 return current;
2970 }
2971 // $ANTLR end "ruleScopeDeclaration"
2972
2973
2974 // $ANTLR start "entryRuleTypeScope"
2975 // InternalProblem.g:1174:1: entryRuleTypeScope returns [EObject current=null] : iv_ruleTypeScope= ruleTypeScope EOF ;
2976 public final EObject entryRuleTypeScope() throws RecognitionException {
2977 EObject current = null;
2978
2979 EObject iv_ruleTypeScope = null;
2980
2981
2982 try {
2983 // InternalProblem.g:1174:50: (iv_ruleTypeScope= ruleTypeScope EOF )
2984 // InternalProblem.g:1175:2: iv_ruleTypeScope= ruleTypeScope EOF
2985 {
2986 newCompositeNode(grammarAccess.getTypeScopeRule());
2987 pushFollow(FOLLOW_1);
2988 iv_ruleTypeScope=ruleTypeScope();
2989
2990 state._fsp--;
2991
2992 current =iv_ruleTypeScope;
2993 match(input,EOF,FOLLOW_2);
2994
2995 }
2996
2997 }
2998
2999 catch (RecognitionException re) {
3000 recover(input,re);
3001 appendSkippedTokens();
3002 }
3003 finally {
3004 }
3005 return current;
3006 }
3007 // $ANTLR end "entryRuleTypeScope"
3008
3009
3010 // $ANTLR start "ruleTypeScope"
3011 // InternalProblem.g:1181:1: ruleTypeScope returns [EObject current=null] : ( ( (otherlv_0= RULE_ID ) ) ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' ) ( (lv_multiplicity_3_0= ruleMultiplicity ) ) ) ;
3012 public final EObject ruleTypeScope() throws RecognitionException {
3013 EObject current = null;
3014
3015 Token otherlv_0=null;
3016 Token lv_increment_1_0=null;
3017 Token otherlv_2=null;
3018 EObject lv_multiplicity_3_0 = null;
3019
3020
3021
3022 enterRule();
3023
3024 try {
3025 // InternalProblem.g:1187:2: ( ( ( (otherlv_0= RULE_ID ) ) ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' ) ( (lv_multiplicity_3_0= ruleMultiplicity ) ) ) )
3026 // InternalProblem.g:1188:2: ( ( (otherlv_0= RULE_ID ) ) ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' ) ( (lv_multiplicity_3_0= ruleMultiplicity ) ) )
3027 {
3028 // InternalProblem.g:1188:2: ( ( (otherlv_0= RULE_ID ) ) ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' ) ( (lv_multiplicity_3_0= ruleMultiplicity ) ) )
3029 // InternalProblem.g:1189:3: ( (otherlv_0= RULE_ID ) ) ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' ) ( (lv_multiplicity_3_0= ruleMultiplicity ) )
3030 {
3031 // InternalProblem.g:1189:3: ( (otherlv_0= RULE_ID ) )
3032 // InternalProblem.g:1190:4: (otherlv_0= RULE_ID )
3033 {
3034 // InternalProblem.g:1190:4: (otherlv_0= RULE_ID )
3035 // InternalProblem.g:1191:5: otherlv_0= RULE_ID
3036 {
3037
3038 if (current==null) {
3039 current = createModelElement(grammarAccess.getTypeScopeRule());
3040 }
3041
3042 otherlv_0=(Token)match(input,RULE_ID,FOLLOW_28);
3043
3044 newLeafNode(otherlv_0, grammarAccess.getTypeScopeAccess().getTargetTypeClassDeclarationCrossReference_0_0());
3045
3046
3047 }
3048
3049
3050 }
3051
3052 // InternalProblem.g:1202:3: ( ( (lv_increment_1_0= '+=' ) ) | otherlv_2= '=' )
3053 int alt29=2;
3054 int LA29_0 = input.LA(1);
3055
3056 if ( (LA29_0==31) ) {
3057 alt29=1;
3058 }
3059 else if ( (LA29_0==32) ) {
3060 alt29=2;
3061 }
3062 else {
3063 NoViableAltException nvae =
3064 new NoViableAltException("", 29, 0, input);
3065
3066 throw nvae;
3067 }
3068 switch (alt29) {
3069 case 1 :
3070 // InternalProblem.g:1203:4: ( (lv_increment_1_0= '+=' ) )
3071 {
3072 // InternalProblem.g:1203:4: ( (lv_increment_1_0= '+=' ) )
3073 // InternalProblem.g:1204:5: (lv_increment_1_0= '+=' )
3074 {
3075 // InternalProblem.g:1204:5: (lv_increment_1_0= '+=' )
3076 // InternalProblem.g:1205:6: lv_increment_1_0= '+='
3077 {
3078 lv_increment_1_0=(Token)match(input,31,FOLLOW_13);
3079
3080 newLeafNode(lv_increment_1_0, grammarAccess.getTypeScopeAccess().getIncrementPlusSignEqualsSignKeyword_1_0_0());
3081
3082
3083 if (current==null) {
3084 current = createModelElement(grammarAccess.getTypeScopeRule());
3085 }
3086 setWithLastConsumed(current, "increment", lv_increment_1_0 != null, "+=");
3087
3088
3089 }
3090
3091
3092 }
3093
3094
3095 }
3096 break;
3097 case 2 :
3098 // InternalProblem.g:1218:4: otherlv_2= '='
3099 {
3100 otherlv_2=(Token)match(input,32,FOLLOW_13);
3101
3102 newLeafNode(otherlv_2, grammarAccess.getTypeScopeAccess().getEqualsSignKeyword_1_1());
3103
3104
3105 }
3106 break;
3107
3108 }
3109
3110 // InternalProblem.g:1223:3: ( (lv_multiplicity_3_0= ruleMultiplicity ) )
3111 // InternalProblem.g:1224:4: (lv_multiplicity_3_0= ruleMultiplicity )
3112 {
3113 // InternalProblem.g:1224:4: (lv_multiplicity_3_0= ruleMultiplicity )
3114 // InternalProblem.g:1225:5: lv_multiplicity_3_0= ruleMultiplicity
3115 {
3116
3117 newCompositeNode(grammarAccess.getTypeScopeAccess().getMultiplicityMultiplicityParserRuleCall_2_0());
3118
3119 pushFollow(FOLLOW_2);
3120 lv_multiplicity_3_0=ruleMultiplicity();
3121
3122 state._fsp--;
3123
3124
3125 if (current==null) {
3126 current = createModelElementForParent(grammarAccess.getTypeScopeRule());
3127 }
3128 set(
3129 current,
3130 "multiplicity",
3131 lv_multiplicity_3_0,
3132 "org.eclipse.viatra.solver.language.Problem.Multiplicity");
3133 afterParserOrEnumRuleCall();
3134
3135
3136 }
3137
3138
3139 }
3140
3141
3142 }
3143
3144
3145 }
3146
3147
3148 leaveRule();
3149
3150 }
3151
3152 catch (RecognitionException re) {
3153 recover(input,re);
3154 appendSkippedTokens();
3155 }
3156 finally {
3157 }
3158 return current;
3159 }
3160 // $ANTLR end "ruleTypeScope"
3161
3162
3163 // $ANTLR start "entryRuleMultiplicity"
3164 // InternalProblem.g:1246:1: entryRuleMultiplicity returns [EObject current=null] : iv_ruleMultiplicity= ruleMultiplicity EOF ;
3165 public final EObject entryRuleMultiplicity() throws RecognitionException {
3166 EObject current = null;
3167
3168 EObject iv_ruleMultiplicity = null;
3169
3170
3171 try {
3172 // InternalProblem.g:1246:53: (iv_ruleMultiplicity= ruleMultiplicity EOF )
3173 // InternalProblem.g:1247:2: iv_ruleMultiplicity= ruleMultiplicity EOF
3174 {
3175 newCompositeNode(grammarAccess.getMultiplicityRule());
3176 pushFollow(FOLLOW_1);
3177 iv_ruleMultiplicity=ruleMultiplicity();
3178
3179 state._fsp--;
3180
3181 current =iv_ruleMultiplicity;
3182 match(input,EOF,FOLLOW_2);
3183
3184 }
3185
3186 }
3187
3188 catch (RecognitionException re) {
3189 recover(input,re);
3190 appendSkippedTokens();
3191 }
3192 finally {
3193 }
3194 return current;
3195 }
3196 // $ANTLR end "entryRuleMultiplicity"
3197
3198
3199 // $ANTLR start "ruleMultiplicity"
3200 // InternalProblem.g:1253:1: ruleMultiplicity returns [EObject current=null] : (this_RangeMultiplicity_0= ruleRangeMultiplicity | this_ExactMultiplicity_1= ruleExactMultiplicity ) ;
3201 public final EObject ruleMultiplicity() throws RecognitionException {
3202 EObject current = null;
3203
3204 EObject this_RangeMultiplicity_0 = null;
3205
3206 EObject this_ExactMultiplicity_1 = null;
3207
3208
3209
3210 enterRule();
3211
3212 try {
3213 // InternalProblem.g:1259:2: ( (this_RangeMultiplicity_0= ruleRangeMultiplicity | this_ExactMultiplicity_1= ruleExactMultiplicity ) )
3214 // InternalProblem.g:1260:2: (this_RangeMultiplicity_0= ruleRangeMultiplicity | this_ExactMultiplicity_1= ruleExactMultiplicity )
3215 {
3216 // InternalProblem.g:1260:2: (this_RangeMultiplicity_0= ruleRangeMultiplicity | this_ExactMultiplicity_1= ruleExactMultiplicity )
3217 int alt30=2;
3218 int LA30_0 = input.LA(1);
3219
3220 if ( (LA30_0==RULE_INT) ) {
3221 int LA30_1 = input.LA(2);
3222
3223 if ( (LA30_1==33) ) {
3224 alt30=1;
3225 }
3226 else if ( (LA30_1==EOF||(LA30_1>=15 && LA30_1<=17)) ) {
3227 alt30=2;
3228 }
3229 else {
3230 NoViableAltException nvae =
3231 new NoViableAltException("", 30, 1, input);
3232
3233 throw nvae;
3234 }
3235 }
3236 else {
3237 NoViableAltException nvae =
3238 new NoViableAltException("", 30, 0, input);
3239
3240 throw nvae;
3241 }
3242 switch (alt30) {
3243 case 1 :
3244 // InternalProblem.g:1261:3: this_RangeMultiplicity_0= ruleRangeMultiplicity
3245 {
3246
3247 newCompositeNode(grammarAccess.getMultiplicityAccess().getRangeMultiplicityParserRuleCall_0());
3248
3249 pushFollow(FOLLOW_2);
3250 this_RangeMultiplicity_0=ruleRangeMultiplicity();
3251
3252 state._fsp--;
3253
3254
3255 current = this_RangeMultiplicity_0;
3256 afterParserOrEnumRuleCall();
3257
3258
3259 }
3260 break;
3261 case 2 :
3262 // InternalProblem.g:1270:3: this_ExactMultiplicity_1= ruleExactMultiplicity
3263 {
3264
3265 newCompositeNode(grammarAccess.getMultiplicityAccess().getExactMultiplicityParserRuleCall_1());
3266
3267 pushFollow(FOLLOW_2);
3268 this_ExactMultiplicity_1=ruleExactMultiplicity();
3269
3270 state._fsp--;
3271
3272
3273 current = this_ExactMultiplicity_1;
3274 afterParserOrEnumRuleCall();
3275
3276
3277 }
3278 break;
3279
3280 }
3281
3282
3283 }
3284
3285
3286 leaveRule();
3287
3288 }
3289
3290 catch (RecognitionException re) {
3291 recover(input,re);
3292 appendSkippedTokens();
3293 }
3294 finally {
3295 }
3296 return current;
3297 }
3298 // $ANTLR end "ruleMultiplicity"
3299
3300
3301 // $ANTLR start "entryRuleRangeMultiplicity"
3302 // InternalProblem.g:1282:1: entryRuleRangeMultiplicity returns [EObject current=null] : iv_ruleRangeMultiplicity= ruleRangeMultiplicity EOF ;
3303 public final EObject entryRuleRangeMultiplicity() throws RecognitionException {
3304 EObject current = null;
3305
3306 EObject iv_ruleRangeMultiplicity = null;
3307
3308
3309 try {
3310 // InternalProblem.g:1282:58: (iv_ruleRangeMultiplicity= ruleRangeMultiplicity EOF )
3311 // InternalProblem.g:1283:2: iv_ruleRangeMultiplicity= ruleRangeMultiplicity EOF
3312 {
3313 newCompositeNode(grammarAccess.getRangeMultiplicityRule());
3314 pushFollow(FOLLOW_1);
3315 iv_ruleRangeMultiplicity=ruleRangeMultiplicity();
3316
3317 state._fsp--;
3318
3319 current =iv_ruleRangeMultiplicity;
3320 match(input,EOF,FOLLOW_2);
3321
3322 }
3323
3324 }
3325
3326 catch (RecognitionException re) {
3327 recover(input,re);
3328 appendSkippedTokens();
3329 }
3330 finally {
3331 }
3332 return current;
3333 }
3334 // $ANTLR end "entryRuleRangeMultiplicity"
3335
3336
3337 // $ANTLR start "ruleRangeMultiplicity"
3338 // InternalProblem.g:1289:1: ruleRangeMultiplicity returns [EObject current=null] : ( ( (lv_lowerBound_0_0= RULE_INT ) ) otherlv_1= '..' ( (lv_upperBound_2_0= ruleUpperBound ) ) ) ;
3339 public final EObject ruleRangeMultiplicity() throws RecognitionException {
3340 EObject current = null;
3341
3342 Token lv_lowerBound_0_0=null;
3343 Token otherlv_1=null;
3344 AntlrDatatypeRuleToken lv_upperBound_2_0 = null;
3345
3346
3347
3348 enterRule();
3349
3350 try {
3351 // InternalProblem.g:1295:2: ( ( ( (lv_lowerBound_0_0= RULE_INT ) ) otherlv_1= '..' ( (lv_upperBound_2_0= ruleUpperBound ) ) ) )
3352 // InternalProblem.g:1296:2: ( ( (lv_lowerBound_0_0= RULE_INT ) ) otherlv_1= '..' ( (lv_upperBound_2_0= ruleUpperBound ) ) )
3353 {
3354 // InternalProblem.g:1296:2: ( ( (lv_lowerBound_0_0= RULE_INT ) ) otherlv_1= '..' ( (lv_upperBound_2_0= ruleUpperBound ) ) )
3355 // InternalProblem.g:1297:3: ( (lv_lowerBound_0_0= RULE_INT ) ) otherlv_1= '..' ( (lv_upperBound_2_0= ruleUpperBound ) )
3356 {
3357 // InternalProblem.g:1297:3: ( (lv_lowerBound_0_0= RULE_INT ) )
3358 // InternalProblem.g:1298:4: (lv_lowerBound_0_0= RULE_INT )
3359 {
3360 // InternalProblem.g:1298:4: (lv_lowerBound_0_0= RULE_INT )
3361 // InternalProblem.g:1299:5: lv_lowerBound_0_0= RULE_INT
3362 {
3363 lv_lowerBound_0_0=(Token)match(input,RULE_INT,FOLLOW_29);
3364
3365 newLeafNode(lv_lowerBound_0_0, grammarAccess.getRangeMultiplicityAccess().getLowerBoundINTTerminalRuleCall_0_0());
3366
3367
3368 if (current==null) {
3369 current = createModelElement(grammarAccess.getRangeMultiplicityRule());
3370 }
3371 setWithLastConsumed(
3372 current,
3373 "lowerBound",
3374 lv_lowerBound_0_0,
3375 "org.eclipse.xtext.common.Terminals.INT");
3376
3377
3378 }
3379
3380
3381 }
3382
3383 otherlv_1=(Token)match(input,33,FOLLOW_30);
3384
3385 newLeafNode(otherlv_1, grammarAccess.getRangeMultiplicityAccess().getFullStopFullStopKeyword_1());
3386
3387 // InternalProblem.g:1319:3: ( (lv_upperBound_2_0= ruleUpperBound ) )
3388 // InternalProblem.g:1320:4: (lv_upperBound_2_0= ruleUpperBound )
3389 {
3390 // InternalProblem.g:1320:4: (lv_upperBound_2_0= ruleUpperBound )
3391 // InternalProblem.g:1321:5: lv_upperBound_2_0= ruleUpperBound
3392 {
3393
3394 newCompositeNode(grammarAccess.getRangeMultiplicityAccess().getUpperBoundUpperBoundParserRuleCall_2_0());
3395
3396 pushFollow(FOLLOW_2);
3397 lv_upperBound_2_0=ruleUpperBound();
3398
3399 state._fsp--;
3400
3401
3402 if (current==null) {
3403 current = createModelElementForParent(grammarAccess.getRangeMultiplicityRule());
3404 }
3405 set(
3406 current,
3407 "upperBound",
3408 lv_upperBound_2_0,
3409 "org.eclipse.viatra.solver.language.Problem.UpperBound");
3410 afterParserOrEnumRuleCall();
3411
3412
3413 }
3414
3415
3416 }
3417
3418
3419 }
3420
3421
3422 }
3423
3424
3425 leaveRule();
3426
3427 }
3428
3429 catch (RecognitionException re) {
3430 recover(input,re);
3431 appendSkippedTokens();
3432 }
3433 finally {
3434 }
3435 return current;
3436 }
3437 // $ANTLR end "ruleRangeMultiplicity"
3438
3439
3440 // $ANTLR start "entryRuleExactMultiplicity"
3441 // InternalProblem.g:1342:1: entryRuleExactMultiplicity returns [EObject current=null] : iv_ruleExactMultiplicity= ruleExactMultiplicity EOF ;
3442 public final EObject entryRuleExactMultiplicity() throws RecognitionException {
3443 EObject current = null;
3444
3445 EObject iv_ruleExactMultiplicity = null;
3446
3447
3448 try {
3449 // InternalProblem.g:1342:58: (iv_ruleExactMultiplicity= ruleExactMultiplicity EOF )
3450 // InternalProblem.g:1343:2: iv_ruleExactMultiplicity= ruleExactMultiplicity EOF
3451 {
3452 newCompositeNode(grammarAccess.getExactMultiplicityRule());
3453 pushFollow(FOLLOW_1);
3454 iv_ruleExactMultiplicity=ruleExactMultiplicity();
3455
3456 state._fsp--;
3457
3458 current =iv_ruleExactMultiplicity;
3459 match(input,EOF,FOLLOW_2);
3460
3461 }
3462
3463 }
3464
3465 catch (RecognitionException re) {
3466 recover(input,re);
3467 appendSkippedTokens();
3468 }
3469 finally {
3470 }
3471 return current;
3472 }
3473 // $ANTLR end "entryRuleExactMultiplicity"
3474
3475
3476 // $ANTLR start "ruleExactMultiplicity"
3477 // InternalProblem.g:1349:1: ruleExactMultiplicity returns [EObject current=null] : ( (lv_exactValue_0_0= RULE_INT ) ) ;
3478 public final EObject ruleExactMultiplicity() throws RecognitionException {
3479 EObject current = null;
3480
3481 Token lv_exactValue_0_0=null;
3482
3483
3484 enterRule();
3485
3486 try {
3487 // InternalProblem.g:1355:2: ( ( (lv_exactValue_0_0= RULE_INT ) ) )
3488 // InternalProblem.g:1356:2: ( (lv_exactValue_0_0= RULE_INT ) )
3489 {
3490 // InternalProblem.g:1356:2: ( (lv_exactValue_0_0= RULE_INT ) )
3491 // InternalProblem.g:1357:3: (lv_exactValue_0_0= RULE_INT )
3492 {
3493 // InternalProblem.g:1357:3: (lv_exactValue_0_0= RULE_INT )
3494 // InternalProblem.g:1358:4: lv_exactValue_0_0= RULE_INT
3495 {
3496 lv_exactValue_0_0=(Token)match(input,RULE_INT,FOLLOW_2);
3497
3498 newLeafNode(lv_exactValue_0_0, grammarAccess.getExactMultiplicityAccess().getExactValueINTTerminalRuleCall_0());
3499
3500
3501 if (current==null) {
3502 current = createModelElement(grammarAccess.getExactMultiplicityRule());
3503 }
3504 setWithLastConsumed(
3505 current,
3506 "exactValue",
3507 lv_exactValue_0_0,
3508 "org.eclipse.xtext.common.Terminals.INT");
3509
3510
3511 }
3512
3513
3514 }
3515
3516
3517 }
3518
3519
3520 leaveRule();
3521
3522 }
3523
3524 catch (RecognitionException re) {
3525 recover(input,re);
3526 appendSkippedTokens();
3527 }
3528 finally {
3529 }
3530 return current;
3531 }
3532 // $ANTLR end "ruleExactMultiplicity"
3533
3534
3535 // $ANTLR start "entryRuleUpperBound"
3536 // InternalProblem.g:1377:1: entryRuleUpperBound returns [String current=null] : iv_ruleUpperBound= ruleUpperBound EOF ;
3537 public final String entryRuleUpperBound() throws RecognitionException {
3538 String current = null;
3539
3540 AntlrDatatypeRuleToken iv_ruleUpperBound = null;
3541
3542
3543 try {
3544 // InternalProblem.g:1377:50: (iv_ruleUpperBound= ruleUpperBound EOF )
3545 // InternalProblem.g:1378:2: iv_ruleUpperBound= ruleUpperBound EOF
3546 {
3547 newCompositeNode(grammarAccess.getUpperBoundRule());
3548 pushFollow(FOLLOW_1);
3549 iv_ruleUpperBound=ruleUpperBound();
3550
3551 state._fsp--;
3552
3553 current =iv_ruleUpperBound.getText();
3554 match(input,EOF,FOLLOW_2);
3555
3556 }
3557
3558 }
3559
3560 catch (RecognitionException re) {
3561 recover(input,re);
3562 appendSkippedTokens();
3563 }
3564 finally {
3565 }
3566 return current;
3567 }
3568 // $ANTLR end "entryRuleUpperBound"
3569
3570
3571 // $ANTLR start "ruleUpperBound"
3572 // InternalProblem.g:1384:1: ruleUpperBound returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_INT_0= RULE_INT | kw= '*' ) ;
3573 public final AntlrDatatypeRuleToken ruleUpperBound() throws RecognitionException {
3574 AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
3575
3576 Token this_INT_0=null;
3577 Token kw=null;
3578
3579
3580 enterRule();
3581
3582 try {
3583 // InternalProblem.g:1390:2: ( (this_INT_0= RULE_INT | kw= '*' ) )
3584 // InternalProblem.g:1391:2: (this_INT_0= RULE_INT | kw= '*' )
3585 {
3586 // InternalProblem.g:1391:2: (this_INT_0= RULE_INT | kw= '*' )
3587 int alt31=2;
3588 int LA31_0 = input.LA(1);
3589
3590 if ( (LA31_0==RULE_INT) ) {
3591 alt31=1;
3592 }
3593 else if ( (LA31_0==34) ) {
3594 alt31=2;
3595 }
3596 else {
3597 NoViableAltException nvae =
3598 new NoViableAltException("", 31, 0, input);
3599
3600 throw nvae;
3601 }
3602 switch (alt31) {
3603 case 1 :
3604 // InternalProblem.g:1392:3: this_INT_0= RULE_INT
3605 {
3606 this_INT_0=(Token)match(input,RULE_INT,FOLLOW_2);
3607
3608 current.merge(this_INT_0);
3609
3610
3611 newLeafNode(this_INT_0, grammarAccess.getUpperBoundAccess().getINTTerminalRuleCall_0());
3612
3613
3614 }
3615 break;
3616 case 2 :
3617 // InternalProblem.g:1400:3: kw= '*'
3618 {
3619 kw=(Token)match(input,34,FOLLOW_2);
3620
3621 current.merge(kw);
3622 newLeafNode(kw, grammarAccess.getUpperBoundAccess().getAsteriskKeyword_1());
3623
3624
3625 }
3626 break;
3627
3628 }
3629
3630
3631 }
3632
3633
3634 leaveRule();
3635
3636 }
3637
3638 catch (RecognitionException re) {
3639 recover(input,re);
3640 appendSkippedTokens();
3641 }
3642 finally {
3643 }
3644 return current;
3645 }
3646 // $ANTLR end "ruleUpperBound"
3647
3648
3649 // $ANTLR start "entryRuleQualifiedName"
3650 // InternalProblem.g:1409:1: entryRuleQualifiedName returns [String current=null] : iv_ruleQualifiedName= ruleQualifiedName EOF ;
3651 public final String entryRuleQualifiedName() throws RecognitionException {
3652 String current = null;
3653
3654 AntlrDatatypeRuleToken iv_ruleQualifiedName = null;
3655
3656
3657 try {
3658 // InternalProblem.g:1409:53: (iv_ruleQualifiedName= ruleQualifiedName EOF )
3659 // InternalProblem.g:1410:2: iv_ruleQualifiedName= ruleQualifiedName EOF
3660 {
3661 newCompositeNode(grammarAccess.getQualifiedNameRule());
3662 pushFollow(FOLLOW_1);
3663 iv_ruleQualifiedName=ruleQualifiedName();
3664
3665 state._fsp--;
3666
3667 current =iv_ruleQualifiedName.getText();
3668 match(input,EOF,FOLLOW_2);
3669
3670 }
3671
3672 }
3673
3674 catch (RecognitionException re) {
3675 recover(input,re);
3676 appendSkippedTokens();
3677 }
3678 finally {
3679 }
3680 return current;
3681 }
3682 // $ANTLR end "entryRuleQualifiedName"
3683
3684
3685 // $ANTLR start "ruleQualifiedName"
3686 // InternalProblem.g:1416:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* ) ;
3687 public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException {
3688 AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();
3689
3690 Token this_ID_0=null;
3691 Token kw=null;
3692 Token this_ID_2=null;
3693
3694
3695 enterRule();
3696
3697 try {
3698 // InternalProblem.g:1422:2: ( (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* ) )
3699 // InternalProblem.g:1423:2: (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* )
3700 {
3701 // InternalProblem.g:1423:2: (this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )* )
3702 // InternalProblem.g:1424:3: this_ID_0= RULE_ID (kw= '::' this_ID_2= RULE_ID )*
3703 {
3704 this_ID_0=(Token)match(input,RULE_ID,FOLLOW_31);
3705
3706 current.merge(this_ID_0);
3707
3708
3709 newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0());
3710
3711 // InternalProblem.g:1431:3: (kw= '::' this_ID_2= RULE_ID )*
3712 loop32:
3713 do {
3714 int alt32=2;
3715 int LA32_0 = input.LA(1);
3716
3717 if ( (LA32_0==35) ) {
3718 alt32=1;
3719 }
3720
3721
3722 switch (alt32) {
3723 case 1 :
3724 // InternalProblem.g:1432:4: kw= '::' this_ID_2= RULE_ID
3725 {
3726 kw=(Token)match(input,35,FOLLOW_5);
3727
3728 current.merge(kw);
3729 newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_0());
3730
3731 this_ID_2=(Token)match(input,RULE_ID,FOLLOW_31);
3732
3733 current.merge(this_ID_2);
3734
3735
3736 newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1());
3737
3738
3739 }
3740 break;
3741
3742 default :
3743 break loop32;
3744 }
3745 } while (true);
3746
3747
3748 }
3749
3750
3751 }
3752
3753
3754 leaveRule();
3755
3756 }
3757
3758 catch (RecognitionException re) {
3759 recover(input,re);
3760 appendSkippedTokens();
3761 }
3762 finally {
3763 }
3764 return current;
3765 }
3766 // $ANTLR end "ruleQualifiedName"
3767
3768
3769 // $ANTLR start "ruleLogicValue"
3770 // InternalProblem.g:1449:1: ruleLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ;
3771 public final Enumerator ruleLogicValue() throws RecognitionException {
3772 Enumerator current = null;
3773
3774 Token enumLiteral_0=null;
3775 Token enumLiteral_1=null;
3776 Token enumLiteral_2=null;
3777
3778
3779 enterRule();
3780
3781 try {
3782 // InternalProblem.g:1455:2: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) )
3783 // InternalProblem.g:1456:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) )
3784 {
3785 // InternalProblem.g:1456:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) )
3786 int alt33=3;
3787 switch ( input.LA(1) ) {
3788 case 36:
3789 {
3790 alt33=1;
3791 }
3792 break;
3793 case 37:
3794 {
3795 alt33=2;
3796 }
3797 break;
3798 case 38:
3799 {
3800 alt33=3;
3801 }
3802 break;
3803 default:
3804 NoViableAltException nvae =
3805 new NoViableAltException("", 33, 0, input);
3806
3807 throw nvae;
3808 }
3809
3810 switch (alt33) {
3811 case 1 :
3812 // InternalProblem.g:1457:3: (enumLiteral_0= 'true' )
3813 {
3814 // InternalProblem.g:1457:3: (enumLiteral_0= 'true' )
3815 // InternalProblem.g:1458:4: enumLiteral_0= 'true'
3816 {
3817 enumLiteral_0=(Token)match(input,36,FOLLOW_2);
3818
3819 current = grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
3820 newLeafNode(enumLiteral_0, grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0());
3821
3822
3823 }
3824
3825
3826 }
3827 break;
3828 case 2 :
3829 // InternalProblem.g:1465:3: (enumLiteral_1= 'false' )
3830 {
3831 // InternalProblem.g:1465:3: (enumLiteral_1= 'false' )
3832 // InternalProblem.g:1466:4: enumLiteral_1= 'false'
3833 {
3834 enumLiteral_1=(Token)match(input,37,FOLLOW_2);
3835
3836 current = grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
3837 newLeafNode(enumLiteral_1, grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1());
3838
3839
3840 }
3841
3842
3843 }
3844 break;
3845 case 3 :
3846 // InternalProblem.g:1473:3: (enumLiteral_2= 'unknown' )
3847 {
3848 // InternalProblem.g:1473:3: (enumLiteral_2= 'unknown' )
3849 // InternalProblem.g:1474:4: enumLiteral_2= 'unknown'
3850 {
3851 enumLiteral_2=(Token)match(input,38,FOLLOW_2);
3852
3853 current = grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
3854 newLeafNode(enumLiteral_2, grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2());
3855
3856
3857 }
3858
3859
3860 }
3861 break;
3862
3863 }
3864
3865
3866 }
3867
3868
3869 leaveRule();
3870
3871 }
3872
3873 catch (RecognitionException re) {
3874 recover(input,re);
3875 appendSkippedTokens();
3876 }
3877 finally {
3878 }
3879 return current;
3880 }
3881 // $ANTLR end "ruleLogicValue"
3882
3883
3884 // $ANTLR start "ruleShortLogicValue"
3885 // InternalProblem.g:1484:1: ruleShortLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ;
3886 public final Enumerator ruleShortLogicValue() throws RecognitionException {
3887 Enumerator current = null;
3888
3889 Token enumLiteral_0=null;
3890 Token enumLiteral_1=null;
3891
3892
3893 enterRule();
3894
3895 try {
3896 // InternalProblem.g:1490:2: ( ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) )
3897 // InternalProblem.g:1491:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) )
3898 {
3899 // InternalProblem.g:1491:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) )
3900 int alt34=2;
3901 int LA34_0 = input.LA(1);
3902
3903 if ( (LA34_0==27) ) {
3904 alt34=1;
3905 }
3906 else if ( (LA34_0==39) ) {
3907 alt34=2;
3908 }
3909 else {
3910 NoViableAltException nvae =
3911 new NoViableAltException("", 34, 0, input);
3912
3913 throw nvae;
3914 }
3915 switch (alt34) {
3916 case 1 :
3917 // InternalProblem.g:1492:3: (enumLiteral_0= '!' )
3918 {
3919 // InternalProblem.g:1492:3: (enumLiteral_0= '!' )
3920 // InternalProblem.g:1493:4: enumLiteral_0= '!'
3921 {
3922 enumLiteral_0=(Token)match(input,27,FOLLOW_2);
3923
3924 current = grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
3925 newLeafNode(enumLiteral_0, grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0());
3926
3927
3928 }
3929
3930
3931 }
3932 break;
3933 case 2 :
3934 // InternalProblem.g:1500:3: (enumLiteral_1= '?' )
3935 {
3936 // InternalProblem.g:1500:3: (enumLiteral_1= '?' )
3937 // InternalProblem.g:1501:4: enumLiteral_1= '?'
3938 {
3939 enumLiteral_1=(Token)match(input,39,FOLLOW_2);
3940
3941 current = grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
3942 newLeafNode(enumLiteral_1, grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1());
3943
3944
3945 }
3946
3947
3948 }
3949 break;
3950
3951 }
3952
3953
3954 }
3955
3956
3957 leaveRule();
3958
3959 }
3960
3961 catch (RecognitionException re) {
3962 recover(input,re);
3963 appendSkippedTokens();
3964 }
3965 finally {
3966 }
3967 return current;
3968 }
3969 // $ANTLR end "ruleShortLogicValue"
3970
3971 // Delegated rules
3972
3973
3974 protected DFA27 dfa27 = new DFA27(this);
3975 static final String dfa_1s = "\17\uffff";
3976 static final String dfa_2s = "\1\4\1\27\1\uffff\2\4\1\27\1\17\1\21\2\4\1\uffff\2\17\1\4\1\17";
3977 static final String dfa_3s = "\1\47\1\43\1\uffff\1\4\1\30\2\43\1\35\2\4\1\uffff\2\43\1\4\1\43";
3978 static final String dfa_4s = "\2\uffff\1\2\7\uffff\1\1\4\uffff";
3979 static final String dfa_5s = "\17\uffff}>";
3980 static final String[] dfa_6s = {
3981 "\1\1\26\uffff\1\2\13\uffff\1\2",
3982 "\1\4\13\uffff\1\3",
3983 "",
3984 "\1\5",
3985 "\1\6\23\uffff\1\7",
3986 "\1\4\13\uffff\1\3",
3987 "\1\11\10\uffff\1\7\12\uffff\1\10",
3988 "\1\2\13\uffff\1\12",
3989 "\1\13",
3990 "\1\14",
3991 "",
3992 "\1\11\10\uffff\1\7\12\uffff\1\10",
3993 "\1\11\10\uffff\1\7\12\uffff\1\15",
3994 "\1\16",
3995 "\1\11\10\uffff\1\7\12\uffff\1\15"
3996 };
3997
3998 static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s);
3999 static final char[] dfa_2 = DFA.unpackEncodedStringToUnsignedChars(dfa_2s);
4000 static final char[] dfa_3 = DFA.unpackEncodedStringToUnsignedChars(dfa_3s);
4001 static final short[] dfa_4 = DFA.unpackEncodedString(dfa_4s);
4002 static final short[] dfa_5 = DFA.unpackEncodedString(dfa_5s);
4003 static final short[][] dfa_6 = unpackEncodedStringArray(dfa_6s);
4004
4005 class DFA27 extends DFA {
4006
4007 public DFA27(BaseRecognizer recognizer) {
4008 this.recognizer = recognizer;
4009 this.decisionNumber = 27;
4010 this.eot = dfa_1;
4011 this.eof = dfa_1;
4012 this.min = dfa_2;
4013 this.max = dfa_3;
4014 this.accept = dfa_4;
4015 this.special = dfa_5;
4016 this.transition = dfa_6;
4017 }
4018 public String getDescription() {
4019 return "918:3: ( ( ( ( ruleQualifiedName ) ) otherlv_1= '(' ( ( ( ruleQualifiedName ) ) (otherlv_3= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_5= ')' otherlv_6= ':' ( (lv_value_7_0= ruleLogicValue ) ) ) | ( ( (lv_value_8_0= ruleShortLogicValue ) )? ( ( ruleQualifiedName ) ) otherlv_10= '(' ( ( ( ruleQualifiedName ) ) (otherlv_12= ',' ( ( ruleQualifiedName ) ) )* )? otherlv_14= ')' ) )";
4020 }
4021 }
4022
4023
4024 public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
4025 public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
4026 public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000008048601812L});
4027 public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000001000L});
4028 public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000000010L});
4029 public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x00000000000EA000L});
4030 public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000004010L});
4031 public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000028000L});
4032 public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000010010L});
4033 public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000018000L});
4034 public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00000000000C0000L});
4035 public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000004000L});
4036 public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000000000020L});
4037 public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000010000L});
4038 public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100002L});
4039 public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000400010L});
4040 public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000800000L});
4041 public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000001000010L});
4042 public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000001008000L});
4043 public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000000002020000L});
4044 public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000008000010L});
4045 public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000000004020000L});
4046 public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000000008002L});
4047 public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000010800000L});
4048 public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000020000000L});
4049 public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000007000000000L});
4050 public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000000020000L});
4051 public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000180000000L});
4052 public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000200000000L});
4053 public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x0000000400000020L});
4054 public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000800000002L});
4055
4056} \ No newline at end of file
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/scoping/AbstractProblemScopeProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/scoping/AbstractProblemScopeProvider.java
new file mode 100644
index 00000000..5b024d47
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/scoping/AbstractProblemScopeProvider.java
@@ -0,0 +1,9 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.scoping;
5
6import org.eclipse.xtext.scoping.impl.DelegatingScopeProvider;
7
8public abstract class AbstractProblemScopeProvider extends DelegatingScopeProvider {
9}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java
new file mode 100644
index 00000000..a857b997
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSemanticSequencer.java
@@ -0,0 +1,296 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.serializer;
5
6import com.google.inject.Inject;
7import java.util.Set;
8import org.eclipse.emf.ecore.EObject;
9import org.eclipse.emf.ecore.EPackage;
10import org.eclipse.viatra.solver.language.model.problem.Assertion;
11import org.eclipse.viatra.solver.language.model.problem.Atom;
12import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration;
13import org.eclipse.viatra.solver.language.model.problem.Conjunction;
14import org.eclipse.viatra.solver.language.model.problem.ExactMultiplicity;
15import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral;
16import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition;
17import org.eclipse.viatra.solver.language.model.problem.Problem;
18import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
19import org.eclipse.viatra.solver.language.model.problem.RangeMultiplicity;
20import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration;
21import org.eclipse.viatra.solver.language.model.problem.ScopeDeclaration;
22import org.eclipse.viatra.solver.language.model.problem.TypeScope;
23import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
24import org.eclipse.xtext.Action;
25import org.eclipse.xtext.Parameter;
26import org.eclipse.xtext.ParserRule;
27import org.eclipse.xtext.serializer.ISerializationContext;
28import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
29import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
30import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
31
32@SuppressWarnings("all")
33public class ProblemSemanticSequencer extends AbstractDelegatingSemanticSequencer {
34
35 @Inject
36 private ProblemGrammarAccess grammarAccess;
37
38 @Override
39 public void sequence(ISerializationContext context, EObject semanticObject) {
40 EPackage epackage = semanticObject.eClass().getEPackage();
41 ParserRule rule = context.getParserRule();
42 Action action = context.getAssignedAction();
43 Set<Parameter> parameters = context.getEnabledBooleanParameters();
44 if (epackage == ProblemPackage.eINSTANCE)
45 switch (semanticObject.eClass().getClassifierID()) {
46 case ProblemPackage.ASSERTION:
47 sequence_Assertion(context, (Assertion) semanticObject);
48 return;
49 case ProblemPackage.ATOM:
50 sequence_Atom(context, (Atom) semanticObject);
51 return;
52 case ProblemPackage.CLASS_DECLARATION:
53 sequence_ClassDeclaration(context, (ClassDeclaration) semanticObject);
54 return;
55 case ProblemPackage.CONJUNCTION:
56 sequence_Conjunction(context, (Conjunction) semanticObject);
57 return;
58 case ProblemPackage.EXACT_MULTIPLICITY:
59 sequence_ExactMultiplicity(context, (ExactMultiplicity) semanticObject);
60 return;
61 case ProblemPackage.NEGATIVE_LITERAL:
62 sequence_NegativeLiteral(context, (NegativeLiteral) semanticObject);
63 return;
64 case ProblemPackage.PARAMETER:
65 sequence_Parameter(context, (org.eclipse.viatra.solver.language.model.problem.Parameter) semanticObject);
66 return;
67 case ProblemPackage.PREDICATE_DEFINITION:
68 sequence_PredicateDefinition(context, (PredicateDefinition) semanticObject);
69 return;
70 case ProblemPackage.PROBLEM:
71 sequence_Problem(context, (Problem) semanticObject);
72 return;
73 case ProblemPackage.RANGE_MULTIPLICITY:
74 sequence_RangeMultiplicity(context, (RangeMultiplicity) semanticObject);
75 return;
76 case ProblemPackage.REFERENCE_DECLARATION:
77 sequence_ReferenceDeclaration(context, (ReferenceDeclaration) semanticObject);
78 return;
79 case ProblemPackage.SCOPE_DECLARATION:
80 sequence_ScopeDeclaration(context, (ScopeDeclaration) semanticObject);
81 return;
82 case ProblemPackage.TYPE_SCOPE:
83 sequence_TypeScope(context, (TypeScope) semanticObject);
84 return;
85 }
86 if (errorAcceptor != null)
87 errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
88 }
89
90 /**
91 * Contexts:
92 * Statement returns Assertion
93 * Assertion returns Assertion
94 *
95 * Constraint:
96 * (
97 * (relation=[Relation|QualifiedName] (arguments+=[Node|QualifiedName] arguments+=[Node|QualifiedName]*)? value=LogicValue) |
98 * (value=ShortLogicValue? relation=[Relation|QualifiedName] (arguments+=[Node|QualifiedName] arguments+=[Node|QualifiedName]*)?)
99 * )
100 */
101 protected void sequence_Assertion(ISerializationContext context, Assertion semanticObject) {
102 genericSequencer.createSequence(context, semanticObject);
103 }
104
105
106 /**
107 * Contexts:
108 * Literal returns Atom
109 * Atom returns Atom
110 *
111 * Constraint:
112 * (relation=[Relation|QualifiedName] transitiveClosure?='+'? (arguments+=[Variable|ID] arguments+=[Variable|ID]*)?)
113 */
114 protected void sequence_Atom(ISerializationContext context, Atom semanticObject) {
115 genericSequencer.createSequence(context, semanticObject);
116 }
117
118
119 /**
120 * Contexts:
121 * Statement returns ClassDeclaration
122 * ClassDeclaration returns ClassDeclaration
123 *
124 * Constraint:
125 * (
126 * abstract?='abstract'?
127 * name=ID
128 * (
129 * superTypes+=[ClassDeclaration|ID] |
130 * (superTypes+=[ClassDeclaration|ID] superTypes+=[ClassDeclaration|ID]*) |
131 * referenceDeclarations+=ReferenceDeclaration
132 * )?
133 * referenceDeclarations+=ReferenceDeclaration*
134 * )
135 */
136 protected void sequence_ClassDeclaration(ISerializationContext context, ClassDeclaration semanticObject) {
137 genericSequencer.createSequence(context, semanticObject);
138 }
139
140
141 /**
142 * Contexts:
143 * Conjunction returns Conjunction
144 *
145 * Constraint:
146 * (literals+=Literal literals+=Literal*)
147 */
148 protected void sequence_Conjunction(ISerializationContext context, Conjunction semanticObject) {
149 genericSequencer.createSequence(context, semanticObject);
150 }
151
152
153 /**
154 * Contexts:
155 * Multiplicity returns ExactMultiplicity
156 * ExactMultiplicity returns ExactMultiplicity
157 *
158 * Constraint:
159 * exactValue=INT
160 */
161 protected void sequence_ExactMultiplicity(ISerializationContext context, ExactMultiplicity semanticObject) {
162 if (errorAcceptor != null) {
163 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.EXACT_MULTIPLICITY__EXACT_VALUE) == ValueTransient.YES)
164 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.EXACT_MULTIPLICITY__EXACT_VALUE));
165 }
166 SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
167 feeder.accept(grammarAccess.getExactMultiplicityAccess().getExactValueINTTerminalRuleCall_0(), semanticObject.getExactValue());
168 feeder.finish();
169 }
170
171
172 /**
173 * Contexts:
174 * Literal returns NegativeLiteral
175 * NegativeLiteral returns NegativeLiteral
176 *
177 * Constraint:
178 * atom=Atom
179 */
180 protected void sequence_NegativeLiteral(ISerializationContext context, NegativeLiteral semanticObject) {
181 if (errorAcceptor != null) {
182 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.NEGATIVE_LITERAL__ATOM) == ValueTransient.YES)
183 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.NEGATIVE_LITERAL__ATOM));
184 }
185 SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
186 feeder.accept(grammarAccess.getNegativeLiteralAccess().getAtomAtomParserRuleCall_1_0(), semanticObject.getAtom());
187 feeder.finish();
188 }
189
190
191 /**
192 * Contexts:
193 * Parameter returns Parameter
194 *
195 * Constraint:
196 * (parameterType=[ClassDeclaration|ID] name=ID)
197 */
198 protected void sequence_Parameter(ISerializationContext context, org.eclipse.viatra.solver.language.model.problem.Parameter semanticObject) {
199 if (errorAcceptor != null) {
200 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.PARAMETER__PARAMETER_TYPE) == ValueTransient.YES)
201 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.PARAMETER__PARAMETER_TYPE));
202 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.NAMED_ELEMENT__NAME) == ValueTransient.YES)
203 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.NAMED_ELEMENT__NAME));
204 }
205 SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
206 feeder.accept(grammarAccess.getParameterAccess().getParameterTypeClassDeclarationIDTerminalRuleCall_0_0_1(), semanticObject.eGet(ProblemPackage.Literals.PARAMETER__PARAMETER_TYPE, false));
207 feeder.accept(grammarAccess.getParameterAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
208 feeder.finish();
209 }
210
211
212 /**
213 * Contexts:
214 * Statement returns PredicateDefinition
215 * PredicateDefinition returns PredicateDefinition
216 *
217 * Constraint:
218 * (error?='error'? name=ID (parameters+=Parameter parameters+=Parameter*)? (bodies+=Conjunction bodies+=Conjunction*)?)
219 */
220 protected void sequence_PredicateDefinition(ISerializationContext context, PredicateDefinition semanticObject) {
221 genericSequencer.createSequence(context, semanticObject);
222 }
223
224
225 /**
226 * Contexts:
227 * Problem returns Problem
228 *
229 * Constraint:
230 * statements+=Statement+
231 */
232 protected void sequence_Problem(ISerializationContext context, Problem semanticObject) {
233 genericSequencer.createSequence(context, semanticObject);
234 }
235
236
237 /**
238 * Contexts:
239 * Multiplicity returns RangeMultiplicity
240 * RangeMultiplicity returns RangeMultiplicity
241 *
242 * Constraint:
243 * (lowerBound=INT upperBound=UpperBound)
244 */
245 protected void sequence_RangeMultiplicity(ISerializationContext context, RangeMultiplicity semanticObject) {
246 if (errorAcceptor != null) {
247 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.RANGE_MULTIPLICITY__LOWER_BOUND) == ValueTransient.YES)
248 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.RANGE_MULTIPLICITY__LOWER_BOUND));
249 if (transientValues.isValueTransient(semanticObject, ProblemPackage.Literals.RANGE_MULTIPLICITY__UPPER_BOUND) == ValueTransient.YES)
250 errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ProblemPackage.Literals.RANGE_MULTIPLICITY__UPPER_BOUND));
251 }
252 SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
253 feeder.accept(grammarAccess.getRangeMultiplicityAccess().getLowerBoundINTTerminalRuleCall_0_0(), semanticObject.getLowerBound());
254 feeder.accept(grammarAccess.getRangeMultiplicityAccess().getUpperBoundUpperBoundParserRuleCall_2_0(), semanticObject.getUpperBound());
255 feeder.finish();
256 }
257
258
259 /**
260 * Contexts:
261 * ReferenceDeclaration returns ReferenceDeclaration
262 *
263 * Constraint:
264 * (containment?='contains'? referenceType=[ClassDeclaration|ID] multiplicity=Multiplicity name=ID opposite=[ReferenceDeclaration|QualifiedName]?)
265 */
266 protected void sequence_ReferenceDeclaration(ISerializationContext context, ReferenceDeclaration semanticObject) {
267 genericSequencer.createSequence(context, semanticObject);
268 }
269
270
271 /**
272 * Contexts:
273 * Statement returns ScopeDeclaration
274 * ScopeDeclaration returns ScopeDeclaration
275 *
276 * Constraint:
277 * (typeScopes+=TypeScope typeScopes+=TypeScope*)
278 */
279 protected void sequence_ScopeDeclaration(ISerializationContext context, ScopeDeclaration semanticObject) {
280 genericSequencer.createSequence(context, semanticObject);
281 }
282
283
284 /**
285 * Contexts:
286 * TypeScope returns TypeScope
287 *
288 * Constraint:
289 * (targetType=[ClassDeclaration|ID] increment?='+='? multiplicity=Multiplicity)
290 */
291 protected void sequence_TypeScope(ISerializationContext context, TypeScope semanticObject) {
292 genericSequencer.createSequence(context, semanticObject);
293 }
294
295
296}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSyntacticSequencer.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSyntacticSequencer.java
new file mode 100644
index 00000000..3ffb6315
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer/ProblemSyntacticSequencer.java
@@ -0,0 +1,77 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.serializer;
5
6import com.google.inject.Inject;
7import java.util.List;
8import org.eclipse.emf.ecore.EObject;
9import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
10import org.eclipse.xtext.IGrammarAccess;
11import org.eclipse.xtext.RuleCall;
12import org.eclipse.xtext.nodemodel.INode;
13import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
14import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias;
15import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;
16import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable;
17import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
18import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
19
20@SuppressWarnings("all")
21public class ProblemSyntacticSequencer extends AbstractSyntacticSequencer {
22
23 protected ProblemGrammarAccess grammarAccess;
24 protected AbstractElementAlias match_ClassDeclaration___ExtendsKeyword_3_0_0_LeftSquareBracketKeyword_3_0_1_1_0_RightSquareBracketKeyword_3_0_1_1_2__q;
25 protected AbstractElementAlias match_PredicateDefinition_PredKeyword_0_0_1_q;
26
27 @Inject
28 protected void init(IGrammarAccess access) {
29 grammarAccess = (ProblemGrammarAccess) access;
30 match_ClassDeclaration___ExtendsKeyword_3_0_0_LeftSquareBracketKeyword_3_0_1_1_0_RightSquareBracketKeyword_3_0_1_1_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getExtendsKeyword_3_0_0()), new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getLeftSquareBracketKeyword_3_0_1_1_0()), new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getRightSquareBracketKeyword_3_0_1_1_2()));
31 match_PredicateDefinition_PredKeyword_0_0_1_q = new TokenAlias(false, true, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1());
32 }
33
34 @Override
35 protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
36 return "";
37 }
38
39
40 @Override
41 protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
42 if (transition.getAmbiguousSyntaxes().isEmpty()) return;
43 List<INode> transitionNodes = collectNodes(fromNode, toNode);
44 for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
45 List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
46 if (match_ClassDeclaration___ExtendsKeyword_3_0_0_LeftSquareBracketKeyword_3_0_1_1_0_RightSquareBracketKeyword_3_0_1_1_2__q.equals(syntax))
47 emit_ClassDeclaration___ExtendsKeyword_3_0_0_LeftSquareBracketKeyword_3_0_1_1_0_RightSquareBracketKeyword_3_0_1_1_2__q(semanticObject, getLastNavigableState(), syntaxNodes);
48 else if (match_PredicateDefinition_PredKeyword_0_0_1_q.equals(syntax))
49 emit_PredicateDefinition_PredKeyword_0_0_1_q(semanticObject, getLastNavigableState(), syntaxNodes);
50 else acceptNodes(getLastNavigableState(), syntaxNodes);
51 }
52 }
53
54 /**
55 * Ambiguous syntax:
56 * ('extends' '[' ']')?
57 *
58 * This ambiguous syntax occurs at:
59 * name=ID (ambiguity) ',' referenceDeclarations+=ReferenceDeclaration
60 * name=ID (ambiguity) '.' (rule end)
61 */
62 protected void emit_ClassDeclaration___ExtendsKeyword_3_0_0_LeftSquareBracketKeyword_3_0_1_1_0_RightSquareBracketKeyword_3_0_1_1_2__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
63 acceptNodes(transition, nodes);
64 }
65
66 /**
67 * Ambiguous syntax:
68 * 'pred'?
69 *
70 * This ambiguous syntax occurs at:
71 * error?='error' (ambiguity) name=ID
72 */
73 protected void emit_PredicateDefinition_PredKeyword_0_0_1_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
74 acceptNodes(transition, nodes);
75 }
76
77}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java
new file mode 100644
index 00000000..7d6b7013
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java
@@ -0,0 +1,1411 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.services;
5
6import com.google.inject.Inject;
7import com.google.inject.Singleton;
8import java.util.List;
9import org.eclipse.xtext.Alternatives;
10import org.eclipse.xtext.Assignment;
11import org.eclipse.xtext.CrossReference;
12import org.eclipse.xtext.EnumLiteralDeclaration;
13import org.eclipse.xtext.EnumRule;
14import org.eclipse.xtext.Grammar;
15import org.eclipse.xtext.GrammarUtil;
16import org.eclipse.xtext.Group;
17import org.eclipse.xtext.Keyword;
18import org.eclipse.xtext.ParserRule;
19import org.eclipse.xtext.RuleCall;
20import org.eclipse.xtext.TerminalRule;
21import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
22import org.eclipse.xtext.service.AbstractElementFinder;
23import org.eclipse.xtext.service.GrammarProvider;
24
25@Singleton
26public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarElementFinder {
27
28 public class ProblemElements extends AbstractParserRuleElementFinder {
29 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Problem");
30 private final Assignment cStatementsAssignment = (Assignment)rule.eContents().get(1);
31 private final RuleCall cStatementsStatementParserRuleCall_0 = (RuleCall)cStatementsAssignment.eContents().get(0);
32
33 //Problem:
34 // statements+=Statement*;
35 @Override public ParserRule getRule() { return rule; }
36
37 //statements+=Statement*
38 public Assignment getStatementsAssignment() { return cStatementsAssignment; }
39
40 //Statement
41 public RuleCall getStatementsStatementParserRuleCall_0() { return cStatementsStatementParserRuleCall_0; }
42 }
43 public class StatementElements extends AbstractParserRuleElementFinder {
44 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Statement");
45 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
46 private final RuleCall cClassDeclarationParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
47 private final RuleCall cPredicateDefinitionParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
48 private final RuleCall cAssertionParserRuleCall_2 = (RuleCall)cAlternatives.eContents().get(2);
49 private final RuleCall cScopeDeclarationParserRuleCall_3 = (RuleCall)cAlternatives.eContents().get(3);
50
51 //Statement:
52 // ClassDeclaration | PredicateDefinition | Assertion | ScopeDeclaration;
53 @Override public ParserRule getRule() { return rule; }
54
55 //ClassDeclaration | PredicateDefinition | Assertion | ScopeDeclaration
56 public Alternatives getAlternatives() { return cAlternatives; }
57
58 //ClassDeclaration
59 public RuleCall getClassDeclarationParserRuleCall_0() { return cClassDeclarationParserRuleCall_0; }
60
61 //PredicateDefinition
62 public RuleCall getPredicateDefinitionParserRuleCall_1() { return cPredicateDefinitionParserRuleCall_1; }
63
64 //Assertion
65 public RuleCall getAssertionParserRuleCall_2() { return cAssertionParserRuleCall_2; }
66
67 //ScopeDeclaration
68 public RuleCall getScopeDeclarationParserRuleCall_3() { return cScopeDeclarationParserRuleCall_3; }
69 }
70 public class ClassDeclarationElements extends AbstractParserRuleElementFinder {
71 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ClassDeclaration");
72 private final Group cGroup = (Group)rule.eContents().get(1);
73 private final Assignment cAbstractAssignment_0 = (Assignment)cGroup.eContents().get(0);
74 private final Keyword cAbstractAbstractKeyword_0_0 = (Keyword)cAbstractAssignment_0.eContents().get(0);
75 private final Keyword cClassKeyword_1 = (Keyword)cGroup.eContents().get(1);
76 private final Assignment cNameAssignment_2 = (Assignment)cGroup.eContents().get(2);
77 private final RuleCall cNameIDTerminalRuleCall_2_0 = (RuleCall)cNameAssignment_2.eContents().get(0);
78 private final Alternatives cAlternatives_3 = (Alternatives)cGroup.eContents().get(3);
79 private final Group cGroup_3_0 = (Group)cAlternatives_3.eContents().get(0);
80 private final Keyword cExtendsKeyword_3_0_0 = (Keyword)cGroup_3_0.eContents().get(0);
81 private final Alternatives cAlternatives_3_0_1 = (Alternatives)cGroup_3_0.eContents().get(1);
82 private final Assignment cSuperTypesAssignment_3_0_1_0 = (Assignment)cAlternatives_3_0_1.eContents().get(0);
83 private final CrossReference cSuperTypesClassDeclarationCrossReference_3_0_1_0_0 = (CrossReference)cSuperTypesAssignment_3_0_1_0.eContents().get(0);
84 private final RuleCall cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_0_0_1 = (RuleCall)cSuperTypesClassDeclarationCrossReference_3_0_1_0_0.eContents().get(1);
85 private final Group cGroup_3_0_1_1 = (Group)cAlternatives_3_0_1.eContents().get(1);
86 private final Keyword cLeftSquareBracketKeyword_3_0_1_1_0 = (Keyword)cGroup_3_0_1_1.eContents().get(0);
87 private final Group cGroup_3_0_1_1_1 = (Group)cGroup_3_0_1_1.eContents().get(1);
88 private final Assignment cSuperTypesAssignment_3_0_1_1_1_0 = (Assignment)cGroup_3_0_1_1_1.eContents().get(0);
89 private final CrossReference cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0 = (CrossReference)cSuperTypesAssignment_3_0_1_1_1_0.eContents().get(0);
90 private final RuleCall cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_0_0_1 = (RuleCall)cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0.eContents().get(1);
91 private final Group cGroup_3_0_1_1_1_1 = (Group)cGroup_3_0_1_1_1.eContents().get(1);
92 private final Keyword cCommaKeyword_3_0_1_1_1_1_0 = (Keyword)cGroup_3_0_1_1_1_1.eContents().get(0);
93 private final Assignment cSuperTypesAssignment_3_0_1_1_1_1_1 = (Assignment)cGroup_3_0_1_1_1_1.eContents().get(1);
94 private final CrossReference cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0 = (CrossReference)cSuperTypesAssignment_3_0_1_1_1_1_1.eContents().get(0);
95 private final RuleCall cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_1_1_0_1 = (RuleCall)cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0.eContents().get(1);
96 private final Keyword cRightSquareBracketKeyword_3_0_1_1_2 = (Keyword)cGroup_3_0_1_1.eContents().get(2);
97 private final Assignment cReferenceDeclarationsAssignment_3_1 = (Assignment)cAlternatives_3.eContents().get(1);
98 private final RuleCall cReferenceDeclarationsReferenceDeclarationParserRuleCall_3_1_0 = (RuleCall)cReferenceDeclarationsAssignment_3_1.eContents().get(0);
99 private final Group cGroup_4 = (Group)cGroup.eContents().get(4);
100 private final Keyword cCommaKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0);
101 private final Assignment cReferenceDeclarationsAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1);
102 private final RuleCall cReferenceDeclarationsReferenceDeclarationParserRuleCall_4_1_0 = (RuleCall)cReferenceDeclarationsAssignment_4_1.eContents().get(0);
103 private final Keyword cFullStopKeyword_5 = (Keyword)cGroup.eContents().get(5);
104
105 //ClassDeclaration:
106 // abstract?="abstract"? "class"
107 // name=ID
108 // ("extends" (superTypes+=[ClassDeclaration] |
109 // "[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]") |
110 // referenceDeclarations+=ReferenceDeclaration)?
111 // ("," referenceDeclarations+=ReferenceDeclaration)*
112 // ".";
113 @Override public ParserRule getRule() { return rule; }
114
115 //abstract?="abstract"? "class"
116 //name=ID
117 //("extends" (superTypes+=[ClassDeclaration] |
118 //"[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]") |
119 //referenceDeclarations+=ReferenceDeclaration)?
120 //("," referenceDeclarations+=ReferenceDeclaration)*
121 //"."
122 public Group getGroup() { return cGroup; }
123
124 //abstract?="abstract"?
125 public Assignment getAbstractAssignment_0() { return cAbstractAssignment_0; }
126
127 //"abstract"
128 public Keyword getAbstractAbstractKeyword_0_0() { return cAbstractAbstractKeyword_0_0; }
129
130 //"class"
131 public Keyword getClassKeyword_1() { return cClassKeyword_1; }
132
133 //name=ID
134 public Assignment getNameAssignment_2() { return cNameAssignment_2; }
135
136 //ID
137 public RuleCall getNameIDTerminalRuleCall_2_0() { return cNameIDTerminalRuleCall_2_0; }
138
139 //("extends" (superTypes+=[ClassDeclaration] |
140 //"[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]") |
141 //referenceDeclarations+=ReferenceDeclaration)?
142 public Alternatives getAlternatives_3() { return cAlternatives_3; }
143
144 //"extends" (superTypes+=[ClassDeclaration] |
145 // "[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]")
146 public Group getGroup_3_0() { return cGroup_3_0; }
147
148 //"extends"
149 public Keyword getExtendsKeyword_3_0_0() { return cExtendsKeyword_3_0_0; }
150
151 //(superTypes+=[ClassDeclaration] |
152 // "[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]")
153 public Alternatives getAlternatives_3_0_1() { return cAlternatives_3_0_1; }
154
155 //superTypes+=[ClassDeclaration]
156 public Assignment getSuperTypesAssignment_3_0_1_0() { return cSuperTypesAssignment_3_0_1_0; }
157
158 //[ClassDeclaration]
159 public CrossReference getSuperTypesClassDeclarationCrossReference_3_0_1_0_0() { return cSuperTypesClassDeclarationCrossReference_3_0_1_0_0; }
160
161 //ID
162 public RuleCall getSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_0_0_1() { return cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_0_0_1; }
163
164 //"[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]"
165 public Group getGroup_3_0_1_1() { return cGroup_3_0_1_1; }
166
167 //"["
168 public Keyword getLeftSquareBracketKeyword_3_0_1_1_0() { return cLeftSquareBracketKeyword_3_0_1_1_0; }
169
170 //(superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)?
171 public Group getGroup_3_0_1_1_1() { return cGroup_3_0_1_1_1; }
172
173 //superTypes+=[ClassDeclaration]
174 public Assignment getSuperTypesAssignment_3_0_1_1_1_0() { return cSuperTypesAssignment_3_0_1_1_1_0; }
175
176 //[ClassDeclaration]
177 public CrossReference getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0() { return cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_0_0; }
178
179 //ID
180 public RuleCall getSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_0_0_1() { return cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_0_0_1; }
181
182 //("," superTypes+=[ClassDeclaration])*
183 public Group getGroup_3_0_1_1_1_1() { return cGroup_3_0_1_1_1_1; }
184
185 //","
186 public Keyword getCommaKeyword_3_0_1_1_1_1_0() { return cCommaKeyword_3_0_1_1_1_1_0; }
187
188 //superTypes+=[ClassDeclaration]
189 public Assignment getSuperTypesAssignment_3_0_1_1_1_1_1() { return cSuperTypesAssignment_3_0_1_1_1_1_1; }
190
191 //[ClassDeclaration]
192 public CrossReference getSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0() { return cSuperTypesClassDeclarationCrossReference_3_0_1_1_1_1_1_0; }
193
194 //ID
195 public RuleCall getSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_1_1_0_1() { return cSuperTypesClassDeclarationIDTerminalRuleCall_3_0_1_1_1_1_1_0_1; }
196
197 //"]"
198 public Keyword getRightSquareBracketKeyword_3_0_1_1_2() { return cRightSquareBracketKeyword_3_0_1_1_2; }
199
200 //referenceDeclarations+=ReferenceDeclaration
201 public Assignment getReferenceDeclarationsAssignment_3_1() { return cReferenceDeclarationsAssignment_3_1; }
202
203 //ReferenceDeclaration
204 public RuleCall getReferenceDeclarationsReferenceDeclarationParserRuleCall_3_1_0() { return cReferenceDeclarationsReferenceDeclarationParserRuleCall_3_1_0; }
205
206 //("," referenceDeclarations+=ReferenceDeclaration)*
207 public Group getGroup_4() { return cGroup_4; }
208
209 //","
210 public Keyword getCommaKeyword_4_0() { return cCommaKeyword_4_0; }
211
212 //referenceDeclarations+=ReferenceDeclaration
213 public Assignment getReferenceDeclarationsAssignment_4_1() { return cReferenceDeclarationsAssignment_4_1; }
214
215 //ReferenceDeclaration
216 public RuleCall getReferenceDeclarationsReferenceDeclarationParserRuleCall_4_1_0() { return cReferenceDeclarationsReferenceDeclarationParserRuleCall_4_1_0; }
217
218 //"."
219 public Keyword getFullStopKeyword_5() { return cFullStopKeyword_5; }
220 }
221 public class ReferenceDeclarationElements extends AbstractParserRuleElementFinder {
222 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ReferenceDeclaration");
223 private final Group cGroup = (Group)rule.eContents().get(1);
224 private final Alternatives cAlternatives_0 = (Alternatives)cGroup.eContents().get(0);
225 private final Assignment cContainmentAssignment_0_0 = (Assignment)cAlternatives_0.eContents().get(0);
226 private final Keyword cContainmentContainsKeyword_0_0_0 = (Keyword)cContainmentAssignment_0_0.eContents().get(0);
227 private final Keyword cRefersKeyword_0_1 = (Keyword)cAlternatives_0.eContents().get(1);
228 private final Assignment cReferenceTypeAssignment_1 = (Assignment)cGroup.eContents().get(1);
229 private final CrossReference cReferenceTypeClassDeclarationCrossReference_1_0 = (CrossReference)cReferenceTypeAssignment_1.eContents().get(0);
230 private final RuleCall cReferenceTypeClassDeclarationIDTerminalRuleCall_1_0_1 = (RuleCall)cReferenceTypeClassDeclarationCrossReference_1_0.eContents().get(1);
231 private final Keyword cLeftSquareBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
232 private final Assignment cMultiplicityAssignment_3 = (Assignment)cGroup.eContents().get(3);
233 private final RuleCall cMultiplicityMultiplicityParserRuleCall_3_0 = (RuleCall)cMultiplicityAssignment_3.eContents().get(0);
234 private final Keyword cRightSquareBracketKeyword_4 = (Keyword)cGroup.eContents().get(4);
235 private final Assignment cNameAssignment_5 = (Assignment)cGroup.eContents().get(5);
236 private final RuleCall cNameIDTerminalRuleCall_5_0 = (RuleCall)cNameAssignment_5.eContents().get(0);
237 private final Group cGroup_6 = (Group)cGroup.eContents().get(6);
238 private final Keyword cOppositeKeyword_6_0 = (Keyword)cGroup_6.eContents().get(0);
239 private final Assignment cOppositeAssignment_6_1 = (Assignment)cGroup_6.eContents().get(1);
240 private final CrossReference cOppositeReferenceDeclarationCrossReference_6_1_0 = (CrossReference)cOppositeAssignment_6_1.eContents().get(0);
241 private final RuleCall cOppositeReferenceDeclarationQualifiedNameParserRuleCall_6_1_0_1 = (RuleCall)cOppositeReferenceDeclarationCrossReference_6_1_0.eContents().get(1);
242
243 //ReferenceDeclaration:
244 // (containment?="contains" | "refers")
245 // referenceType=[ClassDeclaration]
246 // "[" multiplicity=Multiplicity "]"
247 // name=ID
248 // ("opposite" opposite=[ReferenceDeclaration|QualifiedName])?;
249 @Override public ParserRule getRule() { return rule; }
250
251 //(containment?="contains" | "refers")
252 //referenceType=[ClassDeclaration]
253 //"[" multiplicity=Multiplicity "]"
254 //name=ID
255 //("opposite" opposite=[ReferenceDeclaration|QualifiedName])?
256 public Group getGroup() { return cGroup; }
257
258 //(containment?="contains" | "refers")
259 public Alternatives getAlternatives_0() { return cAlternatives_0; }
260
261 //containment?="contains"
262 public Assignment getContainmentAssignment_0_0() { return cContainmentAssignment_0_0; }
263
264 //"contains"
265 public Keyword getContainmentContainsKeyword_0_0_0() { return cContainmentContainsKeyword_0_0_0; }
266
267 //"refers"
268 public Keyword getRefersKeyword_0_1() { return cRefersKeyword_0_1; }
269
270 //referenceType=[ClassDeclaration]
271 public Assignment getReferenceTypeAssignment_1() { return cReferenceTypeAssignment_1; }
272
273 //[ClassDeclaration]
274 public CrossReference getReferenceTypeClassDeclarationCrossReference_1_0() { return cReferenceTypeClassDeclarationCrossReference_1_0; }
275
276 //ID
277 public RuleCall getReferenceTypeClassDeclarationIDTerminalRuleCall_1_0_1() { return cReferenceTypeClassDeclarationIDTerminalRuleCall_1_0_1; }
278
279 //"["
280 public Keyword getLeftSquareBracketKeyword_2() { return cLeftSquareBracketKeyword_2; }
281
282 //multiplicity=Multiplicity
283 public Assignment getMultiplicityAssignment_3() { return cMultiplicityAssignment_3; }
284
285 //Multiplicity
286 public RuleCall getMultiplicityMultiplicityParserRuleCall_3_0() { return cMultiplicityMultiplicityParserRuleCall_3_0; }
287
288 //"]"
289 public Keyword getRightSquareBracketKeyword_4() { return cRightSquareBracketKeyword_4; }
290
291 //name=ID
292 public Assignment getNameAssignment_5() { return cNameAssignment_5; }
293
294 //ID
295 public RuleCall getNameIDTerminalRuleCall_5_0() { return cNameIDTerminalRuleCall_5_0; }
296
297 //("opposite" opposite=[ReferenceDeclaration|QualifiedName])?
298 public Group getGroup_6() { return cGroup_6; }
299
300 //"opposite"
301 public Keyword getOppositeKeyword_6_0() { return cOppositeKeyword_6_0; }
302
303 //opposite=[ReferenceDeclaration|QualifiedName]
304 public Assignment getOppositeAssignment_6_1() { return cOppositeAssignment_6_1; }
305
306 //[ReferenceDeclaration|QualifiedName]
307 public CrossReference getOppositeReferenceDeclarationCrossReference_6_1_0() { return cOppositeReferenceDeclarationCrossReference_6_1_0; }
308
309 //QualifiedName
310 public RuleCall getOppositeReferenceDeclarationQualifiedNameParserRuleCall_6_1_0_1() { return cOppositeReferenceDeclarationQualifiedNameParserRuleCall_6_1_0_1; }
311 }
312 public class PredicateDefinitionElements extends AbstractParserRuleElementFinder {
313 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.PredicateDefinition");
314 private final Group cGroup = (Group)rule.eContents().get(1);
315 private final Alternatives cAlternatives_0 = (Alternatives)cGroup.eContents().get(0);
316 private final Group cGroup_0_0 = (Group)cAlternatives_0.eContents().get(0);
317 private final Assignment cErrorAssignment_0_0_0 = (Assignment)cGroup_0_0.eContents().get(0);
318 private final Keyword cErrorErrorKeyword_0_0_0_0 = (Keyword)cErrorAssignment_0_0_0.eContents().get(0);
319 private final Keyword cPredKeyword_0_0_1 = (Keyword)cGroup_0_0.eContents().get(1);
320 private final Keyword cPredKeyword_0_1 = (Keyword)cAlternatives_0.eContents().get(1);
321 private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
322 private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
323 private final Keyword cLeftParenthesisKeyword_2 = (Keyword)cGroup.eContents().get(2);
324 private final Group cGroup_3 = (Group)cGroup.eContents().get(3);
325 private final Assignment cParametersAssignment_3_0 = (Assignment)cGroup_3.eContents().get(0);
326 private final RuleCall cParametersParameterParserRuleCall_3_0_0 = (RuleCall)cParametersAssignment_3_0.eContents().get(0);
327 private final Group cGroup_3_1 = (Group)cGroup_3.eContents().get(1);
328 private final Keyword cCommaKeyword_3_1_0 = (Keyword)cGroup_3_1.eContents().get(0);
329 private final Assignment cParametersAssignment_3_1_1 = (Assignment)cGroup_3_1.eContents().get(1);
330 private final RuleCall cParametersParameterParserRuleCall_3_1_1_0 = (RuleCall)cParametersAssignment_3_1_1.eContents().get(0);
331 private final Keyword cRightParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4);
332 private final Group cGroup_5 = (Group)cGroup.eContents().get(5);
333 private final Keyword cColonEqualsSignKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0);
334 private final Assignment cBodiesAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1);
335 private final RuleCall cBodiesConjunctionParserRuleCall_5_1_0 = (RuleCall)cBodiesAssignment_5_1.eContents().get(0);
336 private final Group cGroup_5_2 = (Group)cGroup_5.eContents().get(2);
337 private final Keyword cSemicolonKeyword_5_2_0 = (Keyword)cGroup_5_2.eContents().get(0);
338 private final Assignment cBodiesAssignment_5_2_1 = (Assignment)cGroup_5_2.eContents().get(1);
339 private final RuleCall cBodiesConjunctionParserRuleCall_5_2_1_0 = (RuleCall)cBodiesAssignment_5_2_1.eContents().get(0);
340 private final Keyword cFullStopKeyword_6 = (Keyword)cGroup.eContents().get(6);
341
342 //PredicateDefinition:
343 // (error?="error" "pred"? | "pred")
344 // name=ID
345 // "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")"
346 // (":=" bodies+=Conjunction (";" bodies+=Conjunction)*)?
347 // ".";
348 @Override public ParserRule getRule() { return rule; }
349
350 //(error?="error" "pred"? | "pred")
351 //name=ID
352 //"(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")"
353 //(":=" bodies+=Conjunction (";" bodies+=Conjunction)*)?
354 //"."
355 public Group getGroup() { return cGroup; }
356
357 //(error?="error" "pred"? | "pred")
358 public Alternatives getAlternatives_0() { return cAlternatives_0; }
359
360 //error?="error" "pred"?
361 public Group getGroup_0_0() { return cGroup_0_0; }
362
363 //error?="error"
364 public Assignment getErrorAssignment_0_0_0() { return cErrorAssignment_0_0_0; }
365
366 //"error"
367 public Keyword getErrorErrorKeyword_0_0_0_0() { return cErrorErrorKeyword_0_0_0_0; }
368
369 //"pred"?
370 public Keyword getPredKeyword_0_0_1() { return cPredKeyword_0_0_1; }
371
372 //"pred"
373 public Keyword getPredKeyword_0_1() { return cPredKeyword_0_1; }
374
375 //name=ID
376 public Assignment getNameAssignment_1() { return cNameAssignment_1; }
377
378 //ID
379 public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
380
381 //"("
382 public Keyword getLeftParenthesisKeyword_2() { return cLeftParenthesisKeyword_2; }
383
384 //(parameters+=Parameter ("," parameters+=Parameter)*)?
385 public Group getGroup_3() { return cGroup_3; }
386
387 //parameters+=Parameter
388 public Assignment getParametersAssignment_3_0() { return cParametersAssignment_3_0; }
389
390 //Parameter
391 public RuleCall getParametersParameterParserRuleCall_3_0_0() { return cParametersParameterParserRuleCall_3_0_0; }
392
393 //("," parameters+=Parameter)*
394 public Group getGroup_3_1() { return cGroup_3_1; }
395
396 //","
397 public Keyword getCommaKeyword_3_1_0() { return cCommaKeyword_3_1_0; }
398
399 //parameters+=Parameter
400 public Assignment getParametersAssignment_3_1_1() { return cParametersAssignment_3_1_1; }
401
402 //Parameter
403 public RuleCall getParametersParameterParserRuleCall_3_1_1_0() { return cParametersParameterParserRuleCall_3_1_1_0; }
404
405 //")"
406 public Keyword getRightParenthesisKeyword_4() { return cRightParenthesisKeyword_4; }
407
408 //(":=" bodies+=Conjunction (";" bodies+=Conjunction)*)?
409 public Group getGroup_5() { return cGroup_5; }
410
411 //":="
412 public Keyword getColonEqualsSignKeyword_5_0() { return cColonEqualsSignKeyword_5_0; }
413
414 //bodies+=Conjunction
415 public Assignment getBodiesAssignment_5_1() { return cBodiesAssignment_5_1; }
416
417 //Conjunction
418 public RuleCall getBodiesConjunctionParserRuleCall_5_1_0() { return cBodiesConjunctionParserRuleCall_5_1_0; }
419
420 //(";" bodies+=Conjunction)*
421 public Group getGroup_5_2() { return cGroup_5_2; }
422
423 //";"
424 public Keyword getSemicolonKeyword_5_2_0() { return cSemicolonKeyword_5_2_0; }
425
426 //bodies+=Conjunction
427 public Assignment getBodiesAssignment_5_2_1() { return cBodiesAssignment_5_2_1; }
428
429 //Conjunction
430 public RuleCall getBodiesConjunctionParserRuleCall_5_2_1_0() { return cBodiesConjunctionParserRuleCall_5_2_1_0; }
431
432 //"."
433 public Keyword getFullStopKeyword_6() { return cFullStopKeyword_6; }
434 }
435 public class ParameterElements extends AbstractParserRuleElementFinder {
436 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Parameter");
437 private final Group cGroup = (Group)rule.eContents().get(1);
438 private final Assignment cParameterTypeAssignment_0 = (Assignment)cGroup.eContents().get(0);
439 private final CrossReference cParameterTypeClassDeclarationCrossReference_0_0 = (CrossReference)cParameterTypeAssignment_0.eContents().get(0);
440 private final RuleCall cParameterTypeClassDeclarationIDTerminalRuleCall_0_0_1 = (RuleCall)cParameterTypeClassDeclarationCrossReference_0_0.eContents().get(1);
441 private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
442 private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
443
444 //Parameter:
445 // parameterType=[ClassDeclaration] name=ID;
446 @Override public ParserRule getRule() { return rule; }
447
448 //parameterType=[ClassDeclaration] name=ID
449 public Group getGroup() { return cGroup; }
450
451 //parameterType=[ClassDeclaration]
452 public Assignment getParameterTypeAssignment_0() { return cParameterTypeAssignment_0; }
453
454 //[ClassDeclaration]
455 public CrossReference getParameterTypeClassDeclarationCrossReference_0_0() { return cParameterTypeClassDeclarationCrossReference_0_0; }
456
457 //ID
458 public RuleCall getParameterTypeClassDeclarationIDTerminalRuleCall_0_0_1() { return cParameterTypeClassDeclarationIDTerminalRuleCall_0_0_1; }
459
460 //name=ID
461 public Assignment getNameAssignment_1() { return cNameAssignment_1; }
462
463 //ID
464 public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
465 }
466 public class ConjunctionElements extends AbstractParserRuleElementFinder {
467 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Conjunction");
468 private final Group cGroup = (Group)rule.eContents().get(1);
469 private final Assignment cLiteralsAssignment_0 = (Assignment)cGroup.eContents().get(0);
470 private final RuleCall cLiteralsLiteralParserRuleCall_0_0 = (RuleCall)cLiteralsAssignment_0.eContents().get(0);
471 private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
472 private final Keyword cCommaKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
473 private final Assignment cLiteralsAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1);
474 private final RuleCall cLiteralsLiteralParserRuleCall_1_1_0 = (RuleCall)cLiteralsAssignment_1_1.eContents().get(0);
475
476 //Conjunction:
477 // literals+=Literal ("," literals+=Literal)*;
478 @Override public ParserRule getRule() { return rule; }
479
480 //literals+=Literal ("," literals+=Literal)*
481 public Group getGroup() { return cGroup; }
482
483 //literals+=Literal
484 public Assignment getLiteralsAssignment_0() { return cLiteralsAssignment_0; }
485
486 //Literal
487 public RuleCall getLiteralsLiteralParserRuleCall_0_0() { return cLiteralsLiteralParserRuleCall_0_0; }
488
489 //("," literals+=Literal)*
490 public Group getGroup_1() { return cGroup_1; }
491
492 //","
493 public Keyword getCommaKeyword_1_0() { return cCommaKeyword_1_0; }
494
495 //literals+=Literal
496 public Assignment getLiteralsAssignment_1_1() { return cLiteralsAssignment_1_1; }
497
498 //Literal
499 public RuleCall getLiteralsLiteralParserRuleCall_1_1_0() { return cLiteralsLiteralParserRuleCall_1_1_0; }
500 }
501 public class LiteralElements extends AbstractParserRuleElementFinder {
502 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Literal");
503 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
504 private final RuleCall cAtomParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
505 private final RuleCall cNegativeLiteralParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
506
507 //Literal:
508 // Atom | NegativeLiteral;
509 @Override public ParserRule getRule() { return rule; }
510
511 //Atom | NegativeLiteral
512 public Alternatives getAlternatives() { return cAlternatives; }
513
514 //Atom
515 public RuleCall getAtomParserRuleCall_0() { return cAtomParserRuleCall_0; }
516
517 //NegativeLiteral
518 public RuleCall getNegativeLiteralParserRuleCall_1() { return cNegativeLiteralParserRuleCall_1; }
519 }
520 public class NegativeLiteralElements extends AbstractParserRuleElementFinder {
521 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.NegativeLiteral");
522 private final Group cGroup = (Group)rule.eContents().get(1);
523 private final Keyword cExclamationMarkKeyword_0 = (Keyword)cGroup.eContents().get(0);
524 private final Assignment cAtomAssignment_1 = (Assignment)cGroup.eContents().get(1);
525 private final RuleCall cAtomAtomParserRuleCall_1_0 = (RuleCall)cAtomAssignment_1.eContents().get(0);
526
527 //NegativeLiteral:
528 // "!" atom=Atom;
529 @Override public ParserRule getRule() { return rule; }
530
531 //"!" atom=Atom
532 public Group getGroup() { return cGroup; }
533
534 //"!"
535 public Keyword getExclamationMarkKeyword_0() { return cExclamationMarkKeyword_0; }
536
537 //atom=Atom
538 public Assignment getAtomAssignment_1() { return cAtomAssignment_1; }
539
540 //Atom
541 public RuleCall getAtomAtomParserRuleCall_1_0() { return cAtomAtomParserRuleCall_1_0; }
542 }
543 public class AtomElements extends AbstractParserRuleElementFinder {
544 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Atom");
545 private final Group cGroup = (Group)rule.eContents().get(1);
546 private final Assignment cRelationAssignment_0 = (Assignment)cGroup.eContents().get(0);
547 private final CrossReference cRelationRelationCrossReference_0_0 = (CrossReference)cRelationAssignment_0.eContents().get(0);
548 private final RuleCall cRelationRelationQualifiedNameParserRuleCall_0_0_1 = (RuleCall)cRelationRelationCrossReference_0_0.eContents().get(1);
549 private final Assignment cTransitiveClosureAssignment_1 = (Assignment)cGroup.eContents().get(1);
550 private final Keyword cTransitiveClosurePlusSignKeyword_1_0 = (Keyword)cTransitiveClosureAssignment_1.eContents().get(0);
551 private final Keyword cLeftParenthesisKeyword_2 = (Keyword)cGroup.eContents().get(2);
552 private final Group cGroup_3 = (Group)cGroup.eContents().get(3);
553 private final Assignment cArgumentsAssignment_3_0 = (Assignment)cGroup_3.eContents().get(0);
554 private final CrossReference cArgumentsVariableCrossReference_3_0_0 = (CrossReference)cArgumentsAssignment_3_0.eContents().get(0);
555 private final RuleCall cArgumentsVariableIDTerminalRuleCall_3_0_0_1 = (RuleCall)cArgumentsVariableCrossReference_3_0_0.eContents().get(1);
556 private final Group cGroup_3_1 = (Group)cGroup_3.eContents().get(1);
557 private final Keyword cCommaKeyword_3_1_0 = (Keyword)cGroup_3_1.eContents().get(0);
558 private final Assignment cArgumentsAssignment_3_1_1 = (Assignment)cGroup_3_1.eContents().get(1);
559 private final CrossReference cArgumentsVariableCrossReference_3_1_1_0 = (CrossReference)cArgumentsAssignment_3_1_1.eContents().get(0);
560 private final RuleCall cArgumentsVariableIDTerminalRuleCall_3_1_1_0_1 = (RuleCall)cArgumentsVariableCrossReference_3_1_1_0.eContents().get(1);
561 private final Keyword cRightParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4);
562
563 //Atom:
564 // relation=[Relation|QualifiedName]
565 // transitiveClosure?="+"?
566 // "(" (arguments+=[Variable] ("," arguments+=[Variable])*)? ")";
567 @Override public ParserRule getRule() { return rule; }
568
569 //relation=[Relation|QualifiedName]
570 //transitiveClosure?="+"?
571 //"(" (arguments+=[Variable] ("," arguments+=[Variable])*)? ")"
572 public Group getGroup() { return cGroup; }
573
574 //relation=[Relation|QualifiedName]
575 public Assignment getRelationAssignment_0() { return cRelationAssignment_0; }
576
577 //[Relation|QualifiedName]
578 public CrossReference getRelationRelationCrossReference_0_0() { return cRelationRelationCrossReference_0_0; }
579
580 //QualifiedName
581 public RuleCall getRelationRelationQualifiedNameParserRuleCall_0_0_1() { return cRelationRelationQualifiedNameParserRuleCall_0_0_1; }
582
583 //transitiveClosure?="+"?
584 public Assignment getTransitiveClosureAssignment_1() { return cTransitiveClosureAssignment_1; }
585
586 //"+"
587 public Keyword getTransitiveClosurePlusSignKeyword_1_0() { return cTransitiveClosurePlusSignKeyword_1_0; }
588
589 //"("
590 public Keyword getLeftParenthesisKeyword_2() { return cLeftParenthesisKeyword_2; }
591
592 //(arguments+=[Variable] ("," arguments+=[Variable])*)?
593 public Group getGroup_3() { return cGroup_3; }
594
595 //arguments+=[Variable]
596 public Assignment getArgumentsAssignment_3_0() { return cArgumentsAssignment_3_0; }
597
598 //[Variable]
599 public CrossReference getArgumentsVariableCrossReference_3_0_0() { return cArgumentsVariableCrossReference_3_0_0; }
600
601 //ID
602 public RuleCall getArgumentsVariableIDTerminalRuleCall_3_0_0_1() { return cArgumentsVariableIDTerminalRuleCall_3_0_0_1; }
603
604 //("," arguments+=[Variable])*
605 public Group getGroup_3_1() { return cGroup_3_1; }
606
607 //","
608 public Keyword getCommaKeyword_3_1_0() { return cCommaKeyword_3_1_0; }
609
610 //arguments+=[Variable]
611 public Assignment getArgumentsAssignment_3_1_1() { return cArgumentsAssignment_3_1_1; }
612
613 //[Variable]
614 public CrossReference getArgumentsVariableCrossReference_3_1_1_0() { return cArgumentsVariableCrossReference_3_1_1_0; }
615
616 //ID
617 public RuleCall getArgumentsVariableIDTerminalRuleCall_3_1_1_0_1() { return cArgumentsVariableIDTerminalRuleCall_3_1_1_0_1; }
618
619 //")"
620 public Keyword getRightParenthesisKeyword_4() { return cRightParenthesisKeyword_4; }
621 }
622 public class AssertionElements extends AbstractParserRuleElementFinder {
623 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Assertion");
624 private final Group cGroup = (Group)rule.eContents().get(1);
625 private final Alternatives cAlternatives_0 = (Alternatives)cGroup.eContents().get(0);
626 private final Group cGroup_0_0 = (Group)cAlternatives_0.eContents().get(0);
627 private final Assignment cRelationAssignment_0_0_0 = (Assignment)cGroup_0_0.eContents().get(0);
628 private final CrossReference cRelationRelationCrossReference_0_0_0_0 = (CrossReference)cRelationAssignment_0_0_0.eContents().get(0);
629 private final RuleCall cRelationRelationQualifiedNameParserRuleCall_0_0_0_0_1 = (RuleCall)cRelationRelationCrossReference_0_0_0_0.eContents().get(1);
630 private final Keyword cLeftParenthesisKeyword_0_0_1 = (Keyword)cGroup_0_0.eContents().get(1);
631 private final Group cGroup_0_0_2 = (Group)cGroup_0_0.eContents().get(2);
632 private final Assignment cArgumentsAssignment_0_0_2_0 = (Assignment)cGroup_0_0_2.eContents().get(0);
633 private final CrossReference cArgumentsNodeCrossReference_0_0_2_0_0 = (CrossReference)cArgumentsAssignment_0_0_2_0.eContents().get(0);
634 private final RuleCall cArgumentsNodeQualifiedNameParserRuleCall_0_0_2_0_0_1 = (RuleCall)cArgumentsNodeCrossReference_0_0_2_0_0.eContents().get(1);
635 private final Group cGroup_0_0_2_1 = (Group)cGroup_0_0_2.eContents().get(1);
636 private final Keyword cCommaKeyword_0_0_2_1_0 = (Keyword)cGroup_0_0_2_1.eContents().get(0);
637 private final Assignment cArgumentsAssignment_0_0_2_1_1 = (Assignment)cGroup_0_0_2_1.eContents().get(1);
638 private final CrossReference cArgumentsNodeCrossReference_0_0_2_1_1_0 = (CrossReference)cArgumentsAssignment_0_0_2_1_1.eContents().get(0);
639 private final RuleCall cArgumentsNodeQualifiedNameParserRuleCall_0_0_2_1_1_0_1 = (RuleCall)cArgumentsNodeCrossReference_0_0_2_1_1_0.eContents().get(1);
640 private final Keyword cRightParenthesisKeyword_0_0_3 = (Keyword)cGroup_0_0.eContents().get(3);
641 private final Keyword cColonKeyword_0_0_4 = (Keyword)cGroup_0_0.eContents().get(4);
642 private final Assignment cValueAssignment_0_0_5 = (Assignment)cGroup_0_0.eContents().get(5);
643 private final RuleCall cValueLogicValueEnumRuleCall_0_0_5_0 = (RuleCall)cValueAssignment_0_0_5.eContents().get(0);
644 private final Group cGroup_0_1 = (Group)cAlternatives_0.eContents().get(1);
645 private final Assignment cValueAssignment_0_1_0 = (Assignment)cGroup_0_1.eContents().get(0);
646 private final RuleCall cValueShortLogicValueEnumRuleCall_0_1_0_0 = (RuleCall)cValueAssignment_0_1_0.eContents().get(0);
647 private final Assignment cRelationAssignment_0_1_1 = (Assignment)cGroup_0_1.eContents().get(1);
648 private final CrossReference cRelationRelationCrossReference_0_1_1_0 = (CrossReference)cRelationAssignment_0_1_1.eContents().get(0);
649 private final RuleCall cRelationRelationQualifiedNameParserRuleCall_0_1_1_0_1 = (RuleCall)cRelationRelationCrossReference_0_1_1_0.eContents().get(1);
650 private final Keyword cLeftParenthesisKeyword_0_1_2 = (Keyword)cGroup_0_1.eContents().get(2);
651 private final Group cGroup_0_1_3 = (Group)cGroup_0_1.eContents().get(3);
652 private final Assignment cArgumentsAssignment_0_1_3_0 = (Assignment)cGroup_0_1_3.eContents().get(0);
653 private final CrossReference cArgumentsNodeCrossReference_0_1_3_0_0 = (CrossReference)cArgumentsAssignment_0_1_3_0.eContents().get(0);
654 private final RuleCall cArgumentsNodeQualifiedNameParserRuleCall_0_1_3_0_0_1 = (RuleCall)cArgumentsNodeCrossReference_0_1_3_0_0.eContents().get(1);
655 private final Group cGroup_0_1_3_1 = (Group)cGroup_0_1_3.eContents().get(1);
656 private final Keyword cCommaKeyword_0_1_3_1_0 = (Keyword)cGroup_0_1_3_1.eContents().get(0);
657 private final Assignment cArgumentsAssignment_0_1_3_1_1 = (Assignment)cGroup_0_1_3_1.eContents().get(1);
658 private final CrossReference cArgumentsNodeCrossReference_0_1_3_1_1_0 = (CrossReference)cArgumentsAssignment_0_1_3_1_1.eContents().get(0);
659 private final RuleCall cArgumentsNodeQualifiedNameParserRuleCall_0_1_3_1_1_0_1 = (RuleCall)cArgumentsNodeCrossReference_0_1_3_1_1_0.eContents().get(1);
660 private final Keyword cRightParenthesisKeyword_0_1_4 = (Keyword)cGroup_0_1.eContents().get(4);
661 private final Keyword cFullStopKeyword_1 = (Keyword)cGroup.eContents().get(1);
662
663 //Assertion:
664 // (relation=[Relation|QualifiedName]
665 // "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
666 // ":" value=LogicValue |
667 // value=ShortLogicValue?
668 // relation=[Relation|QualifiedName]
669 // "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")")
670 // ".";
671 @Override public ParserRule getRule() { return rule; }
672
673 //(relation=[Relation|QualifiedName]
674 //"(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
675 //":" value=LogicValue |
676 //value=ShortLogicValue?
677 //relation=[Relation|QualifiedName]
678 //"(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")")
679 //"."
680 public Group getGroup() { return cGroup; }
681
682 //(relation=[Relation|QualifiedName]
683 //"(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
684 //":" value=LogicValue |
685 //value=ShortLogicValue?
686 //relation=[Relation|QualifiedName]
687 //"(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")")
688 public Alternatives getAlternatives_0() { return cAlternatives_0; }
689
690 //relation=[Relation|QualifiedName]
691 // "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
692 // ":" value=LogicValue
693 public Group getGroup_0_0() { return cGroup_0_0; }
694
695 //relation=[Relation|QualifiedName]
696 public Assignment getRelationAssignment_0_0_0() { return cRelationAssignment_0_0_0; }
697
698 //[Relation|QualifiedName]
699 public CrossReference getRelationRelationCrossReference_0_0_0_0() { return cRelationRelationCrossReference_0_0_0_0; }
700
701 //QualifiedName
702 public RuleCall getRelationRelationQualifiedNameParserRuleCall_0_0_0_0_1() { return cRelationRelationQualifiedNameParserRuleCall_0_0_0_0_1; }
703
704 //"("
705 public Keyword getLeftParenthesisKeyword_0_0_1() { return cLeftParenthesisKeyword_0_0_1; }
706
707 //(arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)?
708 public Group getGroup_0_0_2() { return cGroup_0_0_2; }
709
710 //arguments+=[Node|QualifiedName]
711 public Assignment getArgumentsAssignment_0_0_2_0() { return cArgumentsAssignment_0_0_2_0; }
712
713 //[Node|QualifiedName]
714 public CrossReference getArgumentsNodeCrossReference_0_0_2_0_0() { return cArgumentsNodeCrossReference_0_0_2_0_0; }
715
716 //QualifiedName
717 public RuleCall getArgumentsNodeQualifiedNameParserRuleCall_0_0_2_0_0_1() { return cArgumentsNodeQualifiedNameParserRuleCall_0_0_2_0_0_1; }
718
719 //("," arguments+=[Node|QualifiedName])*
720 public Group getGroup_0_0_2_1() { return cGroup_0_0_2_1; }
721
722 //","
723 public Keyword getCommaKeyword_0_0_2_1_0() { return cCommaKeyword_0_0_2_1_0; }
724
725 //arguments+=[Node|QualifiedName]
726 public Assignment getArgumentsAssignment_0_0_2_1_1() { return cArgumentsAssignment_0_0_2_1_1; }
727
728 //[Node|QualifiedName]
729 public CrossReference getArgumentsNodeCrossReference_0_0_2_1_1_0() { return cArgumentsNodeCrossReference_0_0_2_1_1_0; }
730
731 //QualifiedName
732 public RuleCall getArgumentsNodeQualifiedNameParserRuleCall_0_0_2_1_1_0_1() { return cArgumentsNodeQualifiedNameParserRuleCall_0_0_2_1_1_0_1; }
733
734 //")"
735 public Keyword getRightParenthesisKeyword_0_0_3() { return cRightParenthesisKeyword_0_0_3; }
736
737 //":"
738 public Keyword getColonKeyword_0_0_4() { return cColonKeyword_0_0_4; }
739
740 //value=LogicValue
741 public Assignment getValueAssignment_0_0_5() { return cValueAssignment_0_0_5; }
742
743 //LogicValue
744 public RuleCall getValueLogicValueEnumRuleCall_0_0_5_0() { return cValueLogicValueEnumRuleCall_0_0_5_0; }
745
746 //value=ShortLogicValue?
747 //relation=[Relation|QualifiedName]
748 //"(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
749 public Group getGroup_0_1() { return cGroup_0_1; }
750
751 //value=ShortLogicValue?
752 public Assignment getValueAssignment_0_1_0() { return cValueAssignment_0_1_0; }
753
754 //ShortLogicValue
755 public RuleCall getValueShortLogicValueEnumRuleCall_0_1_0_0() { return cValueShortLogicValueEnumRuleCall_0_1_0_0; }
756
757 //relation=[Relation|QualifiedName]
758 public Assignment getRelationAssignment_0_1_1() { return cRelationAssignment_0_1_1; }
759
760 //[Relation|QualifiedName]
761 public CrossReference getRelationRelationCrossReference_0_1_1_0() { return cRelationRelationCrossReference_0_1_1_0; }
762
763 //QualifiedName
764 public RuleCall getRelationRelationQualifiedNameParserRuleCall_0_1_1_0_1() { return cRelationRelationQualifiedNameParserRuleCall_0_1_1_0_1; }
765
766 //"("
767 public Keyword getLeftParenthesisKeyword_0_1_2() { return cLeftParenthesisKeyword_0_1_2; }
768
769 //(arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)?
770 public Group getGroup_0_1_3() { return cGroup_0_1_3; }
771
772 //arguments+=[Node|QualifiedName]
773 public Assignment getArgumentsAssignment_0_1_3_0() { return cArgumentsAssignment_0_1_3_0; }
774
775 //[Node|QualifiedName]
776 public CrossReference getArgumentsNodeCrossReference_0_1_3_0_0() { return cArgumentsNodeCrossReference_0_1_3_0_0; }
777
778 //QualifiedName
779 public RuleCall getArgumentsNodeQualifiedNameParserRuleCall_0_1_3_0_0_1() { return cArgumentsNodeQualifiedNameParserRuleCall_0_1_3_0_0_1; }
780
781 //("," arguments+=[Node|QualifiedName])*
782 public Group getGroup_0_1_3_1() { return cGroup_0_1_3_1; }
783
784 //","
785 public Keyword getCommaKeyword_0_1_3_1_0() { return cCommaKeyword_0_1_3_1_0; }
786
787 //arguments+=[Node|QualifiedName]
788 public Assignment getArgumentsAssignment_0_1_3_1_1() { return cArgumentsAssignment_0_1_3_1_1; }
789
790 //[Node|QualifiedName]
791 public CrossReference getArgumentsNodeCrossReference_0_1_3_1_1_0() { return cArgumentsNodeCrossReference_0_1_3_1_1_0; }
792
793 //QualifiedName
794 public RuleCall getArgumentsNodeQualifiedNameParserRuleCall_0_1_3_1_1_0_1() { return cArgumentsNodeQualifiedNameParserRuleCall_0_1_3_1_1_0_1; }
795
796 //")"
797 public Keyword getRightParenthesisKeyword_0_1_4() { return cRightParenthesisKeyword_0_1_4; }
798
799 //"."
800 public Keyword getFullStopKeyword_1() { return cFullStopKeyword_1; }
801 }
802 public class ScopeDeclarationElements extends AbstractParserRuleElementFinder {
803 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ScopeDeclaration");
804 private final Group cGroup = (Group)rule.eContents().get(1);
805 private final Keyword cScopeKeyword_0 = (Keyword)cGroup.eContents().get(0);
806 private final Assignment cTypeScopesAssignment_1 = (Assignment)cGroup.eContents().get(1);
807 private final RuleCall cTypeScopesTypeScopeParserRuleCall_1_0 = (RuleCall)cTypeScopesAssignment_1.eContents().get(0);
808 private final Group cGroup_2 = (Group)cGroup.eContents().get(2);
809 private final Keyword cCommaKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0);
810 private final Assignment cTypeScopesAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1);
811 private final RuleCall cTypeScopesTypeScopeParserRuleCall_2_1_0 = (RuleCall)cTypeScopesAssignment_2_1.eContents().get(0);
812 private final Keyword cFullStopKeyword_3 = (Keyword)cGroup.eContents().get(3);
813
814 //ScopeDeclaration:
815 // "scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* ".";
816 @Override public ParserRule getRule() { return rule; }
817
818 //"scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* "."
819 public Group getGroup() { return cGroup; }
820
821 //"scope"
822 public Keyword getScopeKeyword_0() { return cScopeKeyword_0; }
823
824 //typeScopes+=TypeScope
825 public Assignment getTypeScopesAssignment_1() { return cTypeScopesAssignment_1; }
826
827 //TypeScope
828 public RuleCall getTypeScopesTypeScopeParserRuleCall_1_0() { return cTypeScopesTypeScopeParserRuleCall_1_0; }
829
830 //("," typeScopes+=TypeScope)*
831 public Group getGroup_2() { return cGroup_2; }
832
833 //","
834 public Keyword getCommaKeyword_2_0() { return cCommaKeyword_2_0; }
835
836 //typeScopes+=TypeScope
837 public Assignment getTypeScopesAssignment_2_1() { return cTypeScopesAssignment_2_1; }
838
839 //TypeScope
840 public RuleCall getTypeScopesTypeScopeParserRuleCall_2_1_0() { return cTypeScopesTypeScopeParserRuleCall_2_1_0; }
841
842 //"."
843 public Keyword getFullStopKeyword_3() { return cFullStopKeyword_3; }
844 }
845 public class TypeScopeElements extends AbstractParserRuleElementFinder {
846 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.TypeScope");
847 private final Group cGroup = (Group)rule.eContents().get(1);
848 private final Assignment cTargetTypeAssignment_0 = (Assignment)cGroup.eContents().get(0);
849 private final CrossReference cTargetTypeClassDeclarationCrossReference_0_0 = (CrossReference)cTargetTypeAssignment_0.eContents().get(0);
850 private final RuleCall cTargetTypeClassDeclarationIDTerminalRuleCall_0_0_1 = (RuleCall)cTargetTypeClassDeclarationCrossReference_0_0.eContents().get(1);
851 private final Alternatives cAlternatives_1 = (Alternatives)cGroup.eContents().get(1);
852 private final Assignment cIncrementAssignment_1_0 = (Assignment)cAlternatives_1.eContents().get(0);
853 private final Keyword cIncrementPlusSignEqualsSignKeyword_1_0_0 = (Keyword)cIncrementAssignment_1_0.eContents().get(0);
854 private final Keyword cEqualsSignKeyword_1_1 = (Keyword)cAlternatives_1.eContents().get(1);
855 private final Assignment cMultiplicityAssignment_2 = (Assignment)cGroup.eContents().get(2);
856 private final RuleCall cMultiplicityMultiplicityParserRuleCall_2_0 = (RuleCall)cMultiplicityAssignment_2.eContents().get(0);
857
858 //TypeScope:
859 // targetType=[ClassDeclaration]
860 // (increment?="+=" | "=")
861 // multiplicity=Multiplicity;
862 @Override public ParserRule getRule() { return rule; }
863
864 //targetType=[ClassDeclaration]
865 //(increment?="+=" | "=")
866 //multiplicity=Multiplicity
867 public Group getGroup() { return cGroup; }
868
869 //targetType=[ClassDeclaration]
870 public Assignment getTargetTypeAssignment_0() { return cTargetTypeAssignment_0; }
871
872 //[ClassDeclaration]
873 public CrossReference getTargetTypeClassDeclarationCrossReference_0_0() { return cTargetTypeClassDeclarationCrossReference_0_0; }
874
875 //ID
876 public RuleCall getTargetTypeClassDeclarationIDTerminalRuleCall_0_0_1() { return cTargetTypeClassDeclarationIDTerminalRuleCall_0_0_1; }
877
878 //(increment?="+=" | "=")
879 public Alternatives getAlternatives_1() { return cAlternatives_1; }
880
881 //increment?="+="
882 public Assignment getIncrementAssignment_1_0() { return cIncrementAssignment_1_0; }
883
884 //"+="
885 public Keyword getIncrementPlusSignEqualsSignKeyword_1_0_0() { return cIncrementPlusSignEqualsSignKeyword_1_0_0; }
886
887 //"="
888 public Keyword getEqualsSignKeyword_1_1() { return cEqualsSignKeyword_1_1; }
889
890 //multiplicity=Multiplicity
891 public Assignment getMultiplicityAssignment_2() { return cMultiplicityAssignment_2; }
892
893 //Multiplicity
894 public RuleCall getMultiplicityMultiplicityParserRuleCall_2_0() { return cMultiplicityMultiplicityParserRuleCall_2_0; }
895 }
896 public class MultiplicityElements extends AbstractParserRuleElementFinder {
897 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Multiplicity");
898 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
899 private final RuleCall cRangeMultiplicityParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
900 private final RuleCall cExactMultiplicityParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
901
902 //Multiplicity:
903 // RangeMultiplicity | ExactMultiplicity;
904 @Override public ParserRule getRule() { return rule; }
905
906 //RangeMultiplicity | ExactMultiplicity
907 public Alternatives getAlternatives() { return cAlternatives; }
908
909 //RangeMultiplicity
910 public RuleCall getRangeMultiplicityParserRuleCall_0() { return cRangeMultiplicityParserRuleCall_0; }
911
912 //ExactMultiplicity
913 public RuleCall getExactMultiplicityParserRuleCall_1() { return cExactMultiplicityParserRuleCall_1; }
914 }
915 public class RangeMultiplicityElements extends AbstractParserRuleElementFinder {
916 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.RangeMultiplicity");
917 private final Group cGroup = (Group)rule.eContents().get(1);
918 private final Assignment cLowerBoundAssignment_0 = (Assignment)cGroup.eContents().get(0);
919 private final RuleCall cLowerBoundINTTerminalRuleCall_0_0 = (RuleCall)cLowerBoundAssignment_0.eContents().get(0);
920 private final Keyword cFullStopFullStopKeyword_1 = (Keyword)cGroup.eContents().get(1);
921 private final Assignment cUpperBoundAssignment_2 = (Assignment)cGroup.eContents().get(2);
922 private final RuleCall cUpperBoundUpperBoundParserRuleCall_2_0 = (RuleCall)cUpperBoundAssignment_2.eContents().get(0);
923
924 //RangeMultiplicity:
925 // lowerBound=INT ".." upperBound=UpperBound;
926 @Override public ParserRule getRule() { return rule; }
927
928 //lowerBound=INT ".." upperBound=UpperBound
929 public Group getGroup() { return cGroup; }
930
931 //lowerBound=INT
932 public Assignment getLowerBoundAssignment_0() { return cLowerBoundAssignment_0; }
933
934 //INT
935 public RuleCall getLowerBoundINTTerminalRuleCall_0_0() { return cLowerBoundINTTerminalRuleCall_0_0; }
936
937 //".."
938 public Keyword getFullStopFullStopKeyword_1() { return cFullStopFullStopKeyword_1; }
939
940 //upperBound=UpperBound
941 public Assignment getUpperBoundAssignment_2() { return cUpperBoundAssignment_2; }
942
943 //UpperBound
944 public RuleCall getUpperBoundUpperBoundParserRuleCall_2_0() { return cUpperBoundUpperBoundParserRuleCall_2_0; }
945 }
946 public class ExactMultiplicityElements extends AbstractParserRuleElementFinder {
947 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ExactMultiplicity");
948 private final Assignment cExactValueAssignment = (Assignment)rule.eContents().get(1);
949 private final RuleCall cExactValueINTTerminalRuleCall_0 = (RuleCall)cExactValueAssignment.eContents().get(0);
950
951 //ExactMultiplicity:
952 // exactValue=INT;
953 @Override public ParserRule getRule() { return rule; }
954
955 //exactValue=INT
956 public Assignment getExactValueAssignment() { return cExactValueAssignment; }
957
958 //INT
959 public RuleCall getExactValueINTTerminalRuleCall_0() { return cExactValueINTTerminalRuleCall_0; }
960 }
961 public class UpperBoundElements extends AbstractParserRuleElementFinder {
962 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.UpperBound");
963 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
964 private final RuleCall cINTTerminalRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
965 private final Keyword cAsteriskKeyword_1 = (Keyword)cAlternatives.eContents().get(1);
966
967 //UpperBound returns ecore::EInt:
968 // INT | "*";
969 @Override public ParserRule getRule() { return rule; }
970
971 //INT | "*"
972 public Alternatives getAlternatives() { return cAlternatives; }
973
974 //INT
975 public RuleCall getINTTerminalRuleCall_0() { return cINTTerminalRuleCall_0; }
976
977 //"*"
978 public Keyword getAsteriskKeyword_1() { return cAsteriskKeyword_1; }
979 }
980 public class QualifiedNameElements extends AbstractParserRuleElementFinder {
981 private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.QualifiedName");
982 private final Group cGroup = (Group)rule.eContents().get(1);
983 private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0);
984 private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
985 private final Keyword cColonColonKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
986 private final RuleCall cIDTerminalRuleCall_1_1 = (RuleCall)cGroup_1.eContents().get(1);
987
988 //QualifiedName:
989 // ID ("::" ID)*;
990 @Override public ParserRule getRule() { return rule; }
991
992 //ID ("::" ID)*
993 public Group getGroup() { return cGroup; }
994
995 //ID
996 public RuleCall getIDTerminalRuleCall_0() { return cIDTerminalRuleCall_0; }
997
998 //("::" ID)*
999 public Group getGroup_1() { return cGroup_1; }
1000
1001 //"::"
1002 public Keyword getColonColonKeyword_1_0() { return cColonColonKeyword_1_0; }
1003
1004 //ID
1005 public RuleCall getIDTerminalRuleCall_1_1() { return cIDTerminalRuleCall_1_1; }
1006 }
1007
1008 public class LogicValueElements extends AbstractElementFinder.AbstractEnumRuleElementFinder {
1009 private final EnumRule rule = (EnumRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.LogicValue");
1010 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
1011 private final EnumLiteralDeclaration cTRUEEnumLiteralDeclaration_0 = (EnumLiteralDeclaration)cAlternatives.eContents().get(0);
1012 private final Keyword cTRUETrueKeyword_0_0 = (Keyword)cTRUEEnumLiteralDeclaration_0.eContents().get(0);
1013 private final EnumLiteralDeclaration cFALSEEnumLiteralDeclaration_1 = (EnumLiteralDeclaration)cAlternatives.eContents().get(1);
1014 private final Keyword cFALSEFalseKeyword_1_0 = (Keyword)cFALSEEnumLiteralDeclaration_1.eContents().get(0);
1015 private final EnumLiteralDeclaration cUNKNOWNEnumLiteralDeclaration_2 = (EnumLiteralDeclaration)cAlternatives.eContents().get(2);
1016 private final Keyword cUNKNOWNUnknownKeyword_2_0 = (Keyword)cUNKNOWNEnumLiteralDeclaration_2.eContents().get(0);
1017
1018 //enum LogicValue:
1019 // TRUE="true" | FALSE="false" | UNKNOWN="unknown";
1020 public EnumRule getRule() { return rule; }
1021
1022 //TRUE="true" | FALSE="false" | UNKNOWN="unknown"
1023 public Alternatives getAlternatives() { return cAlternatives; }
1024
1025 //TRUE="true"
1026 public EnumLiteralDeclaration getTRUEEnumLiteralDeclaration_0() { return cTRUEEnumLiteralDeclaration_0; }
1027
1028 //"true"
1029 public Keyword getTRUETrueKeyword_0_0() { return cTRUETrueKeyword_0_0; }
1030
1031 //FALSE="false"
1032 public EnumLiteralDeclaration getFALSEEnumLiteralDeclaration_1() { return cFALSEEnumLiteralDeclaration_1; }
1033
1034 //"false"
1035 public Keyword getFALSEFalseKeyword_1_0() { return cFALSEFalseKeyword_1_0; }
1036
1037 //UNKNOWN="unknown"
1038 public EnumLiteralDeclaration getUNKNOWNEnumLiteralDeclaration_2() { return cUNKNOWNEnumLiteralDeclaration_2; }
1039
1040 //"unknown"
1041 public Keyword getUNKNOWNUnknownKeyword_2_0() { return cUNKNOWNUnknownKeyword_2_0; }
1042 }
1043 public class ShortLogicValueElements extends AbstractElementFinder.AbstractEnumRuleElementFinder {
1044 private final EnumRule rule = (EnumRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ShortLogicValue");
1045 private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
1046 private final EnumLiteralDeclaration cFALSEEnumLiteralDeclaration_0 = (EnumLiteralDeclaration)cAlternatives.eContents().get(0);
1047 private final Keyword cFALSEExclamationMarkKeyword_0_0 = (Keyword)cFALSEEnumLiteralDeclaration_0.eContents().get(0);
1048 private final EnumLiteralDeclaration cUNKNOWNEnumLiteralDeclaration_1 = (EnumLiteralDeclaration)cAlternatives.eContents().get(1);
1049 private final Keyword cUNKNOWNQuestionMarkKeyword_1_0 = (Keyword)cUNKNOWNEnumLiteralDeclaration_1.eContents().get(0);
1050
1051 //enum ShortLogicValue returns LogicValue:
1052 // FALSE="!" | UNKNOWN="?";
1053 public EnumRule getRule() { return rule; }
1054
1055 //FALSE="!" | UNKNOWN="?"
1056 public Alternatives getAlternatives() { return cAlternatives; }
1057
1058 //FALSE="!"
1059 public EnumLiteralDeclaration getFALSEEnumLiteralDeclaration_0() { return cFALSEEnumLiteralDeclaration_0; }
1060
1061 //"!"
1062 public Keyword getFALSEExclamationMarkKeyword_0_0() { return cFALSEExclamationMarkKeyword_0_0; }
1063
1064 //UNKNOWN="?"
1065 public EnumLiteralDeclaration getUNKNOWNEnumLiteralDeclaration_1() { return cUNKNOWNEnumLiteralDeclaration_1; }
1066
1067 //"?"
1068 public Keyword getUNKNOWNQuestionMarkKeyword_1_0() { return cUNKNOWNQuestionMarkKeyword_1_0; }
1069 }
1070
1071 private final ProblemElements pProblem;
1072 private final StatementElements pStatement;
1073 private final ClassDeclarationElements pClassDeclaration;
1074 private final ReferenceDeclarationElements pReferenceDeclaration;
1075 private final PredicateDefinitionElements pPredicateDefinition;
1076 private final ParameterElements pParameter;
1077 private final ConjunctionElements pConjunction;
1078 private final LiteralElements pLiteral;
1079 private final NegativeLiteralElements pNegativeLiteral;
1080 private final AtomElements pAtom;
1081 private final AssertionElements pAssertion;
1082 private final LogicValueElements eLogicValue;
1083 private final ShortLogicValueElements eShortLogicValue;
1084 private final ScopeDeclarationElements pScopeDeclaration;
1085 private final TypeScopeElements pTypeScope;
1086 private final MultiplicityElements pMultiplicity;
1087 private final RangeMultiplicityElements pRangeMultiplicity;
1088 private final ExactMultiplicityElements pExactMultiplicity;
1089 private final UpperBoundElements pUpperBound;
1090 private final QualifiedNameElements pQualifiedName;
1091
1092 private final Grammar grammar;
1093
1094 private final TerminalsGrammarAccess gaTerminals;
1095
1096 @Inject
1097 public ProblemGrammarAccess(GrammarProvider grammarProvider,
1098 TerminalsGrammarAccess gaTerminals) {
1099 this.grammar = internalFindGrammar(grammarProvider);
1100 this.gaTerminals = gaTerminals;
1101 this.pProblem = new ProblemElements();
1102 this.pStatement = new StatementElements();
1103 this.pClassDeclaration = new ClassDeclarationElements();
1104 this.pReferenceDeclaration = new ReferenceDeclarationElements();
1105 this.pPredicateDefinition = new PredicateDefinitionElements();
1106 this.pParameter = new ParameterElements();
1107 this.pConjunction = new ConjunctionElements();
1108 this.pLiteral = new LiteralElements();
1109 this.pNegativeLiteral = new NegativeLiteralElements();
1110 this.pAtom = new AtomElements();
1111 this.pAssertion = new AssertionElements();
1112 this.eLogicValue = new LogicValueElements();
1113 this.eShortLogicValue = new ShortLogicValueElements();
1114 this.pScopeDeclaration = new ScopeDeclarationElements();
1115 this.pTypeScope = new TypeScopeElements();
1116 this.pMultiplicity = new MultiplicityElements();
1117 this.pRangeMultiplicity = new RangeMultiplicityElements();
1118 this.pExactMultiplicity = new ExactMultiplicityElements();
1119 this.pUpperBound = new UpperBoundElements();
1120 this.pQualifiedName = new QualifiedNameElements();
1121 }
1122
1123 protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
1124 Grammar grammar = grammarProvider.getGrammar(this);
1125 while (grammar != null) {
1126 if ("org.eclipse.viatra.solver.language.Problem".equals(grammar.getName())) {
1127 return grammar;
1128 }
1129 List<Grammar> grammars = grammar.getUsedGrammars();
1130 if (!grammars.isEmpty()) {
1131 grammar = grammars.iterator().next();
1132 } else {
1133 return null;
1134 }
1135 }
1136 return grammar;
1137 }
1138
1139 @Override
1140 public Grammar getGrammar() {
1141 return grammar;
1142 }
1143
1144
1145 public TerminalsGrammarAccess getTerminalsGrammarAccess() {
1146 return gaTerminals;
1147 }
1148
1149
1150 //Problem:
1151 // statements+=Statement*;
1152 public ProblemElements getProblemAccess() {
1153 return pProblem;
1154 }
1155
1156 public ParserRule getProblemRule() {
1157 return getProblemAccess().getRule();
1158 }
1159
1160 //Statement:
1161 // ClassDeclaration | PredicateDefinition | Assertion | ScopeDeclaration;
1162 public StatementElements getStatementAccess() {
1163 return pStatement;
1164 }
1165
1166 public ParserRule getStatementRule() {
1167 return getStatementAccess().getRule();
1168 }
1169
1170 //ClassDeclaration:
1171 // abstract?="abstract"? "class"
1172 // name=ID
1173 // ("extends" (superTypes+=[ClassDeclaration] |
1174 // "[" (superTypes+=[ClassDeclaration] ("," superTypes+=[ClassDeclaration])*)? "]") |
1175 // referenceDeclarations+=ReferenceDeclaration)?
1176 // ("," referenceDeclarations+=ReferenceDeclaration)*
1177 // ".";
1178 public ClassDeclarationElements getClassDeclarationAccess() {
1179 return pClassDeclaration;
1180 }
1181
1182 public ParserRule getClassDeclarationRule() {
1183 return getClassDeclarationAccess().getRule();
1184 }
1185
1186 //ReferenceDeclaration:
1187 // (containment?="contains" | "refers")
1188 // referenceType=[ClassDeclaration]
1189 // "[" multiplicity=Multiplicity "]"
1190 // name=ID
1191 // ("opposite" opposite=[ReferenceDeclaration|QualifiedName])?;
1192 public ReferenceDeclarationElements getReferenceDeclarationAccess() {
1193 return pReferenceDeclaration;
1194 }
1195
1196 public ParserRule getReferenceDeclarationRule() {
1197 return getReferenceDeclarationAccess().getRule();
1198 }
1199
1200 //PredicateDefinition:
1201 // (error?="error" "pred"? | "pred")
1202 // name=ID
1203 // "(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")"
1204 // (":=" bodies+=Conjunction (";" bodies+=Conjunction)*)?
1205 // ".";
1206 public PredicateDefinitionElements getPredicateDefinitionAccess() {
1207 return pPredicateDefinition;
1208 }
1209
1210 public ParserRule getPredicateDefinitionRule() {
1211 return getPredicateDefinitionAccess().getRule();
1212 }
1213
1214 //Parameter:
1215 // parameterType=[ClassDeclaration] name=ID;
1216 public ParameterElements getParameterAccess() {
1217 return pParameter;
1218 }
1219
1220 public ParserRule getParameterRule() {
1221 return getParameterAccess().getRule();
1222 }
1223
1224 //Conjunction:
1225 // literals+=Literal ("," literals+=Literal)*;
1226 public ConjunctionElements getConjunctionAccess() {
1227 return pConjunction;
1228 }
1229
1230 public ParserRule getConjunctionRule() {
1231 return getConjunctionAccess().getRule();
1232 }
1233
1234 //Literal:
1235 // Atom | NegativeLiteral;
1236 public LiteralElements getLiteralAccess() {
1237 return pLiteral;
1238 }
1239
1240 public ParserRule getLiteralRule() {
1241 return getLiteralAccess().getRule();
1242 }
1243
1244 //NegativeLiteral:
1245 // "!" atom=Atom;
1246 public NegativeLiteralElements getNegativeLiteralAccess() {
1247 return pNegativeLiteral;
1248 }
1249
1250 public ParserRule getNegativeLiteralRule() {
1251 return getNegativeLiteralAccess().getRule();
1252 }
1253
1254 //Atom:
1255 // relation=[Relation|QualifiedName]
1256 // transitiveClosure?="+"?
1257 // "(" (arguments+=[Variable] ("," arguments+=[Variable])*)? ")";
1258 public AtomElements getAtomAccess() {
1259 return pAtom;
1260 }
1261
1262 public ParserRule getAtomRule() {
1263 return getAtomAccess().getRule();
1264 }
1265
1266 //Assertion:
1267 // (relation=[Relation|QualifiedName]
1268 // "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")"
1269 // ":" value=LogicValue |
1270 // value=ShortLogicValue?
1271 // relation=[Relation|QualifiedName]
1272 // "(" (arguments+=[Node|QualifiedName] ("," arguments+=[Node|QualifiedName])*)? ")")
1273 // ".";
1274 public AssertionElements getAssertionAccess() {
1275 return pAssertion;
1276 }
1277
1278 public ParserRule getAssertionRule() {
1279 return getAssertionAccess().getRule();
1280 }
1281
1282 //enum LogicValue:
1283 // TRUE="true" | FALSE="false" | UNKNOWN="unknown";
1284 public LogicValueElements getLogicValueAccess() {
1285 return eLogicValue;
1286 }
1287
1288 public EnumRule getLogicValueRule() {
1289 return getLogicValueAccess().getRule();
1290 }
1291
1292 //enum ShortLogicValue returns LogicValue:
1293 // FALSE="!" | UNKNOWN="?";
1294 public ShortLogicValueElements getShortLogicValueAccess() {
1295 return eShortLogicValue;
1296 }
1297
1298 public EnumRule getShortLogicValueRule() {
1299 return getShortLogicValueAccess().getRule();
1300 }
1301
1302 //ScopeDeclaration:
1303 // "scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* ".";
1304 public ScopeDeclarationElements getScopeDeclarationAccess() {
1305 return pScopeDeclaration;
1306 }
1307
1308 public ParserRule getScopeDeclarationRule() {
1309 return getScopeDeclarationAccess().getRule();
1310 }
1311
1312 //TypeScope:
1313 // targetType=[ClassDeclaration]
1314 // (increment?="+=" | "=")
1315 // multiplicity=Multiplicity;
1316 public TypeScopeElements getTypeScopeAccess() {
1317 return pTypeScope;
1318 }
1319
1320 public ParserRule getTypeScopeRule() {
1321 return getTypeScopeAccess().getRule();
1322 }
1323
1324 //Multiplicity:
1325 // RangeMultiplicity | ExactMultiplicity;
1326 public MultiplicityElements getMultiplicityAccess() {
1327 return pMultiplicity;
1328 }
1329
1330 public ParserRule getMultiplicityRule() {
1331 return getMultiplicityAccess().getRule();
1332 }
1333
1334 //RangeMultiplicity:
1335 // lowerBound=INT ".." upperBound=UpperBound;
1336 public RangeMultiplicityElements getRangeMultiplicityAccess() {
1337 return pRangeMultiplicity;
1338 }
1339
1340 public ParserRule getRangeMultiplicityRule() {
1341 return getRangeMultiplicityAccess().getRule();
1342 }
1343
1344 //ExactMultiplicity:
1345 // exactValue=INT;
1346 public ExactMultiplicityElements getExactMultiplicityAccess() {
1347 return pExactMultiplicity;
1348 }
1349
1350 public ParserRule getExactMultiplicityRule() {
1351 return getExactMultiplicityAccess().getRule();
1352 }
1353
1354 //UpperBound returns ecore::EInt:
1355 // INT | "*";
1356 public UpperBoundElements getUpperBoundAccess() {
1357 return pUpperBound;
1358 }
1359
1360 public ParserRule getUpperBoundRule() {
1361 return getUpperBoundAccess().getRule();
1362 }
1363
1364 //QualifiedName:
1365 // ID ("::" ID)*;
1366 public QualifiedNameElements getQualifiedNameAccess() {
1367 return pQualifiedName;
1368 }
1369
1370 public ParserRule getQualifiedNameRule() {
1371 return getQualifiedNameAccess().getRule();
1372 }
1373
1374 //terminal ID: '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
1375 public TerminalRule getIDRule() {
1376 return gaTerminals.getIDRule();
1377 }
1378
1379 //terminal INT returns ecore::EInt: ('0'..'9')+;
1380 public TerminalRule getINTRule() {
1381 return gaTerminals.getINTRule();
1382 }
1383
1384 //terminal STRING:
1385 // '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"' |
1386 // "'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'"
1387 // ;
1388 public TerminalRule getSTRINGRule() {
1389 return gaTerminals.getSTRINGRule();
1390 }
1391
1392 //terminal ML_COMMENT : '/*' -> '*/';
1393 public TerminalRule getML_COMMENTRule() {
1394 return gaTerminals.getML_COMMENTRule();
1395 }
1396
1397 //terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?;
1398 public TerminalRule getSL_COMMENTRule() {
1399 return gaTerminals.getSL_COMMENTRule();
1400 }
1401
1402 //terminal WS : (' '|'\t'|'\r'|'\n')+;
1403 public TerminalRule getWSRule() {
1404 return gaTerminals.getWSRule();
1405 }
1406
1407 //terminal ANY_OTHER: .;
1408 public TerminalRule getANY_OTHERRule() {
1409 return gaTerminals.getANY_OTHERRule();
1410 }
1411}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/AbstractProblemValidator.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/AbstractProblemValidator.java
new file mode 100644
index 00000000..9cd73e1e
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/AbstractProblemValidator.java
@@ -0,0 +1,19 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.validation;
5
6import java.util.ArrayList;
7import java.util.List;
8import org.eclipse.emf.ecore.EPackage;
9import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
10
11public abstract class AbstractProblemValidator extends AbstractDeclarativeValidator {
12
13 @Override
14 protected List<EPackage> getEPackages() {
15 List<EPackage> result = new ArrayList<EPackage>();
16 result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/viatra/solver/language/model/Problem"));
17 return result;
18 }
19}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/ProblemConfigurableIssueCodesProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/ProblemConfigurableIssueCodesProvider.java
new file mode 100644
index 00000000..f5a0d87d
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/validation/ProblemConfigurableIssueCodesProvider.java
@@ -0,0 +1,22 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.validation;
5
6import org.eclipse.xtext.preferences.PreferenceKey;
7import org.eclipse.xtext.util.IAcceptor;
8import org.eclipse.xtext.validation.ConfigurableIssueCodesProvider;
9import org.eclipse.xtext.validation.SeverityConverter;
10
11@SuppressWarnings("restriction")
12public class ProblemConfigurableIssueCodesProvider extends ConfigurableIssueCodesProvider {
13 protected static final String ISSUE_CODE_PREFIX = "org.eclipse.viatra.solver.language.";
14
15 public static final String DEPRECATED_MODEL_PART = ISSUE_CODE_PREFIX + "deprecatedModelPart";
16
17 @Override
18 protected void initialize(IAcceptor<PreferenceKey> acceptor) {
19 super.initialize(acceptor);
20 acceptor.accept(create(DEPRECATED_MODEL_PART, SeverityConverter.SEVERITY_WARNING));
21 }
22}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend
new file mode 100644
index 00000000..b007cf8b
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend
@@ -0,0 +1,30 @@
1/*
2 * generated by Xtext 2.25.0
3 */
4package org.eclipse.viatra.solver.language.tests
5
6import com.google.inject.Inject
7import org.eclipse.viatra.solver.language.model.problem.Problem
8import org.eclipse.xtext.testing.InjectWith
9import org.eclipse.xtext.testing.extensions.InjectionExtension
10import org.eclipse.xtext.testing.util.ParseHelper
11import org.junit.jupiter.api.Assertions
12import org.junit.jupiter.api.Test
13import org.junit.jupiter.api.^extension.ExtendWith
14
15@ExtendWith(InjectionExtension)
16@InjectWith(ProblemInjectorProvider)
17class ProblemParsingTest {
18 @Inject
19 ParseHelper<Problem> parseHelper
20
21 @Test
22 def void loadModel() {
23 val result = parseHelper.parse('''
24 Hello Xtext!
25 ''')
26 Assertions.assertNotNull(result)
27 val errors = result.eResource.errors
28 Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''')
29 }
30}
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/xtext-gen/org/eclipse/viatra/solver/language/tests/ProblemInjectorProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/xtext-gen/org/eclipse/viatra/solver/language/tests/ProblemInjectorProvider.java
new file mode 100644
index 00000000..7d0ef1bb
--- /dev/null
+++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/test/xtext-gen/org/eclipse/viatra/solver/language/tests/ProblemInjectorProvider.java
@@ -0,0 +1,69 @@
1/*
2 * generated by Xtext 2.26.0.M1
3 */
4package org.eclipse.viatra.solver.language.tests;
5
6import com.google.inject.Guice;
7import com.google.inject.Injector;
8import org.eclipse.viatra.solver.language.ProblemRuntimeModule;
9import org.eclipse.viatra.solver.language.ProblemStandaloneSetup;
10import org.eclipse.xtext.testing.GlobalRegistries;
11import org.eclipse.xtext.testing.GlobalRegistries.GlobalStateMemento;
12import org.eclipse.xtext.testing.IInjectorProvider;
13import org.eclipse.xtext.testing.IRegistryConfigurator;
14
15public class ProblemInjectorProvider implements IInjectorProvider, IRegistryConfigurator {
16
17 protected GlobalStateMemento stateBeforeInjectorCreation;
18 protected GlobalStateMemento stateAfterInjectorCreation;
19 protected Injector injector;
20
21 static {
22 GlobalRegistries.initializeDefaults();
23 }
24
25 @Override
26 public Injector getInjector() {
27 if (injector == null) {
28 this.injector = internalCreateInjector();
29 stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
30 }
31 return injector;
32 }
33
34 protected Injector internalCreateInjector() {
35 return new ProblemStandaloneSetup() {
36 @Override
37 public Injector createInjector() {
38 return Guice.createInjector(createRuntimeModule());
39 }
40 }.createInjectorAndDoEMFRegistration();
41 }
42
43 protected ProblemRuntimeModule createRuntimeModule() {
44 // make it work also with Maven/Tycho and OSGI
45 // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=493672
46 return new ProblemRuntimeModule() {
47 @Override
48 public ClassLoader bindClassLoaderToInstance() {
49 return ProblemInjectorProvider.class
50 .getClassLoader();
51 }
52 };
53 }
54
55 @Override
56 public void restoreRegistry() {
57 stateBeforeInjectorCreation.restoreGlobalState();
58 stateBeforeInjectorCreation = null;
59 }
60
61 @Override
62 public void setupRegistry() {
63 stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
64 if (injector == null) {
65 getInjector();
66 }
67 stateAfterInjectorCreation.restoreGlobalState();
68 }
69}