@Override public ParseInfo getParseInfo() { ParserATNSimulator interp = getInterpreter(); if (interp instanceof ProfilingATNSimulator) { return new ParseInfo((ProfilingATNSimulator)interp); } return null; }
/** * @since 4.3 */ public void setProfile(boolean profile) { ParserATNSimulator interp = getInterpreter(); if ( profile ) { if (!(interp instanceof ProfilingATNSimulator)) { setInterpreter(new ProfilingATNSimulator(this)); } } else if (interp instanceof ProfilingATNSimulator) { setInterpreter(new ParserATNSimulator(this, getATN(), interp.decisionToDFA, interp.getSharedContextCache())); } }
public ParserInterpreter(String grammarFileName, Collection<String> tokenNames, Collection<String> ruleNames, ATN atn, TokenStream input) { super(input); this.grammarFileName = grammarFileName; this.atn = atn; this.tokenNames = tokenNames.toArray(new String[tokenNames.size()]); this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); this.decisionToDFA = new DFA[atn.getNumberOfDecisions()]; for (int i = 0; i < decisionToDFA.length; i++) { decisionToDFA[i] = new DFA(atn.getDecisionState(i), i); } // identify the ATN states where pushNewRecursionContext must be called this.pushRecursionContextStates = new BitSet(atn.states.size()); for (ATNState state : atn.states) { if (!(state instanceof StarLoopEntryState)) { continue; } if (((StarLoopEntryState)state).precedenceRuleDecision) { this.pushRecursionContextStates.set(state.stateNumber); } } // get atn simulator that knows how to do predictions setInterpreter(new ParserATNSimulator(this, atn, decisionToDFA, sharedContextCache)); }
public CParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public FWPolicyParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public SqlGrammarParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public CypherParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public ExpressionEditorParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public ExprParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public Verilog2001Parser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public ObjCParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public HelloParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public AccountingParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public EditorConfigParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public GroovyLangParser(TokenStream input) { super(input); this.setInterpreter(new ParserATNSimulator(this, new AtnManager(this).getATN())); }
public SkinnyParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public tlvParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public ByteRegexParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public SoqlParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); removeErrorListeners(); addErrorListener(new SoqlErrorListener()); }
public CliParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public QuestionnaireParser( TokenStream input ) { super( input ); _interp = new ParserATNSimulator( this, _ATN, _decisionToDFA, _sharedContextCache ); }
public QLParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
protected void configureParser(@NonNull Parser parser, @NonNull ParserConfiguration configuration) { ParserATNSimulator interpreter = parser.getInterpreter(); // common configuration interpreter.force_global_context = false; interpreter.always_try_local_context = true; interpreter.optimize_tail_calls = true; parser.setBuildParseTree(true); parser.removeErrorListeners(); switch (configuration) { case FASTEST: interpreter.setPredictionMode(PredictionMode.SLL); interpreter.tail_call_preserves_sll = false; interpreter.treat_sllk1_conflict_as_ambiguity = true; parser.setErrorHandler(new BailErrorStrategy()); break; case SLL: throw new UnsupportedOperationException("The tail_call_preserves_sll flag cannot change within a single ATN instance."); //interpreter.setPredictionMode(PredictionMode.SLL); //interpreter.tail_call_preserves_sll = true; //interpreter.treat_sllk1_conflict_as_ambiguity = true; //parser.setErrorHandler(new BailErrorStrategy<Token>()); //break; case HYBRID: interpreter.setPredictionMode(PredictionMode.LL); interpreter.tail_call_preserves_sll = false; interpreter.treat_sllk1_conflict_as_ambiguity = true; parser.setErrorHandler(new BailErrorStrategy()); break; case HYBRID_SLL: throw new UnsupportedOperationException("The tail_call_preserves_sll flag cannot change within a single ATN instance."); //interpreter.setPredictionMode(PredictionMode.LL); //interpreter.tail_call_preserves_sll = true; //interpreter.treat_sllk1_conflict_as_ambiguity = true; //parser.setErrorHandler(new BailErrorStrategy<Token>()); //break; case PRECISE: interpreter.setPredictionMode(PredictionMode.LL); interpreter.tail_call_preserves_sll = false; interpreter.treat_sllk1_conflict_as_ambiguity = false; parser.setErrorHandler(new DefaultErrorStrategy()); parser.addErrorListener(DescriptiveErrorListener.INSTANCE); break; default: throw new IllegalArgumentException("Invalid configuration."); } }
public MemoryModelParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public PSHDLLang(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public CommonParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public CParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public Java8Parser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache); }
public SELECTParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public JKVCParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
public JavaParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }
/** * Instantiates a new expression constraint parser. * * @param input the input */ public ExpressionConstraintParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); }