aboutsummaryrefslogtreecommitdiffstats
path: root/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/serializer/SolverLanguageSyntacticSequencer.java
blob: 2f9ea8a3b361a2ed3e8a6aab2ccf597189973bf7 (plain) (blame)
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
188
189
190
191
/*
 * generated by Xtext 2.21.0
 */
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.SolverLanguageGrammarAccess;
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 SolverLanguageSyntacticSequencer extends AbstractSyntacticSequencer {

	protected SolverLanguageGrammarAccess grammarAccess;
	protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_4_0_a;
	protected AbstractElementAlias match_AtomicExpression_LeftParenthesisKeyword_4_0_p;
	protected AbstractElementAlias match_ClassDeclaration_FULL_STOPTerminalRuleCall_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__;
	protected AbstractElementAlias match_EnumDeclaration_CommaKeyword_2_0_1_1_0_q;
	protected AbstractElementAlias match_EnumDeclaration_FULL_STOPTerminalRuleCall_2_1_or___LeftCurlyBracketKeyword_2_0_0_RightCurlyBracketKeyword_2_0_2__;
	protected AbstractElementAlias match_Field_SemicolonKeyword_5_q;
	
	@Inject
	protected void init(IGrammarAccess access) {
		grammarAccess = (SolverLanguageGrammarAccess) access;
		match_AtomicExpression_LeftParenthesisKeyword_4_0_a = new TokenAlias(true, true, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_4_0());
		match_AtomicExpression_LeftParenthesisKeyword_4_0_p = new TokenAlias(true, false, grammarAccess.getAtomicExpressionAccess().getLeftParenthesisKeyword_4_0());
		match_ClassDeclaration_FULL_STOPTerminalRuleCall_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().getFULL_STOPTerminalRuleCall_4_1()));
		match_EnumDeclaration_CommaKeyword_2_0_1_1_0_q = new TokenAlias(false, true, grammarAccess.getEnumDeclarationAccess().getCommaKeyword_2_0_1_1_0());
		match_EnumDeclaration_FULL_STOPTerminalRuleCall_2_1_or___LeftCurlyBracketKeyword_2_0_0_RightCurlyBracketKeyword_2_0_2__ = new AlternativeAlias(false, false, new GroupAlias(false, false, new TokenAlias(false, false, grammarAccess.getEnumDeclarationAccess().getLeftCurlyBracketKeyword_2_0_0()), new TokenAlias(false, false, grammarAccess.getEnumDeclarationAccess().getRightCurlyBracketKeyword_2_0_2())), new TokenAlias(false, false, grammarAccess.getEnumDeclarationAccess().getFULL_STOPTerminalRuleCall_2_1()));
		match_Field_SemicolonKeyword_5_q = new TokenAlias(false, true, grammarAccess.getFieldAccess().getSemicolonKeyword_5());
	}
	
	@Override
	protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
		if (ruleCall.getRule() == grammarAccess.getFULL_STOPRule())
			return getFULL_STOPToken(semanticObject, ruleCall, node);
		else if (ruleCall.getRule() == grammarAccess.getREFLEXIVE_TRANSITIVE_CLOSURERule())
			return getREFLEXIVE_TRANSITIVE_CLOSUREToken(semanticObject, ruleCall, node);
		else if (ruleCall.getRule() == grammarAccess.getTRANSITIVE_CLOSURERule())
			return getTRANSITIVE_CLOSUREToken(semanticObject, ruleCall, node);
		return "";
	}
	
	/**
	 * Synthetic terminal rule. The concrete syntax is to be specified by clients.
	 * Defaults to the empty string.
	 */
	protected String getFULL_STOPToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; }
	
	/**
	 * Synthetic terminal rule. The concrete syntax is to be specified by clients.
	 * Defaults to the empty string.
	 */
	protected String getREFLEXIVE_TRANSITIVE_CLOSUREToken(EObject semanticObject, RuleCall ruleCall, INode node) { return ""; }
	
	/**
	 * Synthetic terminal rule. The concrete syntax is to be specified by clients.
	 * Defaults to the empty string.
	 */
	protected String getTRANSITIVE_CLOSUREToken(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_AtomicExpression_LeftParenthesisKeyword_4_0_a.equals(syntax))
				emit_AtomicExpression_LeftParenthesisKeyword_4_0_a(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_AtomicExpression_LeftParenthesisKeyword_4_0_p.equals(syntax))
				emit_AtomicExpression_LeftParenthesisKeyword_4_0_p(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ClassDeclaration_FULL_STOPTerminalRuleCall_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__.equals(syntax))
				emit_ClassDeclaration_FULL_STOPTerminalRuleCall_4_1_or___LeftCurlyBracketKeyword_4_0_0_RightCurlyBracketKeyword_4_0_2__(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_EnumDeclaration_CommaKeyword_2_0_1_1_0_q.equals(syntax))
				emit_EnumDeclaration_CommaKeyword_2_0_1_1_0_q(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_EnumDeclaration_FULL_STOPTerminalRuleCall_2_1_or___LeftCurlyBracketKeyword_2_0_0_RightCurlyBracketKeyword_2_0_2__.equals(syntax))
				emit_EnumDeclaration_FULL_STOPTerminalRuleCall_2_1_or___LeftCurlyBracketKeyword_2_0_0_RightCurlyBracketKeyword_2_0_2__(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_Field_SemicolonKeyword_5_q.equals(syntax))
				emit_Field_SemicolonKeyword_5_q(semanticObject, getLastNavigableState(), syntaxNodes);
			else acceptNodes(getLastNavigableState(), syntaxNodes);
		}
	}

	/**
	 * Ambiguous syntax:
	 *     '('*
	 *
	 * This ambiguous syntax occurs at:
	 *     (rule start) (ambiguity) '[' lowerBound=AdditiveExpression
	 *     (rule start) (ambiguity) 'count' '{' condition=Expression
	 *     (rule start) (ambiguity) 'empty' (rule start)
	 *     (rule start) (ambiguity) 'if' condition=DisjunctiveExpression
	 *     (rule start) (ambiguity) 'inf' (rule start)
	 *     (rule start) (ambiguity) 'let' bindings+=LetBinding
	 *     (rule start) (ambiguity) components+=PathComponent
	 *     (rule start) (ambiguity) functor=Reference
	 *     (rule start) (ambiguity) op=UnaryOperator
	 *     (rule start) (ambiguity) op=[Symbol|QualifiedName]
	 *     (rule start) (ambiguity) value=INT
	 *     (rule start) (ambiguity) value=LogicValue
	 *     (rule start) (ambiguity) value=Real
	 *     (rule start) (ambiguity) value=STRING
	 *     (rule start) (ambiguity) {BinaryExpression.left=}
	 *     (rule start) (ambiguity) {CastExpression.body=}
	 *     (rule start) (ambiguity) {Conjunction.children+=}
	 *     (rule start) (ambiguity) {Disjunction.children+=}
	 *     (rule start) (ambiguity) {Forall.condition=}
	 *     (rule start) (ambiguity) {Switch.cases+=}
	 */
	protected void emit_AtomicExpression_LeftParenthesisKeyword_4_0_a(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '('+
	 *
	 * This ambiguous syntax occurs at:
	 *     (rule start) (ambiguity) 'count' '{' condition=Expression
	 *     (rule start) (ambiguity) 'if' condition=DisjunctiveExpression
	 *     (rule start) (ambiguity) 'let' bindings+=LetBinding
	 *     (rule start) (ambiguity) op=UnaryOperator
	 *     (rule start) (ambiguity) op=[Symbol|QualifiedName]
	 *     (rule start) (ambiguity) {BinaryExpression.left=}
	 *     (rule start) (ambiguity) {CastExpression.body=}
	 *     (rule start) (ambiguity) {Conjunction.children+=}
	 *     (rule start) (ambiguity) {Disjunction.children+=}
	 *     (rule start) (ambiguity) {Forall.condition=}
	 *     (rule start) (ambiguity) {Switch.cases+=}
	 */
	protected void emit_AtomicExpression_LeftParenthesisKeyword_4_0_p(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     ('{' '}') | FULL_STOP
	 *
	 * This ambiguous syntax occurs at:
	 *     name=ID (ambiguity) (rule end)
	 *     supertypes+=[Symbol|QualifiedName] (ambiguity) (rule end)
	 */
	protected void emit_ClassDeclaration_FULL_STOPTerminalRuleCall_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:
	 *     literals+=EnumLiteral (ambiguity) literals+=EnumLiteral
	 */
	protected void emit_EnumDeclaration_CommaKeyword_2_0_1_1_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     ('{' '}') | FULL_STOP
	 *
	 * This ambiguous syntax occurs at:
	 *     name=ID (ambiguity) (rule end)
	 */
	protected void emit_EnumDeclaration_FULL_STOPTerminalRuleCall_2_1_or___LeftCurlyBracketKeyword_2_0_0_RightCurlyBracketKeyword_2_0_2__(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     ';'?
	 *
	 * This ambiguous syntax occurs at:
	 *     name=ID (ambiguity) (rule end)
	 *     opposite=[Symbol|QualifiedName] (ambiguity) (rule end)
	 */
	protected void emit_Field_SemicolonKeyword_5_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
}