return decsionOp(raw);
}
private Expression decsionOp(ParserString raw) throws SQLParserException {
Expression expr = plusMinusOp(raw);
boolean hasChanged=false;
do {
hasChanged=false;
// value BETWEEN value AND value
if (raw.forwardIfCurrent("between ")) {
raw.removeSpace();
Expression left = plusMinusOp(raw);
raw.removeSpace();
if(!raw.forwardIfCurrent("and "))throw new SQLParserException("invalid operation (between) missing operator and");
raw.removeSpace();
Expression right = plusMinusOp(raw);
raw.removeSpace();
expr= new Operation3(expr,left,right, Operation.OPERATION3_BETWEEN);
hasChanged=true;
}
// value like value [escape value]
else if (raw.forwardIfCurrentAndNoWordNumberAfter("like")) {
raw.removeSpace();
Expression left = plusMinusOp(raw);
raw.removeSpace();
if(raw.forwardIfCurrentAndNoWordNumberAfter("escape ")){
raw.removeSpace();
Expression right = plusMinusOp(raw);
raw.removeSpace();
expr= new Operation3(expr,left,right, Operation.OPERATION3_LIKE);
}
else {
raw.removeSpace();