Ejemplo n.º 1
0
 public virtual Statement VisitYield(Yield Yield)
 {
     if (Yield == null) return null;
     Yield.Expression = this.VisitExpression(Yield.Expression);
     return Yield;
 }
Ejemplo n.º 2
0
 public override Statement VisitYield(Yield Yield)
 {
     if (Yield == null) return null;
     return base.VisitYield((Yield)Yield.Clone());
 }
Ejemplo n.º 3
0
 public override Statement VisitYield(Yield Yield)
 {
     throw new NotImplementedException("Node type not yet supported");
 }
Ejemplo n.º 4
0
 private Statement ParseYield(TokenSet followers, bool preferExpressionToDeclaration){
   this.sawReturnOrYield = true;
   Yield Yield = new Yield();
   Yield.SourceContext = this.scanner.CurrentSourceContext;
   ScannerState ss = this.scanner.state;
   Debug.Assert(this.currentToken == Token.Yield);
   this.GetNextToken();
   bool breakOutOfIterator = false;
   if (this.currentToken == Token.Break){
     this.GetNextToken();
     breakOutOfIterator = true;
   }else if (this.currentToken != Token.Return){
     //Restore prior state and reparse as expression
     this.scanner.endPos = Yield.SourceContext.StartPos;
     this.scanner.state = ss;
     this.currentToken = Token.None;
     this.GetNextToken();
     return this.ParseExpressionStatementOrDeclaration(false, followers, preferExpressionToDeclaration, true);
   }else
     this.GetNextToken();
   Expression expr = Yield.Expression = breakOutOfIterator ? null : this.ParseExpression(followers|Token.Semicolon);
   if (expr != null)
     Yield.SourceContext.EndPos = expr.SourceContext.EndPos;
   this.SkipSemiColon(followers);
   return Yield;
 }
Ejemplo n.º 5
0
 public EventingVisitor(Action<Yield> visitYield) { VisitedYield += visitYield; } public event Action<Yield> VisitedYield; public override Statement VisitYield(Yield Yield) { if (VisitedYield != null) VisitedYield(Yield); return base.VisitYield(Yield); }