forked from jasder/antlr
Remove unnecessary array indexing operation in execDFA
This commit is contained in:
parent
c34f0d6945
commit
0deadc688a
|
@ -229,15 +229,17 @@ public class LexerATNSimulator extends ATNSimulator {
|
||||||
System.out.format("state %d LA(1)==%s\n", s.stateNumber, getTokenName(t));
|
System.out.format("state %d LA(1)==%s\n", s.stateNumber, getTokenName(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DFAState target = null;
|
||||||
|
if (s.edges != null && t > IntStream.EOF && t < s.edges.length) {
|
||||||
|
target = s.edges[t];
|
||||||
|
}
|
||||||
|
|
||||||
// if no edge, pop over to ATN interpreter, update DFA and return
|
// if no edge, pop over to ATN interpreter, update DFA and return
|
||||||
if ( s.edges == null || t >= s.edges.length || t <= IntStream.EOF ||
|
if (target == null) {
|
||||||
s.edges[t] == null )
|
|
||||||
{
|
|
||||||
ATN_failover++;
|
ATN_failover++;
|
||||||
return failOverToATN(input, s);
|
return failOverToATN(input, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
DFAState target = s.edges[t];
|
|
||||||
if ( target == ERROR ) break;
|
if ( target == ERROR ) break;
|
||||||
s = target;
|
s = target;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue