![]() ![]() Low level parser(Lexical analysis, Tokenize)įor someone haven't heard what does "Token" and "Tokenize" mean, you should read the wikibooks article A brief explain of what does a parser do and Tokenize on wikipedia. Some important note: when all Parserthread instances finish parsing job in the pool, the thread pool will send an event to its parent(in this case, it is the Parser class), so the Parser know that the parsing is done, or the Parser can assign another parsing jobs to the thread pool. Parserthread: The class derived from the worker thread(cbThreadedTask class), it member function DoParse() is the function for parsing.īesides that, when trying to show the suggestion list(auto completion list, or code completion list), the NativeParser need to analyze the current the current statement structure, and query the symbol(token) information from the Tokentree, this is mostly done in ResolveExpression() member function.Parser class also hold a thread pool, it can either run the parsing task in the pool(this means the parsing task will be done in a separate thread), or directly by a function call. Parser class hold a TokenTree which record all the Tokens. Parser: this class is mainly for handling Tokens.NativeParser: as a main member variable of the CodeCompletion class, this class is like the Parser manager class, it create/delete Parser instances when a project load/closed.CodeCompletion: this is the class for main plugin), it handle event sent from the C::B core.The above image show the main structure of our CodeCompletion plugins. Implement the patricia search tree using by TokenTree Tokenizer will return every wxString it regard as a symbol by GetToken(), also do a replacement before return Will do the syntax analysis for every file in a project, it has a Tokenizer as member variableĭefinition of the "Token" class, and TokenTree(which means the Token dababase) this class has member variables like :cbThreadPool m_Pool(which will create a thread from thread pool for each file need passed) TokenTree* m_pTokens(contains all the Token database) Parser class was also derived from w圎vtHandler, can start batch parse. Select multiply matched token names before any jump to declaration or jump to implementation. The Main file need by code completion plug-in, maintain all the CC's GUI and native parserĪ dialog to insert class method, can be open by context menu in editorĪ class derived from w圎vtHandler, NativeParser class has a member variable "Parser m_Parser" Viewing the symbols tree ctrl(token tree).Ī thread to build the class browser tree above Setting the additional parser search path ![]() See the wiki page Installing_Code::Blocks_from_source_on_Windows for more information.Ī brief description of every project filesįrom now on, we use CC as an abbreviation for code completion plug-in.Ī dialog for debugging CC, can be opened by double click on the code browser tree entry with shift and ctrl key pressedĬode completion options dialog, can be opened by menu->setting->editor->code completion and symbols browser If you only want to build the Code Completion plug-in, you can select it in the "build target list" (Note: by default, the Build target option was "ALL", which means all the targets in the current workspace will be build), see the screen shot below:Ĭode completion build target option in code::blocksĭon't forget to run the batch script file "update.bat" after you build the target, this procedure will update your output folder package and strip the debug information. Here is the screen shot when I opened the codecompletion source code in C::B's source navigator view. When you download the svn source code of code::blocks,(see here Installing_Code::Blocks_from_source_on_Windows#Code::Blocks_sources the source code of CodeCompletion plugin was already included. 5.4 How a new item is added to the tree.3.7.6 AAAAA -> 4 High level parser(Syntax Analysis).3.7.2 directly replacement AAAAA -> Empty String.3.7.1 directly replacement AAAAA -> BBBBB.3.6 Return a correct token, Macro replacement.3 Low level parser(Lexical analysis, Tokenize).1.3 A brief description of every project files. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |