ZomicASTCompiler.java 文件源码

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

项目:vzome-core 作者:
public Walk compile( CharStream input, ErrorHandler errors ) {
     try  {
         return compile( input );
     } catch (ParseCancellationException ex) {
int line = ErrorHandler.UNKNOWN;
int column = ErrorHandler.UNKNOWN;
String msg = "Parser Cancelled.";
Throwable cause = ex.getCause();
if( cause instanceof InputMismatchException ) {
    InputMismatchException immEx = (InputMismatchException) cause;
    Token offender = immEx.getOffendingToken();
    if( offender != null ) {
        line = offender.getLine();
        column = offender.getCharPositionInLine();
        String txt = offender.getText();
        if(txt != null) {
            msg = " Unexpected Token '" + txt + "'.";
        }
    }
}
         errors.parseError( line, column, msg );
     }      
     return getProgram();
 }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号