forked from jasder/antlr
ATNSimulator.deserialize computes values for PlusBlockStartState.loopBackState and StarLoopEntryState.loopBackState
This commit is contained in:
parent
83d8903f9f
commit
9b42acbf4d
|
@ -179,6 +179,27 @@ public abstract class ATNSimulator {
|
|||
}
|
||||
}
|
||||
|
||||
for (ATNState state : atn.states) {
|
||||
if (state instanceof PlusLoopbackState) {
|
||||
PlusLoopbackState loopbackState = (PlusLoopbackState)state;
|
||||
for (int i = 0; i < loopbackState.getNumberOfTransitions(); i++) {
|
||||
ATNState target = loopbackState.transition(i).target;
|
||||
if (target instanceof PlusBlockStartState) {
|
||||
((PlusBlockStartState)target).loopBackState = loopbackState;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (state instanceof StarLoopbackState) {
|
||||
StarLoopbackState loopbackState = (StarLoopbackState)state;
|
||||
for (int i = 0; i < loopbackState.getNumberOfTransitions(); i++) {
|
||||
ATNState target = loopbackState.transition(i).target;
|
||||
if (target instanceof StarLoopEntryState) {
|
||||
((StarLoopEntryState)target).loopBackState = loopbackState;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// DECISIONS
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue