/** Make sure we don't attempt to recover inline; if the parser
* successfully recovers, it won't throw an exception.
*/
@Override
public Token recoverInline(Parser recognizer) throws RecognitionException
{
// SINGLE TOKEN DELETION
Token matchedSymbol = singleTokenDeletion(recognizer);
if (matchedSymbol != null)
{
// we have deleted the extra token.
// now, move past ttype token as if all were ok
recognizer.consume();
return matchedSymbol;
}
// SINGLE TOKEN INSERTION
if (singleTokenInsertion(recognizer))
{
return getMissingSymbol(recognizer);
}
// BeetlException exception = new BeetlParserException(BeetlException.PARSER_MISS_ERROR);
// exception.pushToken(this.getGrammarToken(recognizer.getCurrentToken()));
// throw exception;
throw new InputMismatchException(recognizer);
}
BeetlAntlrErrorStrategy.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:beetl2.0
作者:
评论列表
文章目录