aboutsummaryrefslogtreecommitdiffstats
path: root/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src-gen/hu/bme/mit/inf/dslreasoner/serializer/AlloyLanguageSyntacticSequencer.java
blob: 4a5cad5d7b8f57546dec363461b608312153e307 (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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*
 * generated by Xtext
 */
package hu.bme.mit.inf.dslreasoner.serializer;

import com.google.inject.Inject;
import hu.bme.mit.inf.dslreasoner.services.AlloyLanguageGrammarAccess;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
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.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 AlloyLanguageSyntacticSequencer extends AbstractSyntacticSequencer {

	protected AlloyLanguageGrammarAccess grammarAccess;
	protected AbstractElementAlias match_ALSAnd_AmpersandAmpersandKeyword_1_1_0_or_AndKeyword_1_1_1;
	protected AbstractElementAlias match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_a;
	protected AbstractElementAlias match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_p;
	protected AbstractElementAlias match_ALSIff_IffKeyword_1_1_1_or_LessThanSignEqualsSignGreaterThanSignKeyword_1_1_0;
	protected AbstractElementAlias match_ALSImpl_EqualsSignGreaterThanSignKeyword_1_1_0_or_ImpliesKeyword_1_1_1;
	protected AbstractElementAlias match_ALSOr_OrKeyword_1_1_1_or_VerticalLineVerticalLineKeyword_1_1_0;
	protected AbstractElementAlias match_ALSPreficed_ExclamationMarkKeyword_0_1_0_0_or_NotKeyword_0_1_0_1;
	
	@Inject
	protected void init(IGrammarAccess access) {
		grammarAccess = (AlloyLanguageGrammarAccess) access;
		match_ALSAnd_AmpersandAmpersandKeyword_1_1_0_or_AndKeyword_1_1_1 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getALSAndAccess().getAmpersandAmpersandKeyword_1_1_0()), new TokenAlias(false, false, grammarAccess.getALSAndAccess().getAndKeyword_1_1_1()));
		match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_a = new TokenAlias(true, true, grammarAccess.getALSBasicRelationTermAccess().getLeftParenthesisKeyword_8_0());
		match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_p = new TokenAlias(true, false, grammarAccess.getALSBasicRelationTermAccess().getLeftParenthesisKeyword_8_0());
		match_ALSIff_IffKeyword_1_1_1_or_LessThanSignEqualsSignGreaterThanSignKeyword_1_1_0 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getALSIffAccess().getIffKeyword_1_1_1()), new TokenAlias(false, false, grammarAccess.getALSIffAccess().getLessThanSignEqualsSignGreaterThanSignKeyword_1_1_0()));
		match_ALSImpl_EqualsSignGreaterThanSignKeyword_1_1_0_or_ImpliesKeyword_1_1_1 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getALSImplAccess().getEqualsSignGreaterThanSignKeyword_1_1_0()), new TokenAlias(false, false, grammarAccess.getALSImplAccess().getImpliesKeyword_1_1_1()));
		match_ALSOr_OrKeyword_1_1_1_or_VerticalLineVerticalLineKeyword_1_1_0 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getALSOrAccess().getOrKeyword_1_1_1()), new TokenAlias(false, false, grammarAccess.getALSOrAccess().getVerticalLineVerticalLineKeyword_1_1_0()));
		match_ALSPreficed_ExclamationMarkKeyword_0_1_0_0_or_NotKeyword_0_1_0_1 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getALSPreficedAccess().getExclamationMarkKeyword_0_1_0_0()), new TokenAlias(false, false, grammarAccess.getALSPreficedAccess().getNotKeyword_0_1_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_ALSAnd_AmpersandAmpersandKeyword_1_1_0_or_AndKeyword_1_1_1.equals(syntax))
				emit_ALSAnd_AmpersandAmpersandKeyword_1_1_0_or_AndKeyword_1_1_1(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_a.equals(syntax))
				emit_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_a(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_p.equals(syntax))
				emit_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_p(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSIff_IffKeyword_1_1_1_or_LessThanSignEqualsSignGreaterThanSignKeyword_1_1_0.equals(syntax))
				emit_ALSIff_IffKeyword_1_1_1_or_LessThanSignEqualsSignGreaterThanSignKeyword_1_1_0(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSImpl_EqualsSignGreaterThanSignKeyword_1_1_0_or_ImpliesKeyword_1_1_1.equals(syntax))
				emit_ALSImpl_EqualsSignGreaterThanSignKeyword_1_1_0_or_ImpliesKeyword_1_1_1(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSOr_OrKeyword_1_1_1_or_VerticalLineVerticalLineKeyword_1_1_0.equals(syntax))
				emit_ALSOr_OrKeyword_1_1_1_or_VerticalLineVerticalLineKeyword_1_1_0(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_ALSPreficed_ExclamationMarkKeyword_0_1_0_0_or_NotKeyword_0_1_0_1.equals(syntax))
				emit_ALSPreficed_ExclamationMarkKeyword_0_1_0_0_or_NotKeyword_0_1_0_1(semanticObject, getLastNavigableState(), syntaxNodes);
			else acceptNodes(getLastNavigableState(), syntaxNodes);
		}
	}

	/**
	 * Ambiguous syntax:
	 *     'and' | '&&'
	 *
	 * This ambiguous syntax occurs at:
	 *     {ALSAnd.leftOperand=} (ambiguity) rightOperand=ALSComparison
	 */
	protected void emit_ALSAnd_AmpersandAmpersandKeyword_1_1_0_or_AndKeyword_1_1_1(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '('*
	 *
	 * This ambiguous syntax occurs at:
	 *     (rule start) (ambiguity) '#' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) '*' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) '-' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) 'Int' (rule start)
	 *     (rule start) (ambiguity) 'String' (rule start)
	 *     (rule start) (ambiguity) '^' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) 'iden' (rule start)
	 *     (rule start) (ambiguity) 'none' (rule start)
	 *     (rule start) (ambiguity) 'sum' variables+=ALSVariableDeclaration
	 *     (rule start) (ambiguity) 'univ' (rule start)
	 *     (rule start) (ambiguity) '~' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) ('not' | '!') operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) referred=[ALSRelationDeclaration|ID]
	 *     (rule start) (ambiguity) referredDefinition=[ALSDefinition|ID]
	 *     (rule start) (ambiguity) referredNumericOperator=ALSNumericOperator
	 *     (rule start) (ambiguity) type=ALSMultiplicity
	 *     (rule start) (ambiguity) value=INT
	 *     (rule start) (ambiguity) value=STRING
	 *     (rule start) (ambiguity) {ALSAnd.leftOperand=}
	 *     (rule start) (ambiguity) {ALSDirectProduct.leftOperand=}
	 *     (rule start) (ambiguity) {ALSEquals.leftOperand=}
	 *     (rule start) (ambiguity) {ALSIff.leftOperand=}
	 *     (rule start) (ambiguity) {ALSImpl.leftOperand=}
	 *     (rule start) (ambiguity) {ALSIntersection.leftOperand=}
	 *     (rule start) (ambiguity) {ALSJoin.leftOperand=}
	 *     (rule start) (ambiguity) {ALSLeq.leftOperand=}
	 *     (rule start) (ambiguity) {ALSLess.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMeq.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMinus.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMore.leftOperand=}
	 *     (rule start) (ambiguity) {ALSNotEquals.leftOperand=}
	 *     (rule start) (ambiguity) {ALSOr.leftOperand=}
	 *     (rule start) (ambiguity) {ALSOverride.leftOperand=}
	 *     (rule start) (ambiguity) {ALSPlus.leftOperand=}
	 *     (rule start) (ambiguity) {ALSRangeRestrictionLeft.filter=}
	 *     (rule start) (ambiguity) {ALSRangeRestrictionRight.relation=}
	 *     (rule start) (ambiguity) {ALSSubset.leftOperand=}
	 */
	protected void emit_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_a(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '('+
	 *
	 * This ambiguous syntax occurs at:
	 *     (rule start) (ambiguity) '#' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) '*' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) '-' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) '^' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) 'sum' variables+=ALSVariableDeclaration
	 *     (rule start) (ambiguity) '~' operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) ('not' | '!') operand=ALSBasicRelationTerm
	 *     (rule start) (ambiguity) referredDefinition=[ALSDefinition|ID]
	 *     (rule start) (ambiguity) referredNumericOperator=ALSNumericOperator
	 *     (rule start) (ambiguity) type=ALSMultiplicity
	 *     (rule start) (ambiguity) {ALSAnd.leftOperand=}
	 *     (rule start) (ambiguity) {ALSDirectProduct.leftOperand=}
	 *     (rule start) (ambiguity) {ALSEquals.leftOperand=}
	 *     (rule start) (ambiguity) {ALSIff.leftOperand=}
	 *     (rule start) (ambiguity) {ALSImpl.leftOperand=}
	 *     (rule start) (ambiguity) {ALSIntersection.leftOperand=}
	 *     (rule start) (ambiguity) {ALSJoin.leftOperand=}
	 *     (rule start) (ambiguity) {ALSLeq.leftOperand=}
	 *     (rule start) (ambiguity) {ALSLess.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMeq.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMinus.leftOperand=}
	 *     (rule start) (ambiguity) {ALSMore.leftOperand=}
	 *     (rule start) (ambiguity) {ALSNotEquals.leftOperand=}
	 *     (rule start) (ambiguity) {ALSOr.leftOperand=}
	 *     (rule start) (ambiguity) {ALSOverride.leftOperand=}
	 *     (rule start) (ambiguity) {ALSPlus.leftOperand=}
	 *     (rule start) (ambiguity) {ALSRangeRestrictionLeft.filter=}
	 *     (rule start) (ambiguity) {ALSRangeRestrictionRight.relation=}
	 *     (rule start) (ambiguity) {ALSSubset.leftOperand=}
	 */
	protected void emit_ALSBasicRelationTerm_LeftParenthesisKeyword_8_0_p(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '<=>' | 'iff'
	 *
	 * This ambiguous syntax occurs at:
	 *     {ALSIff.leftOperand=} (ambiguity) rightOperand=ALSImpl
	 */
	protected void emit_ALSIff_IffKeyword_1_1_1_or_LessThanSignEqualsSignGreaterThanSignKeyword_1_1_0(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '=>' | 'implies'
	 *
	 * This ambiguous syntax occurs at:
	 *     {ALSImpl.leftOperand=} (ambiguity) rightOperand=ALSAnd
	 */
	protected void emit_ALSImpl_EqualsSignGreaterThanSignKeyword_1_1_0_or_ImpliesKeyword_1_1_1(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     'or' | '||'
	 *
	 * This ambiguous syntax occurs at:
	 *     {ALSOr.leftOperand=} (ambiguity) rightOperand=ALSIff
	 */
	protected void emit_ALSOr_OrKeyword_1_1_1_or_VerticalLineVerticalLineKeyword_1_1_0(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     'not' | '!'
	 *
	 * This ambiguous syntax occurs at:
	 *     (rule start) '('* (ambiguity) operand=ALSBasicRelationTerm
	 *     (rule start) '('+ (ambiguity) operand=ALSBasicRelationTerm
	 */
	protected void emit_ALSPreficed_ExclamationMarkKeyword_0_1_0_0_or_NotKeyword_0_1_0_1(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
}