CXCursorKind

\brief Describes the kind of entity that a cursor refers to.

Values

ValueMeaning
unexposedDecl1

\brief A declaration whose specific kind is not exposed via this interface.

Unexposed declarations have the same operations as any other kind of declaration; one can extract their location information, spelling, find their definitions, etc. However, the specific kind of the declaration is not reported.

structDecl2

\brief A C or C++ struct.

unionDecl3

\brief A C or C++ union.

classDecl4

\brief A C++ class.

enumDecl5

\brief An enumeration.

fieldDecl6

\brief A field (in C) or non-static data member (in C++) in a struct, union, or C++ class.

enumConstantDecl7

\brief An enumerator constant.

functionDecl8

\brief A function.

varDecl9

\brief A variable.

parmDecl10

\brief A function or method parameter.

objCInterfaceDecl11

\brief An Objective-C \@interface.

objCCategoryDecl12

\brief An Objective-C \@interface for a category.

objCProtocolDecl13

\brief An Objective-C \@protocol declaration.

objCPropertyDecl14

\brief An Objective-C \@property declaration.

objCIvarDecl15

\brief An Objective-C instance variable.

objCInstanceMethodDecl16

\brief An Objective-C instance method.

objCClassMethodDecl17

\brief An Objective-C class method.

objCImplementationDecl18

\brief An Objective-C \@implementation.

objCCategoryImplDecl19

\brief An Objective-C \@implementation for a category.

typedefDecl20

\brief A typedef.

cxxMethod21

\brief A C++ class method.

namespace22

\brief A C++ namespace.

linkageSpec23

\brief A linkage specification, e.g. 'extern "C"'.

constructor24

\brief A C++ constructor.

destructor25

\brief A C++ destructor.

conversionFunction26

\brief A C++ conversion function.

templateTypeParameter27

\brief A C++ template type parameter.

nonTypeTemplateParameter28

\brief A C++ non-type template parameter.

templateTemplateParameter29

\brief A C++ template template parameter.

functionTemplate30

\brief A C++ function template.

classTemplate31

\brief A C++ class template.

classTemplatePartialSpecialization32

\brief A C++ class template partial specialization.

namespaceAlias33

\brief A C++ namespace alias declaration.

usingDirective34

\brief A C++ using directive.

usingDeclaration35

\brief A C++ using declaration.

typeAliasDecl36

\brief A C++ alias declaration

objCSynthesizeDecl37

\brief An Objective-C \@synthesize definition.

objCDynamicDecl38

\brief An Objective-C \@dynamic definition.

cxxAccessSpecifier39

\brief An access specifier.

firstDecl1
lastDecl39
firstRef40
objCSuperClassRef40
objCProtocolRef41
objCClassRef42
typeRef43

\brief A reference to a type declaration.

A type reference occurs anywhere where a type is named but not declared. For example, given:

\code typedef unsigned size_type; size_type size; \endcode

The typedef is a declaration of size_type (CXCursor_TypedefDecl), while the type of the variable "size" is referenced. The cursor referenced by the type of size is the typedef for size_type.

cxxBaseSpecifier44
templateRef45

\brief A reference to a class template, function template, template template parameter, or class template partial specialization.

namespaceRef46

\brief A reference to a namespace or namespace alias.

memberRef47

\brief A reference to a member of a struct, union, or class that occurs in some non-expression context, e.g., a designated initializer.

labelRef48

\brief A reference to a labeled statement.

This cursor kind is used to describe the jump to "start_over" in the goto statement in the following example:

\code start_over: ++counter;

goto start_over; \endcode

A label reference cursor refers to a label statement.

overloadedDeclRef49

\brief A reference to a set of overloaded functions or function templates that has not yet been resolved to a specific function or function template.

An overloaded declaration reference cursor occurs in C++ templates where a dependent name refers to a function. For example:

\code template<typename T> void swap(T&, T&);

struct X { ... }; void swap(X&, X&);

template<typename T> void reverse(T* first, T* last) { while (first < last - 1) { swap(*first, *--last); ++first; } }

struct Y { }; void swap(Y&, Y&); \endcode

