Doxygen

1

Doxygen is a documentation generator and static analysis tool for software source trees. When used as a documentation generator, Doxygen extracts information from specially-formatted comments within the code. When used for analysis, Doxygen uses its parse tree to generate diagrams and charts of the code structure. Doxygen can cross reference documentation and code, so that the reader of a document can easily refer to the actual code. Doxygen is free software, released under the terms of the GNU General Public License version2 (GPLv2).

Design

Like Javadoc, Doxygen extracts documentation from source file comments. In addition to the Javadoc syntax, Doxygen supports the documentation tags used in the Qt toolkit and can generate output in HyperText Markup Language (HTML) as well as in Microsoft Compiled HTML Help (CHM), Rich Text Format (RTF), Portable Document Format (PDF), LaTeX, PostScript or man pages.

Uses

Programming languages supported by Doxygen include C, C++, C#, D, Fortran, IDL, Java, Objective-C, Perl, PHP, Python, and VHDL. Other languages can be supported with additional code. Doxygen runs on most Unix-like systems, macOS, and Windows. The first version of Doxygen borrowed code from an early version of DOC++, developed by Roland Wunderling and Malte Zöckler at Zuse Institute Berlin. Later, the Doxygen code was rewritten by Dimitri van Heesch. Doxygen has built-in support to generate inheritance diagrams for C++ classes. For more advanced diagrams and graphs, Doxygen can use the "dot" tool from Graphviz.

Example code

The generic syntax of documentation comments is to start a comment with an extra asterisk or exclamation after the leading comment delimiter ' ': All commands in the documentation start with a backslash or an at-sign. Many programmers like to mark the start of each line with space-asterisk-space, as follows, but that is not necessary. Many programmers avoid using C-style comments and instead use C++ style single line comments. Doxygen accepts comments with an additional subsequent slash or exclamation as Doxygen comments. The following illustrates how a C++ source file can be documented. To put documentation after members, an additional marker is required in the comment block. An alternative approach for documenting parameters is shown below. It will produce the same documentation. Richer markup is also possible. For instance, add equations using LaTeX commands:

Doxygen source and development

The Doxygen sources are currently hosted at GitHub, where the main developer, Dimitri van Heesch, contributes under the user name "doxygen". Doxygen is written in C++, and consists of around 300,000 source lines of code. For lexical analysis, the standard tool Lex (or its replacement Flex) is run via approximately 35,000 lines of lex script. The parsing tool Yacc (or its replacement Bison) is also used, but only for minor tasks; the bulk of language parsing is done by native C++ code. The build process is based on CMake and also involves some Python scripts.

This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
Bliptext is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation.

Edit article