Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

slanning (5049)

  (email not shown publicly)

Scott Lanning is currently working in Amsterdam at a hotel-booking company. The following interviews and commentaries are for entertainment only. The views and opinions expressed therein do not necessarily represent the views of his employer or even himself.

Journal of slanning (5049)

Wednesday September 19, 2007
07:30 AM


[ #34485 ]

For my current library-wrapping project, I want to automate more of the bindings generation. It's a C++ library, so I'm parsing C++ headers. At first I did that kind of manually, which wasn't pleasant. Then someone pointed me to gcc-xml, which does indeed parse the C++ headers and outputs an XML file. A 25MB XML file, in fact, for the particular headers I used it on. The XML file is fairly easy to figure out, though following (dereferencing) all the ID numbers pointing to other elements is tedious.

So, two purposes: 1) Let people who've never heard of gcc-xml know about it. 2) Ask if there is anything else people use to (help) parse C++ headers.

Third purpose: ultimately I'll only have a sloppy, one-off XSUB generator for my specific needs. I'm suggesting, then, that someone, like a university student with too much time and more l33t C++ and XS skillz than me, might find it an interesting project to look into generalizing this to automate generation of Perl bindings for any C++ library.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.