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

Kuba Ober kuba at mareimbrium.org
Tue Aug 15 12:52:17 UTC 2006


> I estimate that using an ANTLR-generated parser for highlighting will be
> faster than using a parser, with the same level of code understanding,
> defined in XML.

You seem to mistake parser's representation for parser type. Parser's source 
representatione choice (XML) got nothing to do with parser's 
performance/feature set. Proper representation may make it easier to write 
parser definitions by hand, but that's about it. I see no problem making 
ANTLR read XML instead, and it doesn't inherently make it similar to kate's 
highlighter.

I suggest you take a look at what Kate uses for highlighting. It's essentially 
a simple pattern-matching state machine with a state stack. States are called 
contexts. It is nowhere near a full-blown generic parser. That's what I make 
out of it.

The implementation in the katepart is not as fast as it could potentially be, 
but it's good enough for me. Their choice of functionality can be made to 
work really fast if one wanted to. Way faster than kdevelop's parsers will 
ever be, simply due to complexity differences.

Please remember that kdevelop's parser machinery has been tweaked for a good 
while to make it perform acceptably at all, and it required quite a lot of 
effort to develop it. Kate's highlighter is much less complicated and serves 
a different purpose.

Cheers, Kuba




More information about the KDevelop-devel mailing list