CXCursorKind

Describes the kind of entity that a cursor refers to.

Values

ValueMeaning
unexposedDecl1

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

A C or C++ struct.

unionDecl3

A C or C++ union.

classDecl4

A C++ class.

enumDecl5

An enumeration.

fieldDecl6

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

enumConstantDecl7

An enumerator constant.

functionDecl8

A function.

varDecl9

A variable.

parmDecl10

A function or method parameter.

objCInterfaceDecl11

An Objective-C \@interface.

objCCategoryDecl12

An Objective-C \@interface for a category.

objCProtocolDecl13

An Objective-C \@protocol declaration.

objCPropertyDecl14

An Objective-C \@property declaration.

objCIvarDecl15

An Objective-C instance variable.

objCInstanceMethodDecl16

An Objective-C instance method.

objCClassMethodDecl17

An Objective-C class method.

objCImplementationDecl18

An Objective-C \@implementation.

objCCategoryImplDecl19

An Objective-C \@implementation for a category.

typedefDecl20

A typedef.

cxxMethod21

A C++ class method.

namespace22

A C++ namespace.

linkageSpec23

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

constructor24

A C++ constructor.

destructor25

A C++ destructor.

conversionFunction26

A C++ conversion function.

templateTypeParameter27

A C++ template type parameter.

nonTypeTemplateParameter28

A C++ non-type template parameter.

templateTemplateParameter29

A C++ template template parameter.

functionTemplate30

A C++ function template.

classTemplate31

A C++ class template.

classTemplatePartialSpecialization32

A C++ class template partial specialization.

namespaceAlias33

A C++ namespace alias declaration.

usingDirective34

A C++ using directive.

usingDeclaration35

A C++ using declaration.

typeAliasDecl36

A C++ alias declaration

objCSynthesizeDecl37

An Objective-C \@synthesize definition.

objCDynamicDecl38

An Objective-C \@dynamic definition.

cxxAccessSpecifier39

An access specifier.

firstDeclunexposedDecl
lastDeclcxxAccessSpecifier
firstRef40
objCSuperClassRef40
objCProtocolRef41
objCClassRef42
typeRef43

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

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

namespaceRef46

A reference to a namespace or namespace alias.

memberRef47

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

labelRef48

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

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

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

lastRefvariableRef
firstInvalid70
invalidFile70
noDeclFound71
notImplemented72
invalidCode73
lastInvalidinvalidCode
firstExpr100
unexposedExpr100

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

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

memberRefExpr102

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

callExpr103

An expression that calls a function.

objCMessageExpr104

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

blockExpr105

An expression that represents a block literal.

integerLiteral106

An integer literal.

floatingLiteral107

A floating point number literal.

imaginaryLiteral108

An imaginary number literal.

stringLiteral109

A string literal.

characterLiteral110

A character literal.

parenExpr111

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

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

unaryOperator112

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

arraySubscriptExpr113

[C99 6.5.2.1] Array Subscripting.

binaryOperator114

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

compoundAssignOperator115

Compound assignment such as "+=".

conditionalOperator116

The ?: ternary operator.

cStyleCastExpr117

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

[C99 6.5.2.5]

initListExpr119

Describes an C or C++ initializer list.

addrLabelExpr120

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

stmtExpr121

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

genericSelectionExpr122

Represents a C11 generic selection.

gnuNullExpr123

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

C++'s static_cast<> expression.

cxxDynamicCastExpr125

C++'s dynamic_cast<> expression.

cxxReinterpretCastExpr126

C++'s reinterpret_cast<> expression.

cxxConstCastExpr127

C++'s const_cast<> expression.

cxxFunctionalCastExpr128

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

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

cxxTypeidExpr129

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

cxxBoolLiteralExpr130

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

cxxNullPtrLiteralExpr131

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

cxxThisExpr132

Represents the "this" expression in C++

cxxThrowExpr133

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

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

cxxNewExpr134

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

cxxDeleteExpr135

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

unaryExpr136

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

objCStringLiteral137

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

objCEncodeExpr138

An Objective-C \@encode expression.

objCSelectorExpr139

An Objective-C \@selector expression.

objCProtocolExpr140

An Objective-C \@protocol expression.

objCBridgedCastExpr141

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

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

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

Objective-c Boolean Literal.

objCSelfExpr146

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

ompArraySectionExpr147

OpenMP 4.0 [2.4, Array Section].

objCAvailabilityCheckExpr148

Represents an @available(...) check.

fixedPointLiteral149

Fixed point literal

lastExprfixedPointLiteral
firstStmt200
unexposedStmt200

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

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

A group of statements like { stmt stmt }.

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

caseStmt203

A case statement.

defaultStmt204

A default statement.

ifStmt205

An if statement

switchStmt206

A switch statement.

whileStmt207

A while statement.

doStmt208

A do statement.

forStmt209

A for statement.

gotoStmt210

A goto statement.

indirectGotoStmt211

An indirect goto statement.

continueStmt212

A continue statement.

breakStmt213

A break statement.

returnStmt214

A return statement.

gccAsmStmt215

A GCC inline assembly statement extension.

asmStmtgccAsmStmt
objCAtTryStmt216

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

objCAtCatchStmt217

Objective-C's \@catch statement.

objCAtFinallyStmt218

