Exemplo n.º 1
0
        private bool compStringNodeSet(Expr left, Expr right, VTDNav vn, int op)
        {
            int    i, i1 = 0, stackSize;
            String s;

            try
            {
                s = left.evalString(vn);
                vn.push2();
                stackSize = vn.contextStack2.size;
                while ((i = right.evalNodeSet(vn)) != -1)
                {
                    i1 = getStringVal(vn, i);
                    if (i1 != -1 && compareVString2(i1, vn, s, op))
                    {
                        right.reset(vn);
                        vn.contextStack2.size = stackSize;
                        vn.pop2();
                        return(true);
                    }
                }
                vn.contextStack2.size = stackSize;
                vn.pop2();
                right.reset(vn);
                return(false);
            }
            catch (Exception e)
            {
                throw new System.SystemException("Undefined behavior");
            }
        }
Exemplo n.º 2
0
        private bool compNodeSetNumerical(Expr left, Expr right, VTDNav vn, int op)
        {
            int    i, i1 = 0, stackSize;
            double d;

            try {
                d = right.evalNumber(vn);
                vn.push2();
                stackSize = vn.contextStack2.size;
                while ((i = left.evalNodeSet(vn)) != -1)
                {
                    i1 = getStringVal(vn, i);
                    if (i1 != -1 && compareVNumber2(i1, vn, d, op))
                    {
                        left.reset(vn);
                        vn.contextStack2.size = stackSize;
                        vn.pop2();
                        return(true);
                    }
                }
                vn.contextStack2.size = stackSize;
                vn.pop2();
                left.reset(vn);
                return(false);
            } catch (Exception e) {
                throw new System.SystemException("Undefined behavior");
            }
        }
Exemplo n.º 3
0
        /// <summary> constructor</summary>
        /// <param name="l">
        /// </param>
        /// <param name="o">
        /// </param>
        /// <param name="r">
        /// </param>
        public BinaryExpr(Expr l, int o, Expr r)
        {
            op    = o;
            left  = l;
            right = r;
            fib1  = null;
            switch (op)
            {
            case ADD:
            case SUB:
            case MULT:
            case DIV:
            case MOD: isNumerical_Renamed_Field = true; isBoolean_Renamed_Field = false; break;

            case OR:
            case AND:
            case EQ:
            case NE:
            case LE:
            case GE:
            case LT:
            case GT: isNumerical_Renamed_Field = false; isBoolean_Renamed_Field = true;
                goto default;

            default:
                break;
            }
        }
Exemplo n.º 4
0
        //public int position;

        public FilterExpr(Expr l, Predicate pr)
        {
            e = l;
            p = pr;
            //stackSize = 0;
            //position = 1;
            //fib = new FastIntBuffer(8);
            first_time = true;
        }
Exemplo n.º 5
0
        //public int getPositon(){
        //	return fib.size();
        //}

        public PathExpr(Expr f, LocationPathExpr l)
        {
            fe  = f;
            lpe = l;
            //first_time = true;
            evalState = 0;
            //fib = new FastIntBuffer(8);
            ih = new intHash();
        }
Exemplo n.º 6
0
        private bool compNodeSetNodeSet(Expr left, Expr right, VTDNav vn, int op)
        {
            int i, i1 = 0, stackSize, s1;

            try
            {
                if (fib1 == null)
                {
                    fib1 = new FastIntBuffer(BUF_SZ_EXP);
                }
                vn.push2();
                stackSize = vn.contextStack2.size;
                while ((i = left.evalNodeSet(vn)) != -1)
                {
                    i1 = getStringVal(vn, i);
                    if (i1 != -1)
                    {
                        fib1.append(i1);
                    }
                }
                left.reset(vn);
                vn.contextStack2.size = stackSize;
                vn.pop2();
                vn.push2();
                stackSize = vn.contextStack2.size;
                while ((i = right.evalNodeSet(vn)) != -1)
                {
                    i1 = getStringVal(vn, i);
                    if (i1 != -1)
                    {
                        s1 = fib1.size();
                        for (int k = 0; k < s1; k++)
                        {
                            bool b = compareVV(fib1.intAt(k), vn, i1, op);
                            if (b)
                            {
                                fib1.clear();
                                vn.contextStack2.size = stackSize;
                                vn.pop2();
                                right.reset(vn);
                                return(true);
                            }
                        }
                    }
                }
                vn.contextStack2.size = stackSize;
                vn.pop2();
                right.reset(vn);
                fib1.clear();
                return(false);
            }
            catch (Exception e)
            {
                fib1.clear();
                throw new System.SystemException("Undefined behavior");
            }
        }
