automatically create header only libraries

Hi,

I have a source project (https://github.com/elemental/Elemental) with ~467 c++ headers and ~578 c++ source files, and ~500 thousand lines of code (according to sloccount).

I would like to produce 467 header files where I remove the ; character from forward declarations and insert the body of function { … } from the source c++ file.

I’m wondering if such a script exists, perhaps making using of a clang api. If not, would someone be willing to point me at what parts of the clang api might be useful for achieving this? It seems that the rewriter would do the actual rewriting of the file, but, i’m not sure how to appropriately walk to the source files via the clang api…