MCPcopy Create free account
hub / github.com/ActiveState/code / parse_cg

Method parse_cg

recipes/Python/578138_gprof2dotpy/recipe-578138.py:986–1005  ·  view source on GitHub ↗

Parse the call graph.

(self)

Source from the content-addressed store, hash-verified

984 self.parse_function_entry(lines)
985
986 def parse_cg(self):
987 """Parse the call graph."""
988
989 # skip call graph header
990 while not self._cg_header_re.match(self.readline()):
991 pass
992 line = self.readline()
993 while self._cg_header_re.match(line):
994 line = self.readline()
995
996 # process call graph entries
997 entry_lines = []
998 while line != '\014': # form feed
999 if line and not line.isspace():
1000 if self._cg_sep_re.match(line):
1001 self.parse_cg_entry(entry_lines)
1002 entry_lines = []
1003 else:
1004 entry_lines.append(line)
1005 line = self.readline()
1006
1007 def parse(self):
1008 self.parse_cg()

Callers 1

parseMethod · 0.95

Calls 4

readlineMethod · 0.95
parse_cg_entryMethod · 0.95
matchMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected