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"
16 using namespace clang;
18 static const char * const TokNames[] = {
20 #define KEYWORD(X,Y) #X,
21 #include "clang/Basic/TokenKinds.def"
25 const char *tok::getTokenName(enum TokenKind Kind) {
26 assert(Kind < tok::NUM_TOKENS);
27 return TokNames[Kind];
30 const char *tok::getTokenSimpleSpelling(enum TokenKind Kind) {
32 #define PUNCTUATOR(X,Y) case X: return Y;
33 #include "clang/Basic/TokenKinds.def"