If you want to have full list, you won't escape writing a kind of C++ preprocessor, because some variables (or even whole classes) can be declared using some of its features, like macro expansion or new line splitting.
Next thing is parse the C++ code itself - you need to be familiar with context free grammars. Parsing C++ code is a really tough task if you ask me.
Try to google for "writing a C++ parser" or something like that, and see for yourself.
In your case it could be easier than a "real" C++ parser, because you don't really have to care about syntax errors in general, as you are only interested in declarations - but a good IDE will warn about syntax errors as well
I don't really know how to help you, try to use google, maybe you can find some code samples or something.






Reply With Quote

Bookmarks