Andrew Delong wrote:
> If OpenC++ still cannot provide this ability, I'd be happy to
> contribute as long as it's a relatively small thing to do (I only have
> two weeks to finish my project :~)
While I believe it is quite substantial work, you may want to look
into it anyways :-) Note that I don't think 'include etc.' can work
in general. You may be able to reintroduce the includes, but definitely
not the macros.
Here is how 'ctool' / 'synopsis' do it:
* the parser receives preprocessed code
* the parser generates special parse tree nodes as markers where
the header is entered and where it is left (use '#line' directives
to figure out the exact place).
* you need a way to find out what the header name was that was
originally used, and whether it used <> or "" (synopsis has some
special logic to interact with the preprocessor to get at that data)
* finally, when regenerating the code, you through out everything
in between the markers and replace it by the stored include
directive
HTH,
Stefan
|