Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/doxygen-1.4.4/html/ drwxr-xr-x |
Viewing file: Select action/file-type: Doxygen's InternalsDoxygen's internalsNote that this section is still under construction! The following picture shows how source files are processed by doxygen.
![]() Data flow overview The following sections explain the steps above in more detail.
Config parser
The configuration file that controls the settings of a project is parsed and the settings are stored in the singleton class
Each configuration option has one of 5 possible types:
The function
C PreprocessorThe input files mentioned in the config file are (by default) fed to the C Preprocessor (after being piped through a user defined filter if available). The way the preprocessor works differs somewhat from a standard C Preprocessor. By default it does not do macro expansion, although it can be configured to expand all macros. Typical usage is to only expand a user specified set of macros. This is to allow macro names to appear in the type of function parameters for instance. Another difference is that the preprocessor parses, but not actually includes code when it encounters a #include (with the exception of #include found inside { ... } blocks). The reasons behind this deviation from the standard is to prevent feeding multiple definitions of the same functions/classes to doxygen's parser. If all source files would include a common header file for instance, the class and type definitions (and their documentation) would be present in each translation unit.
The preprocessor is written using
The preprocessor is invoked for each file using the
0x06 file name 1 0x06 preprocessed contents of file 1 ... 0x06 file name n 0x06 preprocessed contents of file n
Language parser
The preprocessed input buffer is fed to the language parser, which is implemented as a big state machine using
The task of the parser is to convert the input buffer into a tree of entries (basically an abstract syntax tree). An entry is defined in Possible improvements for future versions:
Data organizerThis step consists of many smaller steps, that build dictionaries of the extracted classes, files, namespaces, variables, functions, packages, pages, and groups. Besides building dictionaries, during this step relations (such as inheritance relations), between the extracted entities are computed.
Each step has a function defined in
The result of this step is a number of dictionaries, which can be found in the Doxygen "namespace" defined in
Tag file parser
If tag files are specified in the configuration file, these are parsed by a SAX based XML parser, which can be found in
Documentation parserSpecial comment blocks are stored as strings in the entities that they document. There is a string for the brief description and a string for the detailed description. The documentation parser reads these strings and executes the commands it finds in it (this is the second pass in parsing the documentation). It writes the result directly to the output generators. The parser is written in C++ and can be found in src/docparser.cpp. The tokens that are eaten by the parser come from src/doctokenizer.l. Code fragments found in the comment blocks are passed on to the source parser.
The main entry point for the documentation parser is
Source parserIf source browsing is enabled or if code fragments are encountered in the documentation, the source parser is invoked. The code parser tries to cross-reference to source code it parses with documented entities. It also does syntax highlighting of the sources. The output is directly written to the output generators.
The main entry point for the code parser is
Output generators
After data is gathered and cross-referenced, doxygen generates output in various formats. For this it uses the methods provided by the abstract class
To allow small deviations in what is written to the output for each concrete output generator, it is possible to temporarily disable certain generators. The OutputList class contains various The XML is generated directly from the gathered data structures. In the future XML will be used as an intermediate language (IL). The output generators will then use this IL as a starting point to generate the specific output formats. The advantage of having an IL is that various independently developed tools written in various languages, could extract information from the XML output. Possible tools could be:
Debugging
Since doxygen uses a lot of To make it easier to toggle debug information for a given flex file I wrote the following perl script, which automatically adds or removes -d from the correct line in the Makefile:
#!/usr/local/bin/perl $file = shift @ARGV; print "Toggle debugging mode for $file\n"; # add or remove the -d flex flag in the makefile unless (rename "Makefile.libdoxygen","Makefile.libdoxygen.old") { print STDERR "Error: cannot rename Makefile.libdoxygen!\n"; exit 1; } if (open(F,"<Makefile.libdoxygen.old")) { unless (open(G,">Makefile.libdoxygen")) { print STDERR "Error: opening file Makefile.libdoxygen for writing\n"; exit 1; } print "Processing Makefile.libdoxygen...\n"; while (<F>) { if ( s/\(LEX\) -P([a-zA-Z]+)YY -t $file/(LEX) -d -P\1YY -t $file/g ) { print "Enabling debug info for $file\n"; } elsif ( s/\(LEX\) -d -P([a-zA-Z]+)YY -t $file/(LEX) -P\1YY -t $file/g ) { print "Disabling debug info for $file\n"; } print G "$_"; } close F; unlink "Makefile.libdoxygen.old"; } else { print STDERR "Warning file Makefile.libdoxygen.old does not exist!\n"; } # touch the file $now = time; utime $now, $now, $file Generated on Mon Aug 15 08:38:58 2005 for Doxygen manual by ![]() |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0026 ]-- |