1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
/*
* generated by Xtext 2.18.0.M3
*/
package org.eclipse.viatra.solver.language.ide.contentassist.antlr;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Map;
import org.eclipse.viatra.solver.language.ide.contentassist.antlr.internal.InternalSolverLanguageParser;
import org.eclipse.viatra.solver.language.services.SolverLanguageGrammarAccess;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
public class SolverLanguageParser extends AbstractContentAssistParser {
@Singleton
public static final class NameMappings {
private final Map<AbstractElement, String> mappings;
@Inject
public NameMappings(SolverLanguageGrammarAccess grammarAccess) {
ImmutableMap.Builder<AbstractElement, String> builder = ImmutableMap.builder();
init(builder, grammarAccess);
this.mappings = builder.build();
}
public String getRuleName(AbstractElement element) {
return mappings.get(element);
}
private static void init(ImmutableMap.Builder<AbstractElement, String> builder, SolverLanguageGrammarAccess grammarAccess) {
builder.put(grammarAccess.getStatementAccess().getAlternatives(), "rule__Statement__Alternatives");
builder.put(grammarAccess.getBooleanValueAccess().getAlternatives(), "rule__BooleanValue__Alternatives");
builder.put(grammarAccess.getTruthValueAccess().getAlternatives(), "rule__TruthValue__Alternatives");
builder.put(grammarAccess.getInterpretationAccess().getAlternatives(), "rule__Interpretation__Alternatives");
builder.put(grammarAccess.getSymbolAccess().getAlternatives(), "rule__Symbol__Alternatives");
builder.put(grammarAccess.getPartialitySymbolAccess().getAlternatives(), "rule__PartialitySymbol__Alternatives");
builder.put(grammarAccess.getDataSymbolAccess().getAlternatives(), "rule__DataSymbol__Alternatives");
builder.put(grammarAccess.getComplexObjectAccess().getAlternatives(), "rule__ComplexObject__Alternatives");
builder.put(grammarAccess.getObjectAccess().getAlternatives(), "rule__Object__Alternatives");
builder.put(grammarAccess.getDataObjectAccess().getAlternatives(), "rule__DataObject__Alternatives");
builder.put(grammarAccess.getPredicateAccess().getAlternatives(), "rule__Predicate__Alternatives");
builder.put(grammarAccess.getPredicateSymbolAccess().getAlternatives_6(), "rule__PredicateSymbol__Alternatives_6");
builder.put(grammarAccess.getErrorPredicateAccess().getAlternatives_5(), "rule__ErrorPredicate__Alternatives_5");
builder.put(grammarAccess.getPatternBodyAccess().getAlternatives_1(), "rule__PatternBody__Alternatives_1");
builder.put(grammarAccess.getPolarityAccess().getAlternatives(), "rule__Polarity__Alternatives");
builder.put(grammarAccess.getConstraintAccess().getAlternatives_2(), "rule__Constraint__Alternatives_2");
builder.put(grammarAccess.getClosureTypeAccess().getAlternatives(), "rule__ClosureType__Alternatives");
builder.put(grammarAccess.getLiteralAccess().getAlternatives(), "rule__Literal__Alternatives");
builder.put(grammarAccess.getCDInterpretationAccess().getAlternatives(), "rule__CDInterpretation__Alternatives");
builder.put(grammarAccess.getMultiplicityDefinitionAccess().getAlternatives_2(), "rule__MultiplicityDefinition__Alternatives_2");
builder.put(grammarAccess.getREALLiteralAccess().getGroup(), "rule__REALLiteral__Group__0");
builder.put(grammarAccess.getINTLiteralAccess().getGroup(), "rule__INTLiteral__Group__0");
builder.put(grammarAccess.getBooleanValueAccess().getGroup_0(), "rule__BooleanValue__Group_0__0");
builder.put(grammarAccess.getBooleanValueAccess().getGroup_1(), "rule__BooleanValue__Group_1__0");
builder.put(grammarAccess.getTruthValueAccess().getGroup_0(), "rule__TruthValue__Group_0__0");
builder.put(grammarAccess.getTruthValueAccess().getGroup_1(), "rule__TruthValue__Group_1__0");
builder.put(grammarAccess.getTruthValueAccess().getGroup_2(), "rule__TruthValue__Group_2__0");
builder.put(grammarAccess.getTruthValueAccess().getGroup_3(), "rule__TruthValue__Group_3__0");
builder.put(grammarAccess.getBasicInterpretationAccess().getGroup(), "rule__BasicInterpretation__Group__0");
builder.put(grammarAccess.getExistSymbolAccess().getGroup(), "rule__ExistSymbol__Group__0");
builder.put(grammarAccess.getEqualsSymbolAccess().getGroup(), "rule__EqualsSymbol__Group__0");
builder.put(grammarAccess.getBooleanSymbolAccess().getGroup(), "rule__BooleanSymbol__Group__0");
builder.put(grammarAccess.getIntegerSymbolAccess().getGroup(), "rule__IntegerSymbol__Group__0");
builder.put(grammarAccess.getRealSymbolAccess().getGroup(), "rule__RealSymbol__Group__0");
builder.put(grammarAccess.getStringSymbolAccess().getGroup(), "rule__StringSymbol__Group__0");
builder.put(grammarAccess.getNamedObjectAccess().getGroup(), "rule__NamedObject__Group__0");
builder.put(grammarAccess.getPredicateSymbolAccess().getGroup(), "rule__PredicateSymbol__Group__0");
builder.put(grammarAccess.getPredicateSymbolAccess().getGroup_6_1(), "rule__PredicateSymbol__Group_6_1__0");
builder.put(grammarAccess.getPredicateSymbolAccess().getGroup_6_1_1(), "rule__PredicateSymbol__Group_6_1_1__0");
builder.put(grammarAccess.getErrorPredicateAccess().getGroup(), "rule__ErrorPredicate__Group__0");
builder.put(grammarAccess.getErrorPredicateAccess().getGroup_3(), "rule__ErrorPredicate__Group_3__0");
builder.put(grammarAccess.getErrorPredicateAccess().getGroup_5_1(), "rule__ErrorPredicate__Group_5_1__0");
builder.put(grammarAccess.getErrorPredicateAccess().getGroup_5_1_1(), "rule__ErrorPredicate__Group_5_1_1__0");
builder.put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0");
builder.put(grammarAccess.getParameterAccess().getGroup_1(), "rule__Parameter__Group_1__0");
builder.put(grammarAccess.getPatternBodyAccess().getGroup(), "rule__PatternBody__Group__0");
builder.put(grammarAccess.getPolarityAccess().getGroup_0(), "rule__Polarity__Group_0__0");
builder.put(grammarAccess.getPolarityAccess().getGroup_1(), "rule__Polarity__Group_1__0");
builder.put(grammarAccess.getConstraintAccess().getGroup(), "rule__Constraint__Group__0");
builder.put(grammarAccess.getConstraintAccess().getGroup_2_0(), "rule__Constraint__Group_2_0__0");
builder.put(grammarAccess.getConstraintAccess().getGroup_2_1(), "rule__Constraint__Group_2_1__0");
builder.put(grammarAccess.getClosureTypeAccess().getGroup_0(), "rule__ClosureType__Group_0__0");
builder.put(grammarAccess.getClosureTypeAccess().getGroup_1(), "rule__ClosureType__Group_1__0");
builder.put(grammarAccess.getAllInstancesAccess().getGroup(), "rule__AllInstances__Group__0");
builder.put(grammarAccess.getAllObjectsAccess().getGroup(), "rule__AllObjects__Group__0");
builder.put(grammarAccess.getDefaultInterpretationAccess().getGroup(), "rule__DefaultInterpretation__Group__0");
builder.put(grammarAccess.getClassInterpretationAccess().getGroup(), "rule__ClassInterpretation__Group__0");
builder.put(grammarAccess.getClassInterpretationAccess().getGroup_3(), "rule__ClassInterpretation__Group_3__0");
builder.put(grammarAccess.getEnumInterpretationAccess().getGroup(), "rule__EnumInterpretation__Group__0");
builder.put(grammarAccess.getFieldRelationInterpretationAccess().getGroup(), "rule__FieldRelationInterpretation__Group__0");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getGroup(), "rule__GlobalRelationInterpretation__Group__0");
builder.put(grammarAccess.getMultiplicityDefinitionAccess().getGroup(), "rule__MultiplicityDefinition__Group__0");
builder.put(grammarAccess.getProblemAccess().getStatementsAssignment(), "rule__Problem__StatementsAssignment");
builder.put(grammarAccess.getBasicInterpretationAccess().getSymbolAssignment_0(), "rule__BasicInterpretation__SymbolAssignment_0");
builder.put(grammarAccess.getBasicInterpretationAccess().getObjectsAssignment_2(), "rule__BasicInterpretation__ObjectsAssignment_2");
builder.put(grammarAccess.getBasicInterpretationAccess().getValueAssignment_5(), "rule__BasicInterpretation__ValueAssignment_5");
builder.put(grammarAccess.getModelSymbolAccess().getNameAssignment(), "rule__ModelSymbol__NameAssignment");
builder.put(grammarAccess.getNamedObjectAccess().getNameAssignment_1(), "rule__NamedObject__NameAssignment_1");
builder.put(grammarAccess.getUnnamedObjectAccess().getNameAssignment(), "rule__UnnamedObject__NameAssignment");
builder.put(grammarAccess.getBooleanObjectAccess().getValueAssignment(), "rule__BooleanObject__ValueAssignment");
builder.put(grammarAccess.getIntObjectAccess().getValueAssignment(), "rule__IntObject__ValueAssignment");
builder.put(grammarAccess.getRealObjectAccess().getValueAssignment(), "rule__RealObject__ValueAssignment");
builder.put(grammarAccess.getStringObjectAccess().getValueAssignment(), "rule__StringObject__ValueAssignment");
builder.put(grammarAccess.getPredicateSymbolAccess().getSymbolAssignment_1(), "rule__PredicateSymbol__SymbolAssignment_1");
builder.put(grammarAccess.getPredicateSymbolAccess().getParametersAssignment_3(), "rule__PredicateSymbol__ParametersAssignment_3");
builder.put(grammarAccess.getPredicateSymbolAccess().getBodiesAssignment_6_1_0(), "rule__PredicateSymbol__BodiesAssignment_6_1_0");
builder.put(grammarAccess.getPredicateSymbolAccess().getBodiesAssignment_6_1_1_1(), "rule__PredicateSymbol__BodiesAssignment_6_1_1_1");
builder.put(grammarAccess.getErrorPredicateAccess().getNameAssignment_2(), "rule__ErrorPredicate__NameAssignment_2");
builder.put(grammarAccess.getErrorPredicateAccess().getParametersAssignment_3_1(), "rule__ErrorPredicate__ParametersAssignment_3_1");
builder.put(grammarAccess.getErrorPredicateAccess().getBodiesAssignment_5_1_0(), "rule__ErrorPredicate__BodiesAssignment_5_1_0");
builder.put(grammarAccess.getErrorPredicateAccess().getBodiesAssignment_5_1_1_1(), "rule__ErrorPredicate__BodiesAssignment_5_1_1_1");
builder.put(grammarAccess.getParameterAccess().getVariableAssignment_0(), "rule__Parameter__VariableAssignment_0");
builder.put(grammarAccess.getParameterAccess().getTypeAssignment_1_1(), "rule__Parameter__TypeAssignment_1_1");
builder.put(grammarAccess.getPatternBodyAccess().getConstraintsAssignment_1_1(), "rule__PatternBody__ConstraintsAssignment_1_1");
builder.put(grammarAccess.getConstraintAccess().getPolarityAssignment_0(), "rule__Constraint__PolarityAssignment_0");
builder.put(grammarAccess.getConstraintAccess().getSymbolAssignment_1(), "rule__Constraint__SymbolAssignment_1");
builder.put(grammarAccess.getConstraintAccess().getParamsAssignment_2_0_1(), "rule__Constraint__ParamsAssignment_2_0_1");
builder.put(grammarAccess.getConstraintAccess().getClosureTypeAssignment_2_1_0(), "rule__Constraint__ClosureTypeAssignment_2_1_0");
builder.put(grammarAccess.getConstraintAccess().getParamsAssignment_2_1_2(), "rule__Constraint__ParamsAssignment_2_1_2");
builder.put(grammarAccess.getConstraintAccess().getParamsAssignment_2_1_3(), "rule__Constraint__ParamsAssignment_2_1_3");
builder.put(grammarAccess.getVariableAccess().getNameAssignment(), "rule__Variable__NameAssignment");
builder.put(grammarAccess.getAllInstancesAccess().getSymbolAssignment_1(), "rule__AllInstances__SymbolAssignment_1");
builder.put(grammarAccess.getDefaultInterpretationAccess().getInterpretationAssignment_1(), "rule__DefaultInterpretation__InterpretationAssignment_1");
builder.put(grammarAccess.getClassInterpretationAccess().getAbstractAssignment_0(), "rule__ClassInterpretation__AbstractAssignment_0");
builder.put(grammarAccess.getClassInterpretationAccess().getSymbolAssignment_2(), "rule__ClassInterpretation__SymbolAssignment_2");
builder.put(grammarAccess.getClassInterpretationAccess().getSupertypesAssignment_3_1(), "rule__ClassInterpretation__SupertypesAssignment_3_1");
builder.put(grammarAccess.getClassInterpretationAccess().getFieltAssignment_5(), "rule__ClassInterpretation__FieltAssignment_5");
builder.put(grammarAccess.getEnumInterpretationAccess().getSymbolAssignment_1(), "rule__EnumInterpretation__SymbolAssignment_1");
builder.put(grammarAccess.getEnumInterpretationAccess().getObjectsAssignment_3(), "rule__EnumInterpretation__ObjectsAssignment_3");
builder.put(grammarAccess.getFieldRelationInterpretationAccess().getContainmentAssignment_0(), "rule__FieldRelationInterpretation__ContainmentAssignment_0");
builder.put(grammarAccess.getFieldRelationInterpretationAccess().getSymbolAssignment_1(), "rule__FieldRelationInterpretation__SymbolAssignment_1");
builder.put(grammarAccess.getFieldRelationInterpretationAccess().getMultiplicityAssignment_3(), "rule__FieldRelationInterpretation__MultiplicityAssignment_3");
builder.put(grammarAccess.getFieldRelationInterpretationAccess().getTargetAssignment_4(), "rule__FieldRelationInterpretation__TargetAssignment_4");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getContainmentAssignment_0(), "rule__GlobalRelationInterpretation__ContainmentAssignment_0");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getSymbolAssignment_2(), "rule__GlobalRelationInterpretation__SymbolAssignment_2");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getSourceMultiplicityAssignment_4(), "rule__GlobalRelationInterpretation__SourceMultiplicityAssignment_4");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getSourceAssignment_5(), "rule__GlobalRelationInterpretation__SourceAssignment_5");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getTargetMultiplicityAssignment_6(), "rule__GlobalRelationInterpretation__TargetMultiplicityAssignment_6");
builder.put(grammarAccess.getGlobalRelationInterpretationAccess().getTargetAssignment_7(), "rule__GlobalRelationInterpretation__TargetAssignment_7");
builder.put(grammarAccess.getMultiplicityDefinitionAccess().getLowerAssignment_0(), "rule__MultiplicityDefinition__LowerAssignment_0");
builder.put(grammarAccess.getMultiplicityDefinitionAccess().getUpperAssignment_2_0(), "rule__MultiplicityDefinition__UpperAssignment_2_0");
builder.put(grammarAccess.getMultiplicityDefinitionAccess().getUnlimitedUpperAssignment_2_1(), "rule__MultiplicityDefinition__UnlimitedUpperAssignment_2_1");
}
}
@Inject
private NameMappings nameMappings;
@Inject
private SolverLanguageGrammarAccess grammarAccess;
@Override
protected InternalSolverLanguageParser createParser() {
InternalSolverLanguageParser result = new InternalSolverLanguageParser(null);
result.setGrammarAccess(grammarAccess);
return result;
}
@Override
protected String getRuleName(AbstractElement element) {
return nameMappings.getRuleName(element);
}
@Override
protected String[] getInitialHiddenTokens() {
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
}
public SolverLanguageGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(SolverLanguageGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
public NameMappings getNameMappings() {
return nameMappings;
}
public void setNameMappings(NameMappings nameMappings) {
this.nameMappings = nameMappings;
}
}
|