Esempio n. 1
0
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
 {
     this.PrintToken(VBToken.Indent);
     this.PrintToken(VBToken.YieldBreak);
     this.PrintToken(VBToken.Semicolon);
     this.PrintToken(VBToken.NewLine);
 }
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     if (Process(yieldBreakStatement))
     {
         visitor.Visit(yieldBreakStatement);
     }
     base.Visit(yieldBreakStatement);
 }
 public override bool Visit(IYieldBreakStatement statement, IStatement context)
 {
     _stack.Push(statement);
     try
     {
         return(base.Visit(statement, context));
     }
     finally
     {
         _stack.Pop();
     }
 }
        public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
{ MethodEnter(yieldBreakStatement);
            base.TraverseChildren(yieldBreakStatement);
     MethodExit();   }
Esempio n. 5
0
 public abstract void TranslateStatement(IYieldBreakStatement breakStatement);
Esempio n. 6
0
 /// <summary>
 /// Returns a shallow copy of the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public YieldBreakStatement Copy(IYieldBreakStatement yieldBreakStatement)
 {
     return new YieldBreakStatement(yieldBreakStatement);
 }
Esempio n. 7
0
 /// <summary>
 /// Visits the specified yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement">The yield break statement.</param>
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     YieldBreakStatement mutableYieldBreakStatement = yieldBreakStatement as YieldBreakStatement;
     if (alwaysMakeACopy || mutableYieldBreakStatement == null) mutableYieldBreakStatement = new YieldBreakStatement(yieldBreakStatement);
     this.resultStatement = this.myCodeMutator.Visit(mutableYieldBreakStatement);
 }
Esempio n. 8
0
 /// <summary>
 /// Performs some computation with the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public virtual void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     this.Visit((IStatement)yieldBreakStatement);
 }
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement) {
   this.foundYield = true;
   base.TraverseChildren(yieldBreakStatement);
 }
Esempio n. 10
0
 /// <summary>
 /// Replace a yield break with:
 /// {
 ///   this.state = -2;
 ///   return;
 /// }
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 /// <returns></returns>
 public override IStatement Rewrite(IYieldBreakStatement yieldBreakStatement) {
   BlockStatement blockStatement = new BlockStatement();
   ExpressionStatement thisDotStateEqMinus2 = new ExpressionStatement() {
     Expression = new Assignment() {
       Source = new CompileTimeConstant() { Value = -2, Type = this.host.PlatformType.SystemInt32 },
       Target = new TargetExpression() { Definition = iteratorClosure.StateFieldReference, Type = this.host.PlatformType.SystemInt32, Instance = new ThisReference() },
       Type = this.host.PlatformType.SystemInt32,
     }
   };
   blockStatement.Statements.Add(thisDotStateEqMinus2);
   ReturnStatement returnFalse = new ReturnStatement() {
     Expression = new CompileTimeConstant() {
       Value = false,
       Type = this.host.PlatformType.SystemBoolean
     }
   };
   blockStatement.Statements.Add(returnFalse);
   return blockStatement;
 }
Esempio n. 11
0
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement) {
   this.foundYield = true;
   if (this.foundAnonymousDelegate)
     this.StopTraversal = true;
   else
     base.TraverseChildren(yieldBreakStatement);
 }
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     if(Process(yieldBreakStatement)){visitor.Visit(yieldBreakStatement);}
     base.Visit(yieldBreakStatement);
 }
Esempio n. 13
0
 public TransformationKind Visit(IYieldBreakStatement statement, ITransformationContext context)
 {
     throw new NotImplementedException();
 }
Esempio n. 14
0
 public void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     this.result = this.rewriter.Rewrite(yieldBreakStatement);
 }
Esempio n. 15
0
 /// <summary>
 /// Rewrites the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public virtual IStatement Rewrite(IYieldBreakStatement yieldBreakStatement)
 {
     var mutableYieldBreakStatement = yieldBreakStatement as YieldBreakStatement;
       if (mutableYieldBreakStatement == null) return yieldBreakStatement;
       this.RewriteChildren(mutableYieldBreakStatement);
       return mutableYieldBreakStatement;
 }
Esempio n. 16
0
 /// <summary>
 /// Performs some computation with the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public virtual void Visit(IYieldBreakStatement yieldBreakStatement)
 {
 }
Esempio n. 17
0
 /// <summary>
 /// Traverses the children of the yield break statement.
 /// </summary>
 public virtual void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
 {
     Contract.Requires(yieldBreakStatement != null);
       this.TraverseChildren((IStatement)yieldBreakStatement);
 }
Esempio n. 18
0
 public abstract void Translate(IYieldBreakStatement statement);
Esempio n. 19
0
 public void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     throw new NotImplementedException();
 }
Esempio n. 20
0
 /// <summary>
 /// Generates IL for the specified yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement">The yield break statement.</param>
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
 {
     Contract.Assume(false, "IYieldBreakStatement nodes must be replaced before trying to convert the Code Model to IL.");
 }
Esempio n. 21
0
 public virtual void onASTElement(IYieldBreakStatement yieldBreakStatement) { }
