/** * This method parses a {@link PHP_Depend_Code_ASTConstant} node or an * instance of {@link PHP_Depend_Code_ASTParentReference} as part of * a {@link PHP_Depend_Code_MemberPrimaryPrefix} that contains the parent * reference as its first child when the self token is followed by a * double colon token. * * @return PHP_Depend_Code_ASTNode * @throws PHP_Depend_Parser_Exception When an error occured during the * parsing process. * @throws PHP_Depend_Parser_InvalidStateException When the keyword parent * was used outside of a class or interface scope. * @since 0.9.6 */ private function parseConstantOrParentMemberPrimaryPrefix() { // Consume parent token and strip optional comments $token = $this->consumeToken(self::T_PARENT); $this->consumeComments(); if ($this->tokenizer->peek() == self::T_DOUBLE_COLON) { return $this->parseStaticMemberPrimaryPrefix($this->parseParentReference($token)); } return $this->builder->buildAstConstant($token->image); }