diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java index 7b8b06feb..7c169381e 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java @@ -269,7 +269,7 @@ public class LexerATNSimulator extends ATNSimulator { // if we don't find an existing DFA state // Fill reach starting from closure, following t transitions - getReachableConfigSet(closure, reach, t); + getReachableConfigSet(input, closure, reach, t); if ( reach.isEmpty() ) { // we got nowhere on t from s // we reached state associated with closure for sure, so @@ -326,7 +326,7 @@ public class LexerATNSimulator extends ATNSimulator { * we can reach upon input {@code t}. Parameter {@code reach} is a return * parameter. */ - protected void getReachableConfigSet(@NotNull ATNConfigSet closure, @NotNull ATNConfigSet reach, int t) { + protected void getReachableConfigSet(@NotNull CharStream input, @NotNull ATNConfigSet closure, @NotNull ATNConfigSet reach, int t) { // this is used to skip processing for configs which have a lower priority // than a config that already reached an accept state for the same rule int skipAlt = ATN.INVALID_ALT_NUMBER; @@ -345,7 +345,7 @@ public class LexerATNSimulator extends ATNSimulator { Transition trans = c.state.transition(ti); ATNState target = getReachableTarget(trans, t); if ( target!=null ) { - if (closure(new LexerATNConfig((LexerATNConfig)c, target), reach, currentAltReachedAcceptState)) { + if (closure(input, new LexerATNConfig((LexerATNConfig)c, target), reach, currentAltReachedAcceptState, true)) { // any remaining configs for this alt have a lower priority than // the one that just reached an accept state. skipAlt = c.alt; @@ -383,7 +383,7 @@ public class LexerATNSimulator extends ATNSimulator { } @NotNull - protected ATNConfigSet computeStartState(@NotNull IntStream input, + protected ATNConfigSet computeStartState(@NotNull CharStream input, @NotNull ATNState p) { PredictionContext initialContext = PredictionContext.EMPTY; @@ -391,7 +391,7 @@ public class LexerATNSimulator extends ATNSimulator { for (int i=0; i