Issue with KDevelop: Is it using different parsers in parallell for different puropuses?
apaku at gmx.de
Mon Aug 14 17:17:05 UTC 2006
On 14.08.06 17:00:15, Erik Sigra wrote:
> On 14.08.06 13:30:19, Erik Sigra wrote:
> > 1. We don't really like HTML mails here.
> Sorry, I am away from my computer/connection and have to use the this crappy webmail, which defaults to HTML mail. Will try to do better.
You have my sympathy. That thing also breaks any threading.
> > 2. kate is an editor it's not part of kdevelop and the kdevelop
> > developers have only partial influence on what the kate developers use
> > for parsing files.
> Kate is part of KDevelop when I am using KDevelop
No it's not. KDevelop using Kate as the only implementation of the
KTextEditor interface doesn't make it a part of kdevelop, especially not
in terms of development changes. Kate is it's own project.
> > 3. Kate probably doesn't need all the extra information ANTLR has
> I am not so sure about that. I have seen suboptimal highlighting/folding/indenting/linewrapping because Kate's primitive parsers do not understand the languages well enough.
Well, Kate is open source, if you think the parsers are lacking provide
better alternatives, pay somebody to do so or ask the kate developers if
they can do anything about it. At least send bug reports about these
> > parsing for highlighting and such things needs to be very fast.
> 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.
Well, at least that parsing only happens when opening a file.
> I wonder wether it would be possible at all for KDevelop to highlight the code on it's own, performance not considered, instead of using Kate's highlighter.
I don't know the KTextEditor interface enough to be sure, but I doubt
> > Much faster than parsing to build a tree of classes/methods, code completion
> > or anything else.
> I think code completion also has to be fast, because it is supposed to work as you type, just like highlighting.
Most of the parsing is done when loading a project and for non-small
projects that takes quite some time. Anyway, mattr, jpetso or manyoso
have to comment on this.
> > 4. Kate supports much more languages than kdevelop does (for parsing matter)
> Good. Just keep using Kates XML-defined parsers for the languages that do not have ANTLR parsers.
That's probably not going to happen, why should they provide another
parser when they don't want to replace all. They'd have to provide
support for both and seriously KDE4 is already lacking developers
> > the support for new languages doesn't always come from the
> > developers themselves. Thus the people writing parsers for kate do not
> > necessarily know antlr or what a language grammar is.
> I would rather not use a parser written by someone who does not even know what a language grammar is. I am afraid it would just be too shoddy.
You're missing something here. KDE depends on people contributing to the
project, so the bar needs to be as low as possible. I can read a lexer
with flex, I cannot write one. I don't know the XML format kate uses,
but I guess it's easier to grasp than flex+bison. Especially if you
didn't have lessons in compiler theory.
> > If you think kate should use an antlr parser please write to
> > kwrite-devel and start the discussion there.
> I was not thingking along those lines. For the time being I just wanted to know if the more advanced parsers that KDevelop already has could take over some tasks that the Katepart does, and do them better.
Wait for the more core developers to tell you, or come to
irc.freenode.org, #kdevelop and ask directly there.
Tomorrow, this will be part of the unchangeable past but fortunately,
it can still be changed today.
More information about the KDevelop-devel