Boost logo

Boost Users :

From: Andreas Sæbjørnsen (andreas.saebjoernsen_at_[hidden])
Date: 2005-11-01 13:31:18


After looking at the documentation of Wave I believe it can be used to
extract the preprocessor grammar and I am therefore looking for some tips on
how to get started on my problem. I want to adapt wave into a mechanism for
exptracting all preprocessor grammar from a source file without modifying
the library itself, and I will try to explain what I want to use wave for.
What I want to do is to
*extracting the position and value of preprocessor tokens like #ifdef's,
#defines, #warning etc.
*evaluate the preprocessor conditionals
*after evaluating the preprocessor conditional, extract the portion which
was evaluated as false as a string
 #define positive
#ifdef int positive #endif /*Extract this false part as string*/ int x;
#endif
*I am also interested in the value and position of unexpanded macros
*extracting the C/C++ statement or expression that the unexpanded macro (and
expanded) is
a part of.
*extract the value and position of all C and C++ comments
Which work should I bace my work upon and which data structures should I
reimplement and for what? I have looked at the documentation and the code,
and it seems easy to do some parts but other are not obvious to me at
this point.

Thanks,
Andreas Saebjoernsen



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