KDevelop-PG Qt

November 25, 2007 at 2:28 am | Posted in KDevelop | 2 Comments

The last two days I’ve spent hacking on KDevelop-PG, the parser generator originally written by Roberto Raggi and used for forthcoming QMake, Python and Ruby support in KDevelop4.

There are basically two changes I’ve done, change from STL like class and method names to Qt-ish and change the container classes and similar things to use Qt classes – both for the kdevelop-pg code and the code it generates for your gramar. Most important reasoning for this is maintainability by those people that currently use KDevelop-PG, which is Alexander Dymo and myself. I guess its not that big a problem for Alexander, but I often have a hard time really understanding how STL works – mostly due to me not yet spending any time for an in-depth review.

As introducing Qt as a dependecy for kdevelop-pg as well as the generated parsers is a step not every possible user of kdevelop-pg wants to take we’ve essentially forked the parser generator, creatind KDevelop-PG-Qt. So anybody who wants to have a good LL(1) parser generator (with static and also kind of dynamic lookahead for k>1) without the heavy Qt library can still use kdevelop-pg.

The work was tedious, but not too hard, especially with KDevelop3 project wide search and search+replace🙂 I’ve also already changed the python parser to the new KDevelop-PG-Qt, though the rest of its language support will have to wait until the hand-crafted Ast is done.

My next todo item for KDevelop-PG-Qt is making it bootstrap itself, possibly including a hand-written lexer to be able to read unicode input properly – just in case anybody wants that🙂

2 Comments

  1. well a c++ parser generator that can take unicode would maybe be something nice to have for kturtle.

    right now it uses a handcoded parser. i’d love to move to a generated parser but that seems to be difficult due to the nature of kturtle.

    anyway. i’ll check it out later.

    ciao.

  2. Note though that kdevelop-pg (and its qt version) don’t have a lexer. So you still have to create a unicode-aware lexer and I haven’t seen many for C++ out there (which is why both python and qmake support use a handwritten one)


Sorry, the comment form is closed at this time.

Create a free website or blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: