/// <summary> /// Negates an expression. /// If possible, replaces the operator of exp if exp is a negatable OperatorExpression, /// else return a new OperatorExpression of type Not that wraps exp. /// </summary> public static VisitedExpression Negate(VisitedExpression exp, bool useNewPrecedences) { OperatorExpression expOp = exp as OperatorExpression; if (expOp != null) { Operator op = expOp.op; Operator newOp = null; if (Operator.NegateDict.TryGetValue(op, out newOp)) { expOp.op = newOp; return(expOp); } if (expOp.op == Operator.Not) { return(expOp.right); } } return(OperatorExpression.Build(Operator.Not, useNewPrecedences, exp)); }
internal void And(VisitedExpression andAlso) { // useNewPrecedence doesn't matter here since there was no change with the AND operator _where = OperatorExpression.Build(Operator.And, true, _where, andAlso); }
internal void And(VisitedExpression andAlso) { _where = OperatorExpression.Build(Operator.And, _where, andAlso); }