c++ code generation tool from AIDL

I want to design a tool which generates c++ interface from android interface definition language.In short i am designing an aidl compiler.I am facing tough time as i dont know how to develop AST (Abstract syntax tree) for cpp. Any ideas are welcome.

I had seen the source code for aidl compiler.The lex and yacc files are there in it and generate_java files in it.I dont want to build the compiler from scratch.I need to make adjustments or generate new files such that c++ interface can be generated .

Now to get the c++ interface,is it sufficient if i write generate_cpp files or is there a need to change the AST files also.