projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/serializer/GAMESyntacticSequencer.java

62 lines
2.5 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/*
* generated by Xtext 2.23.0
*/
2021-12-03 07:37:31 +00:00
package fr.n7.serializer;
2021-11-30 17:25:45 +00:00
import com.google.inject.Inject;
2021-12-03 07:37:31 +00:00
import fr.n7.services.GAMEGrammarAccess;
2021-11-30 17:25:45 +00:00
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;
2021-11-30 17:25:45 +00:00
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
2021-12-03 07:37:31 +00:00
public class GAMESyntacticSequencer extends AbstractSyntacticSequencer {
2021-11-30 17:25:45 +00:00
2021-12-03 07:37:31 +00:00
protected GAMEGrammarAccess grammarAccess;
protected AbstractElementAlias match_ConditionTest_FalseKeyword_4_or_TrueKeyword_3;
2021-11-30 17:25:45 +00:00
@Inject
protected void init(IGrammarAccess access) {
2021-12-03 07:37:31 +00:00
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()));
2021-11-30 17:25:45 +00:00
}
@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);
2021-11-30 17:25:45 +00:00
}
}
/**
* 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);
}
2021-11-30 17:25:45 +00:00
}