44 lines
1.4 KiB
Java
44 lines
1.4 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.ISyntacticSequencerPDAProvider.ISynTransition;
|
||
|
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
|
||
|
import xtext.services.GameGrammarAccess;
|
||
|
|
||
|
@SuppressWarnings("all")
|
||
|
public class GameSyntacticSequencer extends AbstractSyntacticSequencer {
|
||
|
|
||
|
protected GameGrammarAccess grammarAccess;
|
||
|
|
||
|
@Inject
|
||
|
protected void init(IGrammarAccess access) {
|
||
|
grammarAccess = (GameGrammarAccess) 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);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|