public function addFilter(Filter $filter, $key = null) {
        $filter->setParser($this);

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

        $tags = $filter->getTags();

        $this->_filters[$key] = $filter;
        $this->_tags = $tags + $this->_tags;

        foreach ($tags as $tag => $options) {
            $this->_filterMap[$tag] = $key;
        }

        $filter->setupHooks($this);

        return $this;
    }