ScoreVisitorImplTest.java 文件源码

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

项目:fix-orchestra 作者:
private ScoreParser parse(String expression) throws IOException {
  ScoreLexer l = new ScoreLexer(CharStreams.fromString(expression));
  ScoreParser p = new ScoreParser(new CommonTokenStream(l));
  p.addErrorListener(new BaseErrorListener() {
    @Override
    public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line,
        int charPositionInLine, String msg, RecognitionException e) {
      throw new IllegalStateException(String.format(
          "Failed to parse at line %d position %d due to %s", line, charPositionInLine, msg), e);
    }
  });
  return p;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号