ProfilingATNSimulator.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:Scratch-ApuC 作者:
@Override
protected void reportAmbiguity(@NotNull DFA dfa, DFAState D, int startIndex, int stopIndex, boolean exact,
                               @Nullable BitSet ambigAlts, @NotNull ATNConfigSet configs)
{
    int prediction;
    if ( ambigAlts!=null ) {
        prediction = ambigAlts.nextSetBit(0);
    }
    else {
        prediction = configs.getAlts().nextSetBit(0);
    }
    if ( configs.fullCtx && prediction != conflictingAltResolvedBySLL ) {
        // Even though this is an ambiguity we are reporting, we can
        // still detect some context sensitivities.  Both SLL and LL
        // are showing a conflict, hence an ambiguity, but if they resolve
        // to different minimum alternatives we have also identified a
        // context sensitivity.
        decisions[currentDecision].contextSensitivities.add(
                new ContextSensitivityInfo(currentDecision, configs, _input, startIndex, stopIndex)
        );
    }
    decisions[currentDecision].ambiguities.add(
        new AmbiguityInfo(currentDecision, configs, _input, startIndex, stopIndex, configs.fullCtx)
    );
    super.reportAmbiguity(dfa, D, startIndex, stopIndex, exact, ambigAlts, configs);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号