Code::Blocks  SVN r11506
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Parser Class Reference

Parser class holds all the tokens of a C::B project. More...

#include <parser.h>

Inheritance diagram for Parser:
Collaboration diagram for Parser:

Public Member Functions

 Parser (wxEvtHandler *parent, cbProject *project)
 constructor More...
 
virtual ~Parser ()
 destructor More...
 
virtual void AddBatchParse (const StringList &filenames)
 Add files to batch parse mode, internally. More...
 
virtual void AddParse (const wxString &filename)
 Add one file to Batch mode Parsing, this is the bridge between the main thread and the thread pool, after this function call, the file(Parserthread) will be run from the thread pool. More...
 
virtual void AddPredefinedMacros (const wxString &defs)
 set the predefined macro definition string was collected from the GCC command line, this function adds the string to an internal m_PredefinedMacros, and switch the ParserState More...
 
virtual void ClearPredefinedMacros ()
 clears the list of predefined macros after it has been parsed More...
 
virtual const wxString GetPredefinedMacros () const
 return the predefined macro definition string that has been collected More...
 
virtual bool UpdateParsingProject (cbProject *project)
 set the associated C::B project pointer. More...
 
virtual bool ParseBuffer (const wxString &buffer, bool isLocal, bool bufferSkipBlocks=false, bool isTemp=false, const wxString &filename=wxEmptyString, int parentIdx=-1, int initLine=0)
 Must add a locker before call all named ParseBufferXXX functions, ParseBuffer function will directly run the parsing in the same thread as the caller. More...
 
virtual bool ParseBufferForFunctions (const wxString &buffer)
 parser the current editor control, this function is used to list all the functions in the current code editor More...
 
virtual bool ParseBufferForNamespaces (const wxString &buffer, NameSpaceVec &result)
 parse the buffer for collecting exposed namespace scopes More...
 
virtual bool ParseBufferForUsingNamespace (const wxString &buffer, wxArrayString &result, bool bufferSkipBlocks=true)
 parse the buffer for collecting using namespace directive More...
 
virtual bool Reparse (const wxString &filename, bool isLocal=true)
 mark this file to be re-parsed in the TokenTree, tick the reparse timer, note it looks like the isLocal parameter is not used in Parser::Reparse function. More...
 
virtual bool AddFile (const wxString &filename, cbProject *project, bool isLocal=true)
 this usually happens when user adds some files to an existing project, it just use AddParse() function internally to add the file. More...
 
virtual bool RemoveFile (const wxString &filename)
 this usually happens when the user removes a file from the existing project, it will remove all the tokens belong to the file. More...
 
virtual bool IsFileParsed (const wxString &filename)
 check to see a file is parsed already, it first check the TokenTree to see whether it has the specified file, but if a file is already queued (put in m_BatchParseFiles), we regard it as already parsed. More...
 
virtual bool Done ()
 check to see whether Parser is in Idle mode, there is no work need to be done in the Parser More...
 
virtual wxString NotDoneReason ()
 if the Parser is not in Idle mode, show which need to be done More...
 
- Public Member Functions inherited from ParserBase
 ParserBase ()
 
virtual ~ParserBase ()
 
virtual void AddBatchParse (cb_unused const StringList &filenames)
 
virtual void AddParse (cb_unused const wxString &filename)
 
virtual void AddPredefinedMacros (cb_unused const wxString &defs)
 
virtual bool UpdateParsingProject (cb_unused cbProject *project)
 
virtual bool ParseBufferForFunctions (cb_unused const wxString &buffer)
 
virtual bool ParseBufferForNamespaces (cb_unused const wxString &buffer, cb_unused NameSpaceVec &result)
 
virtual bool ParseBufferForUsingNamespace (cb_unused const wxString &buffer, cb_unused wxArrayString &result, cb_unused bool bufferSkipBlocks=true)
 
virtual bool Reparse (cb_unused const wxString &filename, cb_unused bool isLocal=true)
 
virtual bool AddFile (cb_unused const wxString &filename, cb_unused cbProject *project, cb_unused bool isLocal=true)
 
virtual bool RemoveFile (cb_unused const wxString &filename)
 
virtual bool IsFileParsed (cb_unused const wxString &filename)
 
virtual TokenTreeGetTokenTree () const
 
