Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
    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;
    }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 5
0
 /// <summary>
 /// Rewrites the children of the given greater-than-or-equal expression.
 /// </summary>
 public virtual void RewriteChildren(GreaterThanOrEqual greaterThanOrEqual)
 {
     this.RewriteChildren((BinaryOperation)greaterThanOrEqual);
 }
Esempio n. 6
0
 /// <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);
 }