Boost Users :
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2005-08-17 12:31:01
Foster Gareth wrote:
> I've been reading through the wave docs, it looks very
> impressive. I was wondering, is it possible to use Wave to
> extract all the macro/class/function definitions with their
> respective line numbers from a source file?
Partly. You can use Wave to extract macro definitions from the sources, but
not to extract function/class definitions. For doing that you'll need to
implement your own parser on top of Wave which extracts the required
information from the token stream Wave is generating. Remember, Wave is just
a preprocessor. It's almost the same as if you're trying to invoke your
favorite compile in preprocessor mode (gcc -E or cl -P).
> I noticed the mention of include paths etc however, does this
> mean that just throwing random source files from a large
> source tree at Wave, with no regard for whether or not all
> the types in it will be defined, is going to result in it
> throwing exceptions?
No. It will act on symbols, regardless whether these are types, function
names or plain identifiers. The only thing it will do is to recognise macro
definitions et.al. and to expand those when referenced in the source code.
Wave throws exceptions on preprocessing errors only, i.e. wrong macro
parameter counts or similar.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net