ParserATNSimulator.java 文件源码

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

项目:Scratch-ApuC 作者:
@NotNull
protected ATNConfigSet computeStartState(@NotNull ATNState p,
                                      @Nullable RuleContext ctx,
                                      boolean fullCtx)
{
    // always at least the implicit call to start rule
    PredictionContext initialContext = PredictionContext.fromRuleContext(atn, ctx);
    ATNConfigSet configs = new ATNConfigSet(fullCtx);

    for (int i=0; i<p.getNumberOfTransitions(); i++) {
        ATNState target = p.transition(i).target;
        ATNConfig c = new ATNConfig(target, i+1, initialContext);
        Set<ATNConfig> closureBusy = new HashSet<ATNConfig>();
        closure(c, configs, closureBusy, true, fullCtx, false);
    }

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


问题


面经


文章

微信
公众号

扫码关注公众号