/** * Put together the namespace path and get an access object for reading the * namespace * * Collect the path to this namespace until an ending token is found. This * ending token denotes whether this namespace is wrapped in curlies or not. * * @param \vc\Data\NSpace $nspace The namespace to append to * @param \vc\Tokens\Access $access The token access * @return \vc\Tokens\Access The access object for reading the namespace */ private function buildNS(\vc\Data\NSpace $nspace, \vc\Tokens\Access $access) { $nspace->setNamespace($this->path->parsePath($access)); $token = $access->findRequired(array(Token::T_SEMICOLON, Token::T_CURLY_OPEN)); if ($token->is(Token::T_CURLY_OPEN)) { return $access->untilBlockEnds(); } else { return $access->untilTokens(array(Token::T_NAMESPACE)); } }