public virtual void OptimizeConfigs(ATNSimulator interpreter) { if (configs.Count == 0) { return; } for (int i = 0; i < configs.Count; i++) { ATNConfig config = configs[i]; config.Context = interpreter.atn.GetCachedContext(config.Context); } }
public void OptimizeConfigs(ATNSimulator interpreter) { if (readOnly) { throw new Exception("This set is readonly"); } if (configLookup.Count == 0) { return; } foreach (ATNConfig config in configs) { // int before = PredictionContext.getAllContextNodes(config.context).size(); config.context = interpreter.getCachedContext(config.context); // int after = PredictionContext.getAllContextNodes(config.context).size(); // System.out.println("configs "+before+"->"+after); } }