private function parseTryStatement()
{
$this->tokenStack->push();
$token = $this->consumeToken(Tokens::T_TRY);
$stmt = $this->builder->buildAstTryStatement($token->image);
$stmt->addChild($this->parseRegularScope());
$this->consumeComments();
if (false === in_array($this->tokenizer->peek(), array(Tokens::T_CATCH, Tokens::T_FINALLY))) {
$this->throwUnexpectedTokenException();
}
while ($this->tokenizer->peek() === Tokens::T_CATCH) {
$stmt->addChild($this->parseCatchStatement());
$this->consumeComments();
}
while ($this->tokenizer->peek() === Tokens::T_FINALLY) {
$stmt->addChild($this->parseFinallyStatement());
$this->consumeComments();
}
return $this->setNodePositionsAndReturn($stmt);
}