The Clang project provides libraries for just parsing C++ code.
Either with Clang and GCC you can generate an XML representation of the code
If you prefer a more Pythonian solution you could also search for a C++ yacc grammar and use py-ply (Yacc for Python), but that seems the solution that needs more work