LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs | Enumerations | Functions
YAMLParser.cpp File Reference
#include "llvm/Support/YAMLParser.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for YAMLParser.cpp:

Go to the source code of this file.

Classes

struct  llvm::yaml::Token
 Token - A single YAML token. More...
 
struct  llvm::ilist_sentinel_traits< Token >
 
struct  llvm::ilist_node_traits< Token >
 
class  llvm::yaml::Scanner
 Scans YAML tokens from a MemoryBuffer. More...
 

Namespaces

 llvm
 List of target independent CodeGen pass IDs.
 
 llvm::yaml
 

Typedefs

typedef std::pair
< UnicodeEncodingForm,
unsigned
EncodingInfo
 
typedef ilist< TokenTokenQueueT
 
typedef std::pair< uint32_t,
unsigned
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. 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)
 
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)
 

Typedef Documentation

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 39 of file YAMLParser.cpp.

Definition at line 177 of file YAMLParser.cpp.

typedef std::pair<uint32_t, unsigned> 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 205 of file YAMLParser.cpp.

Enumeration Type Documentation

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 28 of file YAMLParser.cpp.

Function Documentation

static UTF8Decoded decodeUTF8 ( StringRef  Range)
static

Definition at line 207 of file YAMLParser.cpp.

References llvm::StringRef::begin(), and llvm::StringRef::end().

Referenced by llvm::yaml::escape().

static void encodeUTF8 ( uint32_t  UnicodeScalarValue,
SmallVectorImpl< char > &  Result 
)
static

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

Definition at line 520 of file YAMLParser.cpp.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::yaml::escape().

static EncodingInfo getUnicodeEncoding ( StringRef  Input)
static

getUnicodeEncoding - Reads up to the first 4 bytes to determine the Unicode encoding form of Input.

Parameters
InputA string of length 0 or more.
Returns
An EncodingInfo indicating the Unicode encoding form of the input and how long the byte order mark is if one exists.

Definition at line 47 of file YAMLParser.cpp.

References llvm::StringRef::size(), UEF_Unknown, UEF_UTF16_BE, UEF_UTF16_LE, UEF_UTF32_BE, UEF_UTF32_LE, and UEF_UTF8.

static bool is_ns_hex_digit ( const char  C)
static

Definition at line 844 of file YAMLParser.cpp.

static bool is_ns_word_char ( const char  C)
static

Definition at line 850 of file YAMLParser.cpp.

static bool wasEscaped ( StringRef::iterator  First,
StringRef::iterator  Position 
)
static

Definition at line 1225 of file YAMLParser.cpp.

References I.