LexerATNSimulator.java 文件源码

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

项目:Scratch-ApuC 作者:
@NotNull
protected DFAState addDFAEdge(@NotNull DFAState from,
                              int t,
                              @NotNull ATNConfigSet q)
{
    /* leading to this call, ATNConfigSet.hasSemanticContext is used as a
     * marker indicating dynamic predicate evaluation makes this edge
     * dependent on the specific input sequence, so the static edge in the
     * DFA should be omitted. The target DFAState is still created since
     * execATN has the ability to resynchronize with the DFA state cache
     * following the predicate evaluation step.
     *
     * TJP notes: next time through the DFA, we see a pred again and eval.
     * If that gets us to a previously created (but dangling) DFA
     * state, we can continue in pure DFA mode from there.
     */
    boolean suppressEdge = q.hasSemanticContext;
    q.hasSemanticContext = false;

    @NotNull
    DFAState to = addDFAState(q);

    if (suppressEdge) {
        return to;
    }

    addDFAEdge(from, t, to);
    return to;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号