public override SoqlExpression Simplify()
        {
            par1 = par1.Simplify();
            par2 = par2.Simplify();

            ISoqlConstantExpression cp1 = par1 as ISoqlConstantExpression;
            ISoqlConstantExpression cp2 = par2 as ISoqlConstantExpression;

            if (cp1 != null && cp2 != null)
            {
                object v1 = cp1.GetConstantValue();
                object v2 = cp2.GetConstantValue();

                object newValue = CalcValue(op, v1, v2);
                if (newValue != null)
                {
                    return(new SoqlLiteralExpression(newValue));
                }
                else
                {
                    return(new SoqlNullLiteral());
                }
            }

            return(this);
        }
        public override SoqlExpression Simplify()
        {
            par1 = par1.Simplify();
            par2 = par2.Simplify();

            ISoqlConstantExpression cp1 = par1 as ISoqlConstantExpression;
            ISoqlConstantExpression cp2 = par2 as ISoqlConstantExpression;

            if (cp1 != null && cp2 != null)
            {
                object v1 = cp1.GetConstantValue();
                object v2 = cp2.GetConstantValue();

                object result = Compare(v1, v2, op);
                if (result == null)
                {
                    return(new SoqlNullLiteral());
                }
                else
                {
                    return(new SoqlBooleanLiteralExpression((bool)result));
                }
            }
            return(this);
        }
 public override SoqlExpression Simplify()
 {
     par = par.Simplify();
     return(this);
 }