Esempio n. 1
0
 /**
  * This method parses a try-statement + associated catch-statements.
  *
  * @return PHP_Depend_Code_ASTTryStatement
  * @since 0.9.12
  */
 private function parseTryStatement()
 {
     $this->tokenStack->push();
     $token = $this->consumeToken(self::T_TRY);
     $stmt = $this->builder->buildAstTryStatement($token->image);
     $stmt->addChild($this->parseRegularScope());
     do {
         $stmt->addChild($this->parseCatchStatement());
         $this->consumeComments();
     } while ($this->tokenizer->peek() === self::T_CATCH);
     return $this->setNodePositionsAndReturn($stmt);
 }