public override void Visit(IGreaterThanOrEqual greaterThanOrEqual) { if (Process(greaterThanOrEqual)) { visitor.Visit(greaterThanOrEqual); } base.Visit(greaterThanOrEqual); }
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); }
public void Visit(IGreaterThanOrEqual greaterThanOrEqual) { Contract.Requires(greaterThanOrEqual != null); throw new NotImplementedException(); }
public void Visit(IGreaterThanOrEqual greaterThanOrEqual) { this.traverser.Traverse(greaterThanOrEqual); }
/// <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); }
//^ 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(); }
public virtual void onASTElement(IGreaterThanOrEqual 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); }
public override void Visit(IGreaterThanOrEqual binary) { _formattedValue = Format(binary.LeftOperand) + " >= " + Format(binary.RightOperand); }
/// <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); }
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; }
public void Visit(IGreaterThanOrEqual greaterThanOrEqual) { this.result = this.rewriter.Rewrite(greaterThanOrEqual); }
/// <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; }
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)); }
public override void Visit(IGreaterThanOrEqual operation) { ProcessOperation(operation); }
public override void TraverseChildren(IGreaterThanOrEqual greaterThanOrEqual) { base.TraverseChildren(greaterThanOrEqual); ((GreaterThanOrEqual)greaterThanOrEqual).Type = this.platformType.SystemBoolean; }
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(); }
/// <summary> /// Performs some computation with the given greater-than-or-equal expression. /// </summary> /// <param name="greaterThanOrEqual"></param> public virtual void Visit(IGreaterThanOrEqual greaterThanOrEqual) { }
/// <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; }
/// <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); }
/// <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); }
/// <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); }
public void Visit(IGreaterThanOrEqual greaterThanOrEqual) { throw new NotImplementedException(); }
/// <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); }
public override IExpression Rewrite(IGreaterThanOrEqual operation) { return(ReplaceOperation(operation)); }
/// <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; }
/// <summary> /// /// </summary> /// <param name="greaterThanOrEqual"></param> public GreaterThanOrEqual(IGreaterThanOrEqual greaterThanOrEqual) : base(greaterThanOrEqual) { this.unsignedOrUnordered = greaterThanOrEqual.IsUnsignedOrUnordered; }
/// <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; }
public void Visit(IGreaterThanOrEqual greaterThanOrEqual) { this.result = this.copier.Copy(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 (mutableGreaterThanOrEqual == null) { this.resultExpression = greaterThanOrEqual; return; } this.resultExpression = this.myCodeMutator.Visit(mutableGreaterThanOrEqual); }