A general overview of my system:
As SWIG parses the interface file, it picks up any blobs of Doxygen Comments in its parse tree as another attribute of whatever node followed it. My current version of this in my branch is very rudimentary, but it succeeds for traditionally formatted comments.
While the proxy file is being written, the specific language module will interact with my own module in order to incorporate the translated comments.
Doxygen is parsed (via whatever means- I currently use a hand-parser and simple tokeniser, though Olly and I have discussed that there may be more sensible routes to take) and then placed in a tree of “Doxygen Entities”, for example
a comment of
/*! \brief function description
* \param x some random number
* \param y another random number
* return x divided by y
*/
may be in the parse tree, and this SPECIFIC comment blob is passed to my module.
The DoxygenTranslator class itself transforms this into a tree structure such as this:
node [Type: brief :: Content: function description]
node [Type: param :: Content : { tree containing [string :: x] [string :: some random number]}
node [Type: param :: Content : { tree containing [string :: y] [string :: another random number]}
node[Type: return :: Content: x divided by y]
Which is easily sorted, if need be (for example, JavaDoc wants all comments to be in a certain order) and then reproduced in another documentation language. I feel it is a fairly intuitive solution- for example its very easy to take a node [Type: b :: Content: BoldWord] and express it as < b > BoldWord < / b >. Likewise, it will hopefully be relatively easy to extend the converter to other documentation Languages- considering that a handful of tags are the majority of all Documentation Comments ( such as @param), a rudimentary converter for another language that just abandons the rarer tags would still be very effective.
Currently, I am beginning to write the javaDoc Convertor while also fixing bugs in the parser as I come across them. As soon as the javaDoc Module covers the most common tags (hopefully tomorrow!), I will be getting my SWIG work done- both making the system for detecting and placing comments in the parse tree more robust, and working with the Java module to find the best place to sew comments into the proxy file.