Doxygen html documentation updates and corrections
This commit is contained in:
parent
ef8d68c0ab
commit
73736c3b89
1 changed files with 161 additions and 139 deletions
|
|
@ -32,7 +32,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="#Doxygen_developer_details">Developer Information</a>
|
<li><a href="#Doxygen_developer_details">Developer Information</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Doxygen_module_design">Module Design</a>
|
<li><a href="#Doxygen_translator_design">Doxygen Translator Design</a>
|
||||||
<li><a href="#Doxygen_debugging_commands">Debugging Doxygen parser and translator</a>
|
<li><a href="#Doxygen_debugging_commands">Debugging Doxygen parser and translator</a>
|
||||||
<li><a href="#Doxygen_debugging_commands">Tests</a>
|
<li><a href="#Doxygen_debugging_commands">Tests</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -50,28 +50,20 @@ documentation language. Currently only Javadoc and Pydoc is
|
||||||
supported.
|
supported.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_translation_overview"></a>39.1 Doxygen Translation Overview</H2>
|
<H2><a name="Doxygen_translation_overview"></a>39.1 Doxygen translation overview</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Doxygen Translation Module of SWIG is an ongoing effort from
|
The Doxygen Translation module of SWIG adds an extra layer of
|
||||||
a <A HREF ="http://code.google.com/soc/2008/">Google Summer of
|
functionality to SWIG, allowing automated translation of <a href=
|
||||||
Code</A> proposal from Summer 2008. It adds an extra layer of
|
"http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> formatted comments
|
||||||
functionality to SWIG, allowing automated translation of <A HREF=
|
|
||||||
"http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> formatted comments
|
|
||||||
from input files into a documentation language more suited for the
|
from input files into a documentation language more suited for the
|
||||||
target language. Currently this module only translates into Javadoc
|
target language. Currently this module only translates into Javadoc
|
||||||
and Pydoc for the SWIG Java and Python Modules, but other
|
and Pydoc for the SWIG Java and Python modules.
|
||||||
extensions are to be added in time.
|
Other extensions could be added at a later date.
|
||||||
</p>
|
The Doxygen Translation module originally started as
|
||||||
|
a <a href="http://code.google.com/soc/2008/">Google Summer of
|
||||||
<p>
|
Code</a> proposal from Summer 2008.
|
||||||
Questions about running SWIG are best answered in
|
|
||||||
the <a href="SWIG.html#SWIG">SWIG Basics</a> chapter as well as the
|
|
||||||
target language modules. (For now, only <A href = "Java.html">Java</A>
|
|
||||||
and <A href = "Python.html">Python</A>). The behaviour of this
|
|
||||||
functionality is wildly unpredictable if the interface file is not
|
|
||||||
proper to begin with!
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_file_preparation"></a>39.2 Preparations</H2>
|
<H2><a name="Doxygen_file_preparation"></a>39.2 Preparations</H2>
|
||||||
|
|
@ -79,32 +71,24 @@ proper to begin with!
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To make use of the comment translation system, your documentation
|
To make use of the comment translation system, your documentation
|
||||||
comments must be in properly formatted <A HREF=
|
comments must be in properly formatted <a href=
|
||||||
"http://www.stack.nl/~dimitri/doxygen/">Doxygen.</A> They can be
|
"http://www.stack.nl/~dimitri/doxygen/">Doxygen.</a> Doxygen comments can be
|
||||||
present in your main interface file or any header file that it
|
present in your main SWIG interface file or any header file that it
|
||||||
imports. It is advised that you are certain your comments compile
|
imports. You are advised to be validate that your comments compile
|
||||||
properly with Doxygen before you try to translate them. Doxygen
|
properly with Doxygen before you try to translate them. Doxygen
|
||||||
itself is a deeper tool and can provide you better feedback for
|
itself is a more comprehensive tool and can provide you better feedback for
|
||||||
correcting any syntax errors that may be present. Please look at
|
correcting any syntax errors that may be present. Please look at
|
||||||
Doxygen's <A HREF =
|
Doxygen's <a href=
|
||||||
"http://www.stack.nl/~dimitri/doxygen/docblocks.html"> Documenting the
|
"http://www.stack.nl/~dimitri/doxygen/docblocks.html"> Documenting the
|
||||||
code</A> for proper specifications for comment format. However, SWIG's
|
code</a> for the full comment format specifications. However, SWIG's
|
||||||
Doxygen parser will still point you most of errors and warnings found
|
Doxygen parser will still report many errors and warnings found
|
||||||
in comments (like unterminated strings or missing ending tags).
|
in comments (like unterminated strings or missing ending tags).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
|
||||||
/*! This is describing class Shape
|
|
||||||
\author Bob
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Shape {
|
|
||||||
</pre></div>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Currently, the whole subset of Doxygen comment styles is supported
|
Currently, the whole subset of Doxygen comment styles is supported
|
||||||
(See <A HREF = "http://www.stack.nl/~dimitri/doxygen/docblocks.html">
|
(See <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html">
|
||||||
Documenting the code</A>). Here they are:
|
Documenting the code</a>). Here they are:
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
/**
|
/**
|
||||||
|
|
@ -124,20 +108,20 @@ Documenting the code</A>). Here they are:
|
||||||
<p>
|
<p>
|
||||||
Also any of the above with '<' added after comment-starting symbol,
|
Also any of the above with '<' added after comment-starting symbol,
|
||||||
like <i>/**<, /*!<, ///<, </i> or <i> //!<</i> will be
|
like <i>/**<, /*!<, ///<, </i> or <i> //!<</i> will be
|
||||||
treated as post-comment and will be assigned to the node before the
|
treated as a post-comment and will be assigned to the code before the
|
||||||
comment.
|
comment.
|
||||||
<br>
|
|
||||||
|
|
||||||
Any number of '*' or '/' in Doxygen comment is considered to be a
|
Any number of '*' or '/' within a Doxygen comment is considered to be a
|
||||||
separator and is not included in final comment, so you may safely use
|
separator and is not included in the final comment, so you may safely use
|
||||||
comments like <i>/*********/</i> or <i>//////////</i>.
|
comments like <i>/*********/</i> or <i>//////////</i>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Please note, as SWIG parses input file by itself with strict grammar,
|
Please note, as SWIG parses the input file by itself with strict grammar,
|
||||||
there is only a limited support for various cases of comment placement
|
there is only a limited support for various cases of comment placement
|
||||||
in the file.
|
in the file.
|
||||||
<br>
|
<p>
|
||||||
|
</p>
|
||||||
Comments can be placed before C/C++ expressions on separate lines:
|
Comments can be placed before C/C++ expressions on separate lines:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -192,15 +176,13 @@ enum E_NUMBERS
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Just remember, if SWIG shows syntax error parsing the file because of
|
Currently only comments directly before or after the code items
|
||||||
your comment, try to move it in some other, 'safer' place as described
|
are supported. Doxygen also supports comments containing structural commands,
|
||||||
above.
|
where the comments for a code item are not put directly before or after the code item.
|
||||||
<br>
|
These structural commands are stripped out by SWIG and are not assigned to anything.
|
||||||
Also, currently only the comments directly before or after the nodes
|
|
||||||
are supported. Doxygen structural comments are stripped out and not
|
|
||||||
assigned to anything.
|
|
||||||
</p>
|
</p>
|
||||||
<H3><a name="Doxygen_running_swig"></a>39.2.1 Enabling Doxygen Translation</H3>
|
|
||||||
|
<H3><a name="Doxygen_running_swig"></a>39.2.1 Enabling Doxygen translation</H3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Doxygen comments translation is disabled by default and needs to be explicitly
|
Doxygen comments translation is disabled by default and needs to be explicitly
|
||||||
|
|
@ -208,7 +190,7 @@ enabled using the command line <tt>-doxygen</tt> switch for the languages that
|
||||||
do support it (currently Java and Python).
|
do support it (currently Java and Python).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_features"></a>39.2.2 Doxygen-specific %feature Directives</H3>
|
<H3><a name="Doxygen_features"></a>39.2.2 Doxygen-specific %feature directives</H3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Translation of Doxygen comments is influenced by the following <a
|
Translation of Doxygen comments is influenced by the following <a
|
||||||
|
|
@ -240,7 +222,7 @@ ALIASES = "sideeffect=\par Side Effects:\n"
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Then you could also the same expansion for SWIG with:
|
Then you could also specify the same expansion for SWIG with:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
|
|
@ -275,13 +257,19 @@ wrappers of the C++ API.
|
||||||
<h4>doxygen:ignore:<command-name></h4>
|
<h4>doxygen:ignore:<command-name></h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This feature allows to just ignore an unknown Doxygen command, instead of
|
This feature makes it possible to just ignore an unknown Doxygen command, instead of
|
||||||
replacing it with a predefined text as <tt>doxygen:alias</tt> features allows to
|
replacing it with the predefined text that <tt>doxygen:alias</tt> does.
|
||||||
do. For example, you could use
|
For example, you could use
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
%feature("doxygen:ignore:transferfull");
|
%feature("doxygen:ignore:transferfull") Fantastic();
|
||||||
|
/**
|
||||||
|
A fantastic function.
|
||||||
|
|
||||||
|
@transferfull Command ignored, but anything here is still included.
|
||||||
|
*/
|
||||||
|
int * Fantastic() { }
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -303,11 +291,19 @@ feature directive:
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
// Ignore occurrences of
|
// Ignore occurrences of
|
||||||
//
|
//
|
||||||
// @compiler-options Some special C++ compiler options.
|
// @compileroptions Some special C++ compiler options.
|
||||||
//
|
//
|
||||||
// in Doxygen comments as C++ options are not interested for the target language
|
// in Doxygen comments as C++ options are not interesting for the target language
|
||||||
// developers.
|
// developers.
|
||||||
%feature("doxygen:ignore:compileroptions", range="line");
|
%feature("doxygen:ignore:compileroptions", range="line") Amazing();
|
||||||
|
|
||||||
|
/**
|
||||||
|
An amazing function.
|
||||||
|
|
||||||
|
@compileroptions This function must be compiled with /EHa when using MSVC.
|
||||||
|
*/
|
||||||
|
void Amazing();
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -319,6 +315,14 @@ tags can also be ignored using the special value of <tt>range</tt> starting with
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
%feature("doxygen:ignore:forcpponly", range="end"); // same as "end:endforcpponly"
|
%feature("doxygen:ignore:forcpponly", range="end"); // same as "end:endforcpponly"
|
||||||
|
/**
|
||||||
|
An incredible function.
|
||||||
|
|
||||||
|
@forcpponly
|
||||||
|
This is C++-specific.
|
||||||
|
@endforcpponly
|
||||||
|
*/
|
||||||
|
void Incredible();
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -338,6 +342,15 @@ themselves should be ignored, but their contents should be parsed as usual and
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
%feature("doxygen:ignore:beginPythonOnly", range="end:endPythonOnly", contents="parse");
|
%feature("doxygen:ignore:beginPythonOnly", range="end:endPythonOnly", contents="parse");
|
||||||
|
/**
|
||||||
|
A splendid function.
|
||||||
|
|
||||||
|
@beginPythonOnly
|
||||||
|
This is specific to @b Python.
|
||||||
|
@endPythonOnly
|
||||||
|
*/
|
||||||
|
void Splendid();
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -371,7 +384,7 @@ then the following C++ Doxygen comment:
|
||||||
|
|
||||||
@compileroptions This function must be compiled with /EHa when using MSVC.
|
@compileroptions This function must be compiled with /EHa when using MSVC.
|
||||||
*/
|
*/
|
||||||
void func();
|
int * Contrived();
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -391,7 +404,7 @@ def func():
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
||||||
<h4>doxygen:nolinkranslate (Java-only currently)</h4>
|
<h4>doxygen:nolinktranslate (Java-only currently)</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Turn off automatic link-objects translation.
|
Turn off automatic link-objects translation.
|
||||||
|
|
@ -406,14 +419,14 @@ Doxygen commands if the parameter is not found in the function signature.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<H3><a name="Doxygen_additional_options"></a>39.2.3 Additional Command Line Options</H3>
|
<H3><a name="Doxygen_additional_options"></a>39.2.3 Additional command line options</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
ALSO TO BE ADDED (Javadoc auto brief?)
|
ALSO TO BE ADDED (Javadoc auto brief?)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_to_javadoc"></a>39.3 Doxygen To Javadoc</H2>
|
<H2><a name="Doxygen_to_javadoc"></a>39.3 Doxygen to Javadoc</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -422,7 +435,7 @@ automatically placed in the correct locations in the resulting module
|
||||||
and proxy files.
|
and proxy files.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_basic_example"></a>39.3.1 Basic Example</H3>
|
<H3><a name="Doxygen_basic_example"></a>39.3.1 Basic example</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -505,42 +518,41 @@ public class Shape {
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The code Java-wise should be identical to what would have been
|
The code Java-wise should be identical to what would have been
|
||||||
generated without this feature enabled. When the Doxygen Translator
|
generated without the doxygen functionality enabled. When the Doxygen Translator
|
||||||
Module encounters a comment it finds nothing useful in or cannot
|
module encounters a comment that contains nothing useful or a doxygen comment that it cannot
|
||||||
parse, it should not effect the functionality of the SWIG generated
|
parse, it will not affect the functionality of the SWIG generated
|
||||||
code.
|
code.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Javadoc translator will handle most of the tags conversions (see the
|
The Javadoc translator will handle most of the tags conversions (see the
|
||||||
table below). It will also automatically translate link-objects
|
table below). It will also automatically translate link-objects
|
||||||
params, in \see and \link...\endlink commands. For example,
|
params, in \see and \link...\endlink commands. For example,
|
||||||
'someFunction(std::string)' will be converted to
|
'someFunction(std::string)' will be converted to
|
||||||
'someFunction(String)'. If this works not really good for you, or if
|
'someFunction(String)'. If
|
||||||
you don't want such behaviour, you could turn this off by using
|
you don't want such behaviour, you could turn this off by using the
|
||||||
'doxygen:nolinktranslate' feature. Also all '\param' and '\tparam'
|
'doxygen:nolinktranslate' feature. Also all '\param' and '\tparam'
|
||||||
commands are stripped out, if specified parameter is not present in
|
commands are stripped out, if the specified parameter is not present in
|
||||||
function. Use 'doxygen:nostripparams' to avoid.
|
the function. Use 'doxygen:nostripparams' to avoid.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Javadoc translator features summary
|
Javadoc translator features summary
|
||||||
(see <a href="Customization.html#Customization_features">%feature
|
(see <a href="Customization.html#Customization_features">%feature
|
||||||
directives</a>):
|
directives</a>):
|
||||||
<br>
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_javadoc_tags"></a>39.3.2 Javadoc Tags</H3>
|
<H3><a name="Doxygen_javadoc_tags"></a>39.3.2 Javadoc tags</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Here is the list of all Doxygen tags and the description of how they are translated to Javadoc
|
Here is the list of all Doxygen tags and the description of how they are translated to Javadoc
|
||||||
<br>
|
|
||||||
<b>Doxygen tags:</b>
|
|
||||||
</p>
|
</p>
|
||||||
<div class="diagram"><pre>
|
<div class="diagram"><pre>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<th id="Doxygen Tags Java" align="left">Doxygen tags</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\a</td>
|
<td>\a</td>
|
||||||
<td>wrapped with <i> html tag</td>
|
<td>wrapped with <i> html tag</td>
|
||||||
|
|
@ -792,15 +804,17 @@ Here is the list of all Doxygen tags and the description of how they are transla
|
||||||
Doxygen has a wealth of tags such as @latexonly that have no
|
Doxygen has a wealth of tags such as @latexonly that have no
|
||||||
equivalent in Javadoc (all supported tags are listed in
|
equivalent in Javadoc (all supported tags are listed in
|
||||||
<a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
|
<a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
|
||||||
As a result several tags that have no
|
As a result several tags have no
|
||||||
translation (or particular use, such as some linking and section tags)
|
translation or particular use, such as some linking and section tags.
|
||||||
are suppressed with their content just printed out (if it has any
|
These are suppressed with their content just printed out (if the tag has any
|
||||||
sense, typically text content).
|
sense, typically text content).
|
||||||
<br>
|
|
||||||
Here is the list of these tags:
|
Here is the list of these tags:
|
||||||
</p>
|
</p>
|
||||||
<div class="diagram"><pre>
|
<div class="diagram"><pre>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<th id="Unsupported Doxygen Tags Java" align="left">Unsupported Doxygen tags</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\addindex</td>
|
<td>\addindex</td>
|
||||||
<td>\addtogroup</td>
|
<td>\addtogroup</td>
|
||||||
|
|
@ -956,6 +970,9 @@ comment, the whole comment block is ignored:
|
||||||
</p>
|
</p>
|
||||||
<div class="diagram"><pre>
|
<div class="diagram"><pre>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<th id="Ignored Doxygen Tags" align="left">Ignored Doxygen tags</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\addtogroup</td>
|
<td>\addtogroup</td>
|
||||||
<td>\callgraph</td>
|
<td>\callgraph</td>
|
||||||
|
|
@ -1016,25 +1033,25 @@ comment, the whole comment block is ignored:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<H3><a name="Doxygen_further_details"></a>39.3.4 Further Details</H3>
|
<H3><a name="Doxygen_further_details"></a>39.3.4 Further details</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
TO BE ADDED.
|
TO BE ADDED.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_to_pydoc"></a>39.4 Doxygen To Pydoc</H2>
|
<H2><a name="Doxygen_to_pydoc"></a>39.4 Doxygen to Pydoc</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If translation is enabled, Pydoc formatted comments should be
|
If translation is enabled, Pydoc formatted comments should be
|
||||||
automatically placed in the correct locations in the resulting module
|
automatically placed in the correct locations in the resulting module
|
||||||
and proxy files. The problem is that Pydoc has no tag mechanism like
|
and proxy files. The problem is that Pydoc has no tag mechanism like
|
||||||
Doxygen or Javadoc, so most of Doxygen commands are translated as
|
Doxygen or Javadoc, so most of Doxygen commands are translated by merely
|
||||||
English plain text pieces.
|
copying the appropriate command text.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_python_basic_example"></a>39.4.1 Basic Example</H3>
|
<H3><a name="Doxygen_python_basic_example"></a>39.4.1 Basic example</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1114,9 +1131,13 @@ their description is copied into the generated output using
|
||||||
*/
|
*/
|
||||||
bool SetBreakpoint(const char* filename, int line_number);
|
bool SetBreakpoint(const char* filename, int line_number);
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
<p>
|
||||||
would be translated to
|
would be translated to
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
def SetBreakpoint(*args):
|
def SetBreakpoint(filename, line_number):
|
||||||
r"""
|
r"""
|
||||||
Set a breakpoint at the given location.
|
Set a breakpoint at the given location.
|
||||||
|
|
||||||
|
|
@ -1127,7 +1148,7 @@ def SetBreakpoint(*args):
|
||||||
"""
|
"""
|
||||||
</pre></div>
|
</pre></div>
|
||||||
<p>
|
<p>
|
||||||
The types used for the parameter documentation come from <tt>doctype</tt> typemap which
|
The types used for the parameter documentation come from the "doctype" typemap which
|
||||||
is defined for all the primitive types and a few others (e.g. <tt>std::string</tt> and
|
is defined for all the primitive types and a few others (e.g. <tt>std::string</tt> and
|
||||||
<tt>shared_ptr<T></tt>) but for non-primitive types is taken to be just the C++
|
<tt>shared_ptr<T></tt>) but for non-primitive types is taken to be just the C++
|
||||||
name of the type with namespace scope delimiters (<tt>::</tt>) replaced with a dot. To
|
name of the type with namespace scope delimiters (<tt>::</tt>) replaced with a dot. To
|
||||||
|
|
@ -1138,12 +1159,12 @@ change this, you can define your own typemaps for the custom types, e.g:
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Currently Doxygen comments assigned to vars are not present in proxy
|
Currently Doxygen comments assigned to global variables and static member variables
|
||||||
file, so they have no comment translated for them.
|
are not present in generated code, so they have no comment translated for them.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<b>Whitespace and tables</b><br>
|
<b>Whitespace and tables</b>
|
||||||
Whitespace is preserved when translating comments, so it makes
|
Whitespace is preserved when translating comments, so it makes
|
||||||
sense to have Doxygen comments formatted in a readable way. This
|
sense to have Doxygen comments formatted in a readable way. This
|
||||||
includes tables, where tags <th>, <td> and </tr>are translated
|
includes tables, where tags <th>, <td> and </tr>are translated
|
||||||
|
|
@ -1176,13 +1197,14 @@ translates to Python as:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<b>Overloaded functions</b><br>
|
<b>Overloaded functions</b>
|
||||||
Since all the overloaded functions in c++ are wrapped into one Python
|
Since all the overloaded functions in c++ are wrapped into one Python
|
||||||
function, Pydoc translator will combine every comment of every
|
function, Pydoc translator will combine every comment of every
|
||||||
overloaded function and put it in the comment for wrapping function.
|
overloaded function and put it into the comment for the one wrapper function.
|
||||||
<br>
|
</p>
|
||||||
If you intend to use resulting proxy files with Doxygen docs
|
<p>
|
||||||
generator, rather than Pydoc, you may want to turn off translator
|
If you intend to use resulting generated Python file with the Doxygen docs
|
||||||
|
generator, rather than Pydoc, you may want to turn off translation
|
||||||
completely (doxygen:notranslate feature). Then SWIG will just copy
|
completely (doxygen:notranslate feature). Then SWIG will just copy
|
||||||
the comments to the proxy file and reformat them if needed, but all
|
the comments to the proxy file and reformat them if needed, but all
|
||||||
the comment content will be left as is. As Doxygen doesn't support
|
the comment content will be left as is. As Doxygen doesn't support
|
||||||
|
|
@ -1198,11 +1220,12 @@ to do the work.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Here is the list of all Doxygen tags and the description of how they are translated to Pydoc
|
Here is the list of all Doxygen tags and the description of how they are translated to Pydoc
|
||||||
<br>
|
|
||||||
<b>Doxygen tags:</b>
|
|
||||||
</p>
|
</p>
|
||||||
<div class="diagram"><pre>
|
<div class="diagram"><pre>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<th id="Doxygen Tags Python" align="left">Doxygen tags</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\a</td>
|
<td>\a</td>
|
||||||
<td>wrapped with '_'</td>
|
<td>wrapped with '_'</td>
|
||||||
|
|
@ -1415,11 +1438,13 @@ equivalent in Pydoc. As a result several tags that have no
|
||||||
translation (or particular use, such as some linking and section tags)
|
translation (or particular use, such as some linking and section tags)
|
||||||
are suppressed with their content just printed out (if it has any
|
are suppressed with their content just printed out (if it has any
|
||||||
sense, typically text content).
|
sense, typically text content).
|
||||||
<br>
|
|
||||||
Here is the list of these tags:
|
Here is the list of these tags:
|
||||||
</p>
|
</p>
|
||||||
<div class="diagram"><pre>
|
<div class="diagram"><pre>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
|
<tr>
|
||||||
|
<th id="Unsupported Doxygen Tags Python" align="left">Unsupported Doxygen tags</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>\addindex</td>
|
<td>\addindex</td>
|
||||||
<td>\addtogroup</td>
|
<td>\addtogroup</td>
|
||||||
|
|
@ -1588,26 +1613,26 @@ Here is the list of these tags:
|
||||||
</table>
|
</table>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<H3><a name="Doxygen_python_further_details"></a>39.4.4 Further Details</H3>
|
<H3><a name="Doxygen_python_further_details"></a>39.4.4 Further details</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
TO BE ADDED.
|
TO BE ADDED.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_developer_details"></a>39.5 Developer Information</H2>
|
<H2><a name="Doxygen_developer_details"></a>39.5 Developer information</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_module_design"></a>39.5.1 Module Design</H3>
|
<H3><a name="Doxygen_translator_design"></a>39.5.1 Doxygen translator design</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If this functionality is turned on, SWIG places all comments found
|
If this functionality is turned on, SWIG places all comments found
|
||||||
into the SWIG parse tree. Nodes contain an additional attribute
|
into the SWIG parse tree. Nodes contain an additional attribute
|
||||||
called DoxygenComment when a comment is present. Individual nodes
|
called <tt>doxygen</tt> when a comment is present. Individual nodes
|
||||||
containing Doxygen with Structural Indicators, such as @file, as their
|
containing Doxygen with Structural Indicators, such as @file, as their
|
||||||
first command, are also present in the parse tree. These individual
|
first command, are also present in the parse tree. These individual
|
||||||
"blobs" of Doxygen such as :
|
"blobs" of Doxygen such as :
|
||||||
|
|
@ -1621,13 +1646,13 @@ first command, are also present in the parse tree. These individual
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
are passed on individually to the DoxygenTranslator Module. This
|
are passed on individually to the Doxygen Translator module. This
|
||||||
module builds its own private parse tree and hands it to a separate
|
module builds its own private parse tree and hands it to a separate
|
||||||
class for translation into the target documentation language. For
|
class for translation into the target documentation language. For
|
||||||
example, <tt>JavaDocConverter</tt> is the Javadoc module class.
|
example, <tt>JavaDocConverter</tt> is the Javadoc module class.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_debugging_commands"></a>39.5.2 Debugging Doxygen parser and translator</H3>
|
<H3><a name="Doxygen_debugging_commands"></a>39.5.2 Debugging the Doxygen parser and translator</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1644,58 +1669,55 @@ detailed debug information printing.
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This part of SWIG currently has 6 runtime tests in both Java and Python.
|
Doxygen tests have been added to the regular SWIG test-suite.
|
||||||
|
There are a number of tests beginning <tt>doxygen_</tt> in the Examples/test-suite sub-directory.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Like any other SWIG test case, the tests are included in Examples/test-suite/common.mk and can be tested with
|
||||||
|
commands like <tt>make check-test-suite</tt> or <tt>make check-python-test-suite</tt>.
|
||||||
|
To run them individually, type
|
||||||
|
<tt>make -s <testname>.cpptest</tt> in the language-specific sub-directory in
|
||||||
|
<tt>Examples/test-suite</tt> directory. For example:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="shell"><pre>
|
<div class="shell"><pre>
|
||||||
doxygen_parsing
|
Examples/test-suite/java $ make -s doxygen_parsing.cpptest
|
||||||
doxygen_translate
|
|
||||||
doxygen_translate_all_tags
|
|
||||||
doxygen_basic_translate
|
|
||||||
doxygen_basic_notranslate
|
|
||||||
doxygen_translate_links
|
|
||||||
doxygen_misc_constructs
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
All this tests are included in common.mk and are built with the
|
|
||||||
commands like 'make check-test-suite' or 'make
|
|
||||||
check-python-test-suite'. To run them individually, type
|
|
||||||
<code>make <testname>.cpptest -s</code> in the language-specific subdir in
|
|
||||||
<code>Examples/test-suite</code> directory. For example:
|
|
||||||
<pre>
|
|
||||||
Examples/test-suite/java $ make doxygen_misc_constructs.cpptest -s
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
If the test fails, both expected and translated comments are printed to
|
If the test fails, both expected and translated comments are printed to
|
||||||
std out, but also written to files <i>expected.txt</i>
|
std out, but also written to files <i>expected.txt</i>
|
||||||
and <I>got.txt</I>. Since it is often difficult to find a single
|
and <i>got.txt</i>. Since it is often difficult to find a single
|
||||||
character difference in several lines of text, we can use some diff
|
character difference in several lines of text, we can use some diff
|
||||||
tool, for example:
|
tool, for example:
|
||||||
<pre>
|
</p>
|
||||||
|
|
||||||
|
<div class="shell"><pre>
|
||||||
Examples/test-suite/java $ kdiff3 expected.txt got.txt
|
Examples/test-suite/java $ kdiff3 expected.txt got.txt
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
<br>
|
|
||||||
Runtime tests in Java are implemented using Javadoc doclets. To make that work, you
|
Runtime tests in Java are implemented using Javadoc doclets. To make that work, you
|
||||||
should have tools.jar from the JDK in your classpath. Or you should have JAVA_HOME
|
should have tools.jar from the JDK in your classpath. Or you should have JAVA_HOME
|
||||||
environmental var defined and pointing to the JDK location.
|
environment variable defined and pointing to the JDK location.
|
||||||
<br>
|
</p>
|
||||||
|
<p>
|
||||||
The Java's comment parsing code (the testing part) is located in commentParser.java.
|
The Java's comment parsing code (the testing part) is located in commentParser.java.
|
||||||
You may see it to understand how the checking process works. There is also a possibility
|
It checks the generated code. It is possible
|
||||||
to run that file as stand-alone program, with 'java commentParser <some java package>',
|
to run this file as a stand-alone program, with <tt>java commentParser <some java package></tt>,
|
||||||
and it will print the list of comments found in the specified directory (in the format it's used
|
and it will print the list of comments found in the specified directory (in the format it has used
|
||||||
in runtime tests). So, when you want to create the new test of Doxygen comment translator,
|
in the runtime tests). So, when you want to create a new Doxygen test case,
|
||||||
just copy any existing one, and replace the actual comment content (section of entries in
|
just copy an existing one and replace the actual comment content (section of entries in
|
||||||
form 'wantedComments.put(...)' with the output of the above command.
|
form 'wantedComments.put(...)' with the output of the above command.
|
||||||
<br>
|
</p>
|
||||||
Runtime tests in Python are just plain strings comparison with the use of __doc__
|
<p>
|
||||||
|
Runtime tests in Python are just plain string comparisons of the __doc__
|
||||||
properties.
|
properties.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_language_extension"></a>39.6 Extending to Other Languages</H2>
|
<H2><a name="Doxygen_language_extension"></a>39.6 Extending to other languages</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1705,7 +1727,7 @@ The basic gist is that anywhere a comment may reside on a node, there needs to b
|
||||||
The other half of extension is building a target documentation language comment generator that handles one blob at a time.
|
The other half of extension is building a target documentation language comment generator that handles one blob at a time.
|
||||||
However, this is relatively simple and nowhere near as complex as the wrapper generating modules in SWIG.
|
However, this is relatively simple and nowhere near as complex as the wrapper generating modules in SWIG.
|
||||||
See DoxygenTranslator/JavaDocConverter.cpp for a good example.
|
See DoxygenTranslator/JavaDocConverter.cpp for a good example.
|
||||||
The target language module hands the DoxygenTranslator the blob to translate, and receives back a translated text.
|
The target language module passes the Doxygen Translator the blob to translate, and receives back the translated text.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b> What is given to the Doxygen Translator</b>
|
<b> What is given to the Doxygen Translator</b>
|
||||||
|
|
@ -1728,7 +1750,7 @@ The target language module hands the DoxygenTranslator the blob to translate, an
|
||||||
* @return Foo
|
* @return Foo
|
||||||
*/
|
*/
|
||||||
</pre></div>
|
</pre></div>
|
||||||
<p> Development of the comment translator itself is simplified by the fact that the DoxygenTranslator module can easily include a <tt>main</tt> function and thus be developed, compiled, and tested independently of SWIG.
|
<p> Development of the comment translator itself is simplified by the fact that the Doxygen Translator module can easily include a <tt>main</tt> function and thus be developed, compiled, and tested independently of SWIG.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue