Java 类org.antlr.v4.runtime.atn.ParserATNSimulator 实例源码

项目:Scratch-ApuC    文件:Parser.java   
@Override
public ParseInfo getParseInfo() {
    ParserATNSimulator interp = getInterpreter();
    if (interp instanceof ProfilingATNSimulator) {
        return new ParseInfo((ProfilingATNSimulator)interp);
    }
    return null;
}
项目:Scratch-ApuC    文件:Parser.java   
/**
 * @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()));
    }
}
项目:Scratch-ApuC    文件:ParserInterpreter.java   
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));
}
项目:BEAST    文件:CParser.java   
public CParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:oscm-app    文件:FWPolicyParser.java   
public FWPolicyParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
            _sharedContextCache);
}
项目:coherence-sql    文件:SqlGrammarParser.java   
public SqlGrammarParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:oscm    文件:FWPolicyParser.java   
public FWPolicyParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
            _sharedContextCache);
}
项目:cyp2sql    文件:CypherParser.java   
public CypherParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:Hydrograph    文件:ExpressionEditorParser.java   
public ExpressionEditorParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:Expr3    文件:ExprParser.java   
public ExprParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:netlist-graph    文件:Verilog2001Parser.java   
public Verilog2001Parser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:Objc2Lua    文件:ObjCParser.java   
public ObjCParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:KeepTry    文件:HelloParser.java   
public HelloParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:dsl    文件:AccountingParser.java   
public AccountingParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:development    文件:FWPolicyParser.java   
public FWPolicyParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
            _sharedContextCache);
}
项目:netbeans-editorconfig-editor    文件:EditorConfigParser.java   
public EditorConfigParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:groovy    文件:GroovyLangParser.java   
public GroovyLangParser(TokenStream input) {
    super(input);

    this.setInterpreter(new ParserATNSimulator(this, new AtnManager(this).getATN()));
}
项目:SkinnyAssembler    文件:SkinnyParser.java   
public SkinnyParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:Oscar    文件:tlvParser.java   
public tlvParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:htools    文件:ByteRegexParser.java   
public ByteRegexParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:components    文件:SoqlParser.java   
public SoqlParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
       removeErrorListeners();
       addErrorListener(new SoqlErrorListener());
}
项目:oap    文件:CliParser.java   
public CliParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:poly-ql    文件:QuestionnaireParser.java   
public QuestionnaireParser( TokenStream input )
{
    super( input );
    _interp = new ParserATNSimulator( this, _ATN, _decisionToDFA, _sharedContextCache );
}
项目:poly-ql    文件:QLParser.java   
public QLParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:goworks    文件:GoParserFactory.java   
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.");
    }
}
项目:org.pshdl    文件:MemoryModelParser.java   
public MemoryModelParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:org.pshdl    文件:PSHDLLang.java   
public PSHDLLang(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:SqlParser    文件:CommonParser.java   
public CommonParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:WHOAMI    文件:CParser.java   
public CParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:WHOAMI    文件:Java8Parser.java   
public Java8Parser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:editorconfig-netbeans    文件:EditorConfigParser.java   
public EditorConfigParser(TokenStream input) {
  super(input);
  _interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
项目:relsem-bridge-backend    文件:SELECTParser.java   
public SELECTParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:JKVC    文件:JKVCParser.java   
public JKVCParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:jbpm-data-modeler    文件:JavaParser.java   
public JavaParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
项目:UMLS-Terminology-Server    文件:ExpressionConstraintParser.java   
/**
 * Instantiates a new expression constraint parser.
 *
 * @param input the input
 */
public ExpressionConstraintParser(TokenStream input) {
    super(input);
    _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}