TokenTreeGetTempTokenTree ()
 
void AddIncludeDir (const wxString &dir)
 add a directory to the Parser's include path database More...
 
const wxArrayStringGetIncludeDirs () const
 
wxString GetFullFileName (const wxString &src, const wxString &tgt, bool isGlobal)
 
wxArrayString FindFileInIncludeDirs (const wxString &file, bool firstonly=false)
 it mimics what a compiler does to find an include header files, if the firstonly option is true, it will return the first found header file, otherwise, the complete database of the Parser's include paths will be searched. More...
 
virtual ParserOptionsOptions ()
 
virtual BrowserOptionsClassBrowserOptions ()
 
size_t FindTokensInFile (const wxString &filename, TokenIdxSet &result, short int kindMask)
 

Protected Member Functions

void StartStopWatch ()
 
void EndStopWatch ()
 
unsigned int GetMaxThreads () const
 Node: Currently, the max. More...
 
void SetMaxThreads (unsigned int max)
 Not used, because the ThreadPool only support running ONE ParserThread concurrently. More...
 
bool Parse (const wxString &filename, bool isLocal=true, bool locked=false)
 parse the file, either immediately or delayed. More...
 
void ReparseModifiedFiles ()
 delete those files from the TokenTree, and add them again through AddParse() function More...
 
void TerminateAllThreads ()
 cancel all the tasks in the thread pool m_Pool More...
 
void OnAllThreadsDone (CodeBlocksEvent &event)
 When a ThreadPool batch parse stage is done, it will issue a cbEVT_THREADTASK_ALLDONE message. More...
 
void OnReparseTimer (wxTimerEvent &event)
 some files in the Tokentree is marked as need to be reparsed, this can be done by a call of Reparse() before. More...
 
void OnBatchTimer (wxTimerEvent &event)
 A timer is used to optimized the event handling for parsing, e.g. More...
 
void ProcessParserEvent (ParserCommon::ParserState state, int id, const wxString &info=wxEmptyString)
 The parser will let its parent (NativeParser) to handle the event, as the CodeCompletion instance was set as the next handler of the NativeParser. More...
 
virtual void ReadOptions ()
 read Parser options from configure file More...
 
virtual void WriteOptions ()
 write Parse options to configure file More...
 

Protected Attributes

bool m_UsingCache
 used to detect changes between in-memory data and cache, true if loaded from cache More...
 
cbThreadPool m_Pool
 Thread Pool, executing all the ParserThread, used in batch parse mode. More...
 
bool m_IsParsing
 true, if the parser is still busy with parsing, false if the parsing stage has finished this value is set in parserthreadedtask after putting all the batchFiles to pool(task) it was reset after the last stage (mark tokens as local) More...
 
bool m_NeedsReparse
 Indicates some files in the current project need to be re-parsed, this is commonly caused that the "real-time parsing option" is enabled, and user is editing source file. More...
 
bool m_IsFirstBatch
 batch Parse mode flag. More...
 
- Protected Attributes inherited from ParserBase
TokenTreem_TokenTree
 each Parser class contains a TokenTree object which used to record tokens per project this tree will be created in the constructor and destroyed in destructor. More...
 
TokenTreem_TempTokenTree
 a temp Token tree hold some temporary tokens, e.g. More...
 
ParserOptions m_Options
 options for how the parser try to parse files More...
 
BrowserOptions m_BrowserOptions
 options for how the symbol browser was shown More...
 

Private Types

typedef std::list< cbThreadedTask * > TasksQueue
 A list to contain pointers to internal running threads. More...
 

Private Member Functions

virtual bool ParseFile (const wxString &filename, bool isGlobal, bool locked=false)
 the only usage of this function is in the Parserthread class, when handling include directives the parserthread use some call like m_Parent->ParseFile() to call this function, but this function just call Parser::Parse() function, which either run the syntax analysis immediately or create a parsing task in the Pool. More...
 
void ConnectEvents ()
 connect event handlers of the timers and thread pool More...
 
void DisconnectEvents ()
 connect event handlers of the timers and thread pool More...
 
void AddParserThread (cbThreadedTask *task)
 Remember a newly created internal running threads. More...
 
void RemoveParserThread (cbThreadedTask *task)
 Remove a completed internal running threads. More...
 
