public override void Visit(ILessThan addition) { if (!_found) { _found = true; MarkMutationTarget(addition); } }
public override void Visit(ILessThan lessThan) { if (Process(lessThan)) { visitor.Visit(lessThan); } base.Visit(lessThan); }
private HLLocation ProcessLessThanExpression(ILessThan pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitCompare(HLCompareType.LessThan, locationTemporary, locationLeftOperand, locationRightOperand); return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary); }
/// <summary> /// Generates IL for the specified less than. /// </summary> /// <param name="lessThan">The less than.</param> public override void TraverseChildren(ILessThan lessThan) { this.Traverse(lessThan.LeftOperand); this.Traverse(lessThan.RightOperand); if (lessThan.IsUnsignedOrUnordered) this.generator.Emit(OperationCode.Clt_Un); else this.generator.Emit(OperationCode.Clt); this.StackSize--; }
public void Visit(ILessThan lessThan) { throw new NotImplementedException(); }
/// <summary> /// Performs some computation with the given less-than expression. /// </summary> /// <param name="lessThan"></param> public virtual void Visit(ILessThan lessThan) { this.Visit((IBinaryOperation)lessThan); }
/// <summary> /// Traverses the children of the less-than expression. /// </summary> public virtual void TraverseChildren(ILessThan lessThan) { Contract.Requires(lessThan != null); this.TraverseChildren((IBinaryOperation)lessThan); }
/// <summary> /// Performs some computation with the given less-than expression. /// </summary> /// <param name="lessThan"></param> public virtual void Visit(ILessThan lessThan) { }
public override void TraverseChildren(ILessThan lessThan) { MethodEnter(lessThan); base.TraverseChildren(lessThan); MethodExit(); }
public override void TraverseChildren(ILessThan lessThan) { base.TraverseChildren(lessThan); Bpl.Expr rexp = TranslatedExpressions.Pop(); Bpl.Expr lexp = TranslatedExpressions.Pop(); Bpl.Expr e; switch (lessThan.LeftOperand.Type.TypeCode) { case PrimitiveTypeCode.Float32: case PrimitiveTypeCode.Float64: e = new Bpl.NAryExpr( lessThan.Token(), new Bpl.FunctionCall(this.sink.Heap.RealLessThan), new List<Bpl.Expr>(new Bpl.Expr[] {lexp, rexp}) ); break; default: e = Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Lt, lexp, rexp); break; } TranslatedExpressions.Push(e); }
public virtual void onASTElement(ILessThan lessThan) { }
public override void Visit(ILessThan operation) { ProcessOperation(operation); }
public override void Visit(ILessThan lessThan) { if(Process(lessThan)){visitor.Visit(lessThan);} base.Visit(lessThan); }
private HLLocation ProcessLessThanExpression(ILessThan pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitCompare(HLCompareType.LessThan, locationTemporary, locationLeftOperand, locationRightOperand); return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary; }
public void Visit(ILessThan lessThan) { this.result = this.rewriter.Rewrite(lessThan); }
/// <summary> /// Rewrites the given less-than expression. /// </summary> /// <param name="lessThan"></param> public virtual IExpression Rewrite(ILessThan lessThan) { var mutableLessThan = lessThan as LessThan; if (mutableLessThan == null) return lessThan; this.RewriteChildren(mutableLessThan); return mutableLessThan; }
public override void Visit(ILessThan binary) { _formattedValue = Format(binary.LeftOperand) + " < " + Format(binary.RightOperand); }
public override void TraverseChildren(ILessThan lessThan) { base.TraverseChildren(lessThan); ((LessThan)lessThan).Type = this.platformType.SystemBoolean; }
/// <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); }
public override void Visit(ILessThan lessThan) { allElements.Add(new InvokInfo(Traverser, "ILessThan", lessThan)); }
/// <summary> /// Rewrites the given less-than expression. /// </summary> /// <param name="lessThan"></param> public virtual IExpression Rewrite(ILessThan lessThan) { return lessThan; }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given less-than expression. /// </summary> /// <param name="lessThan"></param> public virtual void Visit(ILessThan lessThan) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(lessThan); this.Visit(lessThan.LeftOperand); this.Visit(lessThan.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(); }
/// <summary> /// Traverses the less-than expression. /// </summary> public void Traverse(ILessThan lessThan) { Contract.Requires(lessThan != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(lessThan); if (this.StopTraversal) return; this.TraverseChildren(lessThan); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(lessThan); }
/// <summary> /// Returns a deep copy of the given less-than expression. /// </summary> /// <param name="lessThan"></param> public LessThan Copy(ILessThan lessThan) { Contract.Requires(lessThan != null); Contract.Ensures(Contract.Result<LessThan>() != null); var mutableCopy = this.shallowCopier.Copy(lessThan); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
public void Visit(ILessThan lessThan) { this.traverser.Traverse(lessThan); }
/// <summary> /// Returns a shallow copy of the given less-than expression. /// </summary> /// <param name="lessThan"></param> public LessThan Copy(ILessThan lessThan) { Contract.Requires(lessThan != null); Contract.Ensures(Contract.Result<LessThan>() != null); return new LessThan(lessThan); }
public void Visit(ILessThan lessThan) { Contract.Requires(lessThan != null); throw new NotImplementedException(); }
public override void Visit(ILessThan lessThan) { base.Visit(lessThan); Bpl.Expr rexp = TranslatedExpressions.Pop(); Bpl.Expr lexp = TranslatedExpressions.Pop(); TranslatedExpressions.Push(Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Lt, lexp, rexp)); }
/// <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); }
public override IExpression Rewrite(ILessThan operation) { return(ReplaceOperation(operation)); }
/// <summary> /// Returns a deep copy of the given less-than expression. /// </summary> /// <param name="lessThan"></param> public LessThan Copy(ILessThan lessThan) { var mutableCopy = this.shallowCopier.Copy(lessThan); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
/// <summary> /// /// </summary> /// <param name="lessThan"></param> public LessThan(ILessThan lessThan) : base(lessThan) { this.unsignedOrUnordered = lessThan.IsUnsignedOrUnordered; }
/// <summary> /// Returns a shallow copy of the given less-than expression. /// </summary> /// <param name="lessThan"></param> public LessThan Copy(ILessThan lessThan) { return new LessThan(lessThan); }
public override void TraverseChildren(ILessThan lessThan) { if (lessThan.IsUnsignedOrUnordered && !TypeHelper.IsPrimitiveInteger(lessThan.LeftOperand.Type)) { this.sourceEmitterOutput.Write("!("); this.Traverse(lessThan.LeftOperand); this.sourceEmitterOutput.Write(" >= "); this.Traverse(lessThan.RightOperand); this.sourceEmitterOutput.Write(")"); return; } var needsParen = LowerPrecedenceThanParentExpression(lessThan); var savedCurrentPrecedence = this.currentPrecedence; this.currentPrecedence = this.Precedence(lessThan); if (needsParen) this.sourceEmitterOutput.Write("("); if (lessThan.IsUnsignedOrUnordered && TypeHelper.IsPrimitiveInteger(lessThan.LeftOperand.Type) && lessThan.LeftOperand.Type != TypeHelper.UnsignedEquivalent(lessThan.LeftOperand.Type)) { if (needsParen) this.sourceEmitterOutput.Write("("); this.PrintTypeReferenceName(TypeHelper.UnsignedEquivalent(lessThan.LeftOperand.Type)); if (needsParen) this.sourceEmitterOutput.Write(")"); } this.Traverse(lessThan.LeftOperand); this.sourceEmitterOutput.Write(" < "); if (lessThan.IsUnsignedOrUnordered && TypeHelper.IsPrimitiveInteger(lessThan.RightOperand.Type) && lessThan.RightOperand.Type != TypeHelper.UnsignedEquivalent(lessThan.RightOperand.Type)) { if (needsParen) this.sourceEmitterOutput.Write("("); this.PrintTypeReferenceName(TypeHelper.UnsignedEquivalent(lessThan.RightOperand.Type)); if (needsParen) this.sourceEmitterOutput.Write(")"); } this.Traverse(lessThan.RightOperand); if (needsParen) this.sourceEmitterOutput.Write(")"); this.currentPrecedence = savedCurrentPrecedence; }
public void Visit(ILessThan lessThan) { this.result = this.copier.Copy(lessThan); }
/// <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 (mutableLessThan == null) { this.resultExpression = lessThan; return; } this.resultExpression = this.myCodeMutator.Visit(mutableLessThan); }