diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /include/clang/Basic/TokenKinds.h | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'include/clang/Basic/TokenKinds.h')
-rw-r--r-- | include/clang/Basic/TokenKinds.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h index 478add8..e850971 100644 --- a/include/clang/Basic/TokenKinds.h +++ b/include/clang/Basic/TokenKinds.h @@ -63,6 +63,31 @@ const char *getTokenName(enum TokenKind Kind); /// Preprocessor::getSpelling(). const char *getTokenSimpleSpelling(enum TokenKind Kind); +/// \brief Return true if this is a raw identifier or an identifier kind. +inline bool isAnyIdentifier(TokenKind K) { + return (K == tok::identifier) || (K == tok::raw_identifier); +} + +/// \brief Return true if this is a "literal" kind, like a numeric +/// constant, string, etc. +inline bool isLiteral(TokenKind K) { + return (K == tok::numeric_constant) || (K == tok::char_constant) || + (K == tok::wide_char_constant) || (K == tok::utf16_char_constant) || + (K == tok::utf32_char_constant) || (K == tok::string_literal) || + (K == tok::wide_string_literal) || (K == tok::utf8_string_literal) || + (K == tok::utf16_string_literal) || (K == tok::utf32_string_literal) || + (K == tok::angle_string_literal); +} + +/// \brief Return true if this is any of tok::annot_* kinds. +inline bool isAnnotation(TokenKind K) { +#define ANNOTATION(NAME) \ + if (K == tok::annot_##NAME) \ + return true; +#include "clang/Basic/TokenKinds.def" + return false; +} + } // end namespace tok } // end namespace clang |