Code completion and interative syntax (semantic) checking

Gregor Zeitlinger zeitling at
Fri Jan 25 12:22:03 UTC 2002

On Thu, 24 Jan 2002, Thomas Schilling wrote:
> But maybe you underestimate C++. (see below)
like everything :=)

> There's one you can download at comp.compilers
> (i don't know the exact url)
I'll have a look at it. But first I need to get a better grip on the
complexity involved.

> So using an overloaded 'new'? I hoped to avoid this. But otherwise
> it should b no bigger problem.
That's implementation details I won't worry about so far.

> The problem is that it has no type evaluation - the important part for CC.
> But it has parsers for several languages and a good persistent classstore.
> I don't know how much error tolerance we need and how much error tolerant
> SN's parsers are and how much tolerance we need.
> At least it shouldn't break down when you missed a ';' or so.
At least SN could be a start for the new library.

> So should we start a poll or so to find out what other languages need?
No. Just do Cpp first. If it works, others can add. But we don't have to
worry about that so far.

> 1. the CC parser  only gets the stuff (code) up
> to the cursor. (optimally only from the last ';' '{' or '}' on to the
> cursor)
I doubt that will suffice. 

> 3. it parses the string - it should actually be just a single statement -
> and assumes that it is in the scope (CS node) to find out the types
> of the identifiers found there. To avoid being confused by earlier
> unfinished statements (e.g: "a = 6; a.b(  c." is the text before the
> cursor, so the CCparser would get "a.b( c.") we can even try to parse
> backwards.
I suggest doing search with _fuzzy_ logic. If a line doesn't end with ";"
it's maybe_error and if ";" is not at the end of line as well. The maybe
error might recover, but if it doesn't it will show the error there.
An maybe_error recovery might consist of finding that the ";" was in a for
statement, or you just did two statements in one line, although that's

> I hoped so, too. But I returned to plain C++-code. But maybe you like it
> more.
I think so will you, if you're presented a clean bison file.

> So how about the poll?
just like above, I don't think this is necessary.

Gregor Zeitlinger      
gregor at

More information about the KDevelop-devel mailing list