Exemplo n.º 7
0
		//public int position;
		
		public FilterExpr(Expr l, Predicate pr)
		{
			e = l;
			p = pr;
			//stackSize = 0;
			//position = 1;
			//fib = new FastIntBuffer(8);
			first_time = true;
		}
Exemplo n.º 8
0
 private bool compStringNodeSet(Expr left, Expr right, VTDNav vn, int op)
 {
     int i, i1 = 0, stackSize;
     String s;
     try
     {
         s = left.evalString(vn);
         vn.push2();
         stackSize = vn.contextStack2.size;
         while ((i = right.evalNodeSet(vn)) != -1)
         {
             i1 = getStringVal(vn, i);
             if (i1 != -1 && compareVString2(i1, vn, s, op))
             {
                 right.reset(vn);
                 vn.contextStack2.size = stackSize;
                 vn.pop2();
                 return true;
             }
         }
         vn.contextStack2.size = stackSize;
         vn.pop2();
         right.reset(vn);
         return false;
     }
     catch (Exception e)
     {
         throw new System.SystemException("Undefined behavior");
     }
 }
Exemplo n.º 9
0
	private bool compNodeSetNumerical(Expr left, Expr right, VTDNav vn, int op ){
	     int i, i1 = 0, stackSize;
	     double d;
       try {
           d = right.evalNumber(vn);
           vn.push2();
           stackSize = vn.contextStack2.size;
           while ((i = left.evalNodeSet(vn)) != -1) {
               i1 = getStringVal(vn,i); 
               if (i1!=-1 && compareVNumber2(i1,vn,d,op)){
                   left.reset(vn);
                   vn.contextStack2.size = stackSize;
                   vn.pop2();
                   return true;
               }
           }    
           vn.contextStack2.size = stackSize;
           vn.pop2();
           left.reset(vn);            
           return false; 
       } catch (Exception e) {
           throw new System.SystemException("Undefined behavior");
       }
	}
Exemplo n.º 10
0
 private bool compNodeSetNodeSet(Expr left, Expr right, VTDNav vn, int op)
 {
     int i, i1 = 0, stackSize, s1;
     try
     {
         if (fib1 == null)
             fib1 = new FastIntBuffer(BUF_SZ_EXP);
         vn.push2();
         stackSize = vn.contextStack2.size;
         while ((i = left.evalNodeSet(vn)) != -1)
         {
             i1 = getStringVal(vn, i);
             if (i1 != -1)
                 fib1.append(i1);
         }
         left.reset(vn);
         vn.contextStack2.size = stackSize;
         vn.pop2();
         vn.push2();
         stackSize = vn.contextStack2.size;
         while ((i = right.evalNodeSet(vn)) != -1)
         {
             i1 = getStringVal(vn, i);
             if (i1 != -1)
             {
                 s1 = fib1.size();
                 for (int k = 0; k < s1; k++)
                 {
                     bool b = compareVV(fib1.intAt(k), vn, i1, op);
                     if (b)
                     {
                         fib1.clear();
                         vn.contextStack2.size = stackSize;
                         vn.pop2();
                         right.reset(vn);
                         return true;
                     }
                 }
             }
         }
         vn.contextStack2.size = stackSize;
         vn.pop2();
         right.reset(vn);
         fib1.clear();
         return false;
     }
     catch (Exception e)
     {
         fib1.clear();
         throw new System.SystemException("Undefined behavior");
     }
 }
Exemplo n.º 11
0
        /// <summary> constructor</summary>
        /// <param name="l">
        /// </param>
        /// <param name="o">
        /// </param>
        /// <param name="r">
        /// </param>
        public BinaryExpr(Expr l, int o, Expr r)
        {
            op = o;
            left = l;
            right = r;
            fib1 = null;
            switch (op)
            {

                case ADD:
                case SUB:
                case MULT:
                case DIV:
                case MOD: isNumerical_Renamed_Field = true; isBoolean_Renamed_Field = false; break;

                case OR:
                case AND:
                case EQ:
                case NE:
                case LE:
                case GE:
                case LT:
                case GT: isNumerical_Renamed_Field = false; isBoolean_Renamed_Field = true;
                    goto default;

                default:
                    break;

            }
        }
Exemplo n.º 12
0
		//public int getPositon(){
		//	return fib.size();
		//}
		
		public PathExpr(Expr f, LocationPathExpr l)
		{
			fe = f;
			lpe = l;
			//first_time = true;
			evalState = 0;
			//fib = new FastIntBuffer(8);
			ih = new intHash();
		}