Issue with KDevelop: Is it using different parsers in parallell for different puropuses?

Matt Rogers mattr at kde.org
Mon Aug 14 23:49:15 UTC 2006


On Monday 14 August 2006 08:02, Erik Sigra wrote:
> I see that KDevelop seems to use one parser for code completion, class
> browsing and whatever. This is located in kdevelop/languages and uses
> ANTLR. But KDevelop also uses a less sophisticated parser for syntax
> highlighting and code folding. This is located in kdelibs/kate/data and
> uses XML. This duplication seems to harm performance, maintainability and
> functionality: 

> * Performance: It seems unnecessary to parse the same text twice.

In this case, the performance differences are negligible when actually using 
the text editor. The big hit from the antlr parser comes on project startup, 
and then smaller hits are seen after building the project and/or saving a 
file.

> * Maintainability: 2 parsers are more work to maintain than one.

We don't maintain the parser in kdelibs/kate/data, so we don't care too much 
about that.

> * Functionality: The parser for highlighting/folding is very primitive This
> makes the result equally primitive as well. 

Nothing we can do about this.

> Suggestion: Use the ANTLR parser for highlighting and folding for the
> languages that have such a parser. It has much more information and should
> therefore be able to achieve a much better result. This issue seems so
> obvious that I thought that it must have been discussed before, but
> unfortunately I did not find such a discussion or any clarifying design
> documents or such.

While this is a theoretically nice idea. We can't do this. We don't control or 
maintain the editor that KDevelop uses. Personally, this looks like a 
solution in search of a problem. The KDevelop C++ parser isn't even based on 
ANTLR (as far as i know), and so this is a moot point as well.

In short, nice idea, but not something we're interested in doing since we're 
not going to be maintaining our own editor (we've tried that once. it didn't 
work) and we're just fine with the way the kate developers do things.
--
Matt




More information about the KDevelop-devel mailing list