8#ifndef INCLUDED_ORCUS_YAML_PARSER_BASE_HPP
9#define INCLUDED_ORCUS_YAML_PARSER_BASE_HPP
11#include "orcus/parser_base.hpp"
12#include "orcus/pstring.hpp"
17namespace orcus {
namespace yaml {
22 parse_error(
const std::string& msg, std::ptrdiff_t offset);
24 static void throw_with(
const char* msg_before,
char c,
const char* msg_after, std::ptrdiff_t offset);
25 static void throw_with(
const char* msg_before,
const char* p,
size_t n,
const char* msg_after, std::ptrdiff_t offset);
46enum class parse_token_t
70 begin_sequence_element
78 std::unique_ptr<impl> mp_impl;
83 static const size_t parse_indent_blank_line;
86 static const size_t parse_indent_end_of_stream;
88 static const size_t scope_empty;
103 void push_parse_token(detail::parse_token_t t);
105 detail::parse_token_t get_last_parse_token()
const;
136 void reset_on_new_line();
138 size_t get_scope()
const;
140 void push_scope(
size_t scope_width);
144 detail::scope_t get_scope_type()
const;
146 void set_scope_type(detail::scope_t type);
155 void push_line_back(
const char* p,
size_t n);
159 bool has_line_buffer()
const;
161 size_t get_line_buffer_count()
const;
182 detail::keyword_t parse_keyword(
const char* p,
size_t len);
184 key_value parse_key_value(
const char* p,
size_t len);
186 pstring parse_single_quoted_string_value(
const char*& p,
size_t max_length);
188 pstring parse_double_quoted_string_value(
const char*& p,
size_t max_length);
190 void skip_blanks(
const char*& p,
size_t len);
192 void start_literal_block();
194 bool in_literal_block()
const;
196 void handle_line_in_literal(
size_t indent);
198 void handle_line_in_multi_line_string();
Definition: parser_base.hpp:26
Definition: parser_base.hpp:40
Definition: pstring.hpp:28
Definition: yaml_parser_base.hpp:20
Definition: yaml_parser_base.hpp:76
pstring 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:91