Jason S
Jason S

Reputation: 189646

Python code to extract C doc comments associated with functions

I'm doing some codebase analysis and I would like the presentation to include some of the information we keep in function name doc comments.

Is there any Python library that can help with extracting information in C including comments? I tried pycparser but swiftly realized it parses the output of cpp, which already strips comments. I also tried using ply to write my own but realized this is a crazy task + don't think I am up to it.

Upvotes: 0

Views: 363

Answers (1)

vikramls
vikramls

Reputation: 1822

Do you have to use python? Why not use a purpose-built doc generator like doxygen?

If this is not sufficient, you could post-process the HTML/XML using python to pick the stuff that you need.

Upvotes: 1

Related Questions