LexerATNSimulator.java 文件源码

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

项目:Scratch-ApuC 作者:
/**
 * Get an existing target state for an edge in the DFA. If the target state
 * for the edge has not yet been computed or is otherwise not available,
 * this method returns {@code null}.
 *
 * @param s The current DFA state
 * @param t The next input symbol
 * @return The existing target DFA state for the given input symbol
 * {@code t}, or {@code null} if the target state for this edge is not
 * already cached
 */
@Nullable
protected DFAState getExistingTargetState(@NotNull DFAState s, int t) {
    if (s.edges == null || t < MIN_DFA_EDGE || t > MAX_DFA_EDGE) {
        return null;
    }

    DFAState target = s.edges[t - MIN_DFA_EDGE];
    if (debug && target != null) {
        System.out.println("reuse state "+s.stateNumber+
                           " edge to "+target.stateNumber);
    }

    return target;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号