1 //===--- TokenKinds.h - Enum values for C Token Kinds -----------*- C++ -*-===//
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 defines the TokenKind enum and support functions.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_TOKENKINDS_H
15 #define LLVM_CLANG_TOKENKINDS_H
21 /// TokenKind - This provides a simple uniform namespace for tokens from all C
25 #include "clang/Basic/TokenKinds.def"
29 /// PPKeywordKind - This provides a namespace for preprocessor keywords which
30 /// start with a '#' at the beginning of the line.
32 #define PPKEYWORD(X) pp_##X,
33 #include "clang/Basic/TokenKinds.def"
37 /// ObjCKeywordKind - This provides a namespace for Objective-C keywords which
38 /// start with an '@'.
39 enum ObjCKeywordKind {
40 #define OBJC1_AT_KEYWORD(X) objc_##X,
41 #define OBJC2_AT_KEYWORD(X) objc_##X,
42 #include "clang/Basic/TokenKinds.def"
46 /// OnOffSwitch - This defines the possible values of an on-off-switch
49 OOS_ON, OOS_OFF, OOS_DEFAULT
52 /// \brief Determines the name of a token as used within the front end.
54 /// The name of a token will be an internal name (such as "l_square")
55 /// and should not be used as part of diagnostic messages.
56 const char *getTokenName(enum TokenKind Kind);
58 /// \brief Determines the spelling of simple punctuation tokens like
59 /// '!' or '%', and returns NULL for literal and annotation tokens.
61 /// This routine only retrieves the "simple" spelling of the token,
62 /// and will not produce any alternative spellings (e.g., a
63 /// digraph). For the actual spelling of a given Token, use
64 /// Preprocessor::getSpelling().
65 const char *getTokenSimpleSpelling(enum TokenKind Kind);
67 } // end namespace tok
68 } // end namespace clang