void AbortParserThreads ()
 Tell internal running threads to abort further processing. More...
 

Private Attributes

wxEvtHandlerm_Parent
 when initialized, this variable will be an instance of a NativeParser More...
 
cbProjectm_Project
 referring to the C::B cbp project currently parsing in one parser per workspace mode More...
 
wxTimer m_ReparseTimer
 a file is need to be reparsed, maybe another file will to be reparsed very soon, so use a timer to collect all the files need to be reparsed. More...
 
wxTimer m_BatchTimer
 a timer to delay the operation of batch parsing, see OnBatchTimer() member function as a reference More...
 
wxStopWatch m_StopWatch
 a stop watch to measure parsing time More...
 
bool m_StopWatchRunning
 
long m_LastStopWatchTime
 
bool m_IgnoreThreadEvents
 Parser::OnAllThreadsDone will be called when m_Pool finished its job, but when we run a batch parsing, we may receive several such event from the m_Pool, because 1, when ParserThreadedTask finished 2, when batchFiles get finished 3, mark C::B project files's token as local. More...
 
StringList m_BatchParseFiles
 All other batch parse files, like the normal headers/sources. More...
 
wxString m_PredefinedMacros
 Pre-defined macros, its a buffer queried from the compiler command line. More...
 
wxString m_LastPredefinedMacros
 
bool m_IsBatchParseDone
 used to measure batch parse time More...
 
ParserCommon::ParserState m_ParserState
 indicated the current state the parser More...
 
bool m_NeedMarkFileAsLocal
 if true, all the files of the current project will be labeled as "local" More...
 
TasksQueue m_tasksQueue
 

Friends

class ParserThreadedTask
 

Detailed Description

Parser class holds all the tokens of a C::B project.

Parser class contains the TokenTree which is a trie structure to record the token information. For details about trie, see http://en.wikipedia.org/wiki/Trie The parser class manages Parser threaded Tasks in a ThreadPool. A ParserThread object is associated with a single source file. Batch parse mode means we have a lot of files to be parsed, so a lot of ParserThreads were generated and added to the ThreadPool, and finally, the ParserThread was executed by ThreadPool.

Definition at line 117 of file parser.h.

Member Typedef Documentation

◆ TasksQueue

typedef std::list<cbThreadedTask*> Parser::TasksQueue
private

A list to contain pointers to internal running threads.

Definition at line 360 of file parser.h.

Constructor & Destructor Documentation

◆ Parser()

Parser::Parser ( wxEvtHandler parent,
cbProject project 
)

constructor

Parameters
parentwhich is actually a NativeParser object
projectthe C::B project associated with the current Parser

Definition at line 98 of file parser.cpp.

References ConnectEvents(), and ReadOptions().

◆ ~Parser()

Parser::~Parser ( )
virtual

Member Function Documentation

◆ AbortParserThreads()

void Parser::AbortParserThreads ( )
private

Tell internal running threads to abort further processing.

Definition at line 945 of file parser.cpp.

References m_tasksQueue.

Referenced by TerminateAllThreads().

◆ AddBatchParse()

void Parser::AddBatchParse ( const StringList filenames)
virtual

◆ AddFile()

bool Parser::AddFile ( const wxString filename,
cbProject project,
bool  isLocal = true 
)
virtual

this usually happens when user adds some files to an existing project, it just use AddParse() function internally to add the file.

and switch the ParserState to ParserCommon::ptAddFileToParser.

Definition at line 494 of file parser.cpp.

References AddParse(), IsFileParsed(), m_NeedMarkFileAsLocal, m_ParserState, m_Project, ParserCommon::ptAddFileToParser, and ParserCommon::ptUndefined.

◆ AddParse()

void Parser::AddParse ( const wxString filename)
virtual

Add one file to Batch mode Parsing, this is the bridge between the main thread and the thread pool, after this function call, the file(Parserthread) will be run from the thread pool.

Parameters
filenamesinput file name

Definition at line 253 of file parser.cpp.

References _T, CC_LOCKER_TRACK_P_MTX_LOCK, CC_LOCKER_TRACK_P_MTX_UNLOCK, wxTimer::IsRunning(), m_BatchParseFiles, m_BatchTimer, m_IsParsing, ParserCommon::PARSER_BATCHPARSE_TIMER_DELAY, ParserCommon::s_ParserMutex, wxTimer::Start(), wxTimer::Stop(), TRACE, and wxTIMER_ONE_SHOT.