Here, the identifier "swap" is associated with an overloaded declaration reference. In the template definition, "swap" refers to either of the two "swap" functions declared above, so both results will be available. At instantiation time, "swap" may also refer to other functions found via argument-dependent lookup (e.g., the "swap" function at the end of the example).

The functions \c clang_getNumOverloadedDecls() and \c clang_getOverloadedDecl() can be used to retrieve the definitions referenced by this cursor.

variableRef50

\brief A reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.

lastRef50
firstInvalid70
invalidFile70
noDeclFound71
notImplemented72
invalidCode73
lastInvalid73
firstExpr100
unexposedExpr100

\brief An expression whose specific kind is not exposed via this interface.

Unexposed expressions have the same operations as any other kind of expression; one can extract their location information, spelling, children, etc. However, the specific kind of the expression is not reported.

declRefExpr101

\brief An expression that refers to some value declaration, such as a function, variable, or enumerator.

memberRefExpr102

\brief An expression that refers to a member of a struct, union, class, Objective-C class, etc.

callExpr103

\brief An expression that calls a function.

objCMessageExpr104

\brief An expression that sends a message to an Objective-C object or class.

blockExpr105

\brief An expression that represents a block literal.

integerLiteral106

\brief An integer literal.

floatingLiteral107

\brief A floating point number literal.

imaginaryLiteral108

\brief An imaginary number literal.

stringLiteral109

\brief A string literal.

characterLiteral110

\brief A character literal.

parenExpr111

\brief A parenthesized expression, e.g. "(1)".

This AST node is only formed if full location information is requested.

unaryOperator112

\brief This represents the unary-expression's (except sizeof and alignof).

arraySubscriptExpr113

\brief [C99 6.5.2.1] Array Subscripting.

binaryOperator114

\brief A builtin binary operation expression such as "x + y" or "x <= y".

compoundAssignOperator115

\brief Compound assignment such as "+=".

conditionalOperator116

\brief The ?: ternary operator.

cStyleCastExpr117

\brief An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ expr.cast), which uses the syntax (Type)expr.

For example: (int)f.

compoundLiteralExpr118

\brief [C99 6.5.2.5]

initListExpr119

\brief Describes an C or C++ initializer list.

addrLabelExpr120

\brief The GNU address of label extension, representing &&label.

stmtExpr121

\brief This is the GNU Statement Expression extension: ({int X=4; X;})

genericSelectionExpr122

\brief Represents a C11 generic selection.

gnuNullExpr123

\brief Implements the GNU __null extension, which is a name for a null pointer constant that has integral type (e.g., int or long) and is the same size and alignment as a pointer.

The __null extension is typically only used by system headers, which define NULL as __null in C++ rather than using 0 (which is an integer that may not match the size of a pointer).

cxxStaticCastExpr124

\brief C++'s static_cast<> expression.

cxxDynamicCastExpr125

\brief C++'s dynamic_cast<> expression.

cxxReinterpretCastExpr126

\brief C++'s reinterpret_cast<> expression.

cxxConstCastExpr127

\brief C++'s const_cast<> expression.

cxxFunctionalCastExpr128

\brief Represents an explicit C++ type conversion that uses "functional" notion (C++ expr.type.conv).

Example: \code x = int(0.5); \endcode

cxxTypeidExpr129

\brief A C++ typeid expression (C++ expr.typeid).

cxxBoolLiteralExpr130

\brief [C++ 2.13.5] C++ Boolean Literal.

cxxNullPtrLiteralExpr131

\brief [C++0x 2.14.7] C++ Pointer Literal.

cxxThisExpr132

\brief Represents the "this" expression in C++

cxxThrowExpr133

\brief [C++ 15] C++ Throw Expression.

This handles 'throw' and 'throw' assignment-expression. When assignment-expression isn't present, Op will be null.

cxxNewExpr134

\brief A new expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".

cxxDeleteExpr135

\brief A delete expression for memory deallocation and destructor calls, e.g. "delete[] pArray".

unaryExpr136

\brief A unary expression. (noexcept, sizeof, or other traits)

objCStringLiteral137

\brief An Objective-C string literal i.e. @"foo".

objCEncodeExpr138

\brief An Objective-C \@encode expression.

objCSelectorExpr139

\brief An Objective-C \@selector expression.

