Nobody really asked for it, but here's a short description of the code generation I do in the SoLoud audio engine project.
The audio engine itself is c++. I have a
code generator that parses the c++ header files and spits out a few files: c wrapper code that calls c++ functions (.c and .h), DLL definition and a python script with description of the c API.
These are then used to compile a 'c' api DLL, and a
bunch of scripts are used to generate glue code using the DLL in python, c#, D, ruby, gamemaker, etc.
Most of the work in the code generator is parsing the c++ header - it's not a complete c++ parser naturally, only understanding the subset I happen to be using (and needs to be patched almost every time I add some completely new kind of feature).