Referenced by AddFile(), and ReparseModifiedFiles().

◆ AddParserThread()

void Parser::AddParserThread ( cbThreadedTask task)
private

Remember a newly created internal running threads.

Definition at line 933 of file parser.cpp.

References m_tasksQueue.

Referenced by Parse().

◆ AddPredefinedMacros()

void Parser::AddPredefinedMacros ( const wxString defs)
virtual

set the predefined macro definition string was collected from the GCC command line, this function adds the string to an internal m_PredefinedMacros, and switch the ParserState

Definition at line 184 of file parser.cpp.

References _T, CC_LOCKER_TRACK_P_MTX_LOCK, CC_LOCKER_TRACK_P_MTX_UNLOCK, wxTimer::IsRunning(), m_BatchTimer, m_IsParsing, m_ParserState, m_PredefinedMacros, ParserCommon::PARSER_BATCHPARSE_TIMER_DELAY, ParserCommon::ptCreateParser, ParserCommon::ptUndefined, ParserCommon::s_ParserMutex, wxTimer::Start(), wxTimer::Stop(), TRACE, and wxTIMER_ONE_SHOT.

◆ ClearPredefinedMacros()

void Parser::ClearPredefinedMacros ( )
virtual

clears the list of predefined macros after it has been parsed

Definition at line 211 of file parser.cpp.

References CC_LOCKER_TRACK_P_MTX_LOCK, CC_LOCKER_TRACK_P_MTX_UNLOCK, wxString::Clear(), m_LastPredefinedMacros, m_PredefinedMacros, and ParserCommon::s_ParserMutex.

Referenced by ParserThreadedTask::Execute().

◆ ConnectEvents()

void Parser::ConnectEvents ( )
private

connect event handlers of the timers and thread pool

Definition at line 135 of file parser.cpp.

References cbEVT_THREADTASK_ALLDONE, wxTimer::GetId(), cbThreadPool::GetId(), m_BatchTimer, m_Pool, m_ReparseTimer, OnAllThreadsDone(), OnBatchTimer(), OnReparseTimer(), and wxEVT_TIMER.

Referenced by Parser().

◆ DisconnectEvents()

void Parser::DisconnectEvents ( )
private

connect event handlers of the timers and thread pool

Definition at line 143 of file parser.cpp.

References cbEVT_THREADTASK_ALLDONE, wxTimer::GetId(), cbThreadPool::GetId(), m_BatchTimer, m_Pool, m_ReparseTimer, OnAllThreadsDone(), OnBatchTimer(), OnReparseTimer(), and wxEVT_TIMER.

Referenced by ~Parser().

◆ Done()

bool Parser::Done ( )
virtual

check to see whether Parser is in Idle mode, there is no work need to be done in the Parser

Reimplemented from ParserBase.

Definition at line 151 of file parser.cpp.

References CC_LOCKER_TRACK_P_MTX_LOCK, CC_LOCKER_TRACK_P_MTX_UNLOCK, cbThreadPool::Done(), wxString::IsEmpty(), m_BatchParseFiles, m_NeedMarkFileAsLocal, m_Pool, m_PredefinedMacros, and ParserCommon::s_ParserMutex.

Referenced by Reparse(), ReparseModifiedFiles(), and UpdateParsingProject().

◆ EndStopWatch()

void Parser::EndStopWatch ( )
protected

◆ GetMaxThreads()

unsigned int Parser::GetMaxThreads ( ) const
inlineprotected

Node: Currently, the max.

concurrent ParserThread number should be ONE, CC does not support multiply threads parsing.

Definition at line 214 of file parser.h.

◆ GetPredefinedMacros()

const wxString Parser::GetPredefinedMacros ( ) const
virtual

return the predefined macro definition string that has been collected

Reimplemented from ParserBase.

Definition at line 221 of file parser.cpp.

References _T, CCLogger::DebugLog(), CCLogger::Get(), and m_LastPredefinedMacros.

◆ IsFileParsed()

bool Parser::IsFileParsed ( const wxString filename)
virtual

check to see a file is parsed already, it first check the TokenTree to see whether it has the specified file, but if a file is already queued (put in m_BatchParseFiles), we regard it as already parsed.

