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={}) |
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 856 of file YAMLParser.cpp.
Scanner::Scanner | ( | MemoryBufferRef | Buffer, |
SourceMgr & | SM_, | ||
bool | ShowColors = true , |
||
std::error_code * | EC = nullptr |
||
) |
Definition at line 862 of file YAMLParser.cpp.
|
inline |
Returns true if an error occurred while parsing.
Definition at line 281 of file YAMLParser.cpp.
References llvm::Failed().
Token Scanner::getNext | ( | ) |
Parse the next token and pop it from the queue.
Definition at line 912 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 885 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.
|
inline |
Definition at line 265 of file YAMLParser.cpp.
References llvm::SourceMgr::DK_Error, End, llvm::Failed(), llvm::SMLoc::getFromPointer(), and llvm::make_error_code().