private function wantSymbol(string $name, bool $isHidden = false, bool $isInline = false): Symbol
    {
        if ($isInline) {
            if (!isset($this->inline[$name]) && isset($this->symbols[$name])) {
                throw new GrammarException(
                    "Inline '$name' conflicts with token <$name> defined previously"
                );
            }
            if (isset($this->defines[$name])) {
                throw new GrammarException("Inline '$name' conflicts with DEFINE");
            }

            $this->inline[$name] = $name;
            $isHidden = true;
        } else {
            if (isset($this->inline[$name])) {
                throw new GrammarException(
                    "Token <$name> conflicts with inline '$name' defined previously"
                );
            }
            if (isset($this->defines[$name])) {
                throw new GrammarException("Token <$name> conflicts with DEFINE");
            }
        }

        return $this->symbols[$name][$isHidden]
            ?? ($this->symbols[$name][$isHidden] = new Symbol($name, true, $isHidden));
    }