1 #ifndef ctags_cxx_scope_h_
2 #define ctags_cxx_scope_h_
4 * Copyright (c) 2016, Szymon Tomasz Stefanek
6 * This source code is released for free distribution under the terms of the
7 * GNU General Public License version 2 or (at your option) any later version.
9 * This module contains functions for parsing and scanning C++ source files
14 #include "cxx_token.h"
18 CXXScopeAccessUnknown
,
20 CXXScopeAccessPrivate
,
21 CXXScopeAccessProtected
27 CXXScopeTypeNamespace
,
32 CXXScopeTypeVariable
, // template variables, mainly
33 CXXScopeTypePrototype
,
34 CXXScopeTypeTypedef
, // template variables used in "using A = B<T>"
35 CXXScopeTypeModule
, // Just for filling the scope field of partitions
39 void cxxScopeInit(void);
40 void cxxScopeDone(void);
41 void cxxScopeClear(void);
43 // Returns the full current scope name or NULL if there
44 // is no scope currently.
45 const char * cxxScopeGetFullName(void);
47 // Returns the current scope name of NULL if there is no
48 // scope currently. This name does not include namespaces so
49 // it is always a single identifier.
50 const char * cxxScopeGetName(void);
52 // Return the corkIndex of the token representing currently scope.
53 // This can be CORK_NIL.
54 int cxxScopeGetDefTag(void);
56 // Return the number of components of the scope name.
57 int cxxScopeGetSize(void);
59 // Returns the current scope name or NULL if there is no scope
60 // currently. Ownership of the string is transferred.
61 vString
* cxxScopeGetFullNameAsString(void);
63 // Returns the current scope name with the exception of the
64 // last component or NULL if there is either no scope or there
65 // are less than two components. Ownership of the string is transferred.
66 vString
* cxxScopeGetFullNameExceptLastComponentAsString(void);
68 enum CXXScopeType
cxxScopeGetType(void);
69 // Returns the current scope kind
70 unsigned int cxxScopeGetKind(void);
71 unsigned int cxxScopeGetVariableKind(void);
72 enum CXXScopeAccess
cxxScopeGetAccess(void);
73 // Are we in global scope?
74 bool cxxScopeIsGlobal(void);
76 // Add a token to the scope chain. The token ownership is transferred.
79 enum CXXScopeType eScopeType
,
80 enum CXXScopeAccess eInitialAccess
82 void cxxScopeSetAccess(enum CXXScopeAccess eAccess
);
83 // Remove the last token from the scope chain
84 void cxxScopePop(void);
86 // Special management: pop one scope level but keep it so it can be pushed back
87 CXXToken
* cxxScopeTakeTop(void);
88 // Special management: push back a scope taken earlier via cxxScopeTakeTop()
89 void cxxScopePushTop(CXXToken
* t
);
91 #endif //!ctags_cxx_scope_h_