def add_parser_to_cascade(self, parser: AnyParser, typ: Type = None):
<EOL>if not self.configured:<EOL><INDENT>self.supported_exts = parser.supported_exts<EOL>self.supported_types = parser.supported_types<EOL><DEDENT>if self.supports_singlefile():<EOL><INDENT>if not parser.supports_singlefile():<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if self.supports_multifile():<EOL><INDENT>if not parser.supports_multifile():<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if AnyObject not in parser.supported_types:<EOL><INDENT>if typ is None:<EOL><INDENT>if AnyObject in self.supported_types:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>+ str(parser.supported_types) + '<STR_LIT:)>')<EOL><DEDENT>else:<EOL><INDENT>missing_types = set(self.supported_types) - set(parser.supported_types)<EOL>if len(missing_types) > <NUM_LIT:0>:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' + str(missing_types) + '<STR_LIT:)>')<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if typ == AnyObject:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' + str(parser.supported_types))<EOL><DEDENT><DEDENT><DEDENT>missing_exts = set(self.supported_exts) - set(parser.supported_exts)<EOL>if len(missing_exts) > <NUM_LIT:0>:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' + str(missing_exts) + '<STR_LIT:)>')<EOL><DEDENT>self._parsers_list.append((typ, parser))<EOL>
Adds the provided parser to this cascade. If this is the first parser, it will configure the cascade according
to the parser capabilities (single and multifile support, extensions).
Subsequent parsers will have to support the same capabilities at least, to be added.

:param parser:
:param typ:
:return: