diff options
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java')
-rw-r--r-- | org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java new file mode 100644 index 00000000..78416e64 --- /dev/null +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.26.0.M1 | ||
3 | */ | ||
4 | package org.eclipse.viatra.solver.language.ide.contentassist.antlr; | ||
5 | |||
6 | import com.google.common.collect.ImmutableMap; | ||
7 | import com.google.inject.Inject; | ||
8 | import com.google.inject.Singleton; | ||
9 | import java.util.Map; | ||
10 | import org.eclipse.viatra.solver.language.ide.contentassist.antlr.internal.InternalProblemParser; | ||
11 | import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess; | ||
12 | import org.eclipse.xtext.AbstractElement; | ||
13 | import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser; | ||
14 | |||
15 | public class ProblemParser extends AbstractContentAssistParser { | ||
16 | |||
17 | @Singleton | ||
18 | public static final class NameMappings { | ||
19 | |||
20 | private final Map<AbstractElement, String> mappings; | ||
21 | |||
22 | @Inject | ||
23 | public NameMappings(ProblemGrammarAccess grammarAccess) { | ||
24 | ImmutableMap.Builder<AbstractElement, String> builder = ImmutableMap.builder(); | ||
25 | init(builder, grammarAccess); | ||
26 | this.mappings = builder.build(); | ||
27 | } | ||
28 | |||
29 | public String getRuleName(AbstractElement element) { | ||
30 | return mappings.get(element); | ||
31 | } | ||
32 | |||
33 | private static void init(ImmutableMap.Builder<AbstractElement, String> builder, ProblemGrammarAccess grammarAccess) { | ||
34 | builder.put(grammarAccess.getStatementAccess().getAlternatives(), "rule__Statement__Alternatives"); | ||
35 | builder.put(grammarAccess.getClassDeclarationAccess().getAlternatives_3(), "rule__ClassDeclaration__Alternatives_3"); | ||
36 | builder.put(grammarAccess.getClassDeclarationAccess().getAlternatives_3_0_1(), "rule__ClassDeclaration__Alternatives_3_0_1"); | ||
37 | builder.put(grammarAccess.getReferenceDeclarationAccess().getAlternatives_0(), "rule__ReferenceDeclaration__Alternatives_0"); | ||
38 | builder.put(grammarAccess.getPredicateDefinitionAccess().getAlternatives_0(), "rule__PredicateDefinition__Alternatives_0"); | ||
39 | builder.put(grammarAccess.getLiteralAccess().getAlternatives(), "rule__Literal__Alternatives"); | ||
40 | builder.put(grammarAccess.getAssertionAccess().getAlternatives_0(), "rule__Assertion__Alternatives_0"); | ||
41 | builder.put(grammarAccess.getTypeScopeAccess().getAlternatives_1(), "rule__TypeScope__Alternatives_1"); | ||
42 | builder.put(grammarAccess.getMultiplicityAccess().getAlternatives(), "rule__Multiplicity__Alternatives"); | ||
43 | builder.put(grammarAccess.getUpperBoundAccess().getAlternatives(), "rule__UpperBound__Alternatives"); | ||
44 | builder.put(grammarAccess.getLogicValueAccess().getAlternatives(), "rule__LogicValue__Alternatives"); | ||
45 | builder.put(grammarAccess.getShortLogicValueAccess().getAlternatives(), "rule__ShortLogicValue__Alternatives"); | ||
46 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup(), "rule__ClassDeclaration__Group__0"); | ||
47 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3_0(), "rule__ClassDeclaration__Group_3_0__0"); | ||
48 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3_0_1_1(), "rule__ClassDeclaration__Group_3_0_1_1__0"); | ||
49 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3_0_1_1_1(), "rule__ClassDeclaration__Group_3_0_1_1_1__0"); | ||
50 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3_0_1_1_1_1(), "rule__ClassDeclaration__Group_3_0_1_1_1_1__0"); | ||
51 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_4(), "rule__ClassDeclaration__Group_4__0"); | ||
52 | builder.put(grammarAccess.getReferenceDeclarationAccess().getGroup(), "rule__ReferenceDeclaration__Group__0"); | ||
53 | builder.put(grammarAccess.getReferenceDeclarationAccess().getGroup_6(), "rule__ReferenceDeclaration__Group_6__0"); | ||
54 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup(), "rule__PredicateDefinition__Group__0"); | ||
55 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_0_0(), "rule__PredicateDefinition__Group_0_0__0"); | ||
56 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_3(), "rule__PredicateDefinition__Group_3__0"); | ||
57 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_3_1(), "rule__PredicateDefinition__Group_3_1__0"); | ||
58 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_5(), "rule__PredicateDefinition__Group_5__0"); | ||
59 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_5_2(), "rule__PredicateDefinition__Group_5_2__0"); | ||
60 | builder.put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0"); | ||
61 | builder.put(grammarAccess.getConjunctionAccess().getGroup(), "rule__Conjunction__Group__0"); | ||
62 | builder.put(grammarAccess.getConjunctionAccess().getGroup_1(), "rule__Conjunction__Group_1__0"); | ||
63 | builder.put(grammarAccess.getNegativeLiteralAccess().getGroup(), "rule__NegativeLiteral__Group__0"); | ||
64 | builder.put(grammarAccess.getAtomAccess().getGroup(), "rule__Atom__Group__0"); | ||
65 | builder.put(grammarAccess.getAtomAccess().getGroup_3(), "rule__Atom__Group_3__0"); | ||
66 | builder.put(grammarAccess.getAtomAccess().getGroup_3_1(), "rule__Atom__Group_3_1__0"); | ||
67 | builder.put(grammarAccess.getAssertionAccess().getGroup(), "rule__Assertion__Group__0"); | ||
68 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0(), "rule__Assertion__Group_0_0__0"); | ||
69 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0_2(), "rule__Assertion__Group_0_0_2__0"); | ||
70 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0_2_1(), "rule__Assertion__Group_0_0_2_1__0"); | ||
71 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1(), "rule__Assertion__Group_0_1__0"); | ||
72 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1_3(), "rule__Assertion__Group_0_1_3__0"); | ||
73 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1_3_1(), "rule__Assertion__Group_0_1_3_1__0"); | ||
74 | builder.put(grammarAccess.getScopeDeclarationAccess().getGroup(), "rule__ScopeDeclaration__Group__0"); | ||
75 | builder.put(grammarAccess.getScopeDeclarationAccess().getGroup_2(), "rule__ScopeDeclaration__Group_2__0"); | ||
76 | builder.put(grammarAccess.getTypeScopeAccess().getGroup(), "rule__TypeScope__Group__0"); | ||
77 | builder.put(grammarAccess.getRangeMultiplicityAccess().getGroup(), "rule__RangeMultiplicity__Group__0"); | ||
78 | builder.put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0"); | ||
79 | builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0"); | ||
80 | builder.put(grammarAccess.getProblemAccess().getStatementsAssignment(), "rule__Problem__StatementsAssignment"); | ||
81 | builder.put(grammarAccess.getClassDeclarationAccess().getAbstractAssignment_0(), "rule__ClassDeclaration__AbstractAssignment_0"); | ||
82 | builder.put(grammarAccess.getClassDeclarationAccess().getNameAssignment_2(), "rule__ClassDeclaration__NameAssignment_2"); | ||
83 | builder.put(grammarAccess.getClassDeclarationAccess().getSuperTypesAssignment_3_0_1_0(), "rule__ClassDeclaration__SuperTypesAssignment_3_0_1_0"); | ||
84 | builder.put(grammarAccess.getClassDeclarationAccess().getSuperTypesAssignment_3_0_1_1_1_0(), "rule__ClassDeclaration__SuperTypesAssignment_3_0_1_1_1_0"); | ||
85 | builder.put(grammarAccess.getClassDeclarationAccess().getSuperTypesAssignment_3_0_1_1_1_1_1(), "rule__ClassDeclaration__SuperTypesAssignment_3_0_1_1_1_1_1"); | ||
86 | builder.put(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsAssignment_3_1(), "rule__ClassDeclaration__ReferenceDeclarationsAssignment_3_1"); | ||
87 | builder.put(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsAssignment_4_1(), "rule__ClassDeclaration__ReferenceDeclarationsAssignment_4_1"); | ||
88 | builder.put(grammarAccess.getReferenceDeclarationAccess().getContainmentAssignment_0_0(), "rule__ReferenceDeclaration__ContainmentAssignment_0_0"); | ||
89 | builder.put(grammarAccess.getReferenceDeclarationAccess().getReferenceTypeAssignment_1(), "rule__ReferenceDeclaration__ReferenceTypeAssignment_1"); | ||
90 | builder.put(grammarAccess.getReferenceDeclarationAccess().getMultiplicityAssignment_3(), "rule__ReferenceDeclaration__MultiplicityAssignment_3"); | ||
91 | builder.put(grammarAccess.getReferenceDeclarationAccess().getNameAssignment_5(), "rule__ReferenceDeclaration__NameAssignment_5"); | ||
92 | builder.put(grammarAccess.getReferenceDeclarationAccess().getOppositeAssignment_6_1(), "rule__ReferenceDeclaration__OppositeAssignment_6_1"); | ||
93 | builder.put(grammarAccess.getPredicateDefinitionAccess().getErrorAssignment_0_0_0(), "rule__PredicateDefinition__ErrorAssignment_0_0_0"); | ||
94 | builder.put(grammarAccess.getPredicateDefinitionAccess().getNameAssignment_1(), "rule__PredicateDefinition__NameAssignment_1"); | ||
95 | builder.put(grammarAccess.getPredicateDefinitionAccess().getParametersAssignment_3_0(), "rule__PredicateDefinition__ParametersAssignment_3_0"); | ||
96 | builder.put(grammarAccess.getPredicateDefinitionAccess().getParametersAssignment_3_1_1(), "rule__PredicateDefinition__ParametersAssignment_3_1_1"); | ||
97 | builder.put(grammarAccess.getPredicateDefinitionAccess().getBodiesAssignment_5_1(), "rule__PredicateDefinition__BodiesAssignment_5_1"); | ||
98 | builder.put(grammarAccess.getPredicateDefinitionAccess().getBodiesAssignment_5_2_1(), "rule__PredicateDefinition__BodiesAssignment_5_2_1"); | ||
99 | builder.put(grammarAccess.getParameterAccess().getParameterTypeAssignment_0(), "rule__Parameter__ParameterTypeAssignment_0"); | ||
100 | builder.put(grammarAccess.getParameterAccess().getNameAssignment_1(), "rule__Parameter__NameAssignment_1"); | ||
101 | builder.put(grammarAccess.getConjunctionAccess().getLiteralsAssignment_0(), "rule__Conjunction__LiteralsAssignment_0"); | ||
102 | builder.put(grammarAccess.getConjunctionAccess().getLiteralsAssignment_1_1(), "rule__Conjunction__LiteralsAssignment_1_1"); | ||
103 | builder.put(grammarAccess.getNegativeLiteralAccess().getAtomAssignment_1(), "rule__NegativeLiteral__AtomAssignment_1"); | ||
104 | builder.put(grammarAccess.getAtomAccess().getRelationAssignment_0(), "rule__Atom__RelationAssignment_0"); | ||
105 | builder.put(grammarAccess.getAtomAccess().getTransitiveClosureAssignment_1(), "rule__Atom__TransitiveClosureAssignment_1"); | ||
106 | builder.put(grammarAccess.getAtomAccess().getArgumentsAssignment_3_0(), "rule__Atom__ArgumentsAssignment_3_0"); | ||
107 | builder.put(grammarAccess.getAtomAccess().getArgumentsAssignment_3_1_1(), "rule__Atom__ArgumentsAssignment_3_1_1"); | ||
108 | builder.put(grammarAccess.getAssertionAccess().getRelationAssignment_0_0_0(), "rule__Assertion__RelationAssignment_0_0_0"); | ||
109 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_0_2_0(), "rule__Assertion__ArgumentsAssignment_0_0_2_0"); | ||
110 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_0_2_1_1(), "rule__Assertion__ArgumentsAssignment_0_0_2_1_1"); | ||
111 | builder.put(grammarAccess.getAssertionAccess().getValueAssignment_0_0_5(), "rule__Assertion__ValueAssignment_0_0_5"); | ||
112 | builder.put(grammarAccess.getAssertionAccess().getValueAssignment_0_1_0(), "rule__Assertion__ValueAssignment_0_1_0"); | ||
113 | builder.put(grammarAccess.getAssertionAccess().getRelationAssignment_0_1_1(), "rule__Assertion__RelationAssignment_0_1_1"); | ||
114 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_1_3_0(), "rule__Assertion__ArgumentsAssignment_0_1_3_0"); | ||
115 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_1_3_1_1(), "rule__Assertion__ArgumentsAssignment_0_1_3_1_1"); | ||
116 | builder.put(grammarAccess.getScopeDeclarationAccess().getTypeScopesAssignment_1(), "rule__ScopeDeclaration__TypeScopesAssignment_1"); | ||
117 | builder.put(grammarAccess.getScopeDeclarationAccess().getTypeScopesAssignment_2_1(), "rule__ScopeDeclaration__TypeScopesAssignment_2_1"); | ||
118 | builder.put(grammarAccess.getTypeScopeAccess().getTargetTypeAssignment_0(), "rule__TypeScope__TargetTypeAssignment_0"); | ||
119 | builder.put(grammarAccess.getTypeScopeAccess().getIncrementAssignment_1_0(), "rule__TypeScope__IncrementAssignment_1_0"); | ||
120 | builder.put(grammarAccess.getTypeScopeAccess().getMultiplicityAssignment_2(), "rule__TypeScope__MultiplicityAssignment_2"); | ||
121 | builder.put(grammarAccess.getRangeMultiplicityAccess().getLowerBoundAssignment_0(), "rule__RangeMultiplicity__LowerBoundAssignment_0"); | ||
122 | builder.put(grammarAccess.getRangeMultiplicityAccess().getUpperBoundAssignment_2(), "rule__RangeMultiplicity__UpperBoundAssignment_2"); | ||
123 | builder.put(grammarAccess.getExactMultiplicityAccess().getExactValueAssignment(), "rule__ExactMultiplicity__ExactValueAssignment"); | ||
124 | } | ||
125 | } | ||
126 | |||
127 | @Inject | ||
128 | private NameMappings nameMappings; | ||
129 | |||
130 | @Inject | ||
131 | private ProblemGrammarAccess grammarAccess; | ||
132 | |||
133 | @Override | ||
134 | protected InternalProblemParser createParser() { | ||
135 | InternalProblemParser result = new InternalProblemParser(null); | ||
136 | result.setGrammarAccess(grammarAccess); | ||
137 | return result; | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | protected String getRuleName(AbstractElement element) { | ||
142 | return nameMappings.getRuleName(element); | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | protected String[] getInitialHiddenTokens() { | ||
147 | return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; | ||
148 | } | ||
149 | |||
150 | public ProblemGrammarAccess getGrammarAccess() { | ||
151 | return this.grammarAccess; | ||
152 | } | ||
153 | |||
154 | public void setGrammarAccess(ProblemGrammarAccess grammarAccess) { | ||
155 | this.grammarAccess = grammarAccess; | ||
156 | } | ||
157 | |||
158 | public NameMappings getNameMappings() { | ||
159 | return nameMappings; | ||
160 | } | ||
161 | |||
162 | public void setNameMappings(NameMappings nameMappings) { | ||
163 | this.nameMappings = nameMappings; | ||
164 | } | ||
165 | } | ||