Code::Blocks
SVN r11506
|
#include <parser_base.h>
Public Member Functions | |
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 | ParseBuffer (const wxString &buffer, bool isLocal, bool bufferSkipBlocks=false, bool isTemp=false, const wxString &filename=wxEmptyString, int parentIdx=-1, int initLine=0) |
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 bool | Done () |
virtual wxString | NotDoneReason () |
virtual TokenTree * | GetTokenTree () const |
TokenTree * | GetTempTokenTree () |
virtual const wxString | GetPredefinedMacros () const |
void | AddIncludeDir (const wxString &dir) |
add a directory to the Parser's include path database More... | |
const wxArrayString & | GetIncludeDirs () 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 void | ReadOptions () |
read Parser options from configure file More... | |
virtual void | WriteOptions () |
write Parse options to configure file More... | |
virtual ParserOptions & | Options () |
virtual BrowserOptions & | ClassBrowserOptions () |
size_t | FindTokensInFile (const wxString &filename, TokenIdxSet &result, short int kindMask) |
Protected Attributes | |
TokenTree * | m_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... | |
TokenTree * | m_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 Member Functions | |
virtual bool | ParseFile (const wxString &filename, bool isGlobal, bool locked=false) |
wxString | FindFirstFileInIncludeDirs (const wxString &file) |
Private Attributes | |
SearchTree< wxString > | m_GlobalIncludes |
wxString -> wxString map More... | |
wxArrayString | m_IncludeDirs |
the include directories can be either three kinds below: 1, compiler's default search paths, e.g. More... | |
Friends | |
class | ParserThread |
Definition at line 124 of file parser_base.h.
ParserBase::ParserBase | ( | ) |
Definition at line 180 of file parser_base.cpp.
References m_TempTokenTree, and m_TokenTree.
|
virtual |
Definition at line 186 of file parser_base.cpp.
References CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, Delete(), m_TempTokenTree, m_TokenTree, and s_TokenTreeMutex.
|
inlinevirtual |
Definition at line 132 of file parser_base.h.
Referenced by NativeParser::DoFullParsing().
|
inlinevirtual |
Definition at line 146 of file parser_base.h.
Referenced by NativeParser::AddFileToParser().
void ParserBase::AddIncludeDir | ( | const wxString & | dir | ) |
add a directory to the Parser's include path database
Definition at line 284 of file parser_base.cpp.
References _T, wxArrayString::Add(), wxDir::Exists(), wxArrayString::Index(), wxString::IsEmpty(), wxString::Last(), m_IncludeDirs, wxString::RemoveLast(), TRACE, wxString::wx_str(), and wxNOT_FOUND.
Referenced by NativeParser::AddCompilerDirs(), NativeParser::AddGCCCompilerDirs(), NativeParser::AddIncludeDirsToParser(), NativeParser::AddProjectToParser(), CCOptionsProjectDlg::OnApply(), and NativeParser::OnEditorActivated().
|
inlinevirtual |
Definition at line 133 of file parser_base.h.
|
inlinevirtual |
Definition at line 134 of file parser_base.h.
Referenced by NativeParser::AddCompilerPredefinedMacros(), and NativeParser::AddProjectDefinedMacros().
|
inlinevirtual |
Definition at line 175 of file parser_base.h.
Referenced by CCOptionsDlg::OnApply(), ClassBrowser::OnCBExpandNS(), ClassBrowser::OnCBViewMode(), NativeParser::OnEditorActivated(), ClassBrowser::OnSetSortType(), ClassBrowser::OnThreadEvent(), ClassBrowser::OnTreeSelChanged(), ClassBrowser::OnViewScope(), NativeParser::SetCBViewMode(), ClassBrowser::SetParser(), ClassBrowser::ShowMenu(), ClassBrowser::ThreadedBuildTree(), and ClassBrowser::UpdateClassBrowserView().
|
inlinevirtual |
Reimplemented in Parser.
Definition at line 150 of file parser_base.h.
Referenced by NativeParser::GetCallTips(), CodeRefactoring::GetSymbolUnderCursor(), NativeParser::MarkItemsByAI(), and NativeParser::UpdateClassBrowser().
wxArrayString ParserBase::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.
Definition at line 320 of file parser_base.cpp.
References _T, wxArrayString::Add(), wxArrayString::GetCount(), wxFileName::GetFullPath(), m_IncludeDirs, NormalizePath(), TRACE, wxString::wx_str(), and wxFileExists().
Referenced by FindFirstFileInIncludeDirs().
Definition at line 305 of file parser_base.cpp.
References SearchTree< T >::AddItem(), FindFileInIncludeDirs(), wxArrayString::GetCount(), SearchTree< T >::GetItem(), wxString::IsEmpty(), m_GlobalIncludes, and UnixFilename().
Referenced by GetFullFileName().
size_t ParserBase::FindTokensInFile | ( | const wxString & | filename, |
TokenIdxSet & | result, | ||
short int | kindMask | ||
) |
Definition at line 381 of file parser_base.cpp.
References _T, TokenTree::at(), CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, TokenTree::FindTokensInFile(), m_TokenTree, s_TokenTreeMutex, TRACE, and wxString::wx_str().
Referenced by NativeParser::FindCurrentFunctionStart().
Definition at line 343 of file parser_base.cpp.
References wxString::Clear(), FindFirstFileInIncludeDirs(), wxFileName::GetFullPath(), wxFileName::GetPath(), wxString::IsEmpty(), NormalizePath(), and wxFileExists().
Referenced by ParserThread::HandleIncludes().
|
inline |
Definition at line 160 of file parser_base.h.
Referenced by CodeCompletion::GetSystemIncludeDirs(), ClassBrowser::OnJumpTo(), and ClassBrowser::OnTreeItemDoubleClick().
|
inlinevirtual |
|
inline |
Definition at line 154 of file parser_base.h.
Referenced by NativeParser::MarkItemsByAI().
|
virtual |
Definition at line 196 of file parser_base.cpp.
References m_TokenTree.
Referenced by NativeParser::AI(), ClassBrowserBuilderThread::CreateSpecialFolders(), MarkFileAsLocalThreadedTask::Execute(), NativeParser::FindCurrentFunctionStart(), NativeParser::FindCurrentFunctionToken(), NativeParser::GetCallTips(), ClassBrowserBuilderThread::Init(), NativeParser::MarkItemsByAI(), DocumentationHelper::OnDocumentationLink(), ClassBrowser::OnSearch(), CodeRefactoring::Parse(), NativeParser::ParseBufferForUsingNamespace(), NativeParser::ParseFunctionArguments(), NativeParser::ParseLocalBlock(), NativeParser::SetParser(), ClassBrowser::ThreadedBuildTree(), and CodeRefactoring::VerifyResult().
|
inlinevirtual |
Definition at line 148 of file parser_base.h.
Referenced by NativeParser::GetProjectByFilename(), and NativeParser::OnEditorActivated().
|
inlinevirtual |
Reimplemented in Parser.
Definition at line 151 of file parser_base.h.
References wxEmptyString.
Referenced by CodeRefactoring::GetSymbolUnderCursor(), and NativeParser::MarkItemsByAI().
|
inlinevirtual |
Definition at line 174 of file parser_base.h.
References ParserThread::m_Options.
Referenced by NativeParser::AddCompilerDirs(), NativeParser::AddCompilerIncludeDirsToParser(), NativeParser::AddCompilerPredefinedMacros(), NativeParser::AddCompilerPredefinedMacrosGCC(), NativeParser::AddCompilerPredefinedMacrosVC(), NativeParser::AddProjectDefinedMacros(), NativeParser::DoFullParsing(), CCOptionsDlg::OnApply(), and NativeParser::RereadParserOptions().
|
virtual |
Reimplemented in Parser.
Definition at line 249 of file parser_base.cpp.
References ParserThreadOptions::bufferSkipBlocks, ParserThreadOptions::fileOfBuffer, ParserThreadOptions::followGlobalIncludes, ParserThreadOptions::followLocalIncludes, ParserThreadOptions::handleFunctions, ParserThreadOptions::initLineOfBuffer, ParserThreadOptions::isTemp, m_Options, m_TokenTree, ParserThreadOptions::parentIdxOfBuffer, ParserThread::Parse(), ParserThreadOptions::parseComplexMacros, ParserThreadOptions::platformCheck, ParserOptions::storeDocumentation, ParserThreadOptions::storeDocumentation, ParserThreadOptions::useBuffer, ParserThreadOptions::wantPreprocessor, and ParserOptions::wantPreprocessor.
Referenced by NativeParser::ParseFunctionArguments(), and NativeParser::ParseLocalBlock().
|
inlinevirtual |
Definition at line 140 of file parser_base.h.
|
inlinevirtual |
Definition at line 141 of file parser_base.h.
|
inlinevirtual |
Definition at line 142 of file parser_base.h.
Referenced by NativeParser::ParseBufferForUsingNamespace().
|
privatevirtual |
Reimplemented in Parser.
Definition at line 201 of file parser_base.cpp.
References Reparse().
Referenced by ParserThread::HandleIncludes().
|
inlinevirtual |
read Parser options from configure file
Reimplemented in Parser.
Definition at line 169 of file parser_base.h.
Referenced by CCOptionsDlg::OnApply(), and NativeParser::RereadParserOptions().
|
inlinevirtual |
Definition at line 147 of file parser_base.h.
Referenced by NativeParser::RemoveFileFromParser().
|
virtual |
Definition at line 206 of file parser_base.cpp.
References m_TokenTree, ParserThread::Parse(), ParserThread, TokenTree::ReserveFileForParsing(), and ParserThreadOptions::useBuffer.
Referenced by ParseFile(), and NativeParser::ReparseFile().
|
inlinevirtual |
Definition at line 135 of file parser_base.h.
References wxEmptyString.
Referenced by NativeParser::AddFileToParser(), NativeParser::AddProjectToParser(), and NativeParser::ReparseFile().
|
inlinevirtual |
write Parse options to configure file
Reimplemented in Parser.
Definition at line 171 of file parser_base.h.
Referenced by CCOptionsDlg::OnApply(), ClassBrowser::OnCBExpandNS(), ClassBrowser::OnCBViewMode(), ClassBrowser::OnSetSortType(), ClassBrowser::OnViewScope(), and ClassBrowser::SetParser().
|
friend |
Definition at line 126 of file parser_base.h.
Referenced by Parser::Parse(), and Reparse().
|
protected |
options for how the symbol browser was shown
Definition at line 199 of file parser_base.h.
Referenced by Parser::ReadOptions(), and Parser::WriteOptions().
|
private |
Definition at line 205 of file parser_base.h.
Referenced by FindFirstFileInIncludeDirs().
|
private |
the include directories can be either three kinds below: 1, compiler's default search paths, e.g.
E:
, project's common folders, e.g. the folder where you put the cbp file in 3, the compiler include search paths defined in the cbp, like: E:.8
Definition at line 212 of file parser_base.h.
Referenced by AddIncludeDir(), and FindFileInIncludeDirs().
|
protected |
options for how the parser try to parse files
Definition at line 196 of file parser_base.h.
Referenced by Parser::Parse(), ParseBuffer(), Parser::ParseBuffer(), Parser::ParseBufferForFunctions(), Parser::ParseBufferForNamespaces(), Parser::ParseBufferForUsingNamespace(), Parser::ParseFile(), Parser::ReadOptions(), and Parser::WriteOptions().
|
protected |
a temp Token tree hold some temporary tokens, e.g.
parsing a buffer containing some preprocessor directives, see ParseBufferForFunctions() like functions this tree will be created in the constructor and destroyed in destructor.
Definition at line 193 of file parser_base.h.
Referenced by Parser::ParseBufferForFunctions(), Parser::ParseBufferForNamespaces(), Parser::ParseBufferForUsingNamespace(), ParserBase(), and ~ParserBase().
|
protected |
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.
Definition at line 187 of file parser_base.h.
Referenced by FindTokensInFile(), GetTokenTree(), Parser::IsFileParsed(), Parser::OnAllThreadsDone(), Parser::Parse(), ParseBuffer(), Parser::ParseBuffer(), ParserBase(), Parser::RemoveFile(), Reparse(), Parser::Reparse(), Parser::ReparseModifiedFiles(), and ~ParserBase().