FailedPredicateException.java 文件源码

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

项目:Scratch-ApuC 作者:
public FailedPredicateException(@NotNull Parser recognizer,
                                @Nullable String predicate,
                                @Nullable String message)
{
    super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
    ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());

    AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
    if (trans instanceof PredicateTransition) {
        this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
        this.predicateIndex = ((PredicateTransition)trans).predIndex;
    }
    else {
        this.ruleIndex = 0;
        this.predicateIndex = 0;
    }

    this.predicate = predicate;
    this.setOffendingToken(recognizer.getCurrentToken());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号