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" 17 namespace 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);
46 enum 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;
115 size_t offset_last_char_of_line()
const;
122 size_t parse_indent();
128 pstring parse_to_end_of_line();
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;
171 const char* get_doc_hash()
const;
180 void set_doc_hash(
const char* hash);
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: yaml_parser_base.hpp:90
Definition: pstring.hpp:24
Definition: parser_base.hpp:35
Definition: yaml_parser_base.hpp:19
Definition: parser_base.hpp:21
Definition: yaml_parser_base.hpp:75