Esempio n. 22
0
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     allElements.Add(new InvokInfo(Traverser, "IYieldBreakStatement", yieldBreakStatement));
 }
Esempio n. 23
0
 /// <summary>
 /// Returns a deep copy of the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public YieldBreakStatement Copy(IYieldBreakStatement yieldBreakStatement)
 {
     var mutableCopy = this.shallowCopier.Copy(yieldBreakStatement);
       return mutableCopy;
 }
Esempio n. 24
0
 public bool Visit(IYieldBreakStatement statement, TContext context)
 {
     return(false);
 }
Esempio n. 25
0
 public void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     this.result = this.copier.Copy(yieldBreakStatement);
 }
Esempio n. 26
0
 public abstract TransformationImpact CalculateRefactorImpact(IYieldBreakStatement statement);
Esempio n. 27
0
 TransformationImpact IStatementVisitor <TransformationImpact> .Visit(IYieldBreakStatement statement)
 {
     return(CalculateRefactorImpact(statement));
 }
 /// <summary>
 /// Rewrites the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public virtual IStatement Rewrite(IYieldBreakStatement yieldBreakStatement)
 {
     return yieldBreakStatement;
 }
Esempio n. 29
0
 public virtual void onASTElement(IYieldBreakStatement yieldBreakStatement)
 {
 }
Esempio n. 30
0
 public override void TranslateStatement(IYieldBreakStatement breakStatement)
 {
     throw new NotImplementedException();
 }
Esempio n. 31
0
 void IStatementVisitor.Visit(IYieldBreakStatement statement)
 {
     this.Translate(statement);
 }
Esempio n. 32
0
    /// <summary>
    /// Returns a shallow copy of the given yield break statement.
    /// </summary>
    /// <param name="yieldBreakStatement"></param>
    public YieldBreakStatement Copy(IYieldBreakStatement yieldBreakStatement) {
      Contract.Requires(yieldBreakStatement != null);
      Contract.Ensures(Contract.Result<YieldBreakStatement>() != null);

      return new YieldBreakStatement(yieldBreakStatement);
    }
Esempio n. 33
0
 /// <summary>
 /// Traverses the yield break statement.
 /// </summary>
 public void Traverse(IYieldBreakStatement yieldBreakStatement)
 {
     Contract.Requires(yieldBreakStatement != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(yieldBreakStatement);
       if (this.StopTraversal) return;
       this.TraverseChildren(yieldBreakStatement);
       if (this.StopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(yieldBreakStatement);
 }
Esempio n. 34
0
    /// <summary>
    /// Returns a deep copy of the given yield break statement.
    /// </summary>
    /// <param name="yieldBreakStatement"></param>
    public YieldBreakStatement Copy(IYieldBreakStatement yieldBreakStatement) {
      Contract.Requires(yieldBreakStatement != null);
      Contract.Ensures(Contract.Result<YieldBreakStatement>() != null);

      var mutableCopy = this.shallowCopier.Copy(yieldBreakStatement);
      return mutableCopy;
    }
Esempio n. 35
0
 public void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     this.traverser.Traverse(yieldBreakStatement);
 }
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
 {
     this.foundYield = true;
     base.TraverseChildren(yieldBreakStatement);
 }
Esempio n. 37
0
 public void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     Contract.Requires(yieldBreakStatement != null);
       throw new NotImplementedException();
 }
 /// <summary>
 /// Performs some computation with the given yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public virtual void Visit(IYieldBreakStatement yieldBreakStatement)
 {
 }
Esempio n. 39
0
 public abstract IStatement Transform(IYieldBreakStatement statement);
Esempio n. 40
0
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement) {
   this.PrintToken(CSharpToken.Indent);
   this.PrintToken(CSharpToken.YieldBreak);
   this.PrintToken(CSharpToken.Semicolon);
   this.PrintToken(CSharpToken.NewLine);
 }
Esempio n. 41
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="yieldBreakStatement"></param>
 public YieldBreakStatement(IYieldBreakStatement yieldBreakStatement)
   : base(yieldBreakStatement) {
 }
Esempio n. 42
0
 /// <summary>
 /// Visits the specified yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement">The yield break statement.</param>
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     YieldBreakStatement mutableYieldBreakStatement = new YieldBreakStatement(yieldBreakStatement);
     this.resultStatement = this.myCodeCopier.DeepCopy(mutableYieldBreakStatement);
 }
Esempio n. 43
0
 public override void TraverseChildren(IYieldBreakStatement yieldBreakStatement)
 {
     MethodEnter(yieldBreakStatement);
     base.TraverseChildren(yieldBreakStatement);
     MethodExit();
 }
Esempio n. 44
0
 /// <summary>
 /// Visits the specified yield break statement.
 /// </summary>
 /// <param name="yieldBreakStatement">The yield break statement.</param>
 public override void Visit(IYieldBreakStatement yieldBreakStatement)
 {
     YieldBreakStatement mutableYieldBreakStatement = yieldBreakStatement as YieldBreakStatement;
     if (mutableYieldBreakStatement == null) {
       this.resultStatement = yieldBreakStatement;
       return;
     }
     this.resultStatement = this.myCodeMutator.Visit(mutableYieldBreakStatement);
 }