www.digitalmars.com         C & C++   DMDScript  

D - Doxygen preprocessor for D

reply Burton Radons <loth users.sourceforge.net> writes:
I've attached a quick hacked Doxygen preprocessor that turns D into 
something a little closer to C++.  It removes contracts, puts a public: 
at the start of classes, fixes up templates, and replaces "}" with "};". 
  It's not well-tested and there'll be code it messes up on, and it is 
very, very slow.  All those problems will be fixed once I switch to a 
tokeniser.

I've also attached a Doxyfile that can be used as a base, little tweaks 
to get the output to behave better.
Nov 27 2002
parent reply Burton Radons <loth users.sourceforge.net> writes:
Attached the rewrite that should be about a dozen times faster.  It now 
transforms delegates into function pointers (non-recursively, so a 
delegate which takes a delegate as an argument will still appear as a 
delegate, but that shouldn't modify documentation).  instance is now 
transformed into a typedef.  What's missing is:

- handling of debug and version statements.
- handling of public/private/protected/static blocks (as in "public { 
... }") and public/private/protected applied to single methods, which 
Doxygen doesn't handle for some reason.
Nov 27 2002
parent reply "Sab" <sab neuropolis.org> writes:
Sorry if I'm asking stupid, but what exactly is the point?
What you said (below) suggests it may be some syntax
"desugarator", but I guess nobody uses D for the syntactical
differences alone. How about e.g. arrays (and strings)?

OTOH, that Doxygen file suggests something much more
powerful, I only don't get the big picture, I think I need some
more info.

Thanks,
Sab

"Burton Radons" <loth users.sourceforge.net> wrote in message
news:as3ji1$1419$1 digitaldaemon.com...
 I've attached a quick hacked Doxygen preprocessor that turns D into
 something a little closer to C++.  It removes contracts, puts a public:
 at the start of classes, fixes up templates, and replaces "}" with "};".
   It's not well-tested and there'll be code it messes up on, and it is
 very, very slow.  All those problems will be fixed once I switch to a
 tokeniser.
"Burton Radons" <loth users.sourceforge.net> wrote in message news:as3uk2$1fab$1 digitaldaemon.com...
 Attached the rewrite that should be about a dozen times faster.  It now
 transforms delegates into function pointers (non-recursively, so a
 delegate which takes a delegate as an argument will still appear as a
 delegate, but that shouldn't modify documentation).  instance is now
 transformed into a typedef.  What's missing is:

 - handling of debug and version statements.
 - handling of public/private/protected/static blocks (as in "public {
 ... }") and public/private/protected applied to single methods, which
 Doxygen doesn't handle for some reason.
Nov 28 2002
parent reply Evan McClanahan <evan dontSPAMaltarinteractive.com> writes:
Doxygen is a automatic documentation generator for C++ and other 
languages.  The preprocessor is to render the code into something that 
doxygen can make more sense of, so that it can generate more useful 
documentation.  It has nothing to do with making the syntax more 
C++-like for coding purpose.

Evan


Sab wrote:
 Sorry if I'm asking stupid, but what exactly is the point?
 What you said (below) suggests it may be some syntax
 "desugarator", but I guess nobody uses D for the syntactical
 differences alone. How about e.g. arrays (and strings)?
 
 OTOH, that Doxygen file suggests something much more
 powerful, I only don't get the big picture, I think I need some
 more info.
 
 Thanks,
 Sab
 
 "Burton Radons" <loth users.sourceforge.net> wrote in message
 news:as3ji1$1419$1 digitaldaemon.com...
 
I've attached a quick hacked Doxygen preprocessor that turns D into
something a little closer to C++.  It removes contracts, puts a public:
at the start of classes, fixes up templates, and replaces "}" with "};".
  It's not well-tested and there'll be code it messes up on, and it is
very, very slow.  All those problems will be fixed once I switch to a
tokeniser.
"Burton Radons" <loth users.sourceforge.net> wrote in message news:as3uk2$1fab$1 digitaldaemon.com...
Attached the rewrite that should be about a dozen times faster.  It now
transforms delegates into function pointers (non-recursively, so a
delegate which takes a delegate as an argument will still appear as a
delegate, but that shouldn't modify documentation).  instance is now
transformed into a typedef.  What's missing is:

- handling of debug and version statements.
- handling of public/private/protected/static blocks (as in "public {
... }") and public/private/protected applied to single methods, which
Doxygen doesn't handle for some reason.
Nov 28 2002
parent "Sab" <sab neuropolis.org> writes:
 Doxygen is a automatic documentation generator for C++ and other
Ah, I see, thanks a lot! (I thought the preprocessor was called Doxygen... :) ) Sab
Nov 28 2002