/// <summary> /// Visits the specified greater than or equal. /// </summary> /// <param name="greaterThanOrEqual">The greater than or equal.</param> /// <returns></returns> protected virtual IExpression DeepCopy(GreaterThanOrEqual greaterThanOrEqual) { return this.DeepCopy((BinaryOperation)greaterThanOrEqual); }
/// <summary> /// Visits the specified greater than or equal. /// </summary> /// <param name="greaterThanOrEqual">The greater than or equal.</param> public override void Visit(IGreaterThanOrEqual greaterThanOrEqual) { GreaterThanOrEqual mutableGreaterThanOrEqual = new GreaterThanOrEqual(greaterThanOrEqual); this.resultExpression = this.myCodeCopier.DeepCopy(mutableGreaterThanOrEqual); }
private static IExpression InvertBinaryOperation(IBinaryOperation binOp) { Contract.Requires(binOp != null); Contract.Ensures(Contract.Result<IExpression>() != null); BinaryOperation/*?*/ result = null; if (binOp is IEquality && binOp.LeftOperand.Type.TypeCode != PrimitiveTypeCode.Float32 && binOp.LeftOperand.Type.TypeCode != PrimitiveTypeCode.Float64) result = new NotEquality(); else if (binOp is INotEquality && binOp.LeftOperand.Type.TypeCode != PrimitiveTypeCode.Float32 && binOp.LeftOperand.Type.TypeCode != PrimitiveTypeCode.Float64) result = new Equality(); else if (binOp is ILessThan) result = new GreaterThanOrEqual() { IsUnsignedOrUnordered = KeepUnsignedButInvertUnordered(((ILessThan)binOp).IsUnsignedOrUnordered, binOp) }; else if (binOp is ILessThanOrEqual) result = new GreaterThan() { IsUnsignedOrUnordered = KeepUnsignedButInvertUnordered(((ILessThanOrEqual)binOp).IsUnsignedOrUnordered, binOp) }; else if (binOp is IGreaterThan) result = new LessThanOrEqual() { IsUnsignedOrUnordered = KeepUnsignedButInvertUnordered(((IGreaterThan)binOp).IsUnsignedOrUnordered, binOp) }; else if (binOp is IGreaterThanOrEqual) result = new LessThan() { IsUnsignedOrUnordered = KeepUnsignedButInvertUnordered(((IGreaterThanOrEqual)binOp).IsUnsignedOrUnordered, binOp) }; if (result != null) { result.LeftOperand = binOp.LeftOperand; result.RightOperand = binOp.RightOperand; result.Type = binOp.Type; result.Locations.AddRange(binOp.Locations); return result; } LogicalNot logicalNot = new LogicalNot(); logicalNot.Operand = binOp; logicalNot.Type = binOp.Type; logicalNot.Locations.AddRange(binOp.Locations); return logicalNot; }
/// <summary> /// Visits the specified greater than or equal. /// </summary> /// <param name="greaterThanOrEqual">The greater than or equal.</param> /// <returns></returns> public virtual IExpression Visit(GreaterThanOrEqual greaterThanOrEqual) { return this.Visit((BinaryOperation)greaterThanOrEqual); }
/// <summary> /// Rewrites the children of the given greater-than-or-equal expression. /// </summary> public virtual void RewriteChildren(GreaterThanOrEqual greaterThanOrEqual) { this.RewriteChildren((BinaryOperation)greaterThanOrEqual); }
/// <summary> /// Visits the specified greater than or equal. /// </summary> /// <param name="greaterThanOrEqual">The greater than or equal.</param> public override void Visit(IGreaterThanOrEqual greaterThanOrEqual) { GreaterThanOrEqual mutableGreaterThanOrEqual = greaterThanOrEqual as GreaterThanOrEqual; if (alwaysMakeACopy || mutableGreaterThanOrEqual == null) mutableGreaterThanOrEqual = new GreaterThanOrEqual(greaterThanOrEqual); this.resultExpression = this.myCodeMutator.Visit(mutableGreaterThanOrEqual); }