public override void Visit(ISubtraction subtraction) { if (Process(subtraction)) { visitor.Visit(subtraction); } base.Visit(subtraction); }
private HLLocation ProcessSubtractionExpression(ISubtraction pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitSubtract(locationTemporary, locationLeftOperand, locationRightOperand); return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary); }
public void Visit(ISubtraction subtraction) { this.traverser.Traverse(subtraction); }
/// <summary> /// Traverses the subtraction expression. /// </summary> public void Traverse(ISubtraction subtraction) { Contract.Requires(subtraction != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(subtraction); if (this.StopTraversal) return; this.TraverseChildren(subtraction); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(subtraction); }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public virtual void Visit(ISubtraction subtraction) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(subtraction); this.Visit(subtraction.LeftOperand); this.Visit(subtraction.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 override void Visit(ISubtraction operation) { ProcessOperation(operation); }
public virtual void onASTElement(ISubtraction subtraction) { }
/// <summary> /// Visits the specified subtraction. /// </summary> /// <param name="subtraction">The subtraction.</param> public override void Visit(ISubtraction subtraction) { Subtraction mutableSubtraction = subtraction as Subtraction; if (alwaysMakeACopy || mutableSubtraction == null) mutableSubtraction = new Subtraction(subtraction); this.resultExpression = this.myCodeMutator.Visit(mutableSubtraction); }
public override void Visit(ISubtraction binary) { _formattedValue = Format(binary.LeftOperand) + " - " + Format(binary.RightOperand); }
public override void TraverseChildren(ISubtraction subtraction) { base.TraverseChildren(subtraction); ((Subtraction)subtraction).Type = this.GetBinaryNumericOperationType(subtraction, subtraction.TreatOperandsAsUnsignedIntegers); }
/// <summary> /// Generates IL for the specified subtraction. /// </summary> /// <param name="subtraction">The subtraction.</param> public override void TraverseChildren(ISubtraction subtraction) { this.Traverse(subtraction.LeftOperand); this.Traverse(subtraction.RightOperand); OperationCode operationCode = OperationCode.Sub; if (subtraction.CheckOverflow) { if (subtraction.TreatOperandsAsUnsignedIntegers) operationCode = OperationCode.Sub_Ovf_Un; else operationCode = OperationCode.Sub_Ovf; } this.generator.Emit(operationCode); this.StackSize--; }
public override void Visit(ISubtraction subtraction) { if(Process(subtraction)){visitor.Visit(subtraction);} base.Visit(subtraction); }
private HLLocation ProcessSubtractionExpression(ISubtraction pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitSubtract(locationTemporary, locationLeftOperand, locationRightOperand); return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary; }
public void Visit(ISubtraction subtraction) { this.result = this.rewriter.Rewrite(subtraction); }
/// <summary> /// Rewrites the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public virtual IExpression Rewrite(ISubtraction subtraction) { var mutableSubtraction = subtraction as Subtraction; if (mutableSubtraction == null) return subtraction; this.RewriteChildren(mutableSubtraction); return mutableSubtraction; }
public void Visit(ISubtraction subtraction) { Contract.Requires(subtraction != null); throw new NotImplementedException(); }
public override void Visit(ISubtraction subtraction) { base.Visit(subtraction); Bpl.Expr rexp = TranslatedExpressions.Pop(); Bpl.Expr lexp = TranslatedExpressions.Pop(); TranslatedExpressions.Push(Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Sub, lexp, rexp)); }
/// <summary> /// /// </summary> /// <param name="subtraction"></param> public Subtraction(ISubtraction subtraction) : base(subtraction) { this.CheckOverflow = subtraction.CheckOverflow; this.TreatOperandsAsUnsignedIntegers = subtraction.TreatOperandsAsUnsignedIntegers; }
public override void Visit(ISubtraction subtraction) { allElements.Add(new InvokInfo(Traverser, "ISubtraction", subtraction)); }
public override void TraverseChildren(ISubtraction subtraction) { var targetExpression = subtraction.LeftOperand as ITargetExpression; if (targetExpression != null) { // x -= e bool statement = this.currentExpressionIsOpAssignStatement; this.currentExpressionIsOpAssignStatement = false; this.VisitAssignment(targetExpression, subtraction, (IExpression e) => this.TraverseSubtractionRightOperandAndDoOperation(e), treatAsStatement: statement, pushTargetRValue: true, resultIsInitialTargetRValue: subtraction.ResultIsUnmodifiedLeftOperand); } else { // x - e this.Traverse(subtraction.LeftOperand); this.TraverseSubtractionRightOperandAndDoOperation(subtraction); } }
/// <summary> /// Rewrites the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public virtual IExpression Rewrite(ISubtraction subtraction) { return subtraction; }
public override IExpression Rewrite(ISubtraction operation) { return(ReplaceOperation(operation)); }
public override void TraverseChildren(ISubtraction subtraction) { MethodEnter(subtraction); base.TraverseChildren(subtraction); MethodExit(); }
/// <summary> /// Returns a shallow copy of the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public Subtraction Copy(ISubtraction subtraction) { Contract.Requires(subtraction != null); Contract.Ensures(Contract.Result<Subtraction>() != null); return new Subtraction(subtraction); }
/// <summary> /// Performs some computation with the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public virtual void Visit(ISubtraction subtraction) { }
/// <summary> /// Returns a deep copy of the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public Subtraction Copy(ISubtraction subtraction) { Contract.Requires(subtraction != null); Contract.Ensures(Contract.Result<Subtraction>() != null); var mutableCopy = this.shallowCopier.Copy(subtraction); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
/// <summary> /// Traverses the children of the subtraction expression. /// </summary> public virtual void TraverseChildren(ISubtraction subtraction) { Contract.Requires(subtraction != null); this.TraverseChildren((IBinaryOperation)subtraction); }
/// <summary> /// Performs some computation with the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public virtual void Visit(ISubtraction subtraction) { this.Visit((IBinaryOperation)subtraction); }
/// <summary> /// Visits the specified subtraction. /// </summary> /// <param name="subtraction">The subtraction.</param> public override void Visit(ISubtraction subtraction) { Subtraction mutableSubtraction = new Subtraction(subtraction); this.resultExpression = this.myCodeCopier.DeepCopy(mutableSubtraction); }
public void Visit(ISubtraction subtraction) { throw new NotImplementedException(); }
/// <summary> /// Returns a deep copy of the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public Subtraction Copy(ISubtraction subtraction) { var mutableCopy = this.shallowCopier.Copy(subtraction); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
/// <summary> /// /// </summary> /// <param name="subtraction"></param> public Subtraction(ISubtraction subtraction) : base(subtraction) { this.CheckOverflow = subtraction.CheckOverflow; }
/// <summary> /// Returns a shallow copy of the given subtraction expression. /// </summary> /// <param name="subtraction"></param> public Subtraction Copy(ISubtraction subtraction) { return new Subtraction(subtraction); }
public override void TraverseChildren(ISubtraction subtraction) { if (subtraction.LeftOperand is ITargetExpression && ExpressionHelper.IsIntegralOne(subtraction.RightOperand)) { if (subtraction.ResultIsUnmodifiedLeftOperand) { this.Traverse(subtraction.LeftOperand); this.sourceEmitterOutput.Write("--"); } else { this.sourceEmitterOutput.Write("--"); this.Traverse(subtraction.LeftOperand); } return; } var needsParen = LowerPrecedenceThanParentExpression(subtraction); var savedCurrentPrecedence = this.currentPrecedence; this.currentPrecedence = this.Precedence(subtraction); if (needsParen) this.sourceEmitterOutput.Write("("); this.Traverse(subtraction.LeftOperand); if (subtraction.LeftOperand is ITargetExpression) this.sourceEmitterOutput.Write(" -= "); else this.sourceEmitterOutput.Write(" - "); this.Traverse(subtraction.RightOperand); if (needsParen) this.sourceEmitterOutput.Write(")"); this.currentPrecedence = savedCurrentPrecedence; }
public void Visit(ISubtraction subtraction) { this.result = this.copier.Copy(subtraction); }
/// <summary> /// Visits the specified subtraction. /// </summary> /// <param name="subtraction">The subtraction.</param> public override void Visit(ISubtraction subtraction) { Subtraction mutableSubtraction = subtraction as Subtraction; if (mutableSubtraction == null) { this.resultExpression = subtraction; return; } this.resultExpression = this.myCodeMutator.Visit(mutableSubtraction); }