Objective-C's \@finally statement.

objCAtThrowStmt219

Objective-C's \@throw statement.

objCAtSynchronizedStmt220

Objective-C's \@synchronized statement.

objCAutoreleasePoolStmt221

Objective-C's autorelease pool statement.

objCForCollectionStmt222

Objective-C's collection statement.

cxxCatchStmt223

C++'s catch statement.

cxxTryStmt224

C++'s try statement.

cxxForRangeStmt225

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

sehTryStmt226

Windows Structured Exception Handling's try statement.

sehExceptStmt227

Windows Structured Exception Handling's except statement.

sehFinallyStmt228

Windows Structured Exception Handling's finally statement.

msAsmStmt229

A MS inline assembly statement extension.

nullStmt230

The null statement ";": C99 6.8.3p3.

This cursor kind is used to describe the null statement.

declStmt231

Adaptor class for mixing declarations with statements and expressions.

ompParallelDirective232

OpenMP parallel directive.

ompSimdDirective233

OpenMP SIMD directive.

ompForDirective234

OpenMP for directive.

ompSectionsDirective235

OpenMP sections directive.

ompSectionDirective236

OpenMP section directive.

ompSingleDirective237

OpenMP single directive.

ompParallelForDirective238

OpenMP parallel for directive.

ompParallelSectionsDirective239

OpenMP parallel sections directive.

ompTaskDirective240

OpenMP task directive.

ompMasterDirective241

OpenMP master directive.

ompCriticalDirective242

OpenMP critical directive.

ompTaskyieldDirective243

OpenMP taskyield directive.

ompBarrierDirective244

OpenMP barrier directive.

ompTaskwaitDirective245

OpenMP taskwait directive.

ompFlushDirective246

OpenMP flush directive.

sehLeaveStmt247

Windows Structured Exception Handling's leave statement.

ompOrderedDirective248

OpenMP ordered directive.

ompAtomicDirective249

OpenMP atomic directive.

ompForSimdDirective250

OpenMP for SIMD directive.

ompParallelForSimdDirective251

OpenMP parallel for SIMD directive.

ompTargetDirective252

OpenMP target directive.

ompTeamsDirective253

OpenMP teams directive.

ompTaskgroupDirective254

OpenMP taskgroup directive.

ompCancellationPointDirective255

OpenMP cancellation point directive.

ompCancelDirective256

OpenMP cancel directive.

ompTargetDataDirective257

OpenMP target data directive.

ompTaskLoopDirective258

OpenMP taskloop directive.

ompTaskLoopSimdDirective259

OpenMP taskloop simd directive.

ompDistributeDirective260

OpenMP distribute directive.

ompTargetEnterDataDirective261

OpenMP target enter data directive.

ompTargetExitDataDirective262

OpenMP target exit data directive.

ompTargetParallelDirective263

OpenMP target parallel directive.

ompTargetParallelForDirective264

OpenMP target parallel for directive.

ompTargetUpdateDirective265

OpenMP target update directive.

ompDistributeParallelForDirective266

OpenMP distribute parallel for directive.

ompDistributeParallelForSimdDirective267

OpenMP distribute parallel for simd directive.

ompDistributeSimdDirective268

OpenMP distribute simd directive.

ompTargetParallelForSimdDirective269

OpenMP target parallel for simd directive.

ompTargetSimdDirective270

OpenMP target simd directive.

ompTeamsDistributeDirective271

OpenMP teams distribute directive.

ompTeamsDistributeSimdDirective272

OpenMP teams distribute simd directive.

ompTeamsDistributeParallelForSimdDirective273

OpenMP teams distribute parallel for simd directive.

ompTeamsDistributeParallelForDirective274

OpenMP teams distribute parallel for directive.

ompTargetTeamsDirective275

OpenMP target teams directive.

ompTargetTeamsDistributeDirective276

OpenMP target teams distribute directive.

ompTargetTeamsDistributeParallelForDirective277

OpenMP target teams distribute parallel for directive.

ompTargetTeamsDistributeParallelForSimdDirective278

OpenMP target teams distribute parallel for simd directive.

ompTargetTeamsDistributeSimdDirective279

OpenMP target teams distribute simd directive.

lastStmtompTargetTeamsDistributeSimdDirective
translationUnit300

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

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
nsReturnsRetained420
nsReturnsNotRetained421
nsReturnsAutoreleased422
nsConsumesSelf423
nsConsumed424
objCException425
objCNSObject426
objCIndependentClass427
objCPreciseLifetime428
objCReturnsInnerPointer429
objCRequiresSuper430
objCRootClass431
objCSubclassingRestricted432
objCExplicitProtocolImpl433
objCDesignatedInitializer434
objCRuntimeVisible435
objCBoxable436
flagEnum437
lastAttrflagEnum
preprocessingDirective500
macroDefinition501
macroExpansion502
macroInstantiationmacroExpansion
inclusionDirective503
firstPreprocessingpreprocessingDirective
lastPreprocessinginclusionDirective
moduleImportDecl600

A module import declaration.

typeAliasTemplateDecl601
staticAssert602

A static_assert or _Static_assert node

friendDecl603

a friend declaration.

firstExtraDeclmoduleImportDecl
lastExtraDeclfriendDecl
overloadCandidate700

A code completion overload candidate.

Meta