Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/Users/jlopezvi/Flowgen/flowdoc/aux_files/simple_demo_src.flowdb
/Users/jlopezvi/Flowgen/flowdoc/aux_files/source1.flowdb
.DS_Store
.*.swp
12 changes: 10 additions & 2 deletions forVINCIA/build_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import clang.cindex
import os
import filecmp

#clang node types (CursorKind)
#21: CXX_METHOD
Expand Down Expand Up @@ -92,6 +93,13 @@ def find_functions(node):
print ('Translation unit:', tu.spelling.decode("utf-8"))
infile_str=os.path.splitext(os.path.basename(sys.argv[1]))[0]
print (infile_str)
writefunc = open('flowdoc/aux_files/'+infile_str+'.flowdb',"w")
provfilename = os.path.join('flowdoc/aux_files/',infile_str+'_provisional.flowdb')
origfilename = os.path.join('flowdoc/aux_files/',infile_str+'.flowdb')
writefunc = open(provfilename,"w")
find_functions(tu.cursor)
writefunc.close()
writefunc.close()
# check whether the name of the provisional file has to be changed into origfilename
if (not(os.path.isfile(origfilename)) or (os.path.isfile(origfilename) and not filecmp.cmp(origfilename, provfilename, shallow=False))):
os.rename(provfilename, origfilename)
else:
os.remove(provfilename)
7 changes: 6 additions & 1 deletion forVINCIA/makeflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,15 @@ def find_functions(node):
#global variable for the name of the input file. It will be defined later on.
infile_str=''
find_functions(tu.cursor)
#touch an empty file so that make knows this source code file has been processed
prcfilename = sys.argv[1]
prcfilename = os.path.join("flowdoc/aux_files", os.path.splitext(os.path.basename(prcfilename))[0]+".mfdone")
with open(prcfilename, 'a'):
os.utime(prcfilename, None)
#print(os.path.splitext(infile_str)[0])
#print(os.path.basename(infile_str))
#print(os.path.splitext(os.path.basename(infile_str))[0])

#f = open('flowdoc/'+os.path.splitext(os.path.basename(infile_str))[0]+".html","w")
#f.write(htmlonline_str)
#f.close()
#f.close()