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; }
public override Statement VisitDoWhile(DoWhile doWhile) { if (doWhile == null) return null; return base.VisitDoWhile((DoWhile)doWhile.Clone()); }
public override Statement VisitDoWhile(DoWhile doWhile) { WriteLine("do"); this.VisitBlock(doWhile.Body); WriteStart("while ("); this.VisitExpression(doWhile.Condition); WriteFinish(");"); return doWhile; }
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; }
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); }