diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java index b305861c6..47e0f1ac6 100755 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java @@ -982,8 +982,6 @@ public class ParserATNSimulator extends ATNSimulator { boolean collectPredicates, boolean greedy, boolean loopsSimulateTailRecursion) { -// System.out.println(PredictionContext.toDOTString(config.context)); - final int initialDepth = 0; closureCheckingStopStateAndLoopRecursion(config, configs, closureBusy, collectPredicates, greedy, loopsSimulateTailRecursion, initialDepth); @@ -1492,6 +1490,7 @@ public class ParserATNSimulator extends ATNSimulator { newState.stateNumber = dfa.states.size(); // System.out.println("Before opt, cache size = "+ sharedContextCache.size()); + configs.optimizeConfigs(this); // System.out.println("After opt, cache size = " + sharedContextCache.size()); newState.configs = new ATNConfigSet(configs, contextCache); diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java index e6cdad7db..71a72c9bc 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java @@ -169,7 +169,7 @@ public abstract class PredictionContext implements Iterable