c++ code completion status report
snuffeler at gmx.net
Mon Jan 7 22:10:05 UTC 2002
> But one the other hand, I like the idea of using the gcc 3.0.x
> tokenizer and bison grammar code as a starting point in 'advancedcpp'.
> gideon would become a sort of 'Visual gcc'. It isn't that your grammar
> be any better or worse than the gcc one, but actually using the same code
> >from gcc for class browsing and code completion etc. would be new in an
Yup! Sounds good but I found out something bad:
One part of the CC parser would be evaluating expressions -
_incomplete_ expressions. Consider this example:
a+b. // cc needed
would be parsed by BISON/YACC bottom-up, so if any error occurs
(as always does in code that needs completion) the root element
(since we bould up a kind of expression tree) cannot be assigned.
A way to avoid this would be a top-down-parser. But errors are
generally a severe problem. The parser could skip all non-decl.
statements that are not in the current line but it's hard (if possible
at all) to let BISON parsers start at any other rule than the start rule.
I think I need to try to write a top-down parser with back-tracking.
Does anyone has a better idea? (if you have undestood my problem ;-)
More information about the KDevelop-devel