Issue with KDevelop: Is it using different parsers in parallell for different puropuses?
cullmann at absint.com
Wed Aug 16 06:48:55 UTC 2006
On Wednesday 16 August 2006 05:57, Hamish Rodda wrote:
> As has been discussed, it is not within the scope of katepart to provide
> advanced highlighting such as this. You simply need to know all of that
> stuff about your build system etc. in order to perform the parsing. Kate
> app could decide to use our parser, and if they decided to do that we could
> make it a shared library. However I'd consider this unlikely, whenever it
> is raised on kwrite-devel to introduce a parser, the response is usually
> (and I believe correctly) 'use kdevelop'.
Yes ;=) I think the current way is the right one to go. You have enriched
KatePart/KTextEditor with methods to allow external apps like KDevelop to
customize the highlighting of the document.
The KatePart internal "parser" should really stay the stackmachine it is atm,
it may get some more tuning for KDE 4, but since KDE 3.4/5 it is
alreadystackmachine really fast, compared to older incarnations. It gives
enough power to the user to write hl's even for stuff like perl, which is
complex, but still provides a xml-syntax format which is much easier to write
than other known parser generator inputs like yacc.
For indentation: yes, first of all, we suck ;) I know this, Kate team works on
this ;) The problem atm is, that unlike the highlighting, which are external
xml file where we get many many many contributions by users, which is really
great ;), the indenters are atm hardcoded in C++ in katepart, which makes the
barrier to write own ones much too high. First we though about making C++
plugins for this, but again, this would be dead-hard for users, to setup a
development environment for KDE stuff just to write indenters. In KDE 4 we
will be as easy to write indenters as highlighting, just fill some stubs in
a .js file, move it to the right place and Kate will be able to use it. This
is still in it's early stages, atm only one indentation script is in work,
for C/C++, by Dominik. We are fighting with some speed problems, as kjs is
not that blazing fast, and yes, you notice that even for the small scripts
needed for indenation. Therefor we will provide a rich js API for
document/view to allow to outsource many loops/calculations to the C++ core
of the katepart (which will mean additional work, as more interface functions
to come up with...) This indenters may use internal knowledge of the hl, too,
but this is not there atm I guess...
More information about the KDevelop-devel