コード例 #1
0
ファイル: Copier.cs プロジェクト: riverar/devtools
 /// <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);
 }
コード例 #2
0
ファイル: Copier.cs プロジェクト: riverar/devtools
 /// <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);
 }
コード例 #3
0
ファイル: IfThenElseReplacer.cs プロジェクト: xornand/cci
    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 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);
 }
コード例 #5
0
ファイル: Mutator.cs プロジェクト: riverar/devtools
 /// <summary>
 /// Rewrites the children of the given greater-than-or-equal expression.
 /// </summary>
 public virtual void RewriteChildren(GreaterThanOrEqual greaterThanOrEqual)
 {
     this.RewriteChildren((BinaryOperation)greaterThanOrEqual);
 }
コード例 #6
0
ファイル: Mutator.cs プロジェクト: riverar/devtools
 /// <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);
 }