예제 #1
0
파일: Parser.php 프로젝트: rouffj/pdepend
 /**
  * Parses/Creates a property postfix node instance.
  *
  * @param PHP_Depend_Code_ASTNode $node Node that represents the image of
  *        the property postfix node.
  *
  * @return PHP_Depend_Code_ASTPropertyPostfix
  * @since 0.10.2
  */
 private function _parsePropertyPostfix(PHP_Depend_Code_ASTNode $node)
 {
     $image = $this->_extractPostfixImage($node);
     $postfix = $this->builder->buildASTPropertyPostfix($image);
     $postfix->addChild($node);
     $postfix->setEndLine($node->getEndLine());
     $postfix->setEndColumn($node->getEndColumn());
     $postfix->setStartLine($node->getStartLine());
     $postfix->setStartColumn($node->getStartColumn());
     return $postfix;
 }
예제 #2
0
 /**
  * This method parses a method- or property-postfix expression. This expression
  * will contain the given node as method or property identifier.
  *
  * @param PHP_Depend_Code_ASTNode $node The identifier for the parsed postfix
  *        expression node. This node will be the first child of the returned
  *        postfix node instance.
  *
  * @return PHP_Depend_Code_ASTNode
  * @throws PHP_Depend_Parser_Exception When an error occured during the
  *         parsing process.
  * @since 0.9.6
  */
 private function _parseMethodOrPropertyPostfix(PHP_Depend_Code_ASTNode $node)
 {
     // Strip optional comments
     $this->_consumeComments();
     // Get next token type
     $tokenType = $this->_tokenizer->peek();
     switch ($tokenType) {
         case self::T_PARENTHESIS_OPEN:
             $postfix = $this->_builder->buildASTMethodPostfix($node->getImage());
             $postfix->addChild($node);
             $postfix->addChild($this->_parseArguments());
             return $this->_parseOptionalMemberPrimaryPrefix($postfix);
         default:
             $postfix = $this->_builder->buildASTPropertyPostfix($node->getImage());
             $postfix->addChild($node);
             return $this->_parseOptionalMemberPrimaryPrefix($postfix);
     }
 }