[vtk-developers] More wrapper stuff

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri May 21 14:35:34 EDT 2010


On Thu, May 20, 2010 at 11:14 AM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi All,
>
> I've been playing around with the lex/yacc parser front-end to the
> wrappers.  At this point, I have a version that can parse all of the
> VTK class header files, including the parts that used to be blocked
> off by //BTX, //ETX.  The new parser more-or-less does the following:
>
> 1) parse all classes in the header file (though for now it only builds
> a FileInfo struct for the one that matches the filename)
> 2) parse templates (but throw away template info for now)
> 3) parse enums, typedefs, internal classes (but throw away the info for
> now)
> 4) parse scoped names, e.g. vtkSomeClass::InternalType as IDs
> 5) in general, it recognizes much more C++ syntax than the parser in VTK
>

This sounds great, especially if we could get rid of the BTX/ETX blocks, and
being able to wrap enums would allow us to improve type safety. Could we
then use those enum types in function declarations, and call that from all
wrapped languages?

>
> It's all based on the original VTK wrapper lex/yacc parser, just
> cleaned up a bit and beefed up substantially. If anyone wants to play
> with it, I have a VTK-to-XML converter at
> http://github.com/dgobbi/WrapVTK.  Eventually I'd like to get it to
> store enum and template info in the FileInfo structure but I have no
> timeline for that... my main goal here was to get it to parse more of
> the header files and eliminate the need for //BTX //ETX.
>

This sounds very promising. I will try to make some time to look through
this, it sounds like you are adding quite a few things from my own personal
wishlist. I would like to make a topic branch with your changes in it, see
how well they test out with all of the wrapped languages.

One thing I am not entirely clear on - is this support for all three wrapped
languages, or some subset of them? If it is not for all three, do you have a
feeling for how difficult it would be to extend it?

Thanks,

Marcus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100521/e10211f5/attachment.html>


More information about the vtk-developers mailing list