Is there a gcc-xml equivalent or some similar tool for Visual C++ compiler, which can reflect the internal structure of a C++ source code?
My goal is to generate output by using a C++ (native C++) source or header file as input such that:
- all preprocessor directives are processed. (This can already be achieved via /P, /E or /EP compiler switches.)
- all
typedef
s are expanded to their base type. - A list of all variables/functions/classes/members name and their signature be obtained.
- Optionally, a list of all the instantiated templated classes can be obtained.
As a typedef
example, this code:
typedef string my_type;
my_type s1;
be expanded to:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > s1;
or something that can get me to this.
I know that this may be achieved by using gcc-xml (with gcc as intermediate compiler), or a number of non-MSVC options. However the important requirement is that "the compilation all be done by VC++".
Any solution or workaround that can solve at least one of the later features or guide me through the goal is appreciated.