ExpressionParser { static Parser<Expression> between(Parser<Expression> expr) { return Parsers.sequence( expr, Parsers.or(term("between").retn(true), phrase("not between").retn(false)), expr, term("and").next(expr), BetweenExpression::new); }    }
@Test public void testBetween() { Parser<Expression> parser = ExpressionParser.between(NUMBER); TerminalParserTest.assertParser(parser, "1 BETWEEN 0 and 2", new BetweenExpression(number(1), true, number(0), number(2))); TerminalParserTest.assertParser(parser, "1 not between 2 and 0", new BetweenExpression(number(1), false, number(2), number(0))); }