#include "llvm/Support/YAMLParser.h"
#include "llvm/ADT/AllocatorList.h"
#include "llvm/ADT/ArrayRef.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 <cassert>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <system_error>
#include <utility>
usingnamespacellvm;
usingnamespaceyaml;
enum UnicodeEncodingForm { … };
EncodingInfo;
static EncodingInfo getUnicodeEncoding(StringRef Input) { … }
void Node::anchor() { … }
void NullNode::anchor() { … }
void ScalarNode::anchor() { … }
void BlockScalarNode::anchor() { … }
void KeyValueNode::anchor() { … }
void MappingNode::anchor() { … }
void SequenceNode::anchor() { … }
void AliasNode::anchor() { … }
namespace llvm {
namespace yaml {
struct Token { … };
}
}
TokenQueueT;
namespace {
struct SimpleKey { … };
}
UTF8Decoded;
static UTF8Decoded decodeUTF8(StringRef Range) { … }
namespace llvm {
namespace yaml {
class Scanner { … };
}
}
static void encodeUTF8( uint32_t UnicodeScalarValue
, SmallVectorImpl<char> &Result) { … }
bool yaml::dumpTokens(StringRef Input, raw_ostream &OS) { … }
bool yaml::scanTokens(StringRef Input) { … }
std::string yaml::escape(StringRef Input, bool EscapePrintable) { … }
std::optional<bool> yaml::parseBool(StringRef S) { … }
Scanner::Scanner(StringRef Input, SourceMgr &sm, bool ShowColors,
std::error_code *EC)
: … { … }
Scanner::Scanner(MemoryBufferRef Buffer, SourceMgr &SM_, bool ShowColors,
std::error_code *EC)
: … { … }
void Scanner::init(MemoryBufferRef Buffer) { … }
Token &Scanner::peekNext() { … }
Token Scanner::getNext() { … }
StringRef::iterator Scanner::skip_nb_char(StringRef::iterator Position) { … }
StringRef::iterator Scanner::skip_b_break(StringRef::iterator Position) { … }
StringRef::iterator Scanner::skip_s_space(StringRef::iterator Position) { … }
StringRef::iterator Scanner::skip_s_white(StringRef::iterator Position) { … }
StringRef::iterator Scanner::skip_ns_char(StringRef::iterator Position) { … }
StringRef::iterator Scanner::skip_while( SkipWhileFunc Func
, StringRef::iterator Position) { … }
void Scanner::advanceWhile(SkipWhileFunc Func) { … }
static bool is_ns_hex_digit(const char C) { … }
static bool is_ns_word_char(const char C) { … }
void Scanner::scan_ns_uri_char() { … }
bool Scanner::consume(uint32_t Expected) { … }
void Scanner::skip(uint32_t Distance) { … }
bool Scanner::isBlankOrBreak(StringRef::iterator Position) { … }
bool Scanner::isPlainSafeNonBlank(StringRef::iterator Position) { … }
bool Scanner::isLineEmpty(StringRef Line) { … }
bool Scanner::consumeLineBreakIfPresent() { … }
void Scanner::saveSimpleKeyCandidate( TokenQueueT::iterator Tok
, unsigned AtColumn
, bool IsRequired) { … }
void Scanner::removeStaleSimpleKeyCandidates() { … }
void Scanner::removeSimpleKeyCandidatesOnFlowLevel(unsigned Level) { … }
bool Scanner::unrollIndent(int ToColumn) { … }
bool Scanner::rollIndent( int ToColumn
, Token::TokenKind Kind
, TokenQueueT::iterator InsertPoint) { … }
void Scanner::skipComment() { … }
void Scanner::scanToNextToken() { … }
bool Scanner::scanStreamStart() { … }
bool Scanner::scanStreamEnd() { … }
bool Scanner::scanDirective() { … }
bool Scanner::scanDocumentIndicator(bool IsStart) { … }
bool Scanner::scanFlowCollectionStart(bool IsSequence) { … }
bool Scanner::scanFlowCollectionEnd(bool IsSequence) { … }
bool Scanner::scanFlowEntry() { … }
bool Scanner::scanBlockEntry() { … }
bool Scanner::scanKey() { … }
bool Scanner::scanValue() { … }
LLVM_ATTRIBUTE_NOINLINE static bool
wasEscaped(StringRef::iterator First, StringRef::iterator Position);
static bool wasEscaped(StringRef::iterator First,
StringRef::iterator Position) { … }
bool Scanner::scanFlowScalar(bool IsDoubleQuoted) { … }
bool Scanner::scanPlainScalar() { … }
bool Scanner::scanAliasOrAnchor(bool IsAlias) { … }
bool Scanner::scanBlockScalarIndicators(char &StyleIndicator,
char &ChompingIndicator,
unsigned &IndentIndicator,
bool &IsDone) { … }
char Scanner::scanBlockStyleIndicator() { … }
char Scanner::scanBlockChompingIndicator() { … }
static unsigned getChompedLineBreaks(char ChompingIndicator,
unsigned LineBreaks, StringRef Str) { … }
unsigned Scanner::scanBlockIndentationIndicator() { … }
bool Scanner::scanBlockScalarHeader(char &ChompingIndicator,
unsigned &IndentIndicator, bool &IsDone) { … }
bool Scanner::findBlockScalarIndent(unsigned &BlockIndent,
unsigned BlockExitIndent,
unsigned &LineBreaks, bool &IsDone) { … }
bool Scanner::scanBlockScalarIndent(unsigned BlockIndent,
unsigned BlockExitIndent, bool &IsDone) { … }
bool Scanner::scanBlockScalar(bool IsLiteral) { … }
bool Scanner::scanTag() { … }
bool Scanner::fetchMoreTokens() { … }
Stream::Stream(StringRef Input, SourceMgr &SM, bool ShowColors,
std::error_code *EC)
: … { … }
Stream::Stream(MemoryBufferRef InputBuffer, SourceMgr &SM, bool ShowColors,
std::error_code *EC)
: … { … }
Stream::~Stream() = default;
bool Stream::failed() { … }
void Stream::printError(Node *N, const Twine &Msg, SourceMgr::DiagKind Kind) { … }
void Stream::printError(const SMRange &Range, const Twine &Msg,
SourceMgr::DiagKind Kind) { … }
document_iterator Stream::begin() { … }
document_iterator Stream::end() { … }
void Stream::skip() { … }
Node::Node(unsigned int Type, std::unique_ptr<Document> &D, StringRef A,
StringRef T)
: … { … }
std::string Node::getVerbatimTag() const { … }
Token &Node::peekNext() { … }
Token Node::getNext() { … }
Node *Node::parseBlockNode() { … }
BumpPtrAllocator &Node::getAllocator() { … }
void Node::setError(const Twine &Msg, Token &Tok) const { … }
bool Node::failed() const { … }
StringRef ScalarNode::getValue(SmallVectorImpl<char> &Storage) const { … }
static StringRef
parseScalarValue(StringRef UnquotedValue, SmallVectorImpl<char> &Storage,
StringRef LookupChars,
std::function<StringRef(StringRef, SmallVectorImpl<char> &)>
UnescapeCallback) { … }
StringRef
ScalarNode::getDoubleQuotedValue(StringRef RawValue,
SmallVectorImpl<char> &Storage) const { … }
StringRef ScalarNode::getSingleQuotedValue(StringRef RawValue,
SmallVectorImpl<char> &Storage) { … }
StringRef ScalarNode::getPlainValue(StringRef RawValue,
SmallVectorImpl<char> &Storage) { … }
Node *KeyValueNode::getKey() { … }
Node *KeyValueNode::getValue() { … }
void MappingNode::increment() { … }
void SequenceNode::increment() { … }
Document::Document(Stream &S) : … { … }
bool Document::skip() { … }
Token &Document::peekNext() { … }
Token Document::getNext() { … }
void Document::setError(const Twine &Message, Token &Location) const { … }
bool Document::failed() const { … }
Node *Document::parseBlockNode() { … }
bool Document::parseDirectives() { … }
void Document::parseYAMLDirective() { … }
void Document::parseTAGDirective() { … }
bool Document::expectToken(int TK) { … }