BeetlAntlrErrorStrategy.java 文件源码

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

项目:beetl2.0 作者:
protected void reportInputMismatch(@NotNull Parser recognizer, @NotNull InputMismatchException e)
{
    Token t1 = recognizer.getInputStream().LT(-1);
    String msg = "缺少输入在 " + getTokenErrorDisplay(t1) + " 后面, 期望 "
            + e.getExpectedTokens().toString(recognizer.getTokenNames());
    BeetlException exception = new BeetlParserException(BeetlException.PARSER_MISS_ERROR, msg, e);
    //      exception.token = this.getGrammarToken(e.getOffendingToken());
    exception.pushToken(this.getGrammarToken(t1));

    throw exception;

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号