my name is Arno Rehn and I”m a bindings developer. I”m working mainly on the C# bindings for Qt and KDE together with Richard Dale.
Currently I”m also working on my gsoc project – Rewriting the SMOKE generator using one of Roberto Raggi”s C++ parsers.
SMOKE is a library which provides the possibility to dynamically call methods on classes. It is the foundation for many of the Qt/KDE bindings, like Ruby, C# and PHP.
The old generator for the SMOKE sources is based on a perl tool, kalyptus, and only works with a bunch of hacks in the code. It tends to break on new releases of Qt or KDE which introduce new features.
The goal of my project is to create a stable and robust tool, similar to the moc, which you just run on the headers of your project and you then end up with a bunch of source files that are the basis for bindings for your project.
Eventually I decided to use the new parser from KDevelop4, since that has a pretty convenient API (unlike the QtJambi / qtscriptgenerator one). It took some time to remove the KDevPlatform/KDevelop specific bits, though. It would”ve also been nice if I could”ve used the DUChain from KDevelop, but that seems to be so tightly integrated that I would have to provide half of KDevelop to use it.
I”m pretty much ahead of time – the generator is nearly finished. By the end of the GCDS, which I”m attending until Thursday, it should be working completely – at least with the Qt classes.
P.S.: I know that gsoc has started quite some time back, but I was really to lazy/busy to start a blog 😉
This sounds highly interesting to me. At least the parser part. I””ve tried to use the KDevelop parser once for the englishbreakfastnetwork but indeed you””ll need to provide half of kdevelop with it.
Could you give me [b.broeksema AT kdemail DOT net] a pointer to your stripped down version of the parser. I””m interested in having a look to see if we can add the DUChain code to that also.
The code is in /trunk/playground/bindings/smokegenerator in KDE””s svn. Since I couldn””t get the DUChain out of KDevelop, I wrote my own small type system. It””s by far not as complete as the DUChain is, but it has all the information about classes, which methods they have, fields, functions, etc… (except for templated stuff – we can””t wrap that anyway in SMOKE). If you””re interested in that as well, take a look at the top-level source files, i.e. generator*.[cpp|h] etc.
Maybe we can work together with the KDevelop people to make the parser and DUchain Qt-only and split it off KDevelop. At the moment there is a bunch of Roberto-Raggi-C++-parsers around – if we had one seperate Qt-only one that””s properly maintained we could unify them all.
Great work 🙂 If the generator is nearly finished, hopefully it will give you plenty of time to make a nice documentation on how to use it ;p
I hate C# ;-/
cool stuff, but i””m wondering why you””re not using the version I””m maintaing in the Qt Creator repository?
@Roberto: I actually didn””t know that Qt Creator uses your parser as well. That could””ve saved my a lot of work I guess. You maybe should consider doing seperate releases of that parser.
When I””ve finished my project with the KDevelop parser, I””ll try to replace it with the one from Qt Creator, then. That should make maintaining it a lot easier.
Thanks for the hint!
Just ask on kdevelop-devel what zwabel thinks about standalone DUChain.