3 warning = re.compile(
"warning: function")
4 tab = re.compile(
"\s+")
5 topfunc = re.compile(
"::produce$|::analyze$|::filter$")
6 paths = re.compile(
".*?\s*src/([A-Z].*?/[A-z].*?)(/.*?):(.*?):(.*?)")
7 from collections
import defaultdict
9 gets = defaultdict(list)
10 calls = defaultdict(list)
16 if warning.search(line):
19 fields = line.split(
"\'")
21 if fields[2] ==
' calls ' :
23 if fields[3].strip()
not in calls[fields[1]]:
24 calls[fields[1]].
append(fields[3].strip())
27 if fields[3].strip()
not in gets[fields[1]]:
28 gets[fields[1]].
append(fields[3].strip())
29 if topfunc.search(fields[1]):
30 dirs = paths.match(fields[0])
31 filename = dirs.group(1)+dirs.group(2)
32 line = filename+
";"+fields[1]
46 "This prints out the get and calls of a function"
47 print "".
join((nspaces *
"\t")+
"function:\t"+str)
50 lf = l.split(
" edm::Handle ")
53 print "".
join(((nspaces+1) *
"\t")+
"acceses:\t"+lf[1].strip())
54 print "".
join(((nspaces+2) *
"\t")+
"label:\t"+lf[0].strip())
56 print "".
join(((nspaces+1) *
"\t")+
"acceses:\t"+l.strip())
57 for call
in calls[str]:
58 print "".
join(((nspaces+1) *
"\t")+
"calls:\t"+call.strip())
59 if call != str:
funcprint(call,(nspaces+2))
63 fields = line.split(
";")
65 print "Package and filename: "+fields[0]
static std::string join(char **cmd)