本文整理汇总了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);
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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);
}