Beispiel #1
0
 private static bool cmpBoolStringO(Operator.Op op, object val1, object val2)
 {
     return(cmpNumberNumberO(op,
                             NumberFunctions.Number((bool)val1),
                             NumberFunctions.Number((string)val2)
                             ));
 }
Beispiel #2
0
 private static bool cmpRtfBoolO(Operator.Op op, object val1, object val2)
 {
     return(cmpNumberNumberO(op,
                             NumberFunctions.Number(Rtf(val1)),
                             NumberFunctions.Number((bool)val2)
                             ));
 }
Beispiel #3
0
        private static bool cmpBoolBoolO(Operator.Op op, object val1, object val2)
        {
            double num  = NumberFunctions.Number((bool)val1);
            double num2 = NumberFunctions.Number((bool)val2);

            return(cmpNumberNumberO(op, num, num2));
        }
Beispiel #4
0
        private static bool cmpBoolNumberO(Operator.Op op, object val1, object val2)
        {
            double n1 = NumberFunctions.Number((bool)val1);
            double n2 = (double)val2;

            return(cmpNumberNumberO(op, n1, n2));
        }
Beispiel #5
0
        static bool cmpRtfNumber(Operator.Op op, object val1, object val2)
        {
            double n2 = (double)val2;
            double n1 = NumberFunctions.Number(Rtf(val1));

            return(cmpNumberNumber(op, n1, n2));
        }
Beispiel #6
0
        /*cmpXslt:*/
        private static bool cmpQueryQueryO(Operator.Op op, object val1, object val2)
        {
            Debug.Assert(
                op == Operator.Op.LT || op == Operator.Op.GT ||
                op == Operator.Op.LE || op == Operator.Op.GE
                );

            NodeSet n1 = new NodeSet(val1);
            NodeSet n2 = new NodeSet(val2);

            while (true)
            {
                if (!n1.MoveNext())
                {
                    return(false);
                }
                if (!n2.MoveNext())
                {
                    return(false);
                }

                double num1 = NumberFunctions.Number(n1.Value);

                do
                {
                    if (cmpNumberNumber(op, num1, NumberFunctions.Number(n2.Value)))
                    {
                        return(true);
                    }
                } while (n2.MoveNext());
                n2.Reset();
            }
        }
Beispiel #7
0
        private static bool cmpRtfStringO(Operator.Op op, object val1, object val2)
        {
            double num  = NumberFunctions.Number(Rtf(val1));
            double num2 = NumberFunctions.Number((string)val2);

            return(cmpNumberNumberO(op, num, num2));
        }
Beispiel #8
0
        private static bool cmpStringNumber(Operator.Op op, object val1, object val2)
        {
            double num  = (double)val2;
            double num2 = NumberFunctions.Number((string)val1);

            return(cmpNumberNumber(op, num2, num));
        }
Beispiel #9
0
        private static bool cmpRtfRtfO(Operator.Op op, object val1, object val2)
        {
            double n1 = NumberFunctions.Number(Rtf(val1));
            double n2 = NumberFunctions.Number(Rtf(val2));

            return(cmpNumberNumberO(op, n1, n2));
        }
Beispiel #10
0
        private static bool cmpStringStringO(Operator.Op op, object val1, object val2)
        {
            double n1 = NumberFunctions.Number((string)val1);
            double n2 = NumberFunctions.Number((string)val2);

            return(cmpNumberNumberO(op, n1, n2));
        }
Beispiel #11
0
        private static bool cmpQueryBoolO(Operator.Op op, object val1, object val2)
        {
            NodeSet n1 = new NodeSet(val1);
            double  d1 = n1.MoveNext() ? 1.0 : 0;
            double  d2 = NumberFunctions.Number((bool)val2);

            return(cmpNumberNumberO(op, d1, d2));
        }
Beispiel #12
0
        private static bool cmpQueryBoolO(Operator.Op op, object val1, object val2)
        {
            NodeSet set  = new NodeSet(val1);
            double  num  = set.MoveNext() ? 1.0 : 0.0;
            double  num2 = NumberFunctions.Number((bool)val2);

            return(cmpNumberNumberO(op, num, num2));
        }
Beispiel #13
0
        private static bool cmpQueryStringO(Operator.Op op, object val1, object val2)
        {
            NodeSet n1 = new NodeSet(val1);
            double  n2 = NumberFunctions.Number((string)val2);

            while (n1.MoveNext())
            {
                if (cmpNumberNumberO(op, NumberFunctions.Number(n1.Value), n2))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #14
0
        private static bool cmpQueryNumber(Operator.Op op, object val1, object val2)
        {
            NodeSet set = new NodeSet(val1);
            double  num = (double)val2;

            while (set.MoveNext())
            {
                if (cmpNumberNumber(op, NumberFunctions.Number(set.Value), num))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #15
0
        private static bool cmpRtfQueryO(Operator.Op op, object val1, object val2)
        {
            double  n1 = NumberFunctions.Number(Rtf(val1));
            NodeSet n2 = new NodeSet(val2);

            while (n2.MoveNext())
            {
                if (cmpNumberNumberO(op, n1, NumberFunctions.Number(n2.Value)))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #16
0
        static bool cmpQueryNumber(Operator.Op op, object val1, object val2)
        {
            NodeSet n1 = new NodeSet(val1);
            double  n2 = (double)val2;

            while (n1.MoveNext())
            {
                if (cmpNumberNumber(op, NumberFunctions.Number(n1.Value), n2))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #17
0
 public NumericExpr(Operator.Op op, Query opnd1, Query opnd2)
 {
     Debug.Assert(
         op == Operator.Op.PLUS || op == Operator.Op.MINUS ||
         op == Operator.Op.MUL || op == Operator.Op.DIV ||
         op == Operator.Op.MOD
         );
     Debug.Assert(opnd1 != null && opnd2 != null);
     if (opnd1.StaticType != XPathResultType.Number)
     {
         opnd1 = new NumberFunctions(Function.FunctionType.FuncNumber, opnd1);
     }
     if (opnd2.StaticType != XPathResultType.Number)
     {
         opnd2 = new NumberFunctions(Function.FunctionType.FuncNumber, opnd2);
     }
     _op    = op;
     _opnd1 = opnd1;
     _opnd2 = opnd2;
 }
Beispiel #18
0
        private static bool cmpQueryQueryO(Operator.Op op, object val1, object val2)
        {
            NodeSet set  = new NodeSet(val1);
            NodeSet set2 = new NodeSet(val2);

            while (set.MoveNext())
            {
                if (!set2.MoveNext())
                {
                    return(false);
                }
                double num = NumberFunctions.Number(set.Value);
                do
                {
                    if (cmpNumberNumber(op, num, NumberFunctions.Number(set2.Value)))
                    {
                        return(true);
                    }
                }while (set2.MoveNext());
                set2.Reset();
            }
            return(false);
        }
 private NumberFunctions(NumberFunctions other) : base(other)
 {
     this.arg   = Clone(other.arg);
     this.ftype = other.ftype;
 }
Beispiel #20
0
 private NumberFunctions(NumberFunctions other) : base(other)
 {
     _arg   = Clone(other._arg);
     _ftype = other._ftype;
 }