1 //===--- TokenKinds.cpp - Token Kinds Support -----------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the TokenKind enum and support functions.
12 //===----------------------------------------------------------------------===//
14 #include "clang/Basic/TokenKinds.h"
17 using namespace clang
;
19 static const char * const TokNames
[] = {
21 #define KEYWORD(X,Y) #X,
22 #include "clang/Basic/TokenKinds.def"
26 const char *tok::getTokenName(enum TokenKind Kind
) {
27 assert(Kind
< tok::NUM_TOKENS
);
28 return TokNames
[Kind
];
31 const char *tok::getTokenSimpleSpelling(enum TokenKind Kind
) {
33 #define PUNCTUATOR(X,Y) case X: return Y;
34 #include "clang/Basic/TokenKinds.def"