tool to combine c++ header and source files


I have a source project with 467 c++ headers and 578 c++ source files, with around 500 thousand lines of code (according to sloccount).

I would like to produce 467 header files where I replace the ‘;’ character with the body of text { … } containing the source implementation from the 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 python api might be useful for achieving this? Would the lexer be the right place to start?