2) if you type "mBars[0]." --> NO completion kicks in : NOT OK
Current CC will do something like:
splite the statement
to
two pieces
One is: mBars class
The next One is: empty string (everything)
Note:
is skipped. So, cc woks badly.
The way to solve the statement information is quite hard. codelite use the bison/yacc grammar to solve the statement grammar tree.
This is the way like gdb to parse user's statement like you enter some command (GDB use bison/yacc grammar either, you can see gdb's source of c-exp.y under gdb subfolder.
Implement this kind of expression solving is not easy.
like jens said, I suggest using Clang (or in the feature)
it was more powerful and if we use the clang and PCH feature, I think codecompletion will run fast. (see some comments from eranif
Clang command line support for codecompletion)
editfrom this page,
http://clang.llvm.org/features.htmlclang is a hand-write recursive descent parser.
A single unified parser for C, Objective C, C++, and Objective C++
Clang is the "C Language Family Front-end", which means we intend to support the most popular members of the C family. We are convinced that the right parsing technology for this class of languages is a hand-built recursive-descent parser. Because it is plain C++ code, recursive descent makes it very easy for new developers to understand the code, it easily supports ad-hoc rules and other strange hacks required by C/C++, and makes it straight-forward to implement excellent diagnostics and error recovery.
We believe that implementing C/C++/ObjC in a single unified parser makes the end result easier to maintain and evolve than maintaining a separate C and C++ parser which must be bugfixed and maintained independently of each other.