LLVM
8.0.1
|
#include "llvm/Support/YAMLParser.h"
#include "llvm/ADT/AllocatorList.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/Unicode.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <system_error>
#include <utility>
Go to the source code of this file.
Classes | |
struct | llvm::yaml::Token |
Token - A single YAML token. More... | |
class | llvm::yaml::Scanner |
Scans YAML tokens from a MemoryBuffer. More... | |
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
llvm::yaml | |
Typedefs | |
using | EncodingInfo = std::pair< UnicodeEncodingForm, unsigned > |
EncodingInfo - Holds the encoding type and length of the byte order mark if it exists. More... | |
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). More... | |
Enumerations | |
enum | UnicodeEncodingForm { UEF_UTF32_LE, UEF_UTF32_BE, UEF_UTF16_LE, UEF_UTF16_BE, UEF_UTF8, UEF_Unknown } |
Functions | |
static EncodingInfo | getUnicodeEncoding (StringRef Input) |
getUnicodeEncoding - Reads up to the first 4 bytes to determine the Unicode encoding form of Input. More... | |
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. More... | |
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. More... | |
using EncodingInfo = std::pair<UnicodeEncodingForm, unsigned> |
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 55 of file YAMLParser.cpp.
using TokenQueueT = BumpPtrList<Token> |
Definition at line 167 of file YAMLParser.cpp.
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).
A length of 0 represents an error.
Definition at line 197 of file YAMLParser.cpp.
enum UnicodeEncodingForm |
Definition at line 44 of file YAMLParser.cpp.
|
static |
Definition at line 199 of file YAMLParser.cpp.
References llvm::StringRef::begin().
Referenced by llvm::yaml::escape().
|
static |
encodeUTF8 - Encode UnicodeScalarValue in UTF-8 and append it to result.
Definition at line 566 of file YAMLParser.cpp.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::yaml::escape(), and llvm::yaml::ScalarNode::getValue().
|
static |
Get the number of line breaks after chomping.
Return the number of trailing line breaks to emit, depending on ChompingIndicator
.
Definition at line 1454 of file YAMLParser.cpp.
References llvm::StringRef::empty().
|
static |
getUnicodeEncoding - Reads up to the first 4 bytes to determine the Unicode encoding form of Input.
Input | A string of length 0 or more. |
Definition at line 63 of file YAMLParser.cpp.
References llvm::StringRef::empty(), llvm::StringRef::size(), UEF_Unknown, UEF_UTF16_BE, UEF_UTF16_LE, UEF_UTF32_BE, UEF_UTF32_LE, and UEF_UTF8.
Referenced by is_ns_word_char().
Definition at line 905 of file YAMLParser.cpp.
Referenced by is_ns_word_char().
Definition at line 911 of file YAMLParser.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), getUnicodeEncoding(), I, llvm::AllocatorList< T, AllocatorT >::insert(), is_ns_hex_digit(), llvm::yaml::Token::Kind, Kind, llvm::StringRef::npos, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::AllocatorList< T, AllocatorT >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::yaml::Token::Range, llvm::report_fatal_error(), llvm::yaml::Scanner::setError(), T, llvm::yaml::Token::TK_BlockEnd, llvm::yaml::Token::TK_StreamEnd, and llvm::yaml::Token::TK_StreamStart.
|
static |
Definition at line 1259 of file YAMLParser.cpp.