63 lines
3.2 KiB
Java
63 lines
3.2 KiB
Java
/*
|
|
* generated by Xtext 2.23.0
|
|
*/
|
|
package fr.n7.serializer;
|
|
|
|
import com.google.inject.Inject;
|
|
import fr.n7.services.PDL1GrammarAccess;
|
|
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.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 PDL1SyntacticSequencer extends AbstractSyntacticSequencer {
|
|
|
|
protected PDL1GrammarAccess grammarAccess;
|
|
protected AbstractElementAlias match_WorkDefinitionList_WorkSequenceList___WorkdefinitionsKeyword_0_ColonKeyword_1___or___WorksequencesKeyword_0_ColonKeyword_1__;
|
|
|
|
@Inject
|
|
protected void init(IGrammarAccess access) {
|
|
grammarAccess = (PDL1GrammarAccess) access;
|
|
match_WorkDefinitionList_WorkSequenceList___WorkdefinitionsKeyword_0_ColonKeyword_1___or___WorksequencesKeyword_0_ColonKeyword_1__ = new AlternativeAlias(false, false, new GroupAlias(false, false, new TokenAlias(false, false, grammarAccess.getWorkDefinitionListAccess().getWorkdefinitionsKeyword_0()), new TokenAlias(false, false, grammarAccess.getWorkDefinitionListAccess().getColonKeyword_1())), new GroupAlias(false, false, new TokenAlias(false, false, grammarAccess.getWorkSequenceListAccess().getWorksequencesKeyword_0()), new TokenAlias(false, false, grammarAccess.getWorkSequenceListAccess().getColonKeyword_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_WorkDefinitionList_WorkSequenceList___WorkdefinitionsKeyword_0_ColonKeyword_1___or___WorksequencesKeyword_0_ColonKeyword_1__.equals(syntax))
|
|
emit_WorkDefinitionList_WorkSequenceList___WorkdefinitionsKeyword_0_ColonKeyword_1___or___WorksequencesKeyword_0_ColonKeyword_1__(semanticObject, getLastNavigableState(), syntaxNodes);
|
|
else acceptNodes(getLastNavigableState(), syntaxNodes);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ambiguous syntax:
|
|
* ('workdefinitions' ':') | ('worksequences' ':')
|
|
*
|
|
* This ambiguous syntax occurs at:
|
|
* (rule start) (ambiguity) (rule start)
|
|
*/
|
|
protected void emit_WorkDefinitionList_WorkSequenceList___WorkdefinitionsKeyword_0_ColonKeyword_1___or___WorksequencesKeyword_0_ColonKeyword_1__(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
|
|
acceptNodes(transition, nodes);
|
|
}
|
|
|
|
}
|