Token

Represents a single token from the preprocessor.

Tokens are effectively segments of source code. Source code is first parsed into tokens before being converted into the AST and Cursors.

Tokens are obtained from parsed TranslationUnit instances. You currently can't create tokens manually.

Members

Properties

cursor
Cursor cursor [@property getter]

The Cursor this Token corresponds to.

extent
SourceRange extent [@property getter]

The SourceRange this Token occupies.

kind
CXTokenKind kind [@property getter]

Obtain the TokenKind of the current token.

location
SourceLocation location [@property getter]

The SourceLocation this Token occurs at.

spelling
string spelling [@property getter]

The spelling of this token.

Meta