//while_stmt: 'while' expression ':' suite ['else' ':' suite] private WhileStatement ParseWhileStmt() { Eat(TokenKind.KeywordWhile); string whileWhiteSpace = _tokenWhiteSpace; var start = GetStart(); Expression expr = ParseExpression(); var mid = GetEnd(); Statement body = ParseLoopSuite(); Statement else_ = null; string elseWhiteSpace = null; int end = body.EndIndex; if (MaybeEat(TokenKind.KeywordElse)) { elseWhiteSpace = _tokenWhiteSpace; else_ = ParseSuite(); end = else_.EndIndex; } WhileStatement ret = new WhileStatement(expr, body, else_); ret.SetLoc(start, mid, end); if (_verbatim) { AddPreceedingWhiteSpace(ret, whileWhiteSpace); if (elseWhiteSpace != null) { AddSecondPreceedingWhiteSpace(ret, elseWhiteSpace); } } return ret; }
public override bool Walk(WhileStatement node) { UpdateChildRanges(node); return base.Walk(node); }
// WhileStmt public override bool Walk(WhileStatement node) { // Walk the expression node.Test.Walk(this); BitArray opte = node.ElseStatement != null ? new BitArray(_bits) : null; BitArray exit = new BitArray(_bits.Length, true); PushLoop(exit); node.Body.Walk(this); PopLoop(); _bits.And(exit); if (node.ElseStatement != null) { // Flow the else BitArray save = _bits; _bits = opte; node.ElseStatement.Walk(this); // Restore the bits _bits = save; // Intersect _bits.And(opte); } return false; }
// WhileStatement public override bool Walk(WhileStatement node) { return ShouldWalkWorker(node); }
public override void PostWalk(WhileStatement node) { PostWalkWorker(node); }
public override bool Walk(WhileStatement node) { WalkLoop(node.Body, node.ElseStatement); return false; }
public override bool Walk(WhileStatement node) { if (node.Test != null) { node.Test.Walk(this); } if (node.Body != null) { bool oldInLoop = _inLoop; _inLoop = true; node.Body.Walk(this); _inLoop = oldInLoop; } if (node.ElseStatement != null) { node.ElseStatement.Walk(this); } return false; }
public override bool Walk(WhileStatement node) { return false; }