List of usage examples for org.antlr.v4.runtime.atn ParserATNSimulator clearDFA
@Override
public void clearDFA()
From source file:com.github.robozonky.strategy.natural.SideEffectFreeParser.java
License:Apache License
private static void modifyInterpreter(final NaturalLanguageStrategyParser p) { final int originalSize = p.getInterpreter().decisionToDFA.length; final DFA[] emptyDFA = new DFA[originalSize]; // give our own array so the static one isn't used final ParserATNSimulator newInterpreter = new ParserATNSimulator(p, p.getATN(), emptyDFA, new PredictionContextCache()); newInterpreter.clearDFA(); // initialize our array so that the parser functions properly p.setInterpreter(newInterpreter); // replace the interpreter to bypass all static caches }