25 typedef std::map< size_t, TokenIdxSet, std::less<size_t> >
TokenFileMap;
198 TokenFileMap::const_iterator it =
m_FileMap.find(fileIdx);
199 return (it ==
m_FileMap.end() ? 0 : &(it->second));
244 bool caseSensitive,
bool is_prefix);
381 #endif // TOKENTREE_H const TokenIdxSet * GetTokensBelongToFile(size_t fileIdx) const
std::vector< Token * > TokenList
int TokenExists(const wxString &name, int parent, short int kindMask)
query tokens by names
BasicSearchTree TokenFilenameMap
TokenSearchTree m_Tree
This is a string->TokenIndexSet map.
void RenameToken(Token *token, const wxString &newName)
only the token's name need to be changed, thus update the index map of the TokenTree ...
size_t InsertFileOrGetIndex(const wxString &filename)
put the filename in the m_FilenameMap, and return the file index, if this file is already in the m_Fi...
std::set< size_t, std::less< size_t > > TokenFileSet
std::deque< int > TokenIdxList
void InsertTokenBelongToFile(size_t fileIdx, int tokenIdx)
int erase(int loc)
remove the Token specified by the index
const wxString GetFilename(size_t fileIdx) const
const TokenIdxSet * GetGlobalNameSpaces() const
all kinds of tokens under global name spaces
void EraseFilesToBeReparsedByIndex(size_t fileIdx)
void FlagFileAsParsed(const wxString &filename)
mark the file status as fpsDone, since parsing this file is done
TokenList m_Tokens
Contains the pointers to all the Token instances, it is just a std::vector<Token*>, the suggest way to access a Token instance is by first get its index in the m_Tokens, then get its address by m_Tokens[index], the reason we have such indirect access is that there are many Tokens which can reference each other, it is much safe using index instead of raw pointers.
a container class to hold all the Tokens getting from parsing stage
TokenFileMap m_FileMap
Map: file indices -> sets of TokenIndexes.
size_t realsize()
some position of the std::vector<Token*> are not used, so the real size maybe a bit smaller than the ...
TokenFileStatusMap m_FileStatusMap
Map: file indices -> status.
size_t size()
total size of std::vector<Token*>
size_t GetFileMapSize() const
void AppendDocumentation(int tokenIdx, unsigned int fileIdx, const wxString &doc)
associate a document string with the token
void RecalcFreeList()
collect the unused slots in the std::vector<Token*>
void RecalcInheritanceChain(Token *token)
convert the Token's ancestor string to it's IDs this contains recursive calls, for example in such co...
std::map< size_t, TokenIdxSet, std::less< size_t > > TokenFileMap
bool empty()
check to see whether the TokenTree is empty
void RecalcFullInheritance(int parentIdx, TokenIdxSet &result)
bool CheckChildRemove(const Token *token, int fileIdx)
Check all the children belong this token should be removed.
std::map< size_t, FileParsingStatus, std::less< size_t > > TokenFileStatusMap
void RemoveFile(const wxString &filename)
remove tokens belong to the file
std::map< int, wxString > TokenIdxStringMap
a symbol found in the parsed files, it can be many kinds, such as a variable, a class and so on...
int AddTokenToList(Token *newToken, int forceidx=-1)
add the Token pointer to the vector<Token*>, mostly the default value forceidx = -1 is used which add...
std::set< int, std::less< int > > TokenIdxSet
size_t GetFileStatusCountForIndex(size_t fileIdx) const
size_t GetFileIndex(const wxString &filename)
const Token * at(int idx) const
size_t FindTokensInFile(const wxString &filename, TokenIdxSet &result, short int kindMask)
find tokens belong to a specified file
const TokenFileSet * GetFilesToBeReparsed() const
This class is generally a string -> size_t map, the tree details (graph) is already show in the decla...
const TokenList * GetTokens() const
Protected access to internal lists / maps.
void MarkFileTokensAsLocal(const wxString &filename, bool local=true, void *userData=0)
mark the tokens so that they are associated with a C::B project
Token * operator[](int idx)
size_t GetFileMatches(const wxString &filename, std::set< size_t > &result, bool caseSensitive, bool is_prefix)
wxString GetDocumentation(int tokenIdx)
get the document string associated with the token
Token * GetTokenAt(int idx)
TokenIdxSet m_GlobalNameSpaces
any tokens belong to the global namespace
void EraseFileStatusByIndex(size_t fileIdx)
friend class NativeParserTest
size_t FindMatches(const wxString &query, TokenIdxSet &result, bool caseSensitive, bool is_prefix, TokenKind kindMask=tkUndefined)
find a collection of matched tokens
void RemoveToken(int idx)
void RemoveTokenFromList(int idx)
Remove the Token specified by the idx in the vector<Token*>, note the Token instance is destroyed...
TokenIdxSet m_TopNameSpaces
namespace tokens belongs to the global namespace
size_t m_TokenTicketCount
TokenFileSet m_FilesToBeReparsed
Set: file indices.
TokenFilenameMap m_FilenameMap
Map: file names -> file indices.
size_t ReserveFileForParsing(const wxString &filename, bool preliminary=false)
mark a file to be parsed.
const TokenFileMap * GetFilesMap() const
void EraseFileMapInFileMap(size_t fileIdx)
SearchTree< TokenIdxSet > TokenSearchTree
int insert(Token *newToken)
add a new Token instance to the TokenTree
bool IsFileParsed(const wxString &filename)
is the file name is in the tokentree, and it's status is either assigned or beingparsed or done also...
void FlagFileForReparsing(const wxString &filename)
mark the file as "need to be reparsed" status, usually happens that this file is saved(updated) so a ...
TokenIdxList m_FreeTokens
List of all the deleted (and available) tokens.
int AddToken(Token *newToken, int forceidx=-1)