public function addRule(AbstractRule $rule) {
        if (array_key_exists($rule->getName(), $this->rules)) {
            throw new ParserException('Rule with ' . $rule->getName() . ' name already exists');
        }

        $this->rules[$rule->getName()] = $rule;

        return $this;
    }