diff options
author | 2021-06-27 14:22:40 +0200 | |
---|---|---|
committer | 2021-06-27 14:22:40 +0200 | |
commit | 07719e927f9d398765e661c84fd8778cefb39083 (patch) | |
tree | 9652080f7e580f09a0763a3e258348dea6e02684 /language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java | |
parent | Add enum support (diff) | |
download | refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.gz refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.zst refinery-07719e927f9d398765e661c84fd8778cefb39083.zip |
Simplify project layout
Diffstat (limited to 'language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java')
-rw-r--r-- | language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java b/language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java new file mode 100644 index 00000000..e4142d9f --- /dev/null +++ b/language-ide/src/main/xtext-gen/org/eclipse/viatra/solver/language/ide/contentassist/antlr/ProblemParser.java | |||
@@ -0,0 +1,181 @@ | |||
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_4(), "rule__ClassDeclaration__Alternatives_4"); | ||
36 | builder.put(grammarAccess.getEnumDeclarationAccess().getAlternatives_2(), "rule__EnumDeclaration__Alternatives_2"); | ||
37 | builder.put(grammarAccess.getEnumDeclarationAccess().getAlternatives_2_0_1_2(), "rule__EnumDeclaration__Alternatives_2_0_1_2"); | ||
38 | builder.put(grammarAccess.getReferenceDeclarationAccess().getAlternatives_0(), "rule__ReferenceDeclaration__Alternatives_0"); | ||
39 | builder.put(grammarAccess.getPredicateDefinitionAccess().getAlternatives_0(), "rule__PredicateDefinition__Alternatives_0"); | ||
40 | builder.put(grammarAccess.getLiteralAccess().getAlternatives(), "rule__Literal__Alternatives"); | ||
41 | builder.put(grammarAccess.getAssertionAccess().getAlternatives_0(), "rule__Assertion__Alternatives_0"); | ||
42 | builder.put(grammarAccess.getTypeScopeAccess().getAlternatives_1(), "rule__TypeScope__Alternatives_1"); | ||
43 | builder.put(grammarAccess.getMultiplicityAccess().getAlternatives(), "rule__Multiplicity__Alternatives"); | ||
44 | builder.put(grammarAccess.getDefiniteMultiplicityAccess().getAlternatives(), "rule__DefiniteMultiplicity__Alternatives"); | ||
45 | builder.put(grammarAccess.getUpperBoundAccess().getAlternatives(), "rule__UpperBound__Alternatives"); | ||
46 | builder.put(grammarAccess.getQuotedOrUnquotedIdAccess().getAlternatives(), "rule__QuotedOrUnquotedId__Alternatives"); | ||
47 | builder.put(grammarAccess.getQualifiedNameAccess().getAlternatives(), "rule__QualifiedName__Alternatives"); | ||
48 | builder.put(grammarAccess.getIdentifierAccess().getAlternatives(), "rule__Identifier__Alternatives"); | ||
49 | builder.put(grammarAccess.getLogicValueAccess().getAlternatives(), "rule__LogicValue__Alternatives"); | ||
50 | builder.put(grammarAccess.getShortLogicValueAccess().getAlternatives(), "rule__ShortLogicValue__Alternatives"); | ||
51 | builder.put(grammarAccess.getProblemAccess().getGroup(), "rule__Problem__Group__0"); | ||
52 | builder.put(grammarAccess.getProblemAccess().getGroup_0(), "rule__Problem__Group_0__0"); | ||
53 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup(), "rule__ClassDeclaration__Group__0"); | ||
54 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3(), "rule__ClassDeclaration__Group_3__0"); | ||
55 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_3_2(), "rule__ClassDeclaration__Group_3_2__0"); | ||
56 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_4_0(), "rule__ClassDeclaration__Group_4_0__0"); | ||
57 | builder.put(grammarAccess.getClassDeclarationAccess().getGroup_4_0_1(), "rule__ClassDeclaration__Group_4_0_1__0"); | ||
58 | builder.put(grammarAccess.getEnumDeclarationAccess().getGroup(), "rule__EnumDeclaration__Group__0"); | ||
59 | builder.put(grammarAccess.getEnumDeclarationAccess().getGroup_2_0(), "rule__EnumDeclaration__Group_2_0__0"); | ||
60 | builder.put(grammarAccess.getEnumDeclarationAccess().getGroup_2_0_1(), "rule__EnumDeclaration__Group_2_0_1__0"); | ||
61 | builder.put(grammarAccess.getEnumDeclarationAccess().getGroup_2_0_1_1(), "rule__EnumDeclaration__Group_2_0_1_1__0"); | ||
62 | builder.put(grammarAccess.getReferenceDeclarationAccess().getGroup(), "rule__ReferenceDeclaration__Group__0"); | ||
63 | builder.put(grammarAccess.getReferenceDeclarationAccess().getGroup_2(), "rule__ReferenceDeclaration__Group_2__0"); | ||
64 | builder.put(grammarAccess.getReferenceDeclarationAccess().getGroup_4(), "rule__ReferenceDeclaration__Group_4__0"); | ||
65 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup(), "rule__PredicateDefinition__Group__0"); | ||
66 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_0_0(), "rule__PredicateDefinition__Group_0_0__0"); | ||
67 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_3(), "rule__PredicateDefinition__Group_3__0"); | ||
68 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_3_1(), "rule__PredicateDefinition__Group_3_1__0"); | ||
69 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_5(), "rule__PredicateDefinition__Group_5__0"); | ||
70 | builder.put(grammarAccess.getPredicateDefinitionAccess().getGroup_5_2(), "rule__PredicateDefinition__Group_5_2__0"); | ||
71 | builder.put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0"); | ||
72 | builder.put(grammarAccess.getConjunctionAccess().getGroup(), "rule__Conjunction__Group__0"); | ||
73 | builder.put(grammarAccess.getConjunctionAccess().getGroup_1(), "rule__Conjunction__Group_1__0"); | ||
74 | builder.put(grammarAccess.getNegativeLiteralAccess().getGroup(), "rule__NegativeLiteral__Group__0"); | ||
75 | builder.put(grammarAccess.getAtomAccess().getGroup(), "rule__Atom__Group__0"); | ||
76 | builder.put(grammarAccess.getAtomAccess().getGroup_3(), "rule__Atom__Group_3__0"); | ||
77 | builder.put(grammarAccess.getAtomAccess().getGroup_3_1(), "rule__Atom__Group_3_1__0"); | ||
78 | builder.put(grammarAccess.getAssertionAccess().getGroup(), "rule__Assertion__Group__0"); | ||
79 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0(), "rule__Assertion__Group_0_0__0"); | ||
80 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0_2(), "rule__Assertion__Group_0_0_2__0"); | ||
81 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_0_2_1(), "rule__Assertion__Group_0_0_2_1__0"); | ||
82 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1(), "rule__Assertion__Group_0_1__0"); | ||
83 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1_3(), "rule__Assertion__Group_0_1_3__0"); | ||
84 | builder.put(grammarAccess.getAssertionAccess().getGroup_0_1_3_1(), "rule__Assertion__Group_0_1_3_1__0"); | ||
85 | builder.put(grammarAccess.getScopeDeclarationAccess().getGroup(), "rule__ScopeDeclaration__Group__0"); | ||
86 | builder.put(grammarAccess.getScopeDeclarationAccess().getGroup_2(), "rule__ScopeDeclaration__Group_2__0"); | ||
87 | builder.put(grammarAccess.getTypeScopeAccess().getGroup(), "rule__TypeScope__Group__0"); | ||
88 | builder.put(grammarAccess.getRangeMultiplicityAccess().getGroup(), "rule__RangeMultiplicity__Group__0"); | ||
89 | builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0"); | ||
90 | builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1_1(), "rule__QualifiedName__Group_1_1__0"); | ||
91 | builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1_2(), "rule__QualifiedName__Group_1_2__0"); | ||
92 | builder.put(grammarAccess.getProblemAccess().getNameAssignment_0_1(), "rule__Problem__NameAssignment_0_1"); | ||
93 | builder.put(grammarAccess.getProblemAccess().getStatementsAssignment_1(), "rule__Problem__StatementsAssignment_1"); | ||
94 | builder.put(grammarAccess.getClassDeclarationAccess().getAbstractAssignment_0(), "rule__ClassDeclaration__AbstractAssignment_0"); | ||
95 | builder.put(grammarAccess.getClassDeclarationAccess().getNameAssignment_2(), "rule__ClassDeclaration__NameAssignment_2"); | ||
96 | builder.put(grammarAccess.getClassDeclarationAccess().getSuperTypesAssignment_3_1(), "rule__ClassDeclaration__SuperTypesAssignment_3_1"); | ||
97 | builder.put(grammarAccess.getClassDeclarationAccess().getSuperTypesAssignment_3_2_1(), "rule__ClassDeclaration__SuperTypesAssignment_3_2_1"); | ||
98 | builder.put(grammarAccess.getClassDeclarationAccess().getReferenceDeclarationsAssignment_4_0_1_0(), "rule__ClassDeclaration__ReferenceDeclarationsAssignment_4_0_1_0"); | ||
99 | builder.put(grammarAccess.getEnumDeclarationAccess().getNameAssignment_1(), "rule__EnumDeclaration__NameAssignment_1"); | ||
100 | builder.put(grammarAccess.getEnumDeclarationAccess().getLiteralsAssignment_2_0_1_0(), "rule__EnumDeclaration__LiteralsAssignment_2_0_1_0"); | ||
101 | builder.put(grammarAccess.getEnumDeclarationAccess().getLiteralsAssignment_2_0_1_1_1(), "rule__EnumDeclaration__LiteralsAssignment_2_0_1_1_1"); | ||
102 | builder.put(grammarAccess.getEnumLiteralAccess().getNameAssignment(), "rule__EnumLiteral__NameAssignment"); | ||
103 | builder.put(grammarAccess.getReferenceDeclarationAccess().getContainmentAssignment_0_0(), "rule__ReferenceDeclaration__ContainmentAssignment_0_0"); | ||
104 | builder.put(grammarAccess.getReferenceDeclarationAccess().getReferenceTypeAssignment_1(), "rule__ReferenceDeclaration__ReferenceTypeAssignment_1"); | ||
105 | builder.put(grammarAccess.getReferenceDeclarationAccess().getMultiplicityAssignment_2_1(), "rule__ReferenceDeclaration__MultiplicityAssignment_2_1"); | ||
106 | builder.put(grammarAccess.getReferenceDeclarationAccess().getNameAssignment_3(), "rule__ReferenceDeclaration__NameAssignment_3"); | ||
107 | builder.put(grammarAccess.getReferenceDeclarationAccess().getOppositeAssignment_4_1(), "rule__ReferenceDeclaration__OppositeAssignment_4_1"); | ||
108 | builder.put(grammarAccess.getPredicateDefinitionAccess().getErrorAssignment_0_0_0(), "rule__PredicateDefinition__ErrorAssignment_0_0_0"); | ||
109 | builder.put(grammarAccess.getPredicateDefinitionAccess().getNameAssignment_1(), "rule__PredicateDefinition__NameAssignment_1"); | ||
110 | builder.put(grammarAccess.getPredicateDefinitionAccess().getParametersAssignment_3_0(), "rule__PredicateDefinition__ParametersAssignment_3_0"); | ||
111 | builder.put(grammarAccess.getPredicateDefinitionAccess().getParametersAssignment_3_1_1(), "rule__PredicateDefinition__ParametersAssignment_3_1_1"); | ||
112 | builder.put(grammarAccess.getPredicateDefinitionAccess().getBodiesAssignment_5_1(), "rule__PredicateDefinition__BodiesAssignment_5_1"); | ||
113 | builder.put(grammarAccess.getPredicateDefinitionAccess().getBodiesAssignment_5_2_1(), "rule__PredicateDefinition__BodiesAssignment_5_2_1"); | ||
114 | builder.put(grammarAccess.getParameterAccess().getParameterTypeAssignment_0(), "rule__Parameter__ParameterTypeAssignment_0"); | ||
115 | builder.put(grammarAccess.getParameterAccess().getNameAssignment_1(), "rule__Parameter__NameAssignment_1"); | ||
116 | builder.put(grammarAccess.getConjunctionAccess().getLiteralsAssignment_0(), "rule__Conjunction__LiteralsAssignment_0"); | ||
117 | builder.put(grammarAccess.getConjunctionAccess().getLiteralsAssignment_1_1(), "rule__Conjunction__LiteralsAssignment_1_1"); | ||
118 | builder.put(grammarAccess.getNegativeLiteralAccess().getAtomAssignment_1(), "rule__NegativeLiteral__AtomAssignment_1"); | ||
119 | builder.put(grammarAccess.getAtomAccess().getRelationAssignment_0(), "rule__Atom__RelationAssignment_0"); | ||
120 | builder.put(grammarAccess.getAtomAccess().getTransitiveClosureAssignment_1(), "rule__Atom__TransitiveClosureAssignment_1"); | ||
121 | builder.put(grammarAccess.getAtomAccess().getArgumentsAssignment_3_0(), "rule__Atom__ArgumentsAssignment_3_0"); | ||
122 | builder.put(grammarAccess.getAtomAccess().getArgumentsAssignment_3_1_1(), "rule__Atom__ArgumentsAssignment_3_1_1"); | ||
123 | builder.put(grammarAccess.getArgumentAccess().getVariableOrNodeAssignment(), "rule__Argument__VariableOrNodeAssignment"); | ||
124 | builder.put(grammarAccess.getAssertionAccess().getRelationAssignment_0_0_0(), "rule__Assertion__RelationAssignment_0_0_0"); | ||
125 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_0_2_0(), "rule__Assertion__ArgumentsAssignment_0_0_2_0"); | ||
126 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_0_2_1_1(), "rule__Assertion__ArgumentsAssignment_0_0_2_1_1"); | ||
127 | builder.put(grammarAccess.getAssertionAccess().getValueAssignment_0_0_5(), "rule__Assertion__ValueAssignment_0_0_5"); | ||
128 | builder.put(grammarAccess.getAssertionAccess().getValueAssignment_0_1_0(), "rule__Assertion__ValueAssignment_0_1_0"); | ||
129 | builder.put(grammarAccess.getAssertionAccess().getRelationAssignment_0_1_1(), "rule__Assertion__RelationAssignment_0_1_1"); | ||
130 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_1_3_0(), "rule__Assertion__ArgumentsAssignment_0_1_3_0"); | ||
131 | builder.put(grammarAccess.getAssertionAccess().getArgumentsAssignment_0_1_3_1_1(), "rule__Assertion__ArgumentsAssignment_0_1_3_1_1"); | ||
132 | builder.put(grammarAccess.getScopeDeclarationAccess().getTypeScopesAssignment_1(), "rule__ScopeDeclaration__TypeScopesAssignment_1"); | ||
133 | builder.put(grammarAccess.getScopeDeclarationAccess().getTypeScopesAssignment_2_1(), "rule__ScopeDeclaration__TypeScopesAssignment_2_1"); | ||
134 | builder.put(grammarAccess.getTypeScopeAccess().getTargetTypeAssignment_0(), "rule__TypeScope__TargetTypeAssignment_0"); | ||
135 | builder.put(grammarAccess.getTypeScopeAccess().getIncrementAssignment_1_0(), "rule__TypeScope__IncrementAssignment_1_0"); | ||
136 | builder.put(grammarAccess.getTypeScopeAccess().getMultiplicityAssignment_2(), "rule__TypeScope__MultiplicityAssignment_2"); | ||
137 | builder.put(grammarAccess.getRangeMultiplicityAccess().getLowerBoundAssignment_0(), "rule__RangeMultiplicity__LowerBoundAssignment_0"); | ||
138 | builder.put(grammarAccess.getRangeMultiplicityAccess().getUpperBoundAssignment_2(), "rule__RangeMultiplicity__UpperBoundAssignment_2"); | ||
139 | builder.put(grammarAccess.getExactMultiplicityAccess().getExactValueAssignment(), "rule__ExactMultiplicity__ExactValueAssignment"); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | @Inject | ||
144 | private NameMappings nameMappings; | ||
145 | |||
146 | @Inject | ||
147 | private ProblemGrammarAccess grammarAccess; | ||
148 | |||
149 | @Override | ||
150 | protected InternalProblemParser createParser() { | ||
151 | InternalProblemParser result = new InternalProblemParser(null); | ||
152 | result.setGrammarAccess(grammarAccess); | ||
153 | return result; | ||
154 | } | ||
155 | |||
156 | @Override | ||
157 | protected String getRuleName(AbstractElement element) { | ||
158 | return nameMappings.getRuleName(element); | ||
159 | } | ||
160 | |||
161 | @Override | ||
162 | protected String[] getInitialHiddenTokens() { | ||
163 | return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; | ||
164 | } | ||
165 | |||
166 | public ProblemGrammarAccess getGrammarAccess() { | ||
167 | return this.grammarAccess; | ||
168 | } | ||
169 | |||
170 | public void setGrammarAccess(ProblemGrammarAccess grammarAccess) { | ||
171 | this.grammarAccess = grammarAccess; | ||
172 | } | ||
173 | |||
174 | public NameMappings getNameMappings() { | ||
175 | return nameMappings; | ||
176 | } | ||
177 | |||
178 | public void setNameMappings(NameMappings nameMappings) { | ||
179 | this.nameMappings = nameMappings; | ||
180 | } | ||
181 | } | ||