当前位置: 首页>>代码示例>>Java>>正文


Java PredictionContextCache类代码示例

本文整理汇总了Java中org.antlr.v4.runtime.atn.PredictionContextCache的典型用法代码示例。如果您正苦于以下问题:Java PredictionContextCache类的具体用法?Java PredictionContextCache怎么用?Java PredictionContextCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PredictionContextCache类属于org.antlr.v4.runtime.atn包,在下文中一共展示了PredictionContextCache类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeReachSet

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
@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);
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:11,代码来源:StatisticsParserATNSimulator.java

示例2: addDFAEdge

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
@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);
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:10,代码来源:TreeCorrectionParserATNSimulator.java

示例3: computeTargetState

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
@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;
        }
    }
}
 
开发者ID:tunnelvisionlabs,项目名称:antlrworks2,代码行数:16,代码来源:StatisticsParserATNSimulator.java

示例4: PositionAdjustingLexerATNSimulator

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
public PositionAdjustingLexerATNSimulator(Lexer recog, ATN atn, DFA[] decisionToDFA, PredictionContextCache sharedContextCache) {
    super(recog, atn, decisionToDFA, sharedContextCache);
}
 
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:4,代码来源:PositionAdjustingLexerATNSimulator.java

示例5: computeTargetState

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
@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);
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:6,代码来源:StatisticsParserATNSimulator.java

示例6: closure

import org.antlr.v4.runtime.atn.PredictionContextCache; //导入依赖的package包/类
@Override
protected void closure(ATNConfigSet sourceConfigs, ATNConfigSet configs, boolean collectPredicates, boolean hasMoreContext, PredictionContextCache contextCache, boolean treatEofAsEpsilon) {
    super.closure(sourceConfigs, configs, collectPredicates, hasMoreContext, contextCache, treatEofAsEpsilon);
}
 
开发者ID:tunnelvisionlabs,项目名称:goworks,代码行数:5,代码来源:AbstractCompletionParserATNSimulator.java


注:本文中的org.antlr.v4.runtime.atn.PredictionContextCache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。