예제 #1
0
파일: Copier.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Visits the specified less than.
 /// </summary>
 /// <param name="lessThan">The less than.</param>
 /// <returns></returns>
 protected virtual IExpression DeepCopy(LessThan lessThan)
 {
     return this.DeepCopy((BinaryOperation)lessThan);
 }
예제 #2
0
파일: Copier.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Visits the specified less than.
 /// </summary>
 /// <param name="lessThan">The less than.</param>
 public override void Visit(ILessThan lessThan)
 {
     LessThan mutableLessThan = new LessThan(lessThan);
     this.resultExpression = this.myCodeCopier.DeepCopy(mutableLessThan);
 }
예제 #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;
    }
예제 #4
0
파일: Mutator.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Visits the specified less than.
 /// </summary>
 /// <param name="lessThan">The less than.</param>
 /// <returns></returns>
 public virtual IExpression Visit(LessThan lessThan)
 {
     return this.Visit((BinaryOperation)lessThan);
 }
예제 #5
0
파일: Mutator.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Rewrites the children of the given less-than expression.
 /// </summary>
 public virtual void RewriteChildren(LessThan lessThan)
 {
     this.RewriteChildren((BinaryOperation)lessThan);
 }
예제 #6
0
파일: Mutator.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Visits the specified less than.
 /// </summary>
 /// <param name="lessThan">The less than.</param>
 public override void Visit(ILessThan lessThan)
 {
     LessThan mutableLessThan = lessThan as LessThan;
     if (alwaysMakeACopy || mutableLessThan == null) mutableLessThan = new LessThan(lessThan);
     this.resultExpression = this.myCodeMutator.Visit(mutableLessThan);
 }