Definition at line 821 of file parser.cpp.

References CC_LOCKER_TRACK_P_MTX_LOCK, CC_LOCKER_TRACK_P_MTX_UNLOCK, CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, TokenTree::IsFileParsed(), m_BatchParseFiles, ParserBase::m_TokenTree, ParserCommon::s_ParserMutex, and s_TokenTreeMutex.

Referenced by AddFile().

◆ NotDoneReason()

wxString Parser::NotDoneReason ( )
virtual

◆ OnAllThreadsDone()

void Parser::OnAllThreadsDone ( CodeBlocksEvent event)
protected

◆ OnBatchTimer()

void Parser::OnBatchTimer ( wxTimerEvent event)
protected

◆ OnReparseTimer()

void Parser::OnReparseTimer ( wxTimerEvent event)
protected

some files in the Tokentree is marked as need to be reparsed, this can be done by a call of Reparse() before.

So, in this timer event handler, we need to remove all the tokens of files in the Tree, and then re-parse them again. This is done by AddParse() again. the Parser status now switch to ParserCommon::ptReparseFile.

Definition at line 697 of file parser.cpp.

References ReparseModifiedFiles().

Referenced by ConnectEvents(), and DisconnectEvents().

◆ Parse()

bool Parser::Parse ( const wxString filename,
bool  isLocal = true,
bool  locked = false 
)
protected

◆ ParseBuffer()

bool Parser::ParseBuffer ( const wxString buffer,
bool  isLocal,
bool  bufferSkipBlocks = false,
bool  isTemp = false,
const wxString filename = wxEmptyString,
int  parentIdx = -1,
int  initLine = 0 
)
virtual

◆ ParseBufferForFunctions()

bool Parser::ParseBufferForFunctions ( const wxString buffer)
virtual

◆ ParseBufferForNamespaces()

bool Parser::ParseBufferForNamespaces ( const wxString buffer,
NameSpaceVec result 
)
virtual

◆ ParseBufferForUsingNamespace()

bool Parser::ParseBufferForUsingNamespace ( const wxString buffer,
wxArrayString result,
bool  bufferSkipBlocks = true 
)
virtual

◆ ParseFile()

bool Parser::ParseFile ( const wxString filename,
bool  isGlobal,
bool  locked = false 
)
privatevirtual

the only usage of this function is in the Parserthread class, when handling include directives the parserthread use some call like m_Parent->ParseFile() to call this function, but this function just call Parser::Parse() function, which either run the syntax analysis immediately or create a parsing task in the Pool.

Parameters
filenamethe file we want to parse
isGlobaltrue if the file is not belong to a C::B project
lockedtrue if the TokenTree is locked. when initially parse a translation unit file the locked should be set as false, but if you want to recursive parse to an include file the locked value should be set as true.

Reimplemented from ParserBase.

Definition at line 660 of file parser.cpp.

References ParserOptions::followGlobalIncludes, ParserOptions::followLocalIncludes, wxString::IsEmpty(), ParserBase::m_Options, and Parse().

◆ ProcessParserEvent()

void Parser::ProcessParserEvent ( ParserCommon::ParserState  state,
int  id,
const wxString info = wxEmptyString 
)
protected

The parser will let its parent (NativeParser) to handle the event, as the CodeCompletion instance was set as the next handler of the NativeParser.

Those events can finally go to the CodeCompletion's event handler.

Parameters
statethe state of the Parser, it could be any kind of enum ParserState
ideither idParserStart or idParserEnd
infothe log message

Definition at line 845 of file parser.cpp.

References m_Parent, and m_Project.

Referenced by OnAllThreadsDone(), and OnBatchTimer().

◆ ReadOptions()

void Parser::ReadOptions ( )
protectedvirtual

◆ RemoveFile()

bool Parser::RemoveFile ( const wxString filename)
virtual

◆ RemoveParserThread()

void Parser::RemoveParserThread ( cbThreadedTask task)
private

Remove a completed internal running threads.

Definition at line 939 of file parser.cpp.

References m_tasksQueue.

Referenced by Parse().

◆ Reparse()

bool Parser::Reparse ( const wxString filename,
bool  isLocal = true 
)
virtual

