A parser turns a stream of bytes into one stream of "events" per YAML document in the input stream.
More...
#include <parser.h>
|
| Parser () |
| Constructs an empty parser (with no input. More...
|
|
| Parser (const Parser &)=delete |
|
| Parser (Parser &&)=delete |
|
Parser & | operator= (const Parser &)=delete |
|
Parser & | operator= (Parser &&)=delete |
|
| Parser (std::istream &in) |
| Constructs a parser from the given input stream. More...
|
|
| operator bool () const |
| Evaluates to true if the parser has some valid input to be read. More...
|
|
void | Load (std::istream &in) |
| Resets the parser with the given input stream. More...
|
|
bool | HandleNextDocument (EventHandler &eventHandler) |
| Handles the next document by calling events on the. More...
|
|
void | PrintTokens (std::ostream &out) |
|
|
void | ParseDirectives () |
| Reads any directives that are next in the queue, setting the internal. More...
|
|
void | HandleDirective (const Token &token) |
|
void | HandleYamlDirective (const Token &token) |
| Handles a "YAML" directive, which should be of the form 'major.minor' (like a version number). More...
|
|
void | HandleTagDirective (const Token &token) |
| Handles a "TAG" directive, which should be of the form 'handle prefix', where 'handle' is converted to 'prefix' in the file. More...
|
|
|
std::unique_ptr< Scanner > | m_pScanner |
|
std::unique_ptr< Directives > | m_pDirectives |
|
A parser turns a stream of bytes into one stream of "events" per YAML document in the input stream.
◆ Parser() [1/2]
Constructs an empty parser (with no input.
◆ Parser() [2/2]
YAML::Parser::Parser |
( |
std::istream & |
in | ) |
|
|
explicit |
Constructs a parser from the given input stream.
The input stream must live as long as the parser.
◆ HandleNextDocument()
bool YAML::Parser::HandleNextDocument |
( |
EventHandler & |
eventHandler | ) |
|
Handles the next document by calling events on the.
.
- Exceptions
-
a | ParserException on error. |
- Returns
- false if there are no more documents
◆ HandleTagDirective()
void YAML::Parser::HandleTagDirective |
( |
const Token & |
token | ) |
|
|
private |
Handles a "TAG" directive, which should be of the form 'handle prefix', where 'handle' is converted to 'prefix' in the file.
◆ HandleYamlDirective()
void YAML::Parser::HandleYamlDirective |
( |
const Token & |
token | ) |
|
|
private |
Handles a "YAML" directive, which should be of the form 'major.minor' (like a version number).
◆ Load()
void YAML::Parser::Load |
( |
std::istream & |
in | ) |
|
Resets the parser with the given input stream.
Any existing state is erased.
◆ operator bool()
YAML::Parser::operator bool |
( |
| ) |
const |
|
explicit |
Evaluates to true if the parser has some valid input to be read.
◆ ParseDirectives()
void YAML::Parser::ParseDirectives |
( |
| ) |
|
|
private |
Reads any directives that are next in the queue, setting the internal.
state.
The documentation for this class was generated from the following file: