예제 #1
0
 public virtual Statement VisitDoWhile(DoWhile doWhile)
 {
     if (doWhile == null) return null;
     doWhile.Invariants = this.VisitLoopInvariantList(doWhile.Invariants);
     doWhile.Body = this.VisitBlock(doWhile.Body);
     doWhile.Condition = this.VisitExpression(doWhile.Condition);
     return doWhile;
 }
예제 #2
0
 public override Statement VisitDoWhile(DoWhile doWhile)
 {
     if (doWhile == null) return null;
     return base.VisitDoWhile((DoWhile)doWhile.Clone());
 }
예제 #3
0
 public override Statement VisitDoWhile(DoWhile doWhile)
 {
     WriteLine("do");
     this.VisitBlock(doWhile.Body);
     WriteStart("while (");
     this.VisitExpression(doWhile.Condition);
     WriteFinish(");");
     return doWhile;
 }
예제 #4
0
 private DoWhile ParseDoWhile(TokenSet followers){
   DoWhile doWhile = new DoWhile();
   doWhile.SourceContext = this.scanner.CurrentSourceContext;
   Debug.Assert(this.currentToken == Token.Do);
   this.GetNextToken();
   doWhile.Invariants = ParseLoopInvariants(followers);
   SourceContext savedCompoundStatementOpeningContext = this.compoundStatementOpeningContext;
   doWhile.SourceContext.EndPos = this.scanner.endPos;
   this.compoundStatementOpeningContext = doWhile.SourceContext;
   Block b = doWhile.Body = this.ParseStatementAsBlock(followers|Token.While);
   if (b != null && b.Statements == null)
     this.HandleError(b.SourceContext, Error.PossibleMistakenNullStatement);
   this.Skip(Token.While);
   doWhile.Condition = this.ParseParenthesizedExpression(followers|Token.Semicolon);
   if (doWhile.Condition != null)
     doWhile.SourceContext.EndPos = doWhile.Condition.SourceContext.EndPos;
   this.SkipSemiColon(followers);
   this.compoundStatementOpeningContext = savedCompoundStatementOpeningContext;
   return doWhile;
 }
예제 #5
0
 public EventingVisitor(Action<DoWhile> visitDoWhile) { VisitedDoWhile += visitDoWhile; } public event Action<DoWhile> VisitedDoWhile; public override Statement VisitDoWhile(DoWhile doWhile) { if (VisitedDoWhile != null) VisitedDoWhile(doWhile); return base.VisitDoWhile(doWhile); }