use of org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable in project xtext-core by eclipse.
the class AbstractSyntacticSequencer method navigateToEmitter.
protected ISynFollowerOwner navigateToEmitter(ISynFollowerOwner fromState, INode fromNode, AbstractElement toEle, INode toNode, RuleCallStack stack) {
if (fromState instanceof ISynAbsorberState)
return fromState;
if (fromState instanceof ISynNavigable) {
ISynNavigable fromEmitter = (ISynNavigable) fromState;
if (!fromEmitter.hasEmitters())
return fromEmitter.getTarget();
List<ISynState> pathAndElement = fromEmitter.getShortestPathTo(toEle, stack);
if (pathAndElement == null) {
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createUnexpectedEmitterDiagnostic(fromEmitter, toEle, stack));
return null;
}
List<ISynState> path = pathAndElement.subList(0, pathAndElement.size() - 1);
accept(fromNode, path, stack);
return pathAndElement.get(pathAndElement.size() - 1);
}
throw new IllegalStateException();
}
use of org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable in project xtext-core by eclipse.
the class AbstractSyntacticSequencer method navigateToAbsorber.
protected ISynAbsorberState navigateToAbsorber(ISynFollowerOwner fromState, INode fromNode, INode toNode, RuleCallStack stack) {
if (fromState instanceof ISynAbsorberState)
return (ISynAbsorberState) fromState;
if (fromState instanceof ISynNavigable) {
ISynNavigable fromEmitter = (ISynNavigable) fromState;
// RCStack back = stack.clone();
if (fromEmitter.hasEmitters()) {
List<ISynState> path = fromEmitter.getShortestStackpruningPathToAbsorber(stack);
accept(fromNode, path, stack);
}
return fromEmitter.getTarget();
}
throw new IllegalStateException();
}
Aggregations