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();
}
ZomicASTCompiler.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:vzome-core
作者:
评论列表
文章目录