class StringLiteralParser
Declaration
class StringLiteralParser { /* full declaration omitted */ };
Description
StringLiteralParser - This decodes string escape characters and performs wide string analysis and Translation Phase #6 (concatenation of string literals) (C99 5.1.1.2p1).
Declared at: clang/include/clang/Lex/LiteralSupport.h:218
Member Variables
- private const clang::SourceManager& SM
- private const clang::LangOptions& Features
- private const clang::TargetInfo& Target
- private clang::DiagnosticsEngine* Diags
- private unsigned int MaxTokenLength
- private unsigned int SizeBound
- private unsigned int CharByteWidth
- private tok::TokenKind Kind
- private SmallString<512> ResultBuf
- private char* ResultPtr
- private SmallString<32> UDSuffixBuf
- private unsigned int UDSuffixToken
- private unsigned int UDSuffixOffset
- public bool hadError
- public bool Pascal
Method Overview
- private bool CopyStringFragment(const clang::Token & Tok, const char * TokBegin, llvm::StringRef Fragment)
- private void DiagnoseLexingError(clang::SourceLocation Loc)
- public unsigned int GetNumStringChars() const
- public llvm::StringRef GetString() const
- public unsigned int GetStringLength() const
- public StringLiteralParser(ArrayRef<clang::Token> StringToks, const clang::SourceManager & sm, const clang::LangOptions & features, const clang::TargetInfo & target, clang::DiagnosticsEngine * diags = nullptr)
- public StringLiteralParser(ArrayRef<clang::Token> StringToks, clang::Preprocessor & PP)
- public unsigned int getOffsetOfStringByte(const clang::Token & TheTok, unsigned int ByteNo) const
- public llvm::StringRef getUDSuffix() const
- public unsigned int getUDSuffixOffset() const
- public unsigned int getUDSuffixToken() const
- private void init(ArrayRef<clang::Token> StringToks)
- public bool isOrdinary() const
- public bool isPascal() const
- public bool isUTF16() const
- public bool isUTF32() const
- public bool isUTF8() const
- public static bool isValidUDSuffix(const clang::LangOptions & LangOpts, llvm::StringRef Suffix)
- public bool isWide() const
Methods
¶bool CopyStringFragment(const clang::Token& Tok,
const char* TokBegin,
llvm::StringRef Fragment)
bool CopyStringFragment(const clang::Token& Tok,
const char* TokBegin,
llvm::StringRef Fragment)
Declared at: clang/include/clang/Lex/LiteralSupport.h:290
Parameters
- const clang::Token& Tok
- const char* TokBegin
- llvm::StringRef Fragment
¶void DiagnoseLexingError(
clang::SourceLocation Loc)
void DiagnoseLexingError(
clang::SourceLocation Loc)
Declared at: clang/include/clang/Lex/LiteralSupport.h:292
Parameters
¶unsigned int GetNumStringChars() const
unsigned int GetNumStringChars() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:255
¶llvm::StringRef GetString() const
llvm::StringRef GetString() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:250
¶unsigned int GetStringLength() const
unsigned int GetStringLength() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:253
¶StringLiteralParser(
ArrayRef<clang::Token> StringToks,
const clang::SourceManager& sm,
const clang::LangOptions& features,
const clang::TargetInfo& target,
clang::DiagnosticsEngine* diags = nullptr)
StringLiteralParser(
ArrayRef<clang::Token> StringToks,
const clang::SourceManager& sm,
const clang::LangOptions& features,
const clang::TargetInfo& target,
clang::DiagnosticsEngine* diags = nullptr)
Declared at: clang/include/clang/Lex/LiteralSupport.h:236
Parameters
- ArrayRef<clang::Token> StringToks
- const clang::SourceManager& sm
- const clang::LangOptions& features
- const clang::TargetInfo& target
- clang::DiagnosticsEngine* diags = nullptr
¶StringLiteralParser(
ArrayRef<clang::Token> StringToks,
clang::Preprocessor& PP)
StringLiteralParser(
ArrayRef<clang::Token> StringToks,
clang::Preprocessor& PP)
Declared at: clang/include/clang/Lex/LiteralSupport.h:234
Parameters
- ArrayRef<clang::Token> StringToks
- clang::Preprocessor& PP
¶unsigned int getOffsetOfStringByte(
const clang::Token& TheTok,
unsigned int ByteNo) const
unsigned int getOffsetOfStringByte(
const clang::Token& TheTok,
unsigned int ByteNo) const
Description
getOffsetOfStringByte - This function returns the offset of the specified byte of the string data represented by Token. This handles advancing over escape sequences in the string. If the Diagnostics pointer is non-null, then this will do semantic checking of the string literal and emit errors and warnings.
Declared at: clang/include/clang/Lex/LiteralSupport.h:264
Parameters
- const clang::Token& TheTok
- unsigned int ByteNo
¶llvm::StringRef getUDSuffix() const
llvm::StringRef getUDSuffix() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:273
¶unsigned int getUDSuffixOffset() const
unsigned int getUDSuffixOffset() const
Description
Get the spelling offset of the first byte of the ud-suffix.
Declared at: clang/include/clang/Lex/LiteralSupport.h:281
¶unsigned int getUDSuffixToken() const
unsigned int getUDSuffixToken() const
Description
Get the index of a token containing a ud-suffix.
Declared at: clang/include/clang/Lex/LiteralSupport.h:276
¶void init(ArrayRef<clang::Token> StringToks)
void init(ArrayRef<clang::Token> StringToks)
Declared at: clang/include/clang/Lex/LiteralSupport.h:289
Parameters
- ArrayRef<clang::Token> StringToks
¶bool isOrdinary() const
bool isOrdinary() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:266
¶bool isPascal() const
bool isPascal() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:271
¶bool isUTF16() const
bool isUTF16() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:269
¶bool isUTF32() const
bool isUTF32() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:270
¶bool isUTF8() const
bool isUTF8() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:268
¶static bool isValidUDSuffix(
const clang::LangOptions& LangOpts,
llvm::StringRef Suffix)
static bool isValidUDSuffix(
const clang::LangOptions& LangOpts,
llvm::StringRef Suffix)
Declared at: clang/include/clang/Lex/LiteralSupport.h:286
Parameters
- const clang::LangOptions& LangOpts
- llvm::StringRef Suffix
¶bool isWide() const
bool isWide() const
Declared at: clang/include/clang/Lex/LiteralSupport.h:267