def read_minimal_term
      logger.debug "read minimal term"
      term = nil
      operator = get_operator
      if operator
        error("'#{operator}' is no prefix operator") unless operator.prefix?
        read_token
        term = Term.new(operator)
        if operator.maximum > 1
          error("'#{operator}' is prefix operator with more than one argument," \
                " that is not supported yet")
        end
        if operator.minimum > 0
          arg = read_maximal_term(operator.priority)
          error("prefix operator '#{operator}' got no argument") if arg.nil?
          term.add(arg)
        end
        logger.debug "read_minimal_term: #{term}"
        return term
      end
      # no prefix operator found
      token = get_token
      if token == :_begin
        logger.debug "read ()"
        read_token
        term = read_maximal_term(0)
        error "'#{Tokenizer.symbol_to_string(:_end)}' expected " unless get_token == :_end
        read_token
      elsif token == :_list_begin
        logger.debug "read []"
        read_token
        args = []
        loop do
          term = read_maximal_term(0)
          if get_token != :_list_end && get_token != :_comma
            error "'#{Tokenizer.symbol_to_string(:_list_end)}' or" \
                  " '#{Tokenizer.symbol_to_string(:_comma)}' expected"
          end
          args << term if term
          break if read_token == :_list_end
        end
        term = args
      else
        error("no operator #{get_operator} expected here") if get_operator
        if Tokenizer::LANGUAGE_STRINGS.include?(token) && ![:true, :false, :null].include?(token)
          error("that was not expected here: '#{Tokenizer.symbol_to_string(token)}'")
        end
        token = read_token
        logger.debug "atom found: #{token}"
        term = token
      end
      logger.debug "read minimal term: #{term}"
      term
    end
def read_minimal_term
      logger.debug "read minimal term"
      term = nil
      operator = get_operator
      if operator
        error("'#{operator}' is no prefix operator") unless operator.prefix?
        read_token
        term = Term.new(operator)
        if operator.maximum > 1
          error("'#{operator}' is prefix operator with more than one argument," \
                " that is not supported yet")
        end
        if operator.minimum > 0
          arg = read_maximal_term(operator.priority)
          error("prefix operator '#{operator}' got no argument") if arg.nil?
          term.add(arg)
        end
        logger.debug "read_minimal_term: #{term}"
        return term
      end
      # no prefix operator found
      token = get_token
      if token == :_begin
        logger.debug "read ()"
        read_token
        term = read_maximal_term(0)
        error "'#{Tokenizer.symbol_to_string(:_end)}' expected " unless get_token == :_end
        read_token
      elsif token == :_list_begin
        logger.debug "read []"
        read_token
        args = []
        loop do
          term = read_maximal_term(0)
          if get_token != :_list_end && get_token != :_comma
            error "'#{Tokenizer.symbol_to_string(:_list_end)}' or" \
                  " '#{Tokenizer.symbol_to_string(:_comma)}' expected"
          end
          args << term if term
          break if read_token == :_list_end
        end
        term = args
      else
        error("no operator #{get_operator} expected here") if get_operator
        if Tokenizer::LANGUAGE_STRINGS.include?(token) && ![:true, :false, :null].include?(token)
          error("that was not expected here: '#{Tokenizer.symbol_to_string(token)}'")
        end
        token = read_token
        logger.debug "atom found: #{token}"
        term = token
      end
      logger.debug "read minimal term: #{term}"
      term
    end
Read next following term. This is a complete term but some infix operator
 or some terms for an infix operator might follow.
 rubocop:disable Metrics/PerceivedComplexity,Metrics/AbcSize,Metrics/CyclomaticComplexity
 rubocop:disable Metrics/MethodLength