17 #define CC_TOKEN_DEBUG_OUTPUT 0 19 #if defined(CC_GLOBAL_DEBUG_OUTPUT) 20 #if CC_GLOBAL_DEBUG_OUTPUT == 1 21 #undef CC_TOKEN_DEBUG_OUTPUT 22 #define CC_TOKEN_DEBUG_OUTPUT 1 23 #elif CC_GLOBAL_DEBUG_OUTPUT == 2 24 #undef CC_TOKEN_DEBUG_OUTPUT 25 #define CC_TOKEN_DEBUG_OUTPUT 2 29 #if CC_TOKEN_DEBUG_OUTPUT == 1 30 #define TRACE(format, args...) \ 31 CCLogger::Get()->DebugLog(F(format, ##args)) 32 #define TRACE2(format, args...) 33 #elif CC_TOKEN_DEBUG_OUTPUT == 2 34 #define TRACE(format, args...) \ 37 if (g_EnableDebugTrace) \ 38 CCLogger::Get()->DebugLog(F(format, ##args)); \ 41 #define TRACE2(format, args...) \ 42 CCLogger::Get()->DebugLog(F(format, ##args)) 44 #define TRACE(format, args...) 45 #define TRACE2(format, args...) 86 return result << _T(
"namespace ") <<
m_Name << _T(
" {...}");
88 return result << _T(
"enum ") <<
m_Name << _T(
" {...}");
91 result << _T(
"typedef");
112 return result << _T(
" ") <<
m_Name;
135 switch (ancestor.
Len())
138 if (ancestor ==
_T(
"int"))
143 if ( ancestor ==
_T(
"void")
144 || ancestor ==
_T(
"bool")
145 || ancestor ==
_T(
"long")
146 || ancestor ==
_T(
"char") )
153 if ( ancestor ==
_T(
"short")
154 || ancestor ==
_T(
"float") )
161 if ( ancestor ==
_T(
"size_t")
162 || ancestor ==
_T(
"double") )
169 if (ancestor ==
_T(
"value_type"))
215 bool skipDefaultValue =
false;
216 for (
size_t i = 0; i <
m_Args.
Len(); ++i)
221 else if (ch ==
_T(
'='))
223 skipDefaultValue =
true;
226 else if (ch ==
_T(
','))
227 skipDefaultValue =
false;
229 if (!skipDefaultValue)
233 if (args.
Last() !=
_T(
')'))
281 TokenIdxSet::const_iterator it =
m_Children.begin();
std::map< wxString, wxString > m_TemplateMap
a string to string map from formal template argument to actual template argument
destructor class member function
int m_ParentIndex
Parent Token index.
constructor class member function
wxString m_Name
Token's name, it can be searched in the TokenTree.
std::set< size_t, std::less< size_t > > TokenFileSet
bool IsValidAncestor(const wxString &ancestor)
build in types are not valid ancestors for a type define token
typedef, note typedefs are stored as classes inheriting from the typedef'd type, this takes advantage...
int erase(int loc)
remove the Token specified by the index
container like tokens, those tokens can have children tokens
const wxString GetFilename(size_t fileIdx) const
wxString GetFilename() const
get a full path of the file which contains the current Token
wxString m_BaseArgs
stripped arguments e.g.
TokenIdxSet m_Children
if it is a class kind token, then it contains all the member tokens
wxString GetNamespace() const
get a literal string presentation of the namespace.
TokenScope m_Scope
public? private? protected?
wxArrayString m_TemplateType
for a class template, this is the formal template argument list, but for a variable Token...
wxString DisplayName() const
a short simple string to show the token information, this usually generate for show the tip message w...
bool MatchesFiles(const TokenFileSet &files)
see whether the current token belong to any files in the file set, both m_FileIdx and m_ImplFileIdx i...
wxUSE_UNICODE_dependent wxChar
unsigned int m_FileIdx
File index in TokenTree.
wxString GetStrippedArgs() const
remove all default value of the function argument string, e.g.
a symbol found in the parsed files, it can be many kinds, such as a variable, a class and so on...
wxString & RemoveLast(size_t n=1)
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
bool InheritsFrom(int idx) const
check to see the current token is inherited from a specified token
wxString & Trim(bool fromRight=true)
wxString m_Args
If it is a function Token, then this value is function arguments, e.g.
wxString GetTokenScopeString() const
the access kind string, e.g.
unsigned int m_ImplFileIdx
function implementation file index
wxString m_TemplateArgument
template argument list, comma separated list string
TokenTree * m_TokenTree
a pointer to TokenTree
bool DeleteAllChildren()
delete all the child tokens of the current token, not only remove the relation, but also delete the T...
TokenKind m_TokenKind
See TokenKind class.
wxString & Prepend(const wxString &str)
general function, not constructor nor destructor
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
int Find(wxUniChar ch, bool fromEnd=false) const
macro definition, such as: #define AAA(x,y) f(x,y), where AAA is a token of tkMacroDef ...
wxString GetImplFilename() const
get a full path of the file which contains the function implementation.
const wxString dcolon(_T("::"))
wxString m_FullType
this is the full return value (if any): e.g.
wxString GetTokenKindString() const
the token kind string, e.g.
TokenIdxSet m_DirectAncestors
the nearest ancestors
the usage of the macro, for example: AAA(1,2)
bool AddChild(int childIdx)
add a child token