c++ code completion status report

Thomas Schilling snuffeler at gmx.net
Sat Jan 5 23:09:01 UTC 2002


> Yes, it does. Read http://www.acm.org/crossroads/xrds7-5/bison.html It
> properly shows that Bison is arcane. I'm currently working with flex/bison
> at university, and from a theoretical point of view, bison uses a parsing
> algorithm that is pretty fast and yet powerful enough for most languages
> (LALR(1)).

Hm, interesting article.

> However - it is not very intuitive, as you have to avoid
> left-recursion and other shift/reduce and reduce/reduce-errors.

Hm, well it's not that bad, I think. Currently i've only 168 shift/reduce
conflicts and only ~40 reduce/reduce conflicts. I don't know if this is
much but i suppose so. (it's due to "expr: expr '+' expr" and this for every
operator but it works, although i use both left and right recursion).

> Algorithms
> like GLR can handle those easily, but have a slightly higher complexity,
> which doesn't really matter according to the author of the document cited
> above.

Sure performance doesn't matter, not really. The problem is that we have
do minimize parser calls. I'd suggest to do it only when special
characters were typed (such as '.' or '->') and waiting (max.) half a second
for
the completion shouldn't be too much trouble.
Nevertheless I'm currently working on a concept to reuse information
from earlier parser calls.

> Another possibility would be to take the same bison files as the GCC
> project. Don't know if they are any usable, though.

That's how I learned that something like BISON existed. (Knew nothing
of BISON or YACC before - we don't have this in school ;-)

- Thomas





More information about the KDevelop-devel mailing list