clang API Documentation

Namespaces | Defines | Enumerations | Functions
TokenKinds.h File Reference

Defines the clang::TokenKind enum and support functions. More...

#include "llvm/Support/Compiler.h"
#include "clang/Basic/TokenKinds.def"
Include dependency graph for TokenKinds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  clang
namespace  clang::tok

Defines

#define TOK(X)   X,
#define PPKEYWORD(X)   pp_##X,
#define OBJC1_AT_KEYWORD(X)   objc_##X,
#define OBJC2_AT_KEYWORD(X)   objc_##X,
#define ANNOTATION(NAME)

Enumerations

enum  clang::tok::TokenKind
 Provides a simple uniform namespace for tokens from all C languages. More...
enum  clang::tok::PPKeywordKind
 Provides a namespace for preprocessor keywords which start with a '#' at the beginning of the line. More...
enum  clang::tok::ObjCKeywordKind
 Provides a namespace for Objective-C keywords which start with an '@'. More...
enum  clang::tok::OnOffSwitch { clang::tok::OOS_ON, clang::tok::OOS_OFF, clang::tok::OOS_DEFAULT }
 Defines the possible values of an on-off-switch (C99 6.10.6p2). More...

Functions

 TOK (unknown) TOK(eof) TOK(eod) TOK(code_completion) TOK(cxx_defaultarg_end) TOK(cxx_exceptspec_end) TOK(comment) TOK(identifier) TOK(raw_identifier) TOK(numeric_constant) TOK(char_constant) TOK(wide_char_constant) TOK(utf8_char_constant) TOK(utf16_char_constant) TOK(utf32_char_constant) TOK(string_literal) TOK(wide_string_literal) TOK(angle_string_literal) TOK(utf8_string_literal) TOK(utf16_string_literal) TOK(utf32_string_literal) PUNCTUATOR(r_paren
 ANNOTATION (cxxscope) ANNOTATION(typename) ANNOTATION(template_id) ANNOTATION(primary_expr) ANNOTATION(decltype) NUM_TOKENS
 TOK (unknown) TOK(eof) TOK(eod) TOK(code_completion) TOK(cxx_defaultarg_end) TOK(cxx_exceptspec_end) TOK(comment) TOK(identifier) TOK(raw_identifier) TOK(numeric_constant) TOK(char_constant) TOK(wide_char_constant) TOK(utf8_char_constant) TOK(utf16_char_constant) TOK(utf32_char_constant) TOK(string_literal) TOK(wide_string_literal) TOK(angle_string_literal) TOK(utf8_string_literal) TOK(utf16_string_literal) TOK(utf32_string_literal) PUNCTUATOR(r_paren
 ANNOTATION (cxxscope) ANNOTATION(typename) ANNOTATION(template_id) ANNOTATION(primary_expr) ANNOTATION(decltype) NUM_PP_KEYWORDS
 TOK (unknown) TOK(eof) TOK(eod) TOK(code_completion) TOK(cxx_defaultarg_end) TOK(cxx_exceptspec_end) TOK(comment) TOK(identifier) TOK(raw_identifier) TOK(numeric_constant) TOK(char_constant) TOK(wide_char_constant) TOK(utf8_char_constant) TOK(utf16_char_constant) TOK(utf32_char_constant) TOK(string_literal) TOK(wide_string_literal) TOK(angle_string_literal) TOK(utf8_string_literal) TOK(utf16_string_literal) TOK(utf32_string_literal) PUNCTUATOR(r_paren
 ANNOTATION (cxxscope) ANNOTATION(typename) ANNOTATION(template_id) ANNOTATION(primary_expr) ANNOTATION(decltype) NUM_OBJC_KEYWORDS
const char * clang::tok::getTokenName (TokenKind Kind) LLVM_READNONE
 Determines the name of a token as used within the front end.
const char * clang::tok::getPunctuatorSpelling (TokenKind Kind) LLVM_READNONE
 Determines the spelling of simple punctuation tokens like '!' or '', and returns NULL for literal and annotation tokens.
const char * clang::tok::getKeywordSpelling (TokenKind Kind) LLVM_READNONE
 Determines the spelling of simple keyword and contextual keyword tokens like 'int' and 'dynamic_cast'. Returns NULL for other token kinds.
bool clang::tok::isAnyIdentifier (TokenKind K)
 Return true if this is a raw identifier or an identifier kind.
bool clang::tok::isStringLiteral (TokenKind K)
 Return true if this is a C or C++ string-literal (or C++11 user-defined-string-literal) token.
bool clang::tok::isLiteral (TokenKind K)
 Return true if this is a "literal" kind, like a numeric constant, string, etc.
bool clang::tok::isAnnotation (TokenKind K)
 Return true if this is any of tok::annot_* kinds.

Detailed Description

Defines the clang::TokenKind enum and support functions.

Definition in file TokenKinds.h.


Define Documentation

#define ANNOTATION (   NAME)
Value:
if (K == tok::annot_##NAME) \
    return true;
#define OBJC1_AT_KEYWORD (   X)    objc_##X,

Definition at line 42 of file TokenKinds.h.

#define OBJC2_AT_KEYWORD (   X)    objc_##X,

Definition at line 43 of file TokenKinds.h.

#define PPKEYWORD (   X)    pp_##X,

Definition at line 34 of file TokenKinds.h.

#define TOK (   X)    X,

Definition at line 26 of file TokenKinds.h.


Function Documentation