objCProtocolExpr140

\brief An Objective-C \@protocol expression.

objCBridgedCastExpr141

\brief An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers, transferring ownership in the process.

\code NSString *str = (__bridge_transfer NSString *)CFCreateString(); \endcode

packExpansionExpr142

\brief Represents a C++0x pack expansion that produces a sequence of expressions.

A pack expansion expression contains a pattern (which itself is an expression) followed by an ellipsis. For example:

\code template<typename F, typename ...Types> void forward(F f, Types &&...args) { f(static_cast<Types&&>(args)...); } \endcode

sizeOfPackExpr143

\brief Represents an expression that computes the length of a parameter pack.

\code template<typename ...Types> struct count { static const unsigned value = sizeof...(Types); }; \endcode

lambdaExpr144
objCBoolLiteralExpr145

\brief Objective-c Boolean Literal.

objCSelfExpr146

\brief Represents the "self" expression in an Objective-C method.

ompArraySectionExpr147

\brief OpenMP 4.0 [2.4, Array Section].

objCAvailabilityCheckExpr148

\brief Represents an @available(...) check.

lastExpr148
firstStmt200
unexposedStmt200

\brief A statement whose specific kind is not exposed via this interface.

Unexposed statements have the same operations as any other kind of statement; one can extract their location information, spelling, children, etc. However, the specific kind of the statement is not reported.

labelStmt201

\brief A labelled statement in a function.

This cursor kind is used to describe the "start_over:" label statement in the following example:

\code start_over: ++counter; \endcode

compoundStmt202

\brief A group of statements like { stmt stmt }.

This cursor kind is used to describe compound statements, e.g. function bodies.

caseStmt203

\brief A case statement.

defaultStmt204

\brief A default statement.

ifStmt205

\brief An if statement

switchStmt206

\brief A switch statement.

whileStmt207

\brief A while statement.

doStmt208

\brief A do statement.

forStmt209

\brief A for statement.

gotoStmt210

\brief A goto statement.

indirectGotoStmt211

\brief An indirect goto statement.

continueStmt212

\brief A continue statement.

breakStmt213

\brief A break statement.

returnStmt214

\brief A return statement.

gccAsmStmt215

\brief A GCC inline assembly statement extension.

asmStmt215
objCAtTryStmt216

\brief Objective-C's overall \@try-\@catch-\@finally statement.

objCAtCatchStmt217

\brief Objective-C's \@catch statement.

objCAtFinallyStmt218

\brief Objective-C's \@finally statement.

objCAtThrowStmt219

\brief Objective-C's \@throw statement.

objCAtSynchronizedStmt220

\brief Objective-C's \@synchronized statement.

objCAutoreleasePoolStmt221

\brief Objective-C's autorelease pool statement.

objCForCollectionStmt222

\brief Objective-C's collection statement.

cxxCatchStmt223

\brief C++'s catch statement.

cxxTryStmt224

\brief C++'s try statement.

cxxForRangeStmt225

\brief C++'s for (* : *) statement.

sehTryStmt226

\brief Windows Structured Exception Handling's try statement.

sehExceptStmt227

\brief Windows Structured Exception Handling's except statement.

sehFinallyStmt228

\brief Windows Structured Exception Handling's finally statement.

msAsmStmt229

\brief A MS inline assembly statement extension.

nullStmt230

\brief The null statement ";": C99 6.8.3p3.

This cursor kind is used to describe the null statement.

declStmt231

\brief Adaptor class for mixing declarations with statements and expressions.

ompParallelDirective232

\brief OpenMP parallel directive.

ompSimdDirective233

\brief OpenMP SIMD directive.

ompForDirective234

\brief OpenMP for directive.

ompSectionsDirective235

\brief OpenMP sections directive.

ompSectionDirective236

\brief OpenMP section directive.

ompSingleDirective237

\brief OpenMP single directive.

ompParallelForDirective238

\brief OpenMP parallel for directive.

ompParallelSectionsDirective239

\brief OpenMP parallel sections directive.

ompTaskDirective240

\brief OpenMP task directive.

ompMasterDirective241

\brief OpenMP master directive.

ompCriticalDirective242

\brief OpenMP critical directive.

