LLVM 20.0.0git
|
Abstract base class for all Nodes. More...
#include "llvm/Support/YAMLParser.h"
Public Types | |
enum | NodeKind { NK_Null , NK_Scalar , NK_BlockScalar , NK_KeyValue , NK_Mapping , NK_Sequence , NK_Alias } |
Public Member Functions | |
Node (unsigned int Type, std::unique_ptr< Document > &, StringRef Anchor, StringRef Tag) | |
Node (const Node &)=delete | |
void | operator= (const Node &)=delete |
void * | operator new (size_t Size, BumpPtrAllocator &Alloc, size_t Alignment=16) noexcept |
void | operator delete (void *Ptr, BumpPtrAllocator &Alloc, size_t Size) noexcept |
void | operator delete (void *) noexcept=delete |
StringRef | getAnchor () const |
Get the value of the anchor attached to this node. | |
StringRef | getRawTag () const |
Get the tag as it was written in the document. | |
std::string | getVerbatimTag () const |
Get the verbatium tag for a given Node. | |
SMRange | getSourceRange () const |
void | setSourceRange (SMRange SR) |
Token & | peekNext () |
Token | getNext () |
Node * | parseBlockNode () |
BumpPtrAllocator & | getAllocator () |
void | setError (const Twine &Message, Token &Location) const |
bool | failed () const |
virtual void | skip () |
unsigned int | getType () const |
Protected Member Functions | |
~Node ()=default | |
Protected Attributes | |
std::unique_ptr< Document > & | Doc |
SMRange | SourceRange |
Abstract base class for all Nodes.
Definition at line 119 of file YAMLParser.h.
Enumerator | |
---|---|
NK_Null | |
NK_Scalar | |
NK_BlockScalar | |
NK_KeyValue | |
NK_Mapping | |
NK_Sequence | |
NK_Alias |
Definition at line 123 of file YAMLParser.h.
llvm::yaml::Node::Node | ( | unsigned int | Type, |
std::unique_ptr< Document > & | , | ||
StringRef | Anchor, | ||
StringRef | Tag | ||
) |
|
protecteddefault |
bool Node::failed | ( | ) | const |
Definition at line 2027 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getValue(), and llvm::yaml::SequenceNode::increment().
BumpPtrAllocator & Node::getAllocator | ( | ) |
Definition at line 2019 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getKey(), and llvm::yaml::KeyValueNode::getValue().
|
inline |
Get the value of the anchor attached to this node.
If it does not have one, getAnchor().size() will be 0.
Definition at line 155 of file YAMLParser.h.
Token Node::getNext | ( | ) |
Definition at line 2011 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getKey(), llvm::yaml::KeyValueNode::getValue(), and llvm::yaml::SequenceNode::increment().
|
inline |
Get the tag as it was written in the document.
This does not perform tag resolution.
Definition at line 159 of file YAMLParser.h.
Referenced by getVerbatimTag().
|
inline |
Definition at line 165 of file YAMLParser.h.
References SourceRange.
Referenced by llvm::yaml::ScalarTraits< FrameIndex >::input(), llvm::yaml::ScalarTraits< StringValue >::input(), and llvm::yaml::ScalarTraits< UnsignedValue >::input().
|
inline |
Definition at line 178 of file YAMLParser.h.
Referenced by getVerbatimTag().
std::string Node::getVerbatimTag | ( | ) | const |
Get the verbatium tag for a given Node.
This performs tag resoluton and substitution.
Definition at line 1962 of file YAMLParser.cpp.
References Doc, llvm::StringRef::empty(), llvm::StringRef::find_last_of(), getRawTag(), getType(), NK_BlockScalar, NK_Mapping, NK_Null, NK_Scalar, NK_Sequence, setError(), llvm::StringRef::starts_with(), llvm::StringRef::substr(), and llvm::yaml::Token::TK_Tag.
|
deletenoexcept |
|
inlinenoexcept |
Definition at line 146 of file YAMLParser.h.
References llvm::Alloc, Ptr, and Size.
|
inlinenoexcept |
Definition at line 141 of file YAMLParser.h.
References llvm::Alloc, and Size.
Node * Node::parseBlockNode | ( | ) |
Definition at line 2015 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getKey(), llvm::yaml::KeyValueNode::getValue(), and llvm::yaml::SequenceNode::increment().
Token & Node::peekNext | ( | ) |
Definition at line 2007 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getKey(), llvm::yaml::KeyValueNode::getValue(), and llvm::yaml::SequenceNode::increment().
Definition at line 2023 of file YAMLParser.cpp.
References Doc.
Referenced by llvm::yaml::KeyValueNode::getValue(), getVerbatimTag(), and llvm::yaml::SequenceNode::increment().
|
inline |
Definition at line 166 of file YAMLParser.h.
References SourceRange.
|
inlinevirtual |
Reimplemented in llvm::yaml::KeyValueNode, llvm::yaml::MappingNode, and llvm::yaml::SequenceNode.
Definition at line 176 of file YAMLParser.h.
Referenced by llvm::yaml::KeyValueNode::getValue(), llvm::yaml::SequenceNode::increment(), llvm::yaml::Document::skip(), and llvm::yaml::KeyValueNode::skip().
|
protected |
Definition at line 181 of file YAMLParser.h.
Referenced by failed(), getAllocator(), llvm::yaml::KeyValueNode::getKey(), getNext(), llvm::yaml::KeyValueNode::getValue(), getVerbatimTag(), parseBlockNode(), peekNext(), and setError().
|
protected |
Definition at line 182 of file YAMLParser.h.
Referenced by llvm::yaml::BlockScalarNode::BlockScalarNode(), getSourceRange(), llvm::yaml::ScalarNode::ScalarNode(), and setSourceRange().