private function classNameReference() {
    switch ($this->currentType) {
      case T_STRING:
      case T_NS_SEPARATOR:
      case T_NAMESPACE:
        $namespace_path = $this->name();
        if ($this->currentType === T_DOUBLE_COLON) {
          $node = $this->staticMember($namespace_path);
          return $this->dynamicClassNameReference($node);
        }
        else {
          return $namespace_path;
        }
      case T_STATIC:
        $static_node = $this->mustMatchToken(T_STATIC);
        if ($this->currentType === T_DOUBLE_COLON) {
          $node = $this->staticMember($static_node);
          return $this->dynamicClassNameReference($node);
        }
        else {
          return $static_node;
        }
      default:
        if ($this->currentType === '$' && !$this->isLookAhead('{')) {
          return $this->dynamicClassNameReference($this->indirectReference());
        }
        $var_node = $this->referenceVariable();
        if ($this->currentType === T_DOUBLE_COLON) {
          $var_node = $this->staticMember($var_node);
        }
        return $this->dynamicClassNameReference($var_node);
    }
  }