result = new IsNullExpression(child);
}
else if (ast.getText().equals("LIKE"))
{
// TODO implement this
throw new ExpressionException(new UnsupportedExpressionTree(ast));
}
else if (ast.getText().equals("BETWEEN"))
{
// TODO implement this
throw new ExpressionException(new UnsupportedExpressionTree(ast));
}
else if (ast.getText().equals("IN"))
{
// TODO implement this
throw new ExpressionException(new UnsupportedExpressionTree(ast));
}
else if (ast.getText().equals("EXISTS"))
{
// TODO implement this
throw new ExpressionException(new UnsupportedExpressionTree(ast));
}
else if (ast.getText().equals("="))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new EqualExpression(lh, rh);
}
else if (ast.getText().equals("<"))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new LessThanExpression(lh, rh);
}
else if (ast.getText().equals("<="))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new LessThanOrEqualExpression(lh, rh);
}
else if (ast.getText().equals(">"))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new GreaterThanExpression(lh, rh);
}
else if (ast.getText().equals(">="))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new GreaterThanOrEqualExpression(lh, rh);
}
else if (ast.getText().equals("!="))
{
Operand lh = buildOperand((CommonTree)ast.getChild(0));
Operand rh = buildOperand((CommonTree)ast.getChild(1));
result = new NotEqualExpression(lh, rh);
}
else
{
throw new ExpressionException(new UnsupportedExpressionTree(ast));
}
return result;
}