LLVM 22.0.0git
llvm::yaml::Scanner Class Reference

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)
TokenpeekNext ()
 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.

Detailed Description

Scans YAML tokens from a MemoryBuffer.

Definition at line 247 of file YAMLParser.cpp.

Constructor & Destructor Documentation

◆ Scanner() [1/2]

Scanner::Scanner ( StringRef Input,
SourceMgr & SM,
bool ShowColors = true,
std::error_code * EC = nullptr )

Definition at line 857 of file YAMLParser.cpp.

◆ Scanner() [2/2]

Scanner::Scanner ( MemoryBufferRef Buffer,
SourceMgr & SM_,
bool ShowColors = true,
std::error_code * EC = nullptr )

Definition at line 863 of file YAMLParser.cpp.

Member Function Documentation

◆ failed()

bool llvm::yaml::Scanner::failed ( )
inline

Returns true if an error occurred while parsing.

Definition at line 281 of file YAMLParser.cpp.

◆ getNext()

Token Scanner::getNext ( )

Parse the next token and pop it from the queue.

Definition at line 913 of file YAMLParser.cpp.

References peekNext().

Referenced by llvm::yaml::dumpTokens(), and llvm::yaml::scanTokens().

◆ peekNext()

Token & Scanner::peekNext ( )

Parse the next token and return it without popping it.

Definition at line 886 of file YAMLParser.cpp.

References assert(), and llvm::is_contained().

Referenced by getNext().

◆ printError()

void llvm::yaml::Scanner::printError ( SMLoc Loc,
SourceMgr::DiagKind Kind,
const Twine & Message,
ArrayRef< SMRange > Ranges = {} )
inline

Definition at line 260 of file YAMLParser.cpp.

Referenced by setError().

◆ setError()

void llvm::yaml::Scanner::setError ( const Twine & Message,
StringRef::iterator Position )
inline

The documentation for this class was generated from the following file: