10 #ifndef LLVM_CLANG_BASIC_CHARINFO_H 11 #define LLVM_CLANG_BASIC_CHARINFO_H 14 #include "llvm/ADT/StringRef.h" 15 #include "llvm/Support/Compiler.h" 16 #include "llvm/Support/DataTypes.h" 43 LLVM_READNONE
inline bool isASCII(
char c) {
44 return static_cast<unsigned char>(c) <= 127;
50 bool AllowDollar =
false) {
51 using namespace charinfo;
54 return AllowDollar && c ==
'$';
60 bool AllowDollar =
false) {
61 using namespace charinfo;
64 return AllowDollar && c ==
'$';
72 using namespace charinfo;
80 using namespace charinfo;
89 using namespace charinfo;
94 LLVM_READONLY
inline bool isDigit(
unsigned char c) {
95 using namespace charinfo;
101 using namespace charinfo;
107 using namespace charinfo;
112 LLVM_READONLY
inline bool isLetter(
unsigned char c) {
113 using namespace charinfo;
119 using namespace charinfo;
125 using namespace charinfo;
133 using namespace charinfo;
141 using namespace charinfo;
149 using namespace charinfo;
156 using namespace charinfo;
167 return c +
'a' -
'A';
176 return c +
'A' -
'a';
189 for (StringRef::iterator I = S.begin(), E = S.end(); I != E; ++I)
LLVM_READNONE bool isASCII(char c)
Returns true if this is an ASCII character.
LLVM_READONLY bool isHorizontalWhitespace(unsigned char c)
Returns true if this character is horizontal ASCII whitespace: ' ', '\t', '\f', '\v'.
LLVM_READONLY bool isLetter(unsigned char c)
Return true if this character is an ASCII letter: [a-zA-Z].
LLVM_READONLY bool isWhitespace(unsigned char c)
Return true if this character is horizontal or vertical ASCII whitespace: ' ', '\t', '\f', '\v', '\n', '\r'.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
LLVM_READONLY bool isUppercase(unsigned char c)
Return true if this character is an uppercase ASCII letter: [A-Z].
LLVM_READONLY bool isRawStringDelimBody(unsigned char c)
Return true if this is the body character of a C++ raw string delimiter.
LLVM_READONLY bool isIdentifierHead(unsigned char c, bool AllowDollar=false)
Returns true if this is a valid first character of a C identifier, which is [a-zA-Z_].
LLVM_READONLY bool isAlphanumeric(unsigned char c)
Return true if this character is an ASCII letter or digit: [a-zA-Z0-9].
LLVM_READONLY bool isValidIdentifier(StringRef S)
Return true if this is a valid ASCII identifier.
LLVM_READONLY char toLowercase(char c)
Converts the given ASCII character to its lowercase equivalent.
LLVM_READONLY bool isPrintable(unsigned char c)
Return true if this character is an ASCII printable character; that is, a character that should take ...
LLVM_READONLY bool isLowercase(unsigned char c)
Return true if this character is a lowercase ASCII letter: [a-z].
Dataflow Directional Tag Classes.
LLVM_READONLY bool isVerticalWhitespace(unsigned char c)
Returns true if this character is vertical ASCII whitespace: '\n', '\r'.
LLVM_READONLY bool isIdentifierBody(unsigned char c, bool AllowDollar=false)
Returns true if this is a body character of a C identifier, which is [a-zA-Z0-9_].
LLVM_READONLY bool isHexDigit(unsigned char c)
Return true if this character is an ASCII hex digit: [0-9a-fA-F].
LLVM_READONLY bool isDigit(unsigned char c)
Return true if this character is an ASCII digit: [0-9].
LLVM_READONLY bool isPunctuation(unsigned char c)
Return true if this character is an ASCII punctuation character.
const uint16_t InfoTable[256]
LLVM_READONLY char toUppercase(char c)
Converts the given ASCII character to its uppercase equivalent.
LLVM_READONLY bool isPreprocessingNumberBody(unsigned char c)
Return true if this is the body character of a C preprocessing number, which is [a-zA-Z0-9_.