diff options
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/xtext-gen/org/eclipse/viatra/solver/language/serializer')
2 files changed, 373 insertions, 0 deletions
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 | */ | ||
4 | package org.eclipse.viatra.solver.language.serializer; | ||
5 | |||
6 | import com.google.inject.Inject; | ||
7 | import java.util.Set; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EPackage; | ||
10 | import org.eclipse.viatra.solver.language.model.problem.Assertion; | ||
11 | import org.eclipse.viatra.solver.language.model.problem.Atom; | ||
12 | import org.eclipse.viatra.solver.language.model.problem.ClassDeclaration; | ||
13 | import org.eclipse.viatra.solver.language.model.problem.Conjunction; | ||
14 | import org.eclipse.viatra.solver.language.model.problem.ExactMultiplicity; | ||
15 | import org.eclipse.viatra.solver.language.model.problem.NegativeLiteral; | ||
16 | import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition; | ||
17 | import org.eclipse.viatra.solver.language.model.problem.Problem; | ||
18 | import org.eclipse.viatra.solver.language.model.problem.ProblemPackage; | ||
19 | import org.eclipse.viatra.solver.language.model.problem.RangeMultiplicity; | ||
20 | import org.eclipse.viatra.solver.language.model.problem.ReferenceDeclaration; | ||
21 | import org.eclipse.viatra.solver.language.model.problem.ScopeDeclaration; | ||
22 | import org.eclipse.viatra.solver.language.model.problem.TypeScope; | ||
23 | import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess; | ||
24 | import org.eclipse.xtext.Action; | ||
25 | import org.eclipse.xtext.Parameter; | ||
26 | import org.eclipse.xtext.ParserRule; | ||
27 | import org.eclipse.xtext.serializer.ISerializationContext; | ||
28 | import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; | ||
29 | import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer; | ||
30 | import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient; | ||
31 | |||
32 | @SuppressWarnings("all") | ||
33 | public 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 | */ | ||
4 | package org.eclipse.viatra.solver.language.serializer; | ||
5 | |||
6 | import com.google.inject.Inject; | ||
7 | import java.util.List; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess; | ||
10 | import org.eclipse.xtext.IGrammarAccess; | ||
11 | import org.eclipse.xtext.RuleCall; | ||
12 | import org.eclipse.xtext.nodemodel.INode; | ||
13 | import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias; | ||
14 | import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias; | ||
15 | import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias; | ||
16 | import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable; | ||
17 | import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition; | ||
18 | import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; | ||
19 | |||
20 | @SuppressWarnings("all") | ||
21 | public 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 | } | ||