mark this file to be re-parsed in the TokenTree, tick the reparse timer, note it looks like the isLocal parameter is not used in Parser::Reparse function.

A better function name could be: MarkFileNeedToBeReParsed()

Definition at line 515 of file parser.cpp.

References _T, CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, CCLogger::DebugLog(), Done(), TokenTree::FlagFileForReparsing(), CCLogger::Get(), wxTimer::IsRunning(), m_NeedsReparse, m_ReparseTimer, ParserBase::m_TokenTree, NotDoneReason(), ParserCommon::PARSER_REPARSE_TIMER_DELAY, s_TokenTreeMutex, wxTimer::Start(), wxTimer::Stop(), TRACE, and wxTIMER_ONE_SHOT.

◆ ReparseModifiedFiles()

void Parser::ReparseModifiedFiles ( )
protected

◆ SetMaxThreads()

void Parser::SetMaxThreads ( unsigned int  max)
inlineprotected

Not used, because the ThreadPool only support running ONE ParserThread concurrently.

Definition at line 217 of file parser.h.

References wxEmptyString.

◆ StartStopWatch()

void Parser::StartStopWatch ( )
protected

Definition at line 675 of file parser.cpp.

References m_StopWatch, m_StopWatchRunning, and wxStopWatch::Start().

Referenced by OnBatchTimer().

◆ TerminateAllThreads()

void Parser::TerminateAllThreads ( )
protected

cancel all the tasks in the thread pool m_Pool

Definition at line 541 of file parser.cpp.

References cbThreadPool::AbortAllTasks(), AbortParserThreads(), cbThreadPool::Done(), m_Pool, and wxMilliSleep().

Referenced by ~Parser().

◆ UpdateParsingProject()

bool Parser::UpdateParsingProject ( cbProject project)
virtual

set the associated C::B project pointer.

(only used by one parser for whole workspace)

Returns
true if it can do the switch, other wise, return false, and print some debug logs.

Definition at line 553 of file parser.cpp.

References _T, CCLogger::DebugLog(), Done(), CCLogger::Get(), m_Project, and NotDoneReason().

◆ WriteOptions()

void Parser::WriteOptions ( )
protectedvirtual

Friends And Related Function Documentation

◆ ParserThreadedTask

friend class ParserThreadedTask
friend

Definition at line 119 of file parser.h.

Referenced by OnBatchTimer().

Member Data Documentation

◆ m_BatchParseFiles

StringList Parser::m_BatchParseFiles
private

All other batch parse files, like the normal headers/sources.

Definition at line 344 of file parser.h.

Referenced by AddBatchParse(), AddParse(), Done(), ParserThreadedTask::Execute(), IsFileParsed(), NotDoneReason(), OnAllThreadsDone(), and OnBatchTimer().

◆ m_BatchTimer

wxTimer Parser::m_BatchTimer
private

a timer to delay the operation of batch parsing, see OnBatchTimer() member function as a reference

Definition at line 328 of file parser.h.

Referenced by AddBatchParse(), AddParse(), AddPredefinedMacros(), ConnectEvents(), DisconnectEvents(), OnAllThreadsDone(), and OnBatchTimer().

◆ m_IgnoreThreadEvents

bool Parser::m_IgnoreThreadEvents
private

Parser::OnAllThreadsDone will be called when m_Pool finished its job, but when we run a batch parsing, we may receive several such event from the m_Pool, because 1, when ParserThreadedTask finished 2, when batchFiles get finished 3, mark C::B project files's token as local.

Definition at line 341 of file parser.h.

Referenced by ParserThreadedTask::Execute(), and OnAllThreadsDone().

◆ m_IsBatchParseDone

bool Parser::m_IsBatchParseDone
private

used to measure batch parse time

Definition at line 351 of file parser.h.

Referenced by EndStopWatch(), and OnAllThreadsDone().

◆ m_IsFirstBatch

bool Parser::m_IsFirstBatch
protected

batch Parse mode flag.

It was set after consuming m_PredefinedMacros, it was reset after the final stage (mark token as local).

Definition at line 315 of file parser.h.

Referenced by ParserThreadedTask::Execute().

◆ m_IsParsing

bool Parser::m_IsParsing
protected

