Re: [gdome]RFC: Perl libgdome wrapper



On Sat, 13 Oct 2001, T.J. Mather wrote:

> Hi,
>
> I'm interested in implementing XML::GDOME, a Perl wrapper to the libgdome
> library.

Hi TJ. Looks like it's getting crowded here :-).

> Ideally most of the wrapper functions would be generated by
> an adaptation of the libgdome-ruby script that parses the DOM IDL
> Definitions.

I suppose you want to translate the script to perl, but if you intend to
use ruby for code creation you could simply add create_perl_code methods
to the IDL_* classes. They already have create_ruby_code and
create_cpp_code methods.

This is because code creation is implemented as a 2 stage process: first
the IDL is parsed, and its info is stored independent from the target
language in an object tree like this:

module-+-interfaces--+-methods
       +-constants   +-attributes
       +-(exception) +-constants

Then the module's create_*_code is invoked, and it traverses the tree as
appropriate for the target code.

You might want to start with the CVS version of the script, it has a few
readability improvements: Sourceforge, project "gdomemm", checkout
libgdome-wrappers.

As Paolo pointed out once, the user visible core interface of libgdome is
also automatically generated, there is an XML file in test/apigen
describing the interface. You may want to parse that instead of the
official IDL file.
While this introduces a chicken-egg problem, it also has an advantage: All
document loading and saving functionality is implementation specific and
thus not specified in the IDL file. I wrote the code to wrap these methods
by hand. But they are contained in this xml file!

> I look forward to seeing the new memory management functions - they
> will come in very handy for implementing this wrapper.

Bye, Tobias





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]