blob: 772925b1e51069b2103243d9a90a42e2965d0797 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TokenKinds.cpp - Token Kinds Support -----------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the TokenKind enum and support functions.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/Basic/TokenKinds.h"
15#include <cassert>
16using namespace clang;
17
18static const char * const TokNames[] = {
19#define TOK(X) #X,
20#define KEYWORD(X,Y) #X,
21#include "clang/Basic/TokenKinds.def"
22 0
23};
24
25const char *tok::getTokenName(enum TokenKind Kind) {
26 assert(Kind < tok::NUM_TOKENS);
27 return TokNames[Kind];
28}