public override void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     if (Process(greaterThanOrEqual))
     {
         visitor.Visit(greaterThanOrEqual);
     }
     base.Visit(greaterThanOrEqual);
 }
示例#2
0
        private HLLocation ProcessGreaterThanOrEqualExpression(IGreaterThanOrEqual pExpression)
        {
            HLLocation locationLeftOperand  = ProcessExpression(pExpression.LeftOperand);
            HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand);
            HLLocation locationTemporary    = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type)));

            mCurrentBlock.EmitCompare(HLCompareType.GreaterThanOrEqual, locationTemporary, locationLeftOperand, locationRightOperand);
            return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary);
        }
示例#3
0
 public void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     Contract.Requires(greaterThanOrEqual != null);
       throw new NotImplementedException();
 }
示例#4
0
 public void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     this.traverser.Traverse(greaterThanOrEqual);
 }
示例#5
0
 /// <summary>
 /// Traverses the greater-than-or-equal expression.
 /// </summary>
 public void Traverse(IGreaterThanOrEqual greaterThanOrEqual)
 {
     Contract.Requires(greaterThanOrEqual != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(greaterThanOrEqual);
       if (this.StopTraversal) return;
       this.TraverseChildren(greaterThanOrEqual);
       if (this.StopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(greaterThanOrEqual);
 }
示例#6
0
 //^ ensures this.path.Count == old(this.path.Count);
 /// <summary>
 /// Traverses the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     if (this.stopTraversal) return;
       //^ int oldCount = this.path.Count;
       this.path.Push(greaterThanOrEqual);
       this.Visit(greaterThanOrEqual.LeftOperand);
       this.Visit(greaterThanOrEqual.RightOperand);
       //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count.
       this.path.Pop();
 }
示例#7
0
 public virtual void onASTElement(IGreaterThanOrEqual greaterThanOrEqual)
 {
 }
示例#8
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);
 }
示例#9
0
 public override void Visit(IGreaterThanOrEqual binary)
 {
     _formattedValue = Format(binary.LeftOperand) + " >= " + Format(binary.RightOperand);
 }
示例#10
0
 /// <summary>
 /// Generates IL for the specified greater than or equal.
 /// </summary>
 /// <param name="greaterThanOrEqual">The greater than or equal.</param>
 public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual)
 {
     this.Traverse(greaterThanOrEqual.LeftOperand);
       this.Traverse(greaterThanOrEqual.RightOperand);
       if (greaterThanOrEqual.IsUnsignedOrUnordered && !TypeHelper.IsPrimitiveInteger(greaterThanOrEqual.LeftOperand.Type))
     this.generator.Emit(OperationCode.Clt_Un);
       else
     this.generator.Emit(OperationCode.Clt);
       this.generator.Emit(OperationCode.Ldc_I4_0);
       this.generator.Emit(OperationCode.Ceq);
       this.StackSize--;
 }
 public override void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     if(Process(greaterThanOrEqual)){visitor.Visit(greaterThanOrEqual);}
     base.Visit(greaterThanOrEqual);
 }
示例#12
0
 private HLLocation ProcessGreaterThanOrEqualExpression(IGreaterThanOrEqual pExpression)
 {
     HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand);
     HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand);
     HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type)));
     mCurrentBlock.EmitCompare(HLCompareType.GreaterThanOrEqual, locationTemporary, locationLeftOperand, locationRightOperand);
     return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary;
 }
示例#13
0
 public void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     this.result = this.rewriter.Rewrite(greaterThanOrEqual);
 }
示例#14
0
 /// <summary>
 /// Rewrites the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual IExpression Rewrite(IGreaterThanOrEqual greaterThanOrEqual)
 {
     var mutableGreaterThanOrEqual = greaterThanOrEqual as GreaterThanOrEqual;
       if (mutableGreaterThanOrEqual == null) return greaterThanOrEqual;
       this.RewriteChildren(mutableGreaterThanOrEqual);
       return mutableGreaterThanOrEqual;
 }
