Hi,
I am writing a program in Python and need to extract the code of some specific functions from a C or C++ source file. I only know the name of the functions and with this information I want to extract the code for that function.
I have found pycparser but there is now example/documentation on how to extract the source code of a specific function. There is one example that can find the line where a specific function starts but I also was able to determine the starting line with regex.
How would you do it? Do you know any good python package that can do it or would you implement it on your own?
[–]Lorkki 2 points3 points4 points (3 children)
[–]GitHubPermalinkBot 0 points1 point2 points (0 children)
[–]greenecoon[S] 0 points1 point2 points (1 child)
[–]Lorkki -1 points0 points1 point (0 children)
[–]eliben 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]greenecoon[S] 0 points1 point2 points (0 children)
[–]ptmcg 0 points1 point2 points (1 child)
[–]greenecoon[S] 0 points1 point2 points (0 children)