clang API Documentation

Enumerations | Functions
clang::tok Namespace Reference

Enumerations

enum  TokenKind
enum  PPKeywordKind
enum  ObjCKeywordKind
enum  OnOffSwitch { OOS_ON, OOS_OFF, OOS_DEFAULT }

Functions

const char * getTokenName (enum TokenKind Kind)
 Determines the name of a token as used within the front end.
const char * getTokenSimpleSpelling (enum TokenKind Kind)
 Determines the spelling of simple punctuation tokens like '!' or '%', and returns NULL for literal and annotation tokens.

Enumeration Type Documentation

ObjCKeywordKind - This provides a namespace for Objective-C keywords which start with an '@'.

Definition at line 39 of file TokenKinds.h.

OnOffSwitch - This defines the possible values of an on-off-switch (C99 6.10.6p2).

Enumerator:
OOS_ON 
OOS_OFF 
OOS_DEFAULT 

Definition at line 48 of file TokenKinds.h.

PPKeywordKind - This provides a namespace for preprocessor keywords which start with a '#' at the beginning of the line.

Definition at line 31 of file TokenKinds.h.

TokenKind - This provides a simple uniform namespace for tokens from all C languages.

Definition at line 23 of file TokenKinds.h.


Function Documentation

const char * clang::tok::getTokenName ( enum TokenKind  Kind)

Determines the name of a token as used within the front end.

The name of a token will be an internal name (such as "l_square") and should not be used as part of diagnostic messages.

Definition at line 26 of file TokenKinds.cpp.

References TokNames.

Referenced by clang::Preprocessor::DumpToken(), and clang::Token::getName().

const char * clang::tok::getTokenSimpleSpelling ( enum TokenKind  Kind)

Determines the spelling of simple punctuation tokens like '!' or '%', and returns NULL for literal and annotation tokens.

This routine only retrieves the "simple" spelling of the token, and will not produce any alternative spellings (e.g., a digraph). For the actual spelling of a given Token, use Preprocessor::getSpelling().

Definition at line 31 of file TokenKinds.cpp.