コード例 #1
0
    def parse(self, code):
        """main entry point for parsing the text "code".

        return tuple(requires(list),
                     references(list),
                     declarations(set),
                     definitions(set),
        tags(dict))

        """
        #This 2 lines where in normalizing Blob. A final \n is required for some things to be
        #correctly parsed
        if not code.endswith('\n'):
            code = '%s\n' % code

        result, _ = self._parse_strings_comments(code)
        comments = [
            comment for comment in result
            if comment.type in (FileParser.COMMENT, FileParser.MULTILINE)
        ]

        requires = self._parse_requires(code, comments)

        references = self._parse_references(code)
        comments = self.parse_comments(result)
        tags = parse_tags(
            comments)  # parse all biicode tags, comments with "bii:#"
        return requires, references, [], [], tags
コード例 #2
0
    def parse(self, code):
        '''main entry point for parsing the text "code"
        return tuple(includes(list), references(list), declarations(set), definitions(set),
        tags(dict))'''
        #This 2 lines where in normalizing Blob. A final \n is required for some things to be
        #correctly parsed
        if not code.endswith('\n'):
            code = '%s\n' % code

        result, simple_code = self._parse_strings_comments(code)
        declarations, definitions = self._extract_symbols(simple_code)
        includes, references = self._parse_references(result)
        comments = self.parse_comments(result)
        tags = parse_tags(comments)           # parse all biicode tags, comments with "bii:#"
        return includes, references, declarations, definitions, tags
コード例 #3
0
ファイル: file_parser.py プロジェクト: luckcc/bii-common
    def parse(self, code):
        '''main entry point for parsing the text "code"
        return tuple(includes(list), references(list), declarations(set), definitions(set),
        tags(dict))'''
        #This 2 lines where in normalizing Blob. A final \n is required for some things to be
        #correctly parsed
        if not code.endswith('\n'):
            code = '%s\n' % code

        result, simple_code = self._parse_strings_comments(code)
        declarations, definitions = self._extract_symbols(simple_code)
        includes, references = self._parse_references(result)
        comments = self.parse_comments(result)
        tags = parse_tags(
            comments)  # parse all biicode tags, comments with "bii:#"
        return includes, references, declarations, definitions, tags
コード例 #4
0
    def parse(self, code):
        """main entry point for parsing the text "code".

        return tuple(requires(list),
                     references(list),
                     declarations(set),
                     definitions(set),
        tags(dict))

        """
        #This 2 lines where in normalizing Blob. A final \n is required for some things to be
        #correctly parsed
        if not code.endswith('\n'):
            code = '%s\n' % code

        result, _ = self._parse_strings_comments(code)
        comments = [comment for comment in result if comment.type in (FileParser.COMMENT, FileParser.MULTILINE)]

        requires = self._parse_requires(code, comments)

        references = self._parse_references(code)
        comments = self.parse_comments(result)
        tags = parse_tags(comments) # parse all biicode tags, comments with "bii:#"
        return requires, references, [], [], tags