'Validate a parser is well defined.'

def ValidateParser(self, parser):

    for artifact_to_parse in parser.supported_artifacts:
        art_obj = artifact_registry.REGISTRY.GetArtifact(artifact_to_parse)
        if (art_obj is None):
            raise parsers.ParserDefinitionError(('Artifact    parser    %s    has    an    invalid    artifact    %s.    Artifact    is    undefined' % (parser.__name__, artifact_to_parse)))
    for out_type in parser.output_types:
        if (out_type not in rdfvalue.RDFValue.classes):
            raise parsers.ParserDefinitionError(('Artifact    parser    %s    has    an    invalid    output    type    %s.' % (parser.__name__, out_type)))
    if parser.process_together:
        if (not hasattr(parser, 'ParseMultiple')):
            raise parsers.ParserDefinitionError(('Parser    %s    has    set    process_together,    but    has    not    defined    a    ParseMultiple    method.' % parser.__name__))
    parser.Validate()
