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

项目:goworks    文件:StatisticsParserATNSimulator.java   
@Override
protected SimulatorState computeReachSet(DFA dfa, SimulatorState previous, int t, PredictionContextCache contextCache) {
    if (previous.useContext) {
        totalTransitions[decision]++;
        computedTransitions[decision]++;
        fullContextTransitions[decision]++;
    }

    return super.computeReachSet(dfa, previous, t, contextCache);
}
项目:goworks    文件:TreeCorrectionParserATNSimulator.java   
@Override
protected DFAState addDFAEdge(DFA dfa, DFAState fromState, int t, IntegerList contextTransitions, ATNConfigSet toConfigs, PredictionContextCache contextCache) {
    if (!getSuppressedSet(startIndex).isNil()) {
        DFAState to = addDFAState(dfa, toConfigs, contextCache);
        return to;
    }

    return super.addDFAEdge(dfa, fromState, t, contextTransitions, toConfigs, contextCache);
}
项目:antlrworks2    文件:StatisticsParserATNSimulator.java   
@Override
protected Tuple2<DFAState, ParserRuleContext> computeTargetState(DFA dfa, DFAState s, ParserRuleContext remainingGlobalContext, int t, boolean useContext, PredictionContextCache contextCache) {
    computedTransitions[decision]++;

    long startTime = System.nanoTime();
    try {
        return super.computeTargetState(dfa, s, remainingGlobalContext, t, useContext, contextCache);
    } finally {
        long totalTime = System.nanoTime() - startTime;
        decisionCost[dfa.decision] += totalTime;
        if (useContext) {
            decisionLlCost[dfa.decision] += totalTime;
        }
    }
}
项目:antlrworks2    文件:StatisticsParserATNSimulator.java   
@Override
protected SimulatorState computeReachSet(DFA dfa, SimulatorState previous, int t, PredictionContextCache contextCache) {
    if (previous.useContext) {
        totalTransitions[decision]++;
        computedTransitions[decision]++;
        fullContextTransitions[decision]++;
    }

    return super.computeReachSet(dfa, previous, t, contextCache);
}
项目:beaker-notebook-archive    文件:PositionAdjustingLexerATNSimulator.java   
public PositionAdjustingLexerATNSimulator(Lexer recog, ATN atn, DFA[] decisionToDFA, PredictionContextCache sharedContextCache) {
    super(recog, atn, decisionToDFA, sharedContextCache);
}
项目:goworks    文件:StatisticsParserATNSimulator.java   
@Override
protected Tuple2<DFAState, ParserRuleContext> computeTargetState(DFA dfa, DFAState s, ParserRuleContext remainingGlobalContext, int t, boolean useContext, PredictionContextCache contextCache) {
    computedTransitions[decision]++;
    return super.computeTargetState(dfa, s, remainingGlobalContext, t, useContext, contextCache);
}
项目:goworks    文件:AbstractCompletionParserATNSimulator.java   
@Override
protected void closure(ATNConfigSet sourceConfigs, ATNConfigSet configs, boolean collectPredicates, boolean hasMoreContext, PredictionContextCache contextCache, boolean treatEofAsEpsilon) {
    super.closure(sourceConfigs, configs, collectPredicates, hasMoreContext, contextCache, treatEofAsEpsilon);
}
项目:beakerx    文件:PositionAdjustingLexerATNSimulator.java   
public PositionAdjustingLexerATNSimulator(Lexer recog, ATN atn, DFA[] decisionToDFA, PredictionContextCache sharedContextCache) {
    super(recog, atn, decisionToDFA, sharedContextCache);
}
项目:antlrworks2    文件:AbstractCompletionParserATNSimulator.java   
@Override
protected void closure(ATNConfigSet sourceConfigs, ATNConfigSet configs, boolean collectPredicates, boolean hasMoreContext, PredictionContextCache contextCache, boolean treatEofAsEpsilon) {
    super.closure(sourceConfigs, configs, collectPredicates, hasMoreContext, contextCache, treatEofAsEpsilon);
}