← Back to team overview

dolfin team mailing list archive

Re: C++ header parser for generation of documentation

 

On 06/13/2012 09:08 PM, Anders Logg wrote:
Looks very useful. Can you add it as a blueprint?

  https://blueprints.launchpad.net/dolfin/+spec/use-cppheaderparser

It looks like it has problems parsing shared_ptr<Stuff> and some other template parameters. I think we need to evaluate the library just a bit more before moving on this one. The library is, however, just one file and open source, so if we are able to fix the issues and not allowed to push upstream, we can probably ship it with dolfin_utils or something.

Johan


--
Anders


On Wed, Jun 13, 2012 at 11:22:07AM +0200, Johan Hake wrote:
Hello!

Kristian implemented our own C++ header parser in python to extract
documentation and signatures. It is slow and for all I know not
complete.

I just found a recent python library, which seems to be fast (based
on David Beazely's ply implementation of a lex/yacc parser) and
pretty complete.

   http://sourceforge.net/projects/cppheaderparser

While I do not see any urgent need to re-implement Kristian's hard
work of extracting signatures and documentation to be piped to
Sphinx I think it should be considered for possible future work.

For a fast intro of the capability:

sudo apt-get install python-lex python-pip
pip install CppHeaderParser

cd $DOLFIN_DIR
python -c 'import CppHeaderParser;
CppHeaderParser.CppHeader("dolfin/mesh/Mesh.h").show()'

All classes and methods with documentation and complete signatures
are iterable.

Johan

_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp



References