8#ifndef INCLUDED_ORCUS_YAML_PARSER_BASE_HPP
9#define INCLUDED_ORCUS_YAML_PARSER_BASE_HPP
11#include "orcus/parser_base.hpp"
16namespace orcus {
namespace yaml {
21 parse_error(
const std::string& msg, std::ptrdiff_t offset);
23 static void throw_with(
const char* msg_before,
char c,
const char* msg_after, std::ptrdiff_t offset);
24 static void throw_with(
const char* msg_before,
const char* p,
size_t n,
const char* msg_after, std::ptrdiff_t offset);
45enum class parse_token_t
69 begin_sequence_element
77 std::unique_ptr<impl> mp_impl;
82 static const size_t parse_indent_blank_line;
85 static const size_t parse_indent_end_of_stream;
87 static const size_t scope_empty;
92 std::string_view value;
102 void push_parse_token(detail::parse_token_t t);
104 detail::parse_token_t get_last_parse_token()
const;
135 void reset_on_new_line();
137 size_t get_scope()
const;
139 void push_scope(
size_t scope_width);
143 detail::scope_t get_scope_type()
const;
145 void set_scope_type(detail::scope_t type);
154 void push_line_back(
const char* p,
size_t n);
156 std::string_view pop_line_front();
158 bool has_line_buffer()
const;
160 size_t get_line_buffer_count()
const;
162 std::string_view merge_line_buffer();
181 detail::keyword_t parse_keyword(
const char* p,
size_t len);
183 key_value parse_key_value(
const char* p,
size_t len);
185 std::string_view parse_single_quoted_string_value(
const char*& p,
size_t max_length);
187 std::string_view parse_double_quoted_string_value(
const char*& p,
size_t max_length);
189 void skip_blanks(
const char*& p,
size_t len);
191 void start_literal_block();
193 bool in_literal_block()
const;
195 void handle_line_in_literal(
size_t indent);
197 void handle_line_in_multi_line_string();
Definition: parser_base.hpp:27
Definition: parser_base.hpp:41
Definition: yaml_parser_base.hpp:19
Definition: yaml_parser_base.hpp:75
std::string_view parse_to_end_of_line()
const char * get_doc_hash() const
void set_doc_hash(const char *hash)
size_t offset_last_char_of_line() const
Definition: yaml_parser_base.hpp:90