Пример #1
0
 /// <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);
 }
Пример #2
0
 public void Visit(IWhileDoStatement whileDoStatement)
 {
     Contract.Requires(whileDoStatement != null);
       throw new NotImplementedException();
 }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="whileDoStatement"></param>
 public WhileDoStatement(IWhileDoStatement whileDoStatement)
   : base(whileDoStatement) {
   Contract.Requires(whileDoStatement != null);
   this.body = whileDoStatement.Body;
   this.condition = whileDoStatement.Condition;
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 public void Visit(IWhileDoStatement whileDoStatement)
 {
     this.traverser.Traverse(whileDoStatement);
 }
Пример #6
0
 public void Visit(IWhileDoStatement whileDoStatement)
 {
     this.result = this.copier.Copy(whileDoStatement);
 }
Пример #7
0
 //^ 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);
 }
Пример #10
0
 public override void TraverseChildren(IWhileDoStatement whileDoStatement)
 {
     throw new TranslationException("WhileDo statements are not handled");
 }
 public override void TraverseChildren(IWhileDoStatement whileDoStatement) {
   throw new TranslationException("WhileDo statements are not handled");
 }
Пример #12
0
 /// <summary>
 /// Performs some computation with the given while do statement.
 /// </summary>
 /// <param name="whileDoStatement"></param>
 public virtual void Visit(IWhileDoStatement whileDoStatement)
 {
 }
Пример #13
0
 public void Visit(IWhileDoStatement whileDoStatement)
 {
     this.result = this.rewriter.Rewrite(whileDoStatement);
 }
Пример #14
0
 /// <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;
 }
Пример #15
0
 /// <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;
 }
Пример #16
0
        /// <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;
        }
Пример #17
0
 /// <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;
 }
Пример #19
0
        public override void TraverseChildren(IWhileDoStatement whileDoStatement)
{ MethodEnter(whileDoStatement);
            base.TraverseChildren(whileDoStatement);
     MethodExit();   }
Пример #20
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="whileDoStatement"></param>
 public WhileDoStatement(IWhileDoStatement whileDoStatement)
     : base(whileDoStatement)
 {
     this.body = whileDoStatement.Body;
       this.condition = whileDoStatement.Condition;
 }
Пример #21
0
 /// <summary>
 /// Performs some computation with the given while do statement.
 /// </summary>
 /// <param name="whileDoStatement"></param>
 public virtual void Visit(IWhileDoStatement whileDoStatement)
 {
 }
Пример #22
0
    /// <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);
    }
Пример #23
0
 /// <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);
 }
Пример #24
0
    /// <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;
    }
Пример #25
0
 /// <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);
 }
Пример #26
0
 public override void TraverseChildren(IWhileDoStatement whileDoStatement) {
   this.sourceEmitterOutput.Write("while (", true);
   this.Traverse(whileDoStatement.Condition);
   this.sourceEmitterOutput.WriteLine(")");
   this.Traverse(whileDoStatement.Body);
 }
Пример #27
0
 public void Visit(IWhileDoStatement whileDoStatement)
 {
     throw new NotImplementedException();
 }
Пример #28
0
 /// <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);
 }
Пример #29
0
 public virtual void onASTElement(IWhileDoStatement whileDoStatement) { }
Пример #30
0
 /// <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);
 }