public FuckedLexer(CharStream input) { super(input); setInterpreter(new LexerATNSimulator(this, _ATN, getDFA(), new PredictionContextCache())); }
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 }
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 }
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 }
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 }
private static GLSLParser getParser( InputStream inputStream, ParseTreeListener listener) throws IOException { ANTLRInputStream input = new ANTLRInputStream(inputStream); GLSLLexer lexer = new GLSLLexer(input); PredictionContextCache cache = new PredictionContextCache(); lexer.setInterpreter( new LexerATNSimulator(lexer, lexer.getATN(), lexer.getInterpreter().decisionToDFA, cache)); CommonTokenStream tokens = new CommonTokenStream(lexer); GLSLParser parser = new GLSLParser(tokens); if (listener != null) { parser.addParseListener(listener); } parser.setInterpreter( new ParserATNSimulator(parser, parser.getATN(), parser.getInterpreter().decisionToDFA, cache)); return parser; }
PredictionContextCache cache = new PredictionContextCache();
PredictionContextCache cache = new PredictionContextCache();
PredictionContextCache contextCache = new PredictionContextCache(); while (true) { // while more work SimulatorState nextState = computeReachSet(dfa, previous, t, contextCache);
ParserRuleContext remainingGlobalContext = globalContext; PredictionContextCache contextCache = new PredictionContextCache(); if (useContext) { if (!enable_global_context_dfa) {