示例#15
0
 public override void Visit(IGreaterThanOrEqual greaterEqual) {
   base.Visit(greaterEqual);
   Bpl.Expr rexp = TranslatedExpressions.Pop();
   Bpl.Expr lexp = TranslatedExpressions.Pop();
   TranslatedExpressions.Push(Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Ge, lexp, rexp));
 }
示例#16
0
 public override void Visit(IGreaterThanOrEqual operation)
 {
     ProcessOperation(operation);
 }
示例#17
0
 public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual)
 {
     base.TraverseChildren(greaterThanOrEqual);
     ((GreaterThanOrEqual)greaterThanOrEqual).Type = this.platformType.SystemBoolean;
 }
 public virtual void onASTElement(IGreaterThanOrEqual greaterThanOrEqual) { }
示例#19
0
 public override void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     allElements.Add(new InvokInfo(Traverser, "IGreaterThanOrEqual", greaterThanOrEqual));
 }
    public override void TraverseChildren(IGreaterThanOrEqual greaterEqual)
    {
      base.TraverseChildren(greaterEqual);
      Bpl.Expr rexp = TranslatedExpressions.Pop();
      Bpl.Expr lexp = TranslatedExpressions.Pop();

      Bpl.Expr e;
      switch (greaterEqual.LeftOperand.Type.TypeCode) {
        case PrimitiveTypeCode.Float32:
        case PrimitiveTypeCode.Float64:
          e = new Bpl.NAryExpr(
            greaterEqual.Token(),
            new Bpl.FunctionCall(this.sink.Heap.RealGreaterThanOrEqual),
            new List<Bpl.Expr>(new Bpl.Expr[] {lexp, rexp})
            );
          break;
        default:
          e = Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Ge, lexp, rexp);
          break;
      } 
      
      TranslatedExpressions.Push(e);
    }
 /// <summary>
 /// Rewrites the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual IExpression Rewrite(IGreaterThanOrEqual greaterThanOrEqual)
 {
     return greaterThanOrEqual;
 }
        public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual)
{ MethodEnter(greaterThanOrEqual);
            base.TraverseChildren(greaterThanOrEqual);
     MethodExit();   }
示例#23
0
 public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual) {
   base.TraverseChildren(greaterThanOrEqual);
   ((GreaterThanOrEqual)greaterThanOrEqual).Type = this.platformType.SystemBoolean;
 }
示例#24
0
 /// <summary>
 /// Performs some computation with the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
 }
示例#25
0
    /// <summary>
    /// Returns a deep copy of the given greater-than-or-equal expression.
    /// </summary>
    /// <param name="greaterThanOrEqual"></param>
    public GreaterThanOrEqual Copy(IGreaterThanOrEqual greaterThanOrEqual) {
      Contract.Requires(greaterThanOrEqual != null);
      Contract.Ensures(Contract.Result<GreaterThanOrEqual>() != null);

      var mutableCopy = this.shallowCopier.Copy(greaterThanOrEqual);
      this.CopyChildren((BinaryOperation)mutableCopy);
      return mutableCopy;
    }
示例#26
0
 /// <summary>
 /// Traverses the children of the greater-than-or-equal expression.
 /// </summary>
 public virtual void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual)
 {
     Contract.Requires(greaterThanOrEqual != null);
       this.TraverseChildren((IBinaryOperation)greaterThanOrEqual);
 }
示例#27
0
    /// <summary>
    /// Returns a shallow copy of the given greater-than-or-equal expression.
    /// </summary>
    /// <param name="greaterThanOrEqual"></param>
    public GreaterThanOrEqual Copy(IGreaterThanOrEqual greaterThanOrEqual) {
      Contract.Requires(greaterThanOrEqual != null);
      Contract.Ensures(Contract.Result<GreaterThanOrEqual>() != null);

      return new GreaterThanOrEqual(greaterThanOrEqual);
    }
示例#28
0
 /// <summary>
 /// Performs some computation with the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     this.Visit((IBinaryOperation)greaterThanOrEqual);
 }
 /// <summary>
 /// Performs some computation with the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public virtual void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
 }
示例#30
0
 public void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     throw new NotImplementedException();
 }
示例#31
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);
 }
