LLVM: lib/Support/YAMLParser.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
namespace llvm::yaml
Typedefs
using EncodingInfo = std::pair<UnicodeEncodingForm, unsigned>
EncodingInfo - Holds the encoding type and length of the byte order mark if it exists.
using TokenQueueT = BumpPtrList<Token>
using UTF8Decoded = std::pair<uint32_t, unsigned>
The Unicode scalar value of a UTF-8 minimal well-formed code unit subsequence and the subsequence's length in code units (uint8_t).
Functions
static EncodingInfo getUnicodeEncoding (StringRef Input)
getUnicodeEncoding - Reads up to the first 4 bytes to determine the Unicode encoding form of Input.
static UTF8Decoded decodeUTF8 (StringRef Range)
static void encodeUTF8 (uint32_t UnicodeScalarValue, SmallVectorImpl< char > &Result)
encodeUTF8 - Encode UnicodeScalarValue in UTF-8 and append it to result.
static bool is_ns_hex_digit (const char C)
static bool is_ns_word_char (const char C)
static LLVM_ATTRIBUTE_NOINLINE bool wasEscaped (StringRef::iterator First, StringRef::iterator Position)
static unsigned getChompedLineBreaks (char ChompingIndicator, unsigned LineBreaks, StringRef Str)
Get the number of line breaks after chomping.
static StringRef parseScalarValue (StringRef UnquotedValue, SmallVectorImpl< char > &Storage, StringRef LookupChars, std::function< StringRef(StringRef, SmallVectorImpl< char > &)> UnescapeCallback)
parseScalarValue - A common parsing routine for all flow scalar styles.

EncodingInfo

EncodingInfo - Holds the encoding type and length of the byte order mark if it exists.

Length is in {0, 2, 3, 4}.

Definition at line 52 of file YAMLParser.cpp.

TokenQueueT

UTF8Decoded

The Unicode scalar value of a UTF-8 minimal well-formed code unit subsequence and the subsequence's length in code units (uint8_t).

A length of 0 represents an error.

Definition at line 194 of file YAMLParser.cpp.

UnicodeEncodingForm

Enumerator
UEF_UTF32_LE UTF-32 Little Endian.
UEF_UTF32_BE UTF-32 Big Endian.
UEF_UTF16_LE UTF-16 Little Endian.
UEF_UTF16_BE UTF-16 Big Endian.
UEF_UTF8 UTF-8 or ascii.
UEF_Unknown Not a valid Unicode encoding.

Definition at line 41 of file YAMLParser.cpp.

decodeUTF8()

encodeUTF8()

encodeUTF8 - Encode UnicodeScalarValue in UTF-8 and append it to result.

Definition at line 579 of file YAMLParser.cpp.

getChompedLineBreaks()

Get the number of line breaks after chomping.

Return the number of trailing line breaks to emit, depending on ChompingIndicator.

Definition at line 1592 of file YAMLParser.cpp.

getUnicodeEncoding()

is_ns_hex_digit()

is_ns_word_char()

parseScalarValue()

parseScalarValue - A common parsing routine for all flow scalar styles.

It handles line break characters by itself, adds regular content characters to the result, and forwards escaped sequences to the provided routine for the style-specific processing.

Parameters

UnquotedValue - An input value without quotation marks.
Storage - A storage for the result if the input value is multiline or contains escaped characters.
LookupChars - A set of special characters to search in the input string. Should include line break characters and the escape character specific for the processing scalar style, if any.
UnescapeCallback - This is called when the escape character is found in the input.

Returns

- The unfolded and unescaped value.

Definition at line 2055 of file YAMLParser.cpp.

References llvm::append_range(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::StringRef::drop_front(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::StringRef::find_first_of(), llvm::StringRef::find_last_not_of(), I, llvm::StringRef::ltrim(), llvm::StringRef::npos, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::size(), llvm::StringRef::substr(), and llvm::StringRef::take_front().

wasEscaped()