Utility method to register any parser. Parsers that support any type will be stored in the "generic"
        list, and the others will be stored in front of the types they support
        :return:

def register_parser(self, parser: Parser):
        """
        Utility method to register any parser. Parsers that support any type will be stored in the "generic"
        list, and the others will be stored in front of the types they support
        :return:
        """
        check_var(parser, var_types=Parser, var_name='parser')
        if (not parser.supports_multifile()) and (not parser.supports_singlefile()):
            # invalid
            raise _InvalidParserException.create(parser)

        # (0) sanity check : check that parser handles jokers properly
        res = parser.is_able_to_parse_detailed(desired_type=JOKER, desired_ext=JOKER, strict=True)
        if not (res[0] is True and res[1] is None):
            raise ValueError('Parser ' + str(parser) + ' can not be registered since it does not handle the JOKER cases '
                             'correctly')

        # (1) store in the main lists
        if parser.is_generic():
            self._generic_parsers.append(parser)
        else:
            self._specific_parsers.append(parser)

        # (2) simpler : simply store the ext <> type maps
        for ext in parser.supported_exts:
            for typ in parser.supported_types:
                insert_element_to_dict_of_list(self._strict_types_to_ext, typ, ext)
                insert_element_to_dict_of_list(self._ext_to_strict_types, ext, typ)