This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++ stub generator


Nick Ing-Simmons <nick@ing-simmons.net> writes:
>Ivan Rachev <ivanr@syncad.com> writes:
>>Hi,
>>
>>I would like to try building a c++ stub generator which to be added to 
>>http://cppunit.sourceforge.net. Input to the generator would be a header 
>>with declarations and output would be a cpp file with empty definitions.
>>My primary concern is if I could use some parts of gcc c++ compiler to do 
>>this. Probably the lexical analyser, the preprocessor and the structures for 
>>trees. Any link or comment on how these are implemented would be of great 
>>help. Something different from 
>>http://gcc.gnu.org/onlinedocs/gccint/Passes.html#Passes would be better as 
>>the doc on this link says it is "no where near complete".
>
>I would like something very similar - i.e. a tool which reads .h files 
>and produces perl bindings for the public interfaces to class(es).
>This needs same kind of information, and indeed if Ivan's tool
>existed I could probably post-process it to do what I want.

Seems like I can do what I want using -fdump-translation-unit-all
and then reading the .tu file to rebuild perl version of tree
and then traverse as I see fit.

There are one or two oddities in the file that I haven't figured out 
yet but looks promissing. Same technique should work for stub generator.

Oddities are that public/private-ness of base classes seems to get lost
and const-ness (qual:c) is confusing me.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]