public function terminals(array $terminals): self
    {
        if (!$terminals) {
            return $this;
        }

        $new_terminals = $this->addNamedTokens($this->regexpMap, $terminals, 'terminal');

        $copy = clone $this;
        $copy->regexpMap = $new_terminals;
        return $copy;
    }