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

#include <parser_base.h>

Inheritance diagram for ParserBase:
Collaboration diagram for ParserBase:

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
 

Detailed Description

Definition at line 124 of file parser_base.h.

Constructor & Destructor Documentation

◆ ParserBase()

ParserBase::ParserBase ( )

Definition at line 180 of file parser_base.cpp.

References m_TempTokenTree, and m_TokenTree.

◆ ~ParserBase()

ParserBase::~ParserBase ( )
virtual

Member Function Documentation

◆ AddBatchParse()

virtual void ParserBase::AddBatchParse ( cb_unused const StringList &  filenames)
inlinevirtual

Definition at line 132 of file parser_base.h.

Referenced by NativeParser::DoFullParsing().

◆ AddFile()

virtual bool ParserBase::AddFile ( cb_unused const wxString &  filename,
cb_unused cbProject *  project,
cb_unused bool  isLocal = true 
)
inlinevirtual

Definition at line 146 of file parser_base.h.

Referenced by NativeParser::AddFileToParser().

◆ AddIncludeDir()

void ParserBase::AddIncludeDir ( const wxString &  dir)

◆ AddParse()

virtual void ParserBase::AddParse ( cb_unused const wxString &  filename)
inlinevirtual

Definition at line 133 of file parser_base.h.

◆ AddPredefinedMacros()

virtual void ParserBase::AddPredefinedMacros ( cb_unused const wxString &  defs)
inlinevirtual

◆ ClassBrowserOptions()

virtual BrowserOptions& ParserBase::ClassBrowserOptions ( )
inlinevirtual

◆ Done()

virtual bool ParserBase::Done ( )
inlinevirtual

◆ FindFileInIncludeDirs()

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().

◆ FindFirstFileInIncludeDirs()

wxString ParserBase::FindFirstFileInIncludeDirs ( const wxString &  file)
private

◆ FindTokensInFile()

size_t ParserBase::FindTokensInFile ( const wxString &  filename,
TokenIdxSet &  result,
short int  kindMask 
)

◆ GetFullFileName()

wxString ParserBase::GetFullFileName ( const wxString &  src,
const wxString &  tgt,
bool  isGlobal 
)

◆ GetIncludeDirs()

const wxArrayString& ParserBase::GetIncludeDirs ( ) const
inline

◆ GetPredefinedMacros()

virtual const wxString ParserBase::GetPredefinedMacros ( ) const
inlinevirtual

Reimplemented in Parser.

Definition at line 156 of file parser_base.h.

References wxEmptyString.

◆ GetTempTokenTree()

TokenTree* ParserBase::GetTempTokenTree ( )
inline

Definition at line 154 of file parser_base.h.

Referenced by NativeParser::MarkItemsByAI().

◆ GetTokenTree()

TokenTree * ParserBase::GetTokenTree ( ) const
virtual

◆ IsFileParsed()

virtual bool ParserBase::IsFileParsed ( cb_unused const wxString &  filename)
inlinevirtual

◆ NotDoneReason()

virtual wxString ParserBase::NotDoneReason ( )
inlinevirtual

Reimplemented in Parser.

Definition at line 151 of file parser_base.h.

References wxEmptyString.

Referenced by CodeRefactoring::GetSymbolUnderCursor(), and NativeParser::MarkItemsByAI().

◆ Options()

virtual ParserOptions& ParserBase::Options ( )
inlinevirtual

◆ ParseBuffer()

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

◆ ParseBufferForFunctions()

virtual bool ParserBase::ParseBufferForFunctions ( cb_unused const wxString &  buffer)
inlinevirtual

Definition at line 140 of file parser_base.h.

◆ ParseBufferForNamespaces()

virtual bool ParserBase::ParseBufferForNamespaces ( cb_unused const wxString &  buffer,
cb_unused NameSpaceVec &  result 
)
inlinevirtual

Definition at line 141 of file parser_base.h.

◆ ParseBufferForUsingNamespace()

virtual bool ParserBase::ParseBufferForUsingNamespace ( cb_unused const wxString &  buffer,
cb_unused wxArrayString &  result,
cb_unused bool  bufferSkipBlocks = true 
)
inlinevirtual

Definition at line 142 of file parser_base.h.

Referenced by NativeParser::ParseBufferForUsingNamespace().

◆ ParseFile()

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

Reimplemented in Parser.

Definition at line 201 of file parser_base.cpp.

References Reparse().

Referenced by ParserThread::HandleIncludes().

◆ ReadOptions()

virtual void ParserBase::ReadOptions ( )
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().

◆ RemoveFile()

virtual bool ParserBase::RemoveFile ( cb_unused const wxString &  filename)
inlinevirtual

Definition at line 147 of file parser_base.h.

Referenced by NativeParser::RemoveFileFromParser().

◆ Reparse()

bool ParserBase::Reparse ( cb_unused const wxString &  filename,
cb_unused bool  isLocal = true 
)
virtual

◆ UpdateParsingProject()

virtual bool ParserBase::UpdateParsingProject ( cb_unused cbProject *  project)
inlinevirtual

◆ WriteOptions()

virtual void ParserBase::WriteOptions ( )
inlinevirtual

Friends And Related Function Documentation

◆ ParserThread

friend class ParserThread
friend

Definition at line 126 of file parser_base.h.

Referenced by Parser::Parse(), and Reparse().

Member Data Documentation

◆ m_BrowserOptions

BrowserOptions ParserBase::m_BrowserOptions
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().

◆ m_GlobalIncludes

SearchTree<wxString> ParserBase::m_GlobalIncludes
private

wxString -> wxString map

Definition at line 205 of file parser_base.h.

Referenced by FindFirstFileInIncludeDirs().

◆ m_IncludeDirs

wxArrayString ParserBase::m_IncludeDirs
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().

◆ m_Options

ParserOptions ParserBase::m_Options
protected

◆ m_TempTokenTree

TokenTree* ParserBase::m_TempTokenTree
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().

◆ m_TokenTree

TokenTree* ParserBase::m_TokenTree
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().


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