projet-mini-genie-logiciel-.../eclipse-workspace/fr.n7.pdl1/src-gen/fr/n7/serializer/PDL1SyntacticSequencer.java

44 lines
1.4 KiB
Java
Raw Normal View History

2021-10-12 16:49:13 +00:00
/*
* 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.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class PDL1SyntacticSequencer extends AbstractSyntacticSequencer {
protected PDL1GrammarAccess grammarAccess;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (PDL1GrammarAccess) access;
}
@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);
acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
}