Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
I think these links helpful to redesign code completion plugin
eranif:
--- Quote from: ollydbg on March 17, 2009, 07:25:19 am ---I have a glance at codeLite's parser, it use a lex and yacc grammar. But I'm just concerning it's performance. (It use CTags to generate a database).The current design in CC parses all the files in the current workspace as soon as it was opened.
--- End quote ---
1) codelite uses codelite_indexer which is an executable that uses ctags as library and provide indexing services to codelite over Unix sockets (*Nix) / Named Pipes (Windows)
2) the lex & yacc are PARTIAL grammars and they cannot parse an entire file, they are using the lookup table generated by the indexer
3) CodeLite will index workspace on startup only if this option is enabled (by default it is turned off) and subject to the next bullet:
4) indexing is smart: only modified files are being re tagged and constantly re tagged upon file saving (i.e. attempting to right click on the workspace and selecting 'retag workspace' will only trigger one retagg, for the second retag you get message in the status bar that says "All files are up to date"
Eran
ollydbg:
@eranif
Thanks for your explanation.
So, the MAIN parser is a index service (which is based on Ctag's parser), the Lex&Yacc is used to parse the "lookup table generated by the indexer".
I had thought that you use Lex&Yacc to build a parser to parse the source file directly. :(
eranif:
--- Quote from: ollydbg on March 17, 2009, 03:46:39 pm ---So, the MAIN parser is a index service (which is based on Ctag's parser), the Lex&Yacc is used to parse the "lookup table generated by the indexer".
--- End quote ---
No, the indexer creates a database of tags collected from the entire workspace. It searches for declarations and implementations of:
- classes (include methods and variables)
- methods
- globals
- statics
- defines
- structs
- namespaces
- enums
- unions
The Yacc / Lex are used to resolve expressions:
GetManager()->GetWxString(). // completion here is resolved by the yacc grammar (and additional code)
Eran
ollydbg:
--- Quote from: eranif on March 17, 2009, 04:19:20 pm ---
--- Quote from: ollydbg on March 17, 2009, 03:46:39 pm ---So, the MAIN parser is a index service (which is based on Ctag's parser), the Lex&Yacc is used to parse the "lookup table generated by the indexer".
--- End quote ---
No, the indexer creates a database of tags collected from the entire workspace. It searches for declarations and implementations of:
- classes (include methods and variables)
- methods
- globals
- statics
- defines
- structs
- namespaces
- enums
- unions
The Yacc / Lex are used to resolve expressions:
GetManager()->GetWxString(). // completion here is resolved by the yacc grammar (and additional code)
Eran
--- End quote ---
Ok, Thanks!
I understand now. It is a good idea to use Yacc&lex grammar to parse the context expression to give a correct tips. :D
ollydbg:
Here is another one we can use for CC
http://qt.gitorious.org/qt-creator/qt-creator/trees/master
I have read it's source code, find that they use some code from "Kdevelop". You can see
QTcreator\src\libs\cplusplus\pp-engine.cpp
:D
But these code were too complex to understand. :(
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version