/// <summary> /// Visits the specified while do statement. /// </summary> /// <param name="whileDoStatement">The while do statement.</param> public override void Visit(IWhileDoStatement whileDoStatement) { WhileDoStatement mutableWhileDoStatement = whileDoStatement as WhileDoStatement; if (alwaysMakeACopy || mutableWhileDoStatement == null) mutableWhileDoStatement = new WhileDoStatement(whileDoStatement); this.resultStatement = this.myCodeMutator.Visit(mutableWhileDoStatement); }
public void Visit(IWhileDoStatement whileDoStatement) { Contract.Requires(whileDoStatement != null); throw new NotImplementedException(); }
/// <summary> /// /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement(IWhileDoStatement whileDoStatement) : base(whileDoStatement) { Contract.Requires(whileDoStatement != null); this.body = whileDoStatement.Body; this.condition = whileDoStatement.Condition; }
/// <summary> /// Traverses the while do statement. /// </summary> public void Traverse(IWhileDoStatement whileDoStatement) { Contract.Requires(whileDoStatement != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(whileDoStatement); if (this.StopTraversal) return; this.TraverseChildren(whileDoStatement); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(whileDoStatement); }
public void Visit(IWhileDoStatement whileDoStatement) { this.traverser.Traverse(whileDoStatement); }
public void Visit(IWhileDoStatement whileDoStatement) { this.result = this.copier.Copy(whileDoStatement); }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public virtual void Visit(IWhileDoStatement whileDoStatement) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(whileDoStatement); this.Visit(whileDoStatement.Condition); this.Visit(whileDoStatement.Body); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not decrease this.path.Count. this.path.Pop(); }
public override void Visit(IWhileDoStatement whileDoStatement) { if(Process(whileDoStatement)){visitor.Visit(whileDoStatement);} base.Visit(whileDoStatement); }
public override void TraverseChildren(IWhileDoStatement whileDoStatement) { Result++; base.TraverseChildren(whileDoStatement); }
public override void TraverseChildren(IWhileDoStatement whileDoStatement) { throw new TranslationException("WhileDo statements are not handled"); }
/// <summary> /// Performs some computation with the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public virtual void Visit(IWhileDoStatement whileDoStatement) { }
public void Visit(IWhileDoStatement whileDoStatement) { this.result = this.rewriter.Rewrite(whileDoStatement); }
/// <summary> /// Rewrites the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public virtual IStatement Rewrite(IWhileDoStatement whileDoStatement) { var mutableWhileDoStatement = whileDoStatement as WhileDoStatement; if (mutableWhileDoStatement == null) return whileDoStatement; this.RewriteChildren(mutableWhileDoStatement); return mutableWhileDoStatement; }
/// <summary> /// Returns a deep copy of the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement Copy(IWhileDoStatement whileDoStatement) { var mutableCopy = this.shallowCopier.Copy(whileDoStatement); mutableCopy.Condition = this.Copy(mutableCopy.Condition); mutableCopy.Body = this.Copy(mutableCopy.Body); return mutableCopy; }
/// <summary> /// Generates IL for the specified while do statement. /// </summary> /// <param name="whileDoStatement">The while do statement.</param> public override void TraverseChildren(IWhileDoStatement whileDoStatement) { ILGeneratorLabel savedCurrentBreakTarget = this.currentBreakTarget; ILGeneratorLabel savedCurrentContinueTarget = this.currentContinueTarget; this.currentBreakTarget = new ILGeneratorLabel(); this.currentContinueTarget = new ILGeneratorLabel(); if (this.currentTryCatch != null) { this.mostNestedTryCatchFor.Add(this.currentBreakTarget, this.currentTryCatch); this.mostNestedTryCatchFor.Add(this.currentContinueTarget, this.currentTryCatch); } ILGeneratorLabel loopStart = new ILGeneratorLabel(); this.generator.Emit(OperationCode.Br, this.currentContinueTarget); this.generator.MarkLabel(loopStart); this.Traverse(whileDoStatement.Body); this.generator.MarkLabel(this.currentContinueTarget); this.EmitSequencePoint(whileDoStatement.Condition.Locations); this.VisitBranchIfTrue(whileDoStatement.Condition, loopStart); this.generator.MarkLabel(this.currentBreakTarget); this.currentBreakTarget = savedCurrentBreakTarget; this.currentContinueTarget = savedCurrentContinueTarget; this.lastStatementWasUnconditionalTransfer = false; }
/// <summary> /// Returns a shallow copy of the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement Copy(IWhileDoStatement whileDoStatement) { return new WhileDoStatement(whileDoStatement); }
/// <summary> /// Rewrites the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public virtual IStatement Rewrite(IWhileDoStatement whileDoStatement) { return whileDoStatement; }
public override void TraverseChildren(IWhileDoStatement whileDoStatement) { MethodEnter(whileDoStatement); base.TraverseChildren(whileDoStatement); MethodExit(); }
/// <summary> /// /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement(IWhileDoStatement whileDoStatement) : base(whileDoStatement) { this.body = whileDoStatement.Body; this.condition = whileDoStatement.Condition; }
/// <summary> /// Returns a shallow copy of the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement Copy(IWhileDoStatement whileDoStatement) { Contract.Requires(whileDoStatement != null); Contract.Ensures(Contract.Result<WhileDoStatement>() != null); return new WhileDoStatement(whileDoStatement); }
/// <summary> /// Traverses the children of the while do statement. /// </summary> public virtual void TraverseChildren(IWhileDoStatement whileDoStatement) { Contract.Requires(whileDoStatement != null); this.TraverseChildren((IStatement)whileDoStatement); if (this.StopTraversal) return; this.Traverse(whileDoStatement.Condition); if (this.StopTraversal) return; this.Traverse(whileDoStatement.Body); }
/// <summary> /// Returns a deep copy of the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public WhileDoStatement Copy(IWhileDoStatement whileDoStatement) { Contract.Requires(whileDoStatement != null); Contract.Ensures(Contract.Result<WhileDoStatement>() != null); var mutableCopy = this.shallowCopier.Copy(whileDoStatement); mutableCopy.Condition = this.Copy(mutableCopy.Condition); mutableCopy.Body = this.Copy(mutableCopy.Body); return mutableCopy; }
/// <summary> /// Performs some computation with the given while do statement. /// </summary> /// <param name="whileDoStatement"></param> public virtual void Visit(IWhileDoStatement whileDoStatement) { this.Visit((IStatement)whileDoStatement); }
public override void TraverseChildren(IWhileDoStatement whileDoStatement) { this.sourceEmitterOutput.Write("while (", true); this.Traverse(whileDoStatement.Condition); this.sourceEmitterOutput.WriteLine(")"); this.Traverse(whileDoStatement.Body); }
public void Visit(IWhileDoStatement whileDoStatement) { throw new NotImplementedException(); }
/// <summary> /// Visits the specified while do statement. /// </summary> /// <param name="whileDoStatement">The while do statement.</param> public override void Visit(IWhileDoStatement whileDoStatement) { WhileDoStatement mutableWhileDoStatement = new WhileDoStatement(whileDoStatement); this.resultStatement = this.myCodeCopier.DeepCopy(mutableWhileDoStatement); }
public virtual void onASTElement(IWhileDoStatement whileDoStatement) { }
/// <summary> /// Visits the specified while do statement. /// </summary> /// <param name="whileDoStatement">The while do statement.</param> public override void Visit(IWhileDoStatement whileDoStatement) { WhileDoStatement mutableWhileDoStatement = whileDoStatement as WhileDoStatement; if (mutableWhileDoStatement == null) { this.resultStatement = whileDoStatement; return; } this.resultStatement = this.myCodeMutator.Visit(mutableWhileDoStatement); }