ompTaskyieldDirective243

\brief OpenMP taskyield directive.

ompBarrierDirective244

\brief OpenMP barrier directive.

ompTaskwaitDirective245

\brief OpenMP taskwait directive.

ompFlushDirective246

\brief OpenMP flush directive.

sehLeaveStmt247

\brief Windows Structured Exception Handling's leave statement.

ompOrderedDirective248

\brief OpenMP ordered directive.

ompAtomicDirective249

\brief OpenMP atomic directive.

ompForSimdDirective250

\brief OpenMP for SIMD directive.

ompParallelForSimdDirective251

\brief OpenMP parallel for SIMD directive.

ompTargetDirective252

\brief OpenMP target directive.

ompTeamsDirective253

\brief OpenMP teams directive.

ompTaskgroupDirective254

\brief OpenMP taskgroup directive.

ompCancellationPointDirective255

\brief OpenMP cancellation point directive.

ompCancelDirective256

\brief OpenMP cancel directive.

ompTargetDataDirective257

\brief OpenMP target data directive.

ompTaskLoopDirective258

\brief OpenMP taskloop directive.

ompTaskLoopSimdDirective259

\brief OpenMP taskloop simd directive.

ompDistributeDirective260

\brief OpenMP distribute directive.

ompTargetEnterDataDirective261

\brief OpenMP target enter data directive.

ompTargetExitDataDirective262

\brief OpenMP target exit data directive.

ompTargetParallelDirective263

\brief OpenMP target parallel directive.

ompTargetParallelForDirective264

\brief OpenMP target parallel for directive.

ompTargetUpdateDirective265

\brief OpenMP target update directive.

ompDistributeParallelForDirective266

\brief OpenMP distribute parallel for directive.

ompDistributeParallelForSimdDirective267

\brief OpenMP distribute parallel for simd directive.

ompDistributeSimdDirective268

\brief OpenMP distribute simd directive.

ompTargetParallelForSimdDirective269

\brief OpenMP target parallel for simd directive.

ompTargetSimdDirective270

\brief OpenMP target simd directive.

ompTeamsDistributeDirective271

\brief OpenMP teams distribute directive.

ompTeamsDistributeSimdDirective272

\brief OpenMP teams distribute simd directive.

ompTeamsDistributeParallelForSimdDirective273

\brief OpenMP teams distribute parallel for simd directive.

ompTeamsDistributeParallelForDirective274

\brief OpenMP teams distribute parallel for directive.

ompTargetTeamsDirective275

\brief OpenMP target teams directive.

ompTargetTeamsDistributeDirective276

\brief OpenMP target teams distribute directive.

ompTargetTeamsDistributeParallelForDirective277

\brief OpenMP target teams distribute parallel for directive.

ompTargetTeamsDistributeParallelForSimdDirective278

\brief OpenMP target teams distribute parallel for simd directive.

ompTargetTeamsDistributeSimdDirective279

\brief OpenMP target teams distribute simd directive.

lastStmt279
translationUnit300

\brief Cursor that represents the translation unit itself.

The translation unit cursor exists primarily to act as the root cursor for traversing the contents of a translation unit.

firstAttr400
unexposedAttr400

\brief An attribute whose specific kind is not exposed via this interface.

ibActionAttr401
ibOutletAttr402
ibOutletCollectionAttr403
cxxFinalAttr404
cxxOverrideAttr405
annotateAttr406
asmLabelAttr407
packedAttr408
pureAttr409
constAttr410
noDuplicateAttr411
cudaConstantAttr412
cudaDeviceAttr413
cudaGlobalAttr414
cudaHostAttr415
cudaSharedAttr416
visibilityAttr417
dllExport418
dllImport419
lastAttr419
preprocessingDirective500
macroDefinition501
macroExpansion502
macroInstantiation502
inclusionDirective503
firstPreprocessing500
lastPreprocessing503
moduleImportDecl600

\brief A module import declaration.

typeAliasTemplateDecl601
staticAssert602

\brief A static_assert or _Static_assert node

friendDecl603

\brief a friend declaration.

firstExtraDecl600
lastExtraDecl603
overloadCandidate700

\brief A code completion overload candidate.

Meta