示例#32
0
 public override IExpression Rewrite(IGreaterThanOrEqual operation)
 {
     return(ReplaceOperation(operation));
 }
示例#33
0
 /// <summary>
 /// Returns a deep copy of the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public GreaterThanOrEqual Copy(IGreaterThanOrEqual greaterThanOrEqual)
 {
     var mutableCopy = this.shallowCopier.Copy(greaterThanOrEqual);
       this.CopyChildren((BinaryOperation)mutableCopy);
       return mutableCopy;
 }
示例#34
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public GreaterThanOrEqual(IGreaterThanOrEqual greaterThanOrEqual)
     : base(greaterThanOrEqual)
 {
     this.unsignedOrUnordered = greaterThanOrEqual.IsUnsignedOrUnordered;
 }
示例#35
0
 /// <summary>
 /// Returns a shallow copy of the given greater-than-or-equal expression.
 /// </summary>
 /// <param name="greaterThanOrEqual"></param>
 public GreaterThanOrEqual Copy(IGreaterThanOrEqual greaterThanOrEqual)
 {
     return new GreaterThanOrEqual(greaterThanOrEqual);
 }
    public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual) {

      if (greaterThanOrEqual.IsUnsignedOrUnordered && !TypeHelper.IsPrimitiveInteger(greaterThanOrEqual.LeftOperand.Type)) {
        this.sourceEmitterOutput.Write("!(");
        this.Traverse(greaterThanOrEqual.LeftOperand);
        this.sourceEmitterOutput.Write(" < ");
        this.Traverse(greaterThanOrEqual.RightOperand);
        this.sourceEmitterOutput.Write(")");
        return;
      }

      var needsParen = LowerPrecedenceThanParentExpression(greaterThanOrEqual);
      var savedCurrentPrecedence = this.currentPrecedence;
      this.currentPrecedence = this.Precedence(greaterThanOrEqual);

      if (needsParen) this.sourceEmitterOutput.Write("(");
      if (greaterThanOrEqual.IsUnsignedOrUnordered && TypeHelper.IsPrimitiveInteger(greaterThanOrEqual.LeftOperand.Type) && 
        greaterThanOrEqual.LeftOperand.Type != TypeHelper.UnsignedEquivalent(greaterThanOrEqual.LeftOperand.Type)) {
        if (needsParen) this.sourceEmitterOutput.Write("(");
        this.PrintTypeReferenceName(TypeHelper.UnsignedEquivalent(greaterThanOrEqual.LeftOperand.Type));
        if (needsParen) this.sourceEmitterOutput.Write(")");
      }
      this.Traverse(greaterThanOrEqual.LeftOperand);
      this.sourceEmitterOutput.Write(" >= ");
      if (greaterThanOrEqual.IsUnsignedOrUnordered && TypeHelper.IsPrimitiveInteger(greaterThanOrEqual.RightOperand.Type) && 
        greaterThanOrEqual.RightOperand.Type != TypeHelper.UnsignedEquivalent(greaterThanOrEqual.RightOperand.Type)) {
        if (needsParen) this.sourceEmitterOutput.Write("(");
        this.PrintTypeReferenceName(TypeHelper.UnsignedEquivalent(greaterThanOrEqual.RightOperand.Type));
        if (needsParen) this.sourceEmitterOutput.Write(")");
      }
      this.Traverse(greaterThanOrEqual.RightOperand);
      if (needsParen) this.sourceEmitterOutput.Write(")");

      this.currentPrecedence = savedCurrentPrecedence;
    }
示例#37
0
 public void Visit(IGreaterThanOrEqual greaterThanOrEqual)
 {
     this.result = this.copier.Copy(greaterThanOrEqual);
 }
示例#38
0
 public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual)
 {
     MethodEnter(greaterThanOrEqual);
     base.TraverseChildren(greaterThanOrEqual);
     MethodExit();
 }
示例#39
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 (mutableGreaterThanOrEqual == null) {
       this.resultExpression = greaterThanOrEqual;
       return;
     }
     this.resultExpression = this.myCodeMutator.Visit(mutableGreaterThanOrEqual);
 }