-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathex.py
More file actions
32 lines (29 loc) · 996 Bytes
/
ex.py
File metadata and controls
32 lines (29 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Search the source distribution for FISH libraries and extract the function names
"""
from glob import glob
import re
import os
pattern = re.compile(r'[^"]*"([^"]*)".*')
def print_intrinsics(filename):
local_funcs = []
lines = open(filename, "r").readlines()
for line in lines:
vector_intrinsic = "createVectorInt" in line
if "registerLibrary" in line or vector_intrinsic:
match = pattern.match(line)
if match:
if vector_intrinsic:
print "{0} {0}.x {0}.y {0}.z".format(match.groups()[0]),
print " ",
else:
print match.groups()[0],
print " ",
print
print
if __name__ == '__main__':
for root, dirs, files in os.walk("."):
for filename in files:
if filename.endswith(".cpp") and "library" in filename:
#print filename
print_intrinsics(os.path.join(root, filename))