17doxygen Module
17.1Overview
The doxygen module provides measures to parse a document written in Doxygen syntax. To utilize it, import the doxygen module using import function.
+----------+ 1.. +-----------+ 1.. +------+
| document *------| structure *------| elem |
+----------+ +-----------+ +------+
+---------------+ 1 +---------+
| configuration *----| aliases |
+---------------+ +---------+
+----------+ +-------------------+
| renderer |<----| specific_renderer |
+----------+ +-------------------+
17.2doxygen.document Class
17.2.1Constructor
doxygen.document(stream?:stream, aliases?:doxygen.aliases, extracted?:boolean) {block?}
Reads a Doxygen document from stream and creates an instance of doxygen.document class.
The argument aliases is an instance that is available as a member of doxygen.configuration instance and contains information about command aliases, or custom commands in the other word.
In default, the parser expects the Doxygen document is written within C-style comments and extracts the document body from them before parsing. If the argument extracted is set to true, it exepcts the document already have been extracted from the comments.
If block is specified, it would be evaluated with a block parameter |doc:doxygen.document|, where doc is the created instance. In this case, the block's result would become the function's returned value.
17.2.2Method
The doxygen.document class provides following methods:
doxygen.document#structures() {block?}
Creates an iterator that returns instances of doxygen.structure contained in the doxygen.document.
In default, this returns an iterator as its result value. Specifying the following attributes would customize the returned value:
:iter.. An iterator. This is the default behavior.:xiter.. An iterator that eliminatesnilfrom its elements.:list.. A list.:xlist.. A list that eliminatesnilfrom its elements.:set.. A list that eliminates duplicated values from its elements.:xset.. A list that eliminates duplicated values andnilfrom its elements.
See the chapter of Mapping Process in Gura Language Manual for the detail.
If a block is specified, it would be evaluated repeatingly with block parameters |value, idx:number| where value is the iterated value and idx the loop index starting from zero. In this case, the last evaluated value of the block would be the result value. If one of the attributes listed above is specified, an iterator or a list of the evaluated value would be returned.
17.3doxygen.structure Class
17.3.1Property
The doxygen.structure instance has following properties:
doxygen.structure#aftermember … boolean [read-only]doxygen.structure#source … string [read-only]17.3.2Method
The doxygen.structure class provides following methods:
doxygen.structure#elems():map {block?}
Creates an iterator that returns doxygen.elem instances of all the elements contained in the structure.
In default, this returns an iterator as its result value. Specifying the following attributes would customize the returned value:
:iter.. An iterator. This is the default behavior.:xiter.. An iterator that eliminatesnilfrom its elements.:list.. A list.:xlist.. A list that eliminatesnilfrom its elements.:set.. A list that eliminates duplicated values from its elements.:xset.. A list that eliminates duplicated values andnilfrom its elements.
See the chapter of Mapping Process in Gura Language Manual for the detail.
If a block is specified, it would be evaluated repeatingly with block parameters |value, idx:number| where value is the iterated value and idx the loop index starting from zero. In this case, the last evaluated value of the block would be the result value. If one of the attributes listed above is specified, an iterator or a list of the evaluated value would be returned.
doxygen.structure#substructures() {block?}
Creates an iterator that returns doxygen.structure instances of sub structures contained in the structure.
In default, this returns an iterator as its result value. Specifying the following attributes would customize the returned value:
:iter.. An iterator. This is the default behavior.:xiter.. An iterator that eliminatesnilfrom its elements.:list.. A list.:xlist.. A list that eliminatesnilfrom its elements.:set.. A list that eliminates duplicated values from its elements.:xset.. A list that eliminates duplicated values andnilfrom its elements.
See the chapter of Mapping Process in Gura Language Manual for the detail.
If a block is specified, it would be evaluated repeatingly with block parameters |value, idx:number| where value is the iterated value and idx the loop index starting from zero. In this case, the last evaluated value of the block would be the result value. If one of the attributes listed above is specified, an iterator or a list of the evaluated value would be returned.
17.4doxygen.elem Class
17.4.1Method
The doxygen.elem class provides following methods:
doxygen.elem#print(indent?:number, out?:stream):map:voidout with an indentation level specified by indent that starts from zero. If out is omitted, the result would be put out to standard output.
doxygen.elem#render(renderer:doxygen.renderer):voiddoxygen.renderer.
17.5doxygen.configuration Class
17.5.1Property
The doxygen.configuration instance has following properties:
doxygen.configuration#aliases … doxygen.aliases [read-only]17.5.2Constructor
doxygen.configuration(stream?:stream) {block?}
Reads a configuration file, which is usually dubbed "Doxyfile", from stream and creates a doxygen.configuration instance.
If block is specified, it would be evaluated with a block parameter |cfg:doxygen.configuration|, where cfg is the created instance. In this case, the block's result would become the function's returned value.
17.5.3Method
The doxygen.configuration class provides following methods:
doxygen.configuration#get(tagname:string):map:[raise]
Returns a value associated with the tag specified by the argument tagname.
If the specified tag is not found, the method would return nil while it would cause an error in the case the attribute :raise is specified.
doxygen.configuration#print(out?:stream):map:voidout. If omitted, the result would be put out to standard output.
17.6doxygen.aliases Class
17.6.1Method
The doxygen.aliases class provides following methods:
doxygen.aliases#print(out?:stream):map:voidout. If the argument is omitted, the result would be put out to the standard output.
17.7doxygen.renderer Class
17.7.1Constructor
doxygen.renderer(out:stream, cfg:doxygen.configuration) {block?}
Creates a doxygen.renderer instance.
If block is specified, it would be evaluated with a block parameter |renderer:doxygen.renderer|, where renderer is the created instance. In this case, the block's result would become the function's returned value.