def parse_comment(self, comment, filename, lineno, endlineno,<EOL>include_paths=None, stripped=False):
if not stripped and not self.__validate_c_comment(comment.strip()):<EOL><INDENT>return None<EOL><DEDENT>title_offset = <NUM_LIT:0><EOL>column_offset = <NUM_LIT:0><EOL>raw_comment = comment<EOL>if not stripped:<EOL><INDENT>try:<EOL><INDENT>while comment[column_offset * -<NUM_LIT:1> - <NUM_LIT:1>] != '<STR_LIT:\n>':<EOL><INDENT>column_offset += <NUM_LIT:1><EOL><DEDENT><DEDENT>except IndexError:<EOL><INDENT>column_offset = <NUM_LIT:0><EOL><DEDENT>comment, title_offset = self.__strip_comment(comment)<EOL><DEDENT>title_and_params, description = self.__extract_titles_params_and_description(comment)<EOL>try:<EOL><INDENT>block_name, parameters, annotations, is_section =self.__parse_title_and_parameters(filename, title_and_params)<EOL><DEDENT>except HotdocSourceException as _:<EOL><INDENT>warn('<STR_LIT>',<EOL>message=_.message,<EOL>filename=filename,<EOL>lineno=lineno + title_offset)<EOL>return None<EOL><DEDENT>params_offset = <NUM_LIT:0><EOL>for param in parameters:<EOL><INDENT>param.filename = filename<EOL>param.lineno = lineno<EOL>param_offset = param.line_offset<EOL>param.line_offset = title_offset + params_offset + <NUM_LIT:1><EOL>params_offset += param_offset<EOL>param.col_offset = column_offset<EOL><DEDENT>if not block_name:<EOL><INDENT>return None<EOL><DEDENT>description_offset = <NUM_LIT:0><EOL>meta = {}<EOL>tags = []<EOL>if description is not None:<EOL><INDENT>n_lines = len(comment.split('<STR_LIT:\n>'))<EOL>description_offset = (title_offset + n_lines -<EOL>len(description.split('<STR_LIT:\n>')))<EOL>meta['<STR_LIT:description>'], tags = self.__parse_description_and_tags(description)<EOL><DEDENT>actual_parameters = OrderedDict({})<EOL>for param in parameters:<EOL><INDENT>if is_section:<EOL><INDENT>cleaned_up_name = param.name.lower().replace('<STR_LIT:_>', '<STR_LIT:->')<EOL>if cleaned_up_name in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>meta.update(self.__parse_yaml_comment(param, filename))<EOL>if cleaned_up_name == '<STR_LIT>':<EOL><INDENT>sources_paths = [os.path.abspath(os.path.join(os.path.dirname(filename), path)) for path in meta[cleaned_up_name]]<EOL>meta[cleaned_up_name] = sources_paths<EOL><DEDENT><DEDENT>else:<EOL><INDENT>meta[param.name] = param.description<EOL><DEDENT><DEDENT>else:<EOL><INDENT>actual_parameters[param.name] = param<EOL><DEDENT><DEDENT>annotations = {annotation.name: annotation for annotation in<EOL>annotations}<EOL>tags = {tag.name.lower(): tag for tag in tags}<EOL>block = Comment(name=block_name, filename=filename, lineno=lineno,<EOL>endlineno=endlineno,<EOL>annotations=annotations, params=actual_parameters,<EOL>tags=tags, raw_comment=raw_comment,<EOL>meta=meta, toplevel=is_section)<EOL>block.line_offset = description_offset<EOL>block.col_offset = column_offset<EOL>return block<EOL>
Returns a Comment given a string