C++ is notoriously hard to parse. Most people who try to do this properly end up taking apart a compiler. In fact this is (in part) why LLVM started: Apple needed a way they could parse C++ for use in XCode that matched the way the compiler parsed it.
That's why there are projects like GCC_XML which you could combine with a python xml library.
Some non-compiler projects that seem to do a pretty good job at parsing C++ are:
- Eclipse CDT
- OpenGrok
- Doxygen