private function readAlternativeSentenceOrSingle($input, &$i)
    {
        $tokens = array();

        while (true) {
            $tokens []= $this->readSentenceOrSingle($input, $i);

            // end of input reached or end token found
            if (!isset($input[$i]) || strpos('])', $input[$i]) !== false) {
                break;
            }

            // cursor now at alternative symbol (all other symbols are already handled)
            // skip alternative mark and continue with next alternative
            $i++;
        }

        // return a single token as-is
        if (isset($tokens[0]) && !isset($tokens[1])) {
            return $tokens[0];
        }

        return new AlternativeToken($tokens);
    }