« See all posts

It's Good to Be Back

Posted by Alexander Dymo on September 04, 2006

Yes, I'm back after not committing for a month and I'm back with the new ruby parser for KDevelop. The parser is of course not finished and it barely parses simple ruby code but it is there. I'm looking forward to implementing some real ruby language support features. First will most likely be a code model (which will automatically give nice code view with classes, methods, etc.). As it turned out our kdevelop-pg parser generator framework makes it dead easy to do that. And its not only the kdevelop-pg that helps, the whole KDevelop4 architecture makes the process a lot faster.

Previously when you wanted to implement the language support in KDevelop, you should have done:

  1. lexer to tokenize the source
  2. parser to transform the token stream into the AST
  3. AST walker to make it possible to do something with it
  4. AST parser to create the abstract code representation - the code model
  5. "background parser" to execute the parser as a background job and fill the code model
  6. language support part to run the background parser

Today you still have to write the lexer and the parser, but you no longer have to care much about the AST and AST walkers(visitors) because they are generated for you. And once the code model definition file is written, the entire code model will be generated too. kdevelop-pg does all those things.

From the other side, KDevelop4 has more generic language support and abstracted background parser so you can just tell the language support in several lines of code to use your parser. There's no need for language support code duplication which was so common in KDevelop3.

Simply put, points #3 and #5 are automatic now, #2, #4 and #6 were made easier. At this point I'm wondering if it is feasible to eliminate the #4 completely, i.e. implement automatic generation of code model binder which traverses the AST and fills the codemodel with items.

From what I can see KDevelop4 will really shine in the area of language supports. blackarrow is doing wonders with C++. jpetso completed his summer-of-code csharp project and the excellent csharp support is already in SVN. manyoso added java support that uses the complete java parser jpetso created last year. And if we add up language-neutral refactoring (which was another SOC project) to the stack, we would get the idea of how cool KDevelop4 is going to be!

It doesn't look like I'm short of cool material for my aKademy presentation :) Rock on, KDevelop!

Next: The Case of Ideal UI Mode
Previous: Real Life Happens