if (currentToken.equalsIgnoreCase("between"))
{
readNextToken(); // skip 'between'
SelectorNode lowerBound = parseAdditiveExpression();
if (isEndOfExpression())
throw new InvalidSelectorException("Unexpected end of expression");
if (!currentToken.equalsIgnoreCase("and"))
throw new InvalidSelectorException("Expected an AND operator after lower bound in BETWEEN construct");
readNextToken(); // Skip 'and'
SelectorNode upperBound = parseAdditiveExpression();
return new BetweenOperator(lNode, lowerBound, upperBound);
}
if (currentToken.equalsIgnoreCase("not between"))
{
readNextToken(); // skip 'between'
SelectorNode lowerBound = parseAdditiveExpression();
if (isEndOfExpression())
throw new InvalidSelectorException("Unexpected end of expression");
if (!currentToken.equalsIgnoreCase("and"))
throw new InvalidSelectorException("Expected an AND operator after lower bound in BETWEEN construct");
readNextToken(); // Skip 'and'
SelectorNode upperBound = parseAdditiveExpression();
return new NotBetweenOperator(lNode, lowerBound, upperBound);
}