Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking Doxygen read double-slash C++ comments as markup
    primarykey
    data
    text
    <p>I'm trying to set up automated <a href="http://www.doxygen.org/">Doxygen</a> runs on our massive 78,000 file C++ codebase. It's doing okay with extracting basic type and hierarchy information, but I'd like to make it smarter about picking up the documentation comments that are already in place.</p> <p>Most of the comments that have accumulated over the years do follow a general pattern, though not the pattern that Doxygen expected. Mostly they look like </p> <pre><code>// class description class foo { // returns ascii art of a fruit const char* apples( void ); // does something to some other thing customtype_t baz( foo &amp;other ); enum { kBADGER, // an omnivorous mustelid kMUSHROOM, // tasty on pizza kSNAKE, // oh no! }; } </code></pre> <p>Which are double-slashed, rather than the <code>///</code> or <code>//!</code> style comments that Doxygen expects.</p> <p>There are far too many files to go through searching and replacing all such comments, and many of my programmers are violently allergic to seeing triple-slashes in their code, so I'd like to find some way to make Doxygen read ordinary comments as JavaDoc comments, when they're in the right place. <strong>Is there a way to make Doxygen read <code>//</code> as <code>///</code>?</strong> </p> <p>I couldn't find any such configuration parameter, so I figure I'll need to transform the input somehow. In general the rule I'd use is:</p> <ul> <li>if there is a line containing just a comment, immediately preceding a function/class/type/variable declaration, assume it is a <code>///</code> comment. </li> <li>if there is a declaration followed on the same line by a <code>//</code> comment, treat it as a <code>///&lt;</code></li> </ul> <p>But I don't know how to go about teaching Doxygen this rule. The two ways I can think of are:</p> <ol> <li>Write a program as an <a href="http://www.stack.nl/~dimitri/doxygen/config.html#cfg_input_filter">INPUT_FILTER</a>, which parses the input C++ and transforms <code>//</code>s into <code>///</code>s as above. But this kind of transform is too complicated to do as a regular expression, and I really don't want to have to write a full blown C++ parser just to feed input to another C++ parser! Also, spinning up an INPUT_FILTER program for each file slows down Doxygen unacceptably: it already takes over 30 minutes to run across our source, and adding an <a href="http://www.stack.nl/~dimitri/doxygen/config.html#cfg_input_filter">INPUT_FILTER</a> makes it take over six hours.</li> <li>Modify the Doxygen source code to include the above comment rules. That seems like a scary amount of work in unfamiliar code.</li> </ol> <p>Any other ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload