Esempio n. 1
0
 /**
  * This method parses a do/while-statement.
  *
  * @return \PDepend\Source\AST\ASTDoWhileStatement
  * @sibce  0.9.12
  */
 private function parseDoWhileStatement()
 {
     $this->tokenStack->push();
     $token = $this->consumeToken(Tokens::T_DO);
     $stmt = $this->builder->buildAstDoWhileStatement($token->image);
     $stmt = $this->parseStatementBody($stmt);
     $this->consumeComments();
     $this->consumeToken(Tokens::T_WHILE);
     $stmt->addChild($this->parseParenthesisExpression());
     $this->parseStatementTermination();
     return $this->setNodePositionsAndReturn($stmt);
 }