[Kde-bindings] Refactoring kalyptus

Caleb Tennis caleb at aei-tech.com
Wed Dec 7 16:02:42 UTC 2005


> I think the problem is that sometimes you want the macros before they are
> pre-processed, and you also want to be able to get the comments for
> language bindings. For instance, I convert the KDE C++ style doc comments
> to javadoc ones for the KDE java bindings, and I'd like to convert them to
> RDOC ones for ruby. Another possibility is to use the xml format produced
> by the gcc translation unit dump. The disadvantages of that are that it is
> gcc specific, and so I think you would need to generate the bindings and
> check the generated code into the svn - it couldn't be generated by the
> 'make' command as the Smoke lib is now.

Ahh, I wasn't aware of the comment translation.  I was looking a bit yesterday 
at the gcc translation dump, trying to follow some of Ashley's work around 
gccxml.  One thing I noticed from the gcc mailing lists is that the 
translation dump isn't particularly well defined, in so much as the ABI can 
change at anytime.  That seemed a bit perturbing.  As well, I figured some 
people may be using other compilers, such as ICC.  That left me in a quandry 
that I figured people much smarter than I would have to figure out.

> I think my personal 'plan A' for a better C++ parser would be to use the
> one that Roberto Raggi is developing for KDevelop 4/KDE 4. That is what
> Trolltech are using for their Qt4 java bindings, although I don't know
> anything else about their approach as they're doing it 'behind closed
> doors' as a commercial product (although I assume will also be GPL'd). I'll
> cc this to the kdevelop-devel list as I regard language bindings work as
> part of creating RAD environments, and they aren't much use without
> suitable IDE's to go with them, and there are C++ parsing issues that the
> projects have in common.

That sounds good to me.  I figure right now you're the driving force behind 
this, and you probably know the most about it - but I wasn't sure your level 
of involvement with it forward.  I was going to try and take a few baby 
steps, but if you're still actively moving forward I'd rather work on them 
with you as I can.

> As well as a parser for bindings generation, you need to build a symbol
> table, and you need a means of transforming the abstract syntax tree from
> the parser in powerful ways. People underestimate how difficult it is to
> write a C++ parser, as well as not realising it is only solves about 25% of
> the technical problem is producing language bindings. Hence, the very few
> successful efforts to produce complete, finished Qt/KDE bindings..

I think that's apparent by the lack of any real technical material following a 
google search.  It seems right now a gcc dump is about the best parser you're 
going to find, though I haven't looked at Roberto's work yet to make a 
comparison.

Caleb



More information about the Kde-bindings mailing list