25 #define PARSER_IMG_NONE -2 26 #define PARSER_IMG_CLASS_FOLDER 0 27 #define PARSER_IMG_CLASS 1 28 #define PARSER_IMG_CLASS_PRIVATE 2 29 #define PARSER_IMG_CLASS_PROTECTED 3 30 #define PARSER_IMG_CLASS_PUBLIC 4 31 #define PARSER_IMG_CTOR_PRIVATE 5 32 #define PARSER_IMG_CTOR_PROTECTED 6 33 #define PARSER_IMG_CTOR_PUBLIC 7 34 #define PARSER_IMG_DTOR_PRIVATE 8 35 #define PARSER_IMG_DTOR_PROTECTED 9 36 #define PARSER_IMG_DTOR_PUBLIC 10 37 #define PARSER_IMG_FUNC_PRIVATE 11 38 #define PARSER_IMG_FUNC_PROTECTED 12 39 #define PARSER_IMG_FUNC_PUBLIC 13 40 #define PARSER_IMG_VAR_PRIVATE 14 41 #define PARSER_IMG_VAR_PROTECTED 15 42 #define PARSER_IMG_VAR_PUBLIC 16 43 #define PARSER_IMG_MACRO_DEF 17 44 #define PARSER_IMG_ENUM 18 45 #define PARSER_IMG_ENUM_PRIVATE 19 46 #define PARSER_IMG_ENUM_PROTECTED 20 47 #define PARSER_IMG_ENUM_PUBLIC 21 48 #define PARSER_IMG_ENUMERATOR 22 49 #define PARSER_IMG_NAMESPACE 23 50 #define PARSER_IMG_TYPEDEF 24 51 #define PARSER_IMG_TYPEDEF_PRIVATE 25 52 #define PARSER_IMG_TYPEDEF_PROTECTED 26 53 #define PARSER_IMG_TYPEDEF_PUBLIC 27 54 #define PARSER_IMG_SYMBOLS_FOLDER 28 55 #define PARSER_IMG_VARS_FOLDER 29 56 #define PARSER_IMG_FUNCS_FOLDER 30 57 #define PARSER_IMG_ENUMS_FOLDER 31 58 #define PARSER_IMG_MACRO_DEF_FOLDER 32 59 #define PARSER_IMG_OTHERS_FOLDER 33 60 #define PARSER_IMG_TYPEDEF_FOLDER 34 61 #define PARSER_IMG_MACRO_USE 35 62 #define PARSER_IMG_MACRO_USE_PRIVATE 36 63 #define PARSER_IMG_MACRO_USE_PROTECTED 37 64 #define PARSER_IMG_MACRO_USE_PUBLIC 38 65 #define PARSER_IMG_MACRO_USE_FOLDER 39 67 #define PARSER_IMG_MIN PARSER_IMG_CLASS_FOLDER 68 #define PARSER_IMG_MAX PARSER_IMG_MACRO_USE_FOLDER 133 virtual void AddBatchParse(
const StringList& filenames);
140 virtual void AddParse(
const wxString& filename);
145 virtual void AddPredefinedMacros(
const wxString& defs);
148 virtual void ClearPredefinedMacros();
151 virtual const wxString GetPredefinedMacros()
const;
156 virtual bool UpdateParsingProject(
cbProject* project);
162 virtual bool ParseBuffer(
const wxString& buffer,
bool isLocal,
bool bufferSkipBlocks =
false,
163 bool isTemp =
false,
const wxString& filename = wxEmptyString,
164 int parentIdx = -1,
int initLine = 0);
169 virtual bool ParseBufferForFunctions(
const wxString& buffer);
175 virtual bool ParseBufferForUsingNamespace(
const wxString& buffer,
wxArrayString& result,
bool bufferSkipBlocks =
true);
181 virtual bool Reparse(
const wxString& filename,
bool isLocal =
true);
186 virtual bool AddFile(
const wxString& filename,
cbProject* project,
bool isLocal =
true);
197 virtual bool IsFileParsed(
const wxString& filename);
207 void StartStopWatch();
214 unsigned int GetMaxThreads()
const {
return m_Pool.GetConcurrentThreads(); }
223 bool Parse(
const wxString& filename,
bool isLocal =
true,
bool locked =
false);
226 void ReparseModifiedFiles();
229 void TerminateAllThreads();
261 virtual void ReadOptions();
263 virtual void WriteOptions();
276 virtual bool ParseFile(
const wxString& filename,
bool isGlobal,
bool locked =
false);
279 void ConnectEvents();
282 void DisconnectEvents();
370 void AbortParserThreads();
bool m_IsBatchParseDone
used to measure batch parse time
bool m_UsingCache
used to detect changes between in-memory data and cache, true if loaded from cache ...
bool m_IgnoreThreadEvents
Parser::OnAllThreadsDone will be called when m_Pool finished its job, but when we run a batch parsing...
wxStopWatch m_StopWatch
a stop watch to measure parsing time
A Thread Pool implementation.
bool m_NeedMarkFileAsLocal
if true, all the files of the current project will be labeled as "local"
bool m_NeedsReparse
Indicates some files in the current project need to be re-parsed, this is commonly caused that the "r...
std::list< wxString > StringList
wxString m_LastPredefinedMacros
A generic Code::Blocks event.
StringList m_BatchParseFiles
All other batch parse files, like the normal headers/sources.
void SetMaxThreads(unsigned int max)
Not used, because the ThreadPool only support running ONE ParserThread concurrently.
std::vector< NameSpace > NameSpaceVec
Tree data associate with the symbol tree item.
Represents a Code::Blocks project.
a symbol found in the parsed files, it can be many kinds, such as a variable, a class and so on...
ClassTreeData(Token *token)
std::list< cbThreadedTask * > TasksQueue
A list to contain pointers to internal running threads.
cbProject * m_Project
referring to the C::B cbp project currently parsing in one parser per workspace mode ...
unsigned int GetMaxThreads() const
Node: Currently, the max.
wxEvtHandler * m_Parent
when initialized, this variable will be an instance of a NativeParser
bool m_IsParsing
true, if the parser is still busy with parsing, false if the parsing stage has finished this value is...
ParserCommon::ParserState m_ParserState
indicated the current state the parser
symbol browser panel is shown in the Management panel besides projects browser panel.
void SetToken(Token *token)
bool m_IsFirstBatch
batch Parse mode flag.
cbThreadPool m_Pool
Thread Pool, executing all the ParserThread, used in batch parse mode.
This is what you have to use instead of wxThread to add tasks to the Thread Pool. ...
non of the above three status, this means our Parser has finish all the jobs, and it is in idle mode ...
some files are changed by the user, so we are parsing the changed files
a cbThreadedTask can be executed in cbThreadPool to do a lot of parsing jobs in the begining stage of...
wxString m_PredefinedMacros
Pre-defined macros, its a buffer queried from the compiler command line.
bool RemoveFile(const wxString &src)
the Parser object is newly created, and we are parsing the predefined macro buffer, the source files, and finally mark the project's tokens as local
the user has add some files to the cbproject, so we are parsing the new added files ...
wxTimer m_BatchTimer
a timer to delay the operation of batch parsing, see OnBatchTimer() member function as a reference ...
wxTimer m_ReparseTimer
a file is need to be reparsed, maybe another file will to be reparsed very soon, so use a timer to co...
Parser class holds all the tokens of a C::B project.