true, if the parser is still busy with parsing, false if the parsing stage has finished this value is set in parserthreadedtask after putting all the batchFiles to pool(task) it was reset after the last stage (mark tokens as local)

Definition at line 304 of file parser.h.

Referenced by AddBatchParse(), AddParse(), AddPredefinedMacros(), ParserThreadedTask::Execute(), and OnAllThreadsDone().

◆ m_LastPredefinedMacros

wxString Parser::m_LastPredefinedMacros
private

Definition at line 348 of file parser.h.

Referenced by ClearPredefinedMacros(), and GetPredefinedMacros().

◆ m_LastStopWatchTime

long Parser::m_LastStopWatchTime
private

Definition at line 333 of file parser.h.

Referenced by EndStopWatch(), and OnAllThreadsDone().

◆ m_NeedMarkFileAsLocal

bool Parser::m_NeedMarkFileAsLocal
private

if true, all the files of the current project will be labeled as "local"

Definition at line 357 of file parser.h.

Referenced by AddFile(), Done(), NotDoneReason(), and OnAllThreadsDone().

◆ m_NeedsReparse

bool Parser::m_NeedsReparse
protected

Indicates some files in the current project need to be re-parsed, this is commonly caused that the "real-time parsing option" is enabled, and user is editing source file.

Definition at line 310 of file parser.h.

Referenced by OnAllThreadsDone(), Parse(), Reparse(), and ReparseModifiedFiles().

◆ m_Parent

wxEvtHandler* Parser::m_Parent
private

when initialized, this variable will be an instance of a NativeParser

Definition at line 285 of file parser.h.

Referenced by ProcessParserEvent().

◆ m_ParserState

ParserCommon::ParserState Parser::m_ParserState
private

indicated the current state the parser

Definition at line 354 of file parser.h.

Referenced by AddBatchParse(), AddFile(), AddPredefinedMacros(), OnAllThreadsDone(), OnBatchTimer(), and ReparseModifiedFiles().

◆ m_Pool

cbThreadPool Parser::m_Pool
protected

Thread Pool, executing all the ParserThread, used in batch parse mode.

The thread pool can add/remove/execute the ParserThread tasks, it will also notify the Parser that all the thread are done.

Definition at line 298 of file parser.h.

Referenced by ConnectEvents(), DisconnectEvents(), Done(), NotDoneReason(), OnAllThreadsDone(), OnBatchTimer(), Parse(), and TerminateAllThreads().

◆ m_PredefinedMacros

wxString Parser::m_PredefinedMacros
private

Pre-defined macros, its a buffer queried from the compiler command line.

Definition at line 347 of file parser.h.

Referenced by AddPredefinedMacros(), ClearPredefinedMacros(), Done(), ParserThreadedTask::Execute(), NotDoneReason(), OnAllThreadsDone(), and OnBatchTimer().

◆ m_Project

cbProject* Parser::m_Project
private

referring to the C::B cbp project currently parsing in one parser per workspace mode

Definition at line 288 of file parser.h.

Referenced by AddFile(), OnAllThreadsDone(), ProcessParserEvent(), and UpdateParsingProject().

◆ m_ReparseTimer

wxTimer Parser::m_ReparseTimer
private

a file is need to be reparsed, maybe another file will to be reparsed very soon, so use a timer to collect all the files need to be reparsed.

This avoid starting running the thread pool to quickly

Definition at line 323 of file parser.h.

Referenced by ConnectEvents(), DisconnectEvents(), Reparse(), and ReparseModifiedFiles().

◆ m_StopWatch

wxStopWatch Parser::m_StopWatch
private

a stop watch to measure parsing time

Definition at line 331 of file parser.h.

Referenced by EndStopWatch(), OnBatchTimer(), and StartStopWatch().

◆ m_StopWatchRunning

bool Parser::m_StopWatchRunning
private

Definition at line 332 of file parser.h.

Referenced by EndStopWatch(), and StartStopWatch().

◆ m_tasksQueue

TasksQueue Parser::m_tasksQueue
private

Definition at line 361 of file parser.h.

Referenced by AbortParserThreads(), AddParserThread(), and RemoveParserThread().

◆ m_UsingCache

bool Parser::m_UsingCache
protected

used to detect changes between in-memory data and cache, true if loaded from cache

Definition at line 292 of file parser.h.


The documentation for this class was generated from the following files: