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 (compareVNumber2(i, 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"); } }
public override double evalNumber(VTDNav vn) { switch (op) { case ADD: return(left.evalNumber(vn) + right.evalNumber(vn)); case SUB: return(left.evalNumber(vn) - right.evalNumber(vn)); case MULT: return(left.evalNumber(vn) * right.evalNumber(vn)); case DIV: return(left.evalNumber(vn) / right.evalNumber(vn)); case MOD: return(left.evalNumber(vn) % right.evalNumber(vn)); default: if (evalBoolean(vn) == true) { return(1); } return(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 (compareVNumber2(i,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"); } }