Re: [Doxygen-users] EXPAND_AS_DEFINED and Poor Mans Inheritance
Brought to you by:
dimitri
|
From: Peter S. <pet...@hu...> - 2001-06-06 09:40:51
|
Hello!
replying to myself...
On Mon, 14 May 2001 09:46:13 +0200, Peter Steiner wrote:
> I one project, I'm forced to use C. I try to get some struct reuse and
> sort of object inheritance with the following contruct:
> #define BASECLASS \
> int aMember; /**< Members Doc */ \
> /* END OF BASECLASS */
> /**
> * This is the base class
> */
> typedef struct BaseClass {
> BASECLASS
> } BaseClass;
> To get the documentation right, I'm using the MACRO_EXPANSION,
> EXPAND_ONLY_PREDEF and EXPAND_AS_DEFINED = BASECLASS macros. But that
> works only halfway: the 'aMember' appears in the documentation if
> HIDE_UNDOC_MEMBERS is not set, but without documentation.
Looking at the output of "doxygen -d Preprocessor", the comments stay
where the macro definition was, they are not included into the body of a
macro. Now I did not look into the lex files to provide a patch (i don't
know lex/flex yet), but found a workaround using macros that also
illustrates the problem:
#define DXY_PASTE(x,y) x ## y
#define DXY(x) DXY_PASTE(/,**<) x DXY_PASTE(*,/)
#define BASECLASS \
int aMember; DXY(Members Doc) \
/* END OF BASECLASS */
/// This is the base class
typedef struct BaseClass {
BASECLASS
} BaseClass;
Using the DXY macro to get the comments past the lexical analysis seems
to work, but I don't know yet how portable this is for compilers.
It would be nice, if doxygen could handle this itself.
Regards, Peter
--
_ _ Peter Steiner <pet...@hu...>
/ /_/ / Hug-Witschi AG <http://www.hugwi.ch/>
/ _ / Electronic Engineering
/_/ /_/ _ _ Industriestrasse 12
/ / / / / / CH-3178 Boesingen
/ /_/ /_/ / Tel +41 31 740 44 44
/_ _ _ _ _/ Fax +41 31 740 44 45
|