Doxygen c ++ comment string parser in python?

Does anyone know of a python module for parsing a comment line in C ++ for doxygen? I mean a line like this (simple example):

/** * A constructor. * A more elaborate description of the constructor. * @param param1 test1 * @param param2 test2 */ 

and I would like to extract a short description, detailed description, parameters, return value, etc. I am currently using string methods and regular expressions, but my solution is not very reliable. Alternatively, can anyone recommend an easy-to-use python parser lib that I can configure quickly?

Thank you in advance

+8
c ++ python parsing doxygen
Mar 04 '10 at 9:09
source share
2 answers

You may be able to install something using the SimpleParse module, but this requires creating an EBNF grammar, which may be more than you are interested in.

The Sphinx / Doxygen ( Breathe ) bridge uses the Doxygen xml output and acts instead. Perhaps a similar approach might work here - run Doxygen to retrieve formatted XML documents, and then use some code from Breathe to access the required data.

+4
Mar 16
source share

You should take a look at how doxygen is implemented to see how it handles parsing. I highly doubt that he uses regex.

+1
Mar 08
source share



All Articles