Exemplo n.º 1
0
 /**
  * Initializes the parser environment.
  *
  * @return void
  * @since 0.9.12
  */
 protected function setUpEnvironment()
 {
     ini_set('xdebug.max_nesting_level', $this->getMaxNestingLevel());
     $this->_useSymbolTable->createScope();
     $this->reset();
 }
Exemplo n.º 2
0
 /**
  * Extracts all dependencies from a callable body.
  *
  * @return PHP_Depend_Code_ASTScope
  * @since 0.9.12
  */
 private function _parseScope()
 {
     $scope = $this->_builder->buildASTScope();
     $this->_tokenStack->push();
     $this->_useSymbolTable->createScope();
     $this->_consumeComments();
     $this->_consumeToken(self::T_CURLY_BRACE_OPEN);
     while (($stmt = $this->_parseOptionalStatement()) !== null) {
         // TODO: Remove if-statement once, we have translated functions and
         //       closures into ast-nodes
         if ($stmt instanceof PHP_Depend_Code_ASTNodeI) {
             $scope->addChild($stmt);
         }
     }
     $this->_consumeComments();
     $this->_consumeToken(self::T_CURLY_BRACE_CLOSE);
     $this->_useSymbolTable->destroyScope();
     return $this->_setNodePositionsAndReturn($scope);
 }