Source-to-source translation of C++ using Python


I’d like to get some feedback on a Clang-based tool I’ve been working on in my spare time.

The tool is called “cmonster”, a Python wrapper around the Clang internal libraries (preprocessor, parser, AST, rewriter). The purpose of the tool is to make analysis and source-to-source translation of C++ quick and painless. I’d like to think this tool could address the points in the “One-Off Tools” slide from Douglas Gregor’s presentation at the 2011 LLVM dev meeting (

You can obtain and/or read a little more about cmonster here:

A couple of comments from me:

  • I’ve built and tested it only on Ubuntu Linux (11.xx). There’s nothing specifically Linuxy about the code though, so it should work on other *nix platforms.
  • There’s an oddity that I haven’t fixed in the code that requires GCC to be installed. Will be fixed in the future, but shouldn’t be a problem if you test on Linux at least.

If you have any questions or comments, feel free to contact me directly.