forked from jasder/antlr
Move reach variable inside loop. Remove unnecessary ATNConfigSet clone.
This commit is contained in:
parent
51a15ac4a7
commit
aeb43069aa
|
@ -247,14 +247,11 @@ public class LexerATNSimulator extends ATNSimulator {
|
|||
protected int exec(@NotNull CharStream input, @NotNull ATNConfigSet s0, @Nullable DFAState ds0) {
|
||||
//System.out.println("enter exec index "+input.index()+" from "+s0);
|
||||
@NotNull
|
||||
ATNConfigSet closure = new ATNConfigSet();
|
||||
closure.addAll(s0);
|
||||
ATNConfigSet closure = s0;
|
||||
if ( debug ) {
|
||||
System.out.format("start state closure=%s\n", closure);
|
||||
}
|
||||
|
||||
ATNConfigSet reach = null;
|
||||
|
||||
traceLookahead1();
|
||||
int t = input.LA(1);
|
||||
DFAState s = ds0; // s is current/from DFA state
|
||||
|
@ -282,6 +279,7 @@ public class LexerATNSimulator extends ATNSimulator {
|
|||
// A character will take us back to an existing DFA state
|
||||
// that already has lots of edges out of it. e.g., .* in comments.
|
||||
DFAState target = null;
|
||||
ATNConfigSet reach = null;
|
||||
if (s != null) {
|
||||
if ( s.edges != null && t < s.edges.length && t > CharStream.EOF ) {
|
||||
closure = s.configset;
|
||||
|
@ -331,7 +329,6 @@ public class LexerATNSimulator extends ATNSimulator {
|
|||
t = input.LA(1);
|
||||
|
||||
closure = reach;
|
||||
reach = null;
|
||||
s = target; // flip; current DFA target becomes new src/from state
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue