private function processNamespace($pos)
{
$list = array(';', '{');
$stack = $this->getTokensTill($pos, $list);
$stackSize = count($stack);
$newpos = $pos + count($stack);
if ($stackSize < 3) {
// empty namespace defintion == root namespace
$this->inNamespace = '';
$this->aliases = array();
return $newpos - 1;
}
$next = $stack[1];
if (is_array($next) && $next[0] == T_NS_SEPARATOR) {
// inline use - ignore
return $newpos;
}
$this->inNamespace = '';
foreach (array_slice($stack, 1, -1) as $tok) {
$this->inNamespace .= $tok[1];
}
$this->aliases = array();
return $pos + $stackSize - 1;
}