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
|
/*
* generated by Xtext 2.26.0.M1
*/
package org.eclipse.viatra.solver.language.serializer;
import com.google.inject.Inject;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.viatra.solver.language.services.ProblemGrammarAccess;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AlternativeAlias;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class ProblemSyntacticSequencer extends AbstractSyntacticSequencer {
protected ProblemGrammarAccess grammarAccess;
protected AbstractElementAlias match_ClassDeclaration_FullStopKeyword_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__;
protected AbstractElementAlias match_ClassDeclaration_SemicolonKeyword_4_0_1_1_q;
protected AbstractElementAlias match_PredicateDefinition_PredKeyword_0_0_1_q;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (ProblemGrammarAccess) access;
match_ClassDeclaration_FullStopKeyword_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__ = new AlternativeAlias(false, false, new GroupAlias(false, false, new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getLeftCurlyBracketKeyword_4_0_0()), new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getRightCurlyBracketKeyword_4_0_2())), new TokenAlias(false, false, grammarAccess.getClassDeclarationAccess().getFullStopKeyword_4_1()));
match_ClassDeclaration_SemicolonKeyword_4_0_1_1_q = new TokenAlias(false, true, grammarAccess.getClassDeclarationAccess().getSemicolonKeyword_4_0_1_1());
match_PredicateDefinition_PredKeyword_0_0_1_q = new TokenAlias(false, true, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1());
}
@Override
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
return "";
}
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
List<INode> transitionNodes = collectNodes(fromNode, toNode);
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
if (match_ClassDeclaration_FullStopKeyword_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__.equals(syntax))
emit_ClassDeclaration_FullStopKeyword_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__(semanticObject, getLastNavigableState(), syntaxNodes);
else if (match_ClassDeclaration_SemicolonKeyword_4_0_1_1_q.equals(syntax))
emit_ClassDeclaration_SemicolonKeyword_4_0_1_1_q(semanticObject, getLastNavigableState(), syntaxNodes);
else if (match_PredicateDefinition_PredKeyword_0_0_1_q.equals(syntax))
emit_PredicateDefinition_PredKeyword_0_0_1_q(semanticObject, getLastNavigableState(), syntaxNodes);
else acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
/**
* Ambiguous syntax:
* ('{' '}') | '.'
*
* This ambiguous syntax occurs at:
* name=ID (ambiguity) (rule end)
* superTypes+=[ClassDeclaration|QualifiedName] (ambiguity) (rule end)
*/
protected void emit_ClassDeclaration_FullStopKeyword_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
/**
* Ambiguous syntax:
* ';'?
*
* This ambiguous syntax occurs at:
* referenceDeclarations+=ReferenceDeclaration (ambiguity) '}' (rule end)
* referenceDeclarations+=ReferenceDeclaration (ambiguity) referenceDeclarations+=ReferenceDeclaration
*/
protected void emit_ClassDeclaration_SemicolonKeyword_4_0_1_1_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
/**
* Ambiguous syntax:
* 'pred'?
*
* This ambiguous syntax occurs at:
* error?='error' (ambiguity) name=ID
*/
protected void emit_PredicateDefinition_PredKeyword_0_0_1_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
}
|