示例#1
0
 /**
  * This method parses a single if-statement node.
  *
  * @return PHP_Depend_Code_ASTIfStatement
  * @since 0.9.8
  */
 private function parseIfStatement()
 {
     $this->tokenStack->push();
     $token = $this->consumeToken(self::T_IF);
     $stmt = $this->builder->buildAstIfStatement($token->image);
     $stmt->addChild($this->parseParenthesisExpression());
     $this->parseStatementBody($stmt);
     $this->parseOptionalElseOrElseIfStatement($stmt);
     return $this->setNodePositionsAndReturn($stmt);
 }