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/ProblemSemanticSequencer.java')
-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.java | 296 |
1 files changed, 296 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 | } | ||