After much research, I've found http://www.phpcompiler.org/doc/maketea.pdf and http://rosecompiler.org/ROSE_Tutorial/ROSE-0.9.4a-Tutorial.pdf . Since PHP source code can be parsed and then translated to XML, converting it to C++ is just a matter of XSLT. Moreover, PHPCompiler also supports plugins and various transformations of source code (based on AST transformations). I think that should be sufficient for now.
Some extra references:
- http://rosecompiler.org
- http://rosecompiler.org/ROSE_UserManual/ROSE-UserManual.pdf
Thanks, everyone for participating in the discussion!