15 #ifndef LLVM_CLANG_BASIC_TOKENKINDS_H 16 #define LLVM_CLANG_BASIC_TOKENKINDS_H 18 #include "llvm/Support/Compiler.h" 27 #include "clang/Basic/TokenKinds.def" 34 #define PPKEYWORD(X) pp_##X, 35 #include "clang/Basic/TokenKinds.def" 42 #define OBJC_AT_KEYWORD(X) objc_##X, 43 #include "clang/Basic/TokenKinds.def" 73 return (K == tok::identifier) || (K == tok::raw_identifier);
79 return K == tok::string_literal || K == tok::wide_string_literal ||
80 K == tok::utf8_string_literal || K == tok::utf16_string_literal ||
81 K == tok::utf32_string_literal;
87 return K == tok::numeric_constant || K == tok::char_constant ||
88 K == tok::wide_char_constant || K == tok::utf8_char_constant ||
89 K == tok::utf16_char_constant || K == tok::utf32_char_constant ||
95 #define ANNOTATION(NAME) \ 96 if (K == tok::annot_##NAME) \ 98 #include "clang/Basic/TokenKinds.def"
bool isStringLiteral(TokenKind K)
Return true if this is a C or C++ string-literal (or C++11 user-defined-string-literal) token...
const char * getKeywordSpelling(TokenKind Kind) LLVM_READNONE
Determines the spelling of simple keyword and contextual keyword tokens like 'int' and 'dynamic_cast'...
PPKeywordKind
Provides a namespace for preprocessor keywords which start with a '#' at the beginning of the line...
const char * getPunctuatorSpelling(TokenKind Kind) LLVM_READNONE
Determines the spelling of simple punctuation tokens like '!' or '', and returns NULL for literal and...
ObjCKeywordKind
Provides a namespace for Objective-C keywords which start with an '@'.
bool isAnnotation(TokenKind K)
Return true if this is any of tok::annot_* kinds.
bool isLiteral(TokenKind K)
Return true if this is a "literal" kind, like a numeric constant, string, etc.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
Dataflow Directional Tag Classes.
OnOffSwitch
Defines the possible values of an on-off-switch (C99 6.10.6p2).
const char * getTokenName(TokenKind Kind) LLVM_READNONE
Determines the name of a token as used within the front end.
bool isAnyIdentifier(TokenKind K)
Return true if this is a raw identifier or an identifier kind.