Example #1
0
 /**
  * This method parses a static member primary expression. The given node
  * contains the used static class or interface identifier. A static member
  * primary prefix can represent the following code expressions:
  *
  * A static method class:
  *
  * <code>
  * Foo::bar();
  * </code>
  *
  * a static property access:
  *
  * <code>
  * Foo::$bar;
  * </code>
  *
  * or a static constant access:
  *
  * <code>
  * Foo::BAR;
  * </code>
  *
  * @param PHP_Depend_Code_ASTNode $node The left node in the parsed member
  *        primary expression.
  *
  * @return PHP_Depend_Code_ASTMemberPrimaryPrefix
  * @throws PHP_Depend_Parser_Exception When an error occured during the
  *         parsing process.
  * @since 0.9.6
  */
 private function parseStaticMemberPrimaryPrefix(PHP_Depend_Code_ASTNode $node)
 {
     $token = $this->consumeToken(self::T_DOUBLE_COLON);
     $prefix = $this->builder->buildAstMemberPrimaryPrefix($token->image);
     $prefix->addChild($node);
     $this->consumeComments();
     switch ($this->tokenizer->peek()) {
         case self::T_STRING:
             $postfix = $this->parseMethodOrConstantPostfix();
             break;
         default:
             $postfix = $this->parseMethodOrPropertyPostfix($this->parsePostfixIdentifier());
             break;
     }
     $prefix->addChild($postfix);
     return $this->parseOptionalMemberPrimaryPrefix($this->parseOptionalIndexExpression($prefix));
 }