automated C++ binding generation.. Booost D, NO , Not us. SIMD is more important.

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Mar 16 20:34:24 PDT 2012


On 3/17/12, Brad Anderson <eco at gnuk.net> wrote:
> Could the wxc generator be be used as a base for building bindings for
> other libraries?

I hope it will be. It's kind of crazy that the first thing I'm using
it on is a huge library like wxD, this will likely be its biggest
unittest, so to speak. :p

Doxygen can be run on libraries with no documentation (there's a
switch for that), so it can extract the needed data for the generator.
Of course it depends how complex the library is, e.g. you can't run
doxygen directly on wxWidgets include files because they're very
complicated (it actually crashes doxygen), but this is why the wx devs
have created a separate set of interface files for doxygen.

> How about the XML D generator?

Sorry for not being clear, that part is not an xml D generator but an
xml extractor used for doxygen xml files. The process is the
following:

1. Extract as much information as possible from the doxygen xml files
and store them to various structs (I have
header/class/typedef/enum/etc structs).
2. Serialize the structs to json for the generator (this is a simple
toJson() call). I do this step so I don't have to re-run the xml
extractor every time I run the generator.
3. Run the generator, it deserializes the json files and gets all
those structs with information like classes, typedefs, enums,
parameter types, default values, etc. Then it generates the D code.

The xml extractor is about 1500 lines of code, and the D generator
about 2000 lines (with a few string-processing helper functions in
other modules), but this will be compacted later when I get rid of
various code duplication.


More information about the Digitalmars-d mailing list