projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/xtext/serializer/GameSyntacticSequencer.java
2021-12-03 08:36:23 +01:00

62 lines
2.5 KiB
Java

/*
* generated by Xtext 2.23.0
*/
package xtext.serializer;
import com.google.inject.Inject;
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;
import xtext.services.GameGrammarAccess;
@SuppressWarnings("all")
public class GameSyntacticSequencer extends AbstractSyntacticSequencer {
protected GameGrammarAccess grammarAccess;
protected AbstractElementAlias match_ConditionTest_FalseKeyword_4_or_TrueKeyword_3;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (GameGrammarAccess) access;
match_ConditionTest_FalseKeyword_4_or_TrueKeyword_3 = new AlternativeAlias(false, false, new TokenAlias(false, false, grammarAccess.getConditionTestAccess().getFalseKeyword_4()), new TokenAlias(false, false, grammarAccess.getConditionTestAccess().getTrueKeyword_3()));
}
@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_ConditionTest_FalseKeyword_4_or_TrueKeyword_3.equals(syntax))
emit_ConditionTest_FalseKeyword_4_or_TrueKeyword_3(semanticObject, getLastNavigableState(), syntaxNodes);
else acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
/**
* Ambiguous syntax:
* 'true' | 'false'
*
* This ambiguous syntax occurs at:
* (rule start) (ambiguity) (rule start)
*/
protected void emit_ConditionTest_FalseKeyword_4_or_TrueKeyword_3(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
}