BeetlAntlrErrorStrategy.java 文件源码

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

项目:beetl2.0 作者:
protected void reportUnwantedToken(@NotNull Parser recognizer)
{
    if (inErrorRecoveryMode(recognizer))
    {
        return;
    }

    beginErrorCondition(recognizer);

    Token t = recognizer.getCurrentToken();
    String tokenName = getTokenErrorDisplay(t);
    IntervalSet expecting = getExpectedTokens(recognizer);
    String msg = "多余输入 " + tokenName + " 期望 " + expecting.toString(recognizer.getTokenNames());
    BeetlException exception = new BeetlParserException(BeetlException.PARSER_MISS_ERROR, msg);
    //      exception.token = this.getGrammarToken(t);
    exception.pushToken(this.getGrammarToken(t));
    throw exception;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号