169170171172173174175176177178179
} else { expression = expression.substring(1); ExprParser p = new ExprParser(); p.setParserVisitor(this); try { p.parse(new ExprLexer(expression), this); } catch (IOException e) { throw new ExprException(e); } result = p.get(); }
5455565758596061626364
CloseBrace); } private void assertTypes(String expr, ExprTokenType... types) throws IOException { ExprLexer l = new ExprLexer(expr); for (int i = 0; i < types.length; i++) { assertEquals(l.next().type, types[i]); } assertNull(l.next()); }
6364656667686970
} public Expr parse(String expr) throws IOException, ExprException { ExprParser ep = new ExprParser(); ep.setParserVisitor(this); ep.parse(new ExprLexer(expr), this); return ep.get(); }