#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/DiagnosticLex.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TokenKinds.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdio>
#include <cstring>
#include <string>
#include "clang/Basic/TokenKinds.def"
#include "clang/Basic/OperatorKinds.def"
Go to the source code of this file.
|
#define | KEYWORD(NAME, FLAGS) |
|
#define | ALIAS(NAME, TOK, FLAGS) |
|
#define | CXX_KEYWORD_OPERATOR(NAME, ALIAS) |
|
#define | OBJC_AT_KEYWORD(NAME) |
|
#define | INTERESTING_IDENTIFIER(NAME) AddInterestingIdentifier(StringRef(#NAME), tok::NAME, *this); |
|
#define | TESTING_KEYWORD(NAME, FLAGS) |
|
#define | KEYWORD(NAME, FLAGS) case tok::kw_##NAME: return getKeywordStatus(LangOpts, FLAGS); |
|
#define | HASH(LEN, FIRST, THIRD) (LEN << 5) + (((FIRST-'a') + (THIRD-'a')) & 31) |
|
#define | CASE(LEN, FIRST, THIRD, NAME) |
|
#define | OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly) case OO_##Name: return Spelling; |
|
#define | KEYWORD(NAME, FLAGS) .Case(#NAME, FLAGS) |
|
|
static KeywordStatus | getKeywordStatusHelper (const LangOptions &LangOpts, TokenKey Flag) |
|
static KeywordStatus | getKeywordStatus (const LangOptions &LangOpts, unsigned Flags) |
| Translates flags as specified in TokenKinds.def into keyword status in the given language standard.
|
|
static void | AddKeyword (StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, const LangOptions &LangOpts, IdentifierTable &Table) |
| AddKeyword - This method is used to associate a token ID with specific identifiers because they are language keywords.
|
|
static void | AddCXXOperatorKeyword (StringRef Keyword, tok::TokenKind TokenCode, IdentifierTable &Table) |
| AddCXXOperatorKeyword - Register a C++ operator keyword alternative representations.
|
|
static void | AddObjCKeyword (StringRef Name, tok::ObjCKeywordKind ObjCID, IdentifierTable &Table) |
| AddObjCKeyword - Register an Objective-C @keyword like "class" "selector" or "property".
|
|
static void | AddInterestingIdentifier (StringRef Name, tok::InterestingIdentifierKind BTID, IdentifierTable &Table) |
|
static KeywordStatus | getTokenKwStatus (const LangOptions &LangOpts, tok::TokenKind K) |
| Checks if the specified token kind represents a keyword in the specified language.
|
|
static bool | startsWithWord (StringRef name, StringRef word) |
| Interpreting the given string using the normal CamelCase conventions, determine whether the given string starts with the given "word", which is assumed to end in a lowercase letter.
|
|
static SelectorTableImpl & | getSelectorTableImpl (void *P) |
|
◆ ALIAS
#define ALIAS |
( |
|
NAME, |
|
|
|
TOK, |
|
|
|
FLAGS |
|
) |
| |
Value:
FLAGS, LangOpts, *this);
static void AddKeyword(StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, const LangOptions &LangOpts, IdentifierTable &Table)
AddKeyword - This method is used to associate a token ID with specific identifiers because they are l...
◆ CASE
#define CASE |
( |
|
LEN, |
|
|
|
FIRST, |
|
|
|
THIRD, |
|
|
|
NAME |
|
) |
| |
Value: case HASH(LEN, FIRST, THIRD): \
return memcmp(Name, #NAME, LEN) ? tok::pp_not_keyword : tok::pp_ ## NAME
#define HASH(LEN, FIRST, THIRD)
return(__x > > __y)|(__x<<(32 - __y))
◆ CXX_KEYWORD_OPERATOR
#define CXX_KEYWORD_OPERATOR |
( |
|
NAME, |
|
|
|
ALIAS |
|
) |
| |
Value: if (LangOpts.CXXOperatorNames) \
AddCXXOperatorKeyword(StringRef(#NAME), tok::ALIAS, *this);
◆ HASH
#define HASH |
( |
|
LEN, |
|
|
|
FIRST, |
|
|
|
THIRD |
|
) |
| (LEN << 5) + (((FIRST-'a') + (THIRD-'a')) & 31) |
◆ INTERESTING_IDENTIFIER
◆ KEYWORD [1/3]
#define KEYWORD |
( |
|
NAME, |
|
|
|
FLAGS |
|
) |
| |
◆ KEYWORD [2/3]
◆ KEYWORD [3/3]
#define KEYWORD |
( |
|
NAME, |
|
|
|
FLAGS |
|
) |
| .Case(#NAME, FLAGS) |
◆ OBJC_AT_KEYWORD
#define OBJC_AT_KEYWORD |
( |
|
NAME | ) |
|
Value: if (LangOpts.ObjC) \
AddObjCKeyword(StringRef(#NAME), tok::objc_##NAME, *this);
◆ OVERLOADED_OPERATOR
#define OVERLOADED_OPERATOR |
( |
|
Name, |
|
|
|
Spelling, |
|
|
|
Token, |
|
|
|
Unary, |
|
|
|
Binary, |
|
|
|
MemberOnly |
|
) |
| case OO_##Name: return Spelling; |
◆ TESTING_KEYWORD
#define TESTING_KEYWORD |
( |
|
NAME, |
|
|
|
FLAGS |
|
) |
| |
◆ AddCXXOperatorKeyword()
◆ AddInterestingIdentifier()
◆ AddKeyword()
◆ AddObjCKeyword()
◆ getKeywordStatus()
◆ getKeywordStatusHelper()
static KeywordStatus getKeywordStatusHelper |
( |
const LangOptions & |
LangOpts, |
|
|
TokenKey |
Flag |
|
) |
| |
|
static |
◆ getSelectorTableImpl()
static SelectorTableImpl & getSelectorTableImpl |
( |
void * |
P | ) |
|
|
static |
◆ getTokenKwStatus()
◆ startsWithWord()
static bool startsWithWord |
( |
StringRef |
name, |
|
|
StringRef |
word |
|
) |
| |
|
static |