LLVM 20.0.0git
|
Scans YAML tokens from a MemoryBuffer. More...
Public Member Functions | |
Scanner (StringRef Input, SourceMgr &SM, bool ShowColors=true, std::error_code *EC=nullptr) | |
Scanner (MemoryBufferRef Buffer, SourceMgr &SM_, bool ShowColors=true, std::error_code *EC=nullptr) | |
Token & | peekNext () |
Parse the next token and return it without popping it. | |
Token | getNext () |
Parse the next token and pop it from the queue. | |
void | printError (SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Message, ArrayRef< SMRange > Ranges=std::nullopt) |
void | setError (const Twine &Message, StringRef::iterator Position) |
bool | failed () |
Returns true if an error occurred while parsing. | |
Scans YAML tokens from a MemoryBuffer.
Definition at line 247 of file YAMLParser.cpp.
Scanner::Scanner | ( | StringRef | Input, |
SourceMgr & | SM, | ||
bool | ShowColors = true , |
||
std::error_code * | EC = nullptr |
||
) |
Definition at line 857 of file YAMLParser.cpp.
Scanner::Scanner | ( | MemoryBufferRef | Buffer, |
SourceMgr & | SM_, | ||
bool | ShowColors = true , |
||
std::error_code * | EC = nullptr |
||
) |
Definition at line 863 of file YAMLParser.cpp.
|
inline |
Returns true if an error occurred while parsing.
Definition at line 282 of file YAMLParser.cpp.
References llvm::Failed().
Token Scanner::getNext | ( | ) |
Parse the next token and pop it from the queue.
Definition at line 913 of file YAMLParser.cpp.
References llvm::AllocatorList< T, AllocatorT >::empty(), peekNext(), llvm::AllocatorList< T, AllocatorT >::pop_front(), and llvm::AllocatorList< T, AllocatorT >::resetAlloc().
Referenced by llvm::yaml::dumpTokens(), and llvm::yaml::scanTokens().
Token & Scanner::peekNext | ( | ) |
Parse the next token and return it without popping it.
Definition at line 886 of file YAMLParser.cpp.
References assert(), llvm::AllocatorList< T, AllocatorT >::begin(), llvm::AllocatorList< T, AllocatorT >::clear(), llvm::SmallVectorImpl< T >::clear(), llvm::AllocatorList< T, AllocatorT >::empty(), llvm::AllocatorList< T, AllocatorT >::front(), llvm::is_contained(), and llvm::AllocatorList< T, AllocatorT >::push_back().
Referenced by getNext().
|
inline |
Definition at line 260 of file YAMLParser.cpp.
References llvm::SourceMgr::PrintMessage().
|
inline |
Definition at line 266 of file YAMLParser.cpp.
References llvm::SourceMgr::DK_Error, End, llvm::Failed(), llvm::SMLoc::getFromPointer(), and llvm::make_error_code().