public function addHook(Hook $hook, $key = null) {
        $hook->setParser($this);

        if (!$key) {
            $key = explode('\\', get_class($hook));
            $key = str_replace('Hook', '', end($key));
        }

        $this->_hooks[$key] = $hook;

        $hook->setupFilters($this);

        ksort($this->_hooks);

        return $this;
    }