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