78 if (!parser->stream_start_produced) {
84 if (parser->stream_end_produced) {
96 parser->document = document;
101 parser->document =
NULL;
109 parser->document =
NULL;
203 switch (first_event->
type) {
231 if (!anchor)
return 1;
238 alias_data != parser->
aliases.
top; alias_data ++) {
239 if (strcmp((
char *)alias_data->
anchor, (
char *)anchor) == 0) {
242 "found duplicate anchor; first occurence",
243 alias_data->
mark,
"second occurence", data.
mark);
266 alias_data != parser->
aliases.
top; alias_data ++) {
267 if (strcmp((
char *)alias_data->
anchor, (
char *)anchor) == 0) {
269 return alias_data->
index;
289 if (!tag || strcmp((
char *)tag,
"!") == 0) {
292 if (!tag)
goto error;
329 int index, item_index;
332 if (!tag || strcmp((
char *)tag,
"!") == 0) {
335 if (!tag)
goto error;
355 if (!item_index)
return 0;
358 item_index))
return 0;
390 if (!tag || strcmp((
char *)tag,
"!") == 0) {
393 if (!tag)
goto error;
413 if (!pair.
key)
return 0;
416 if (!pair.
value)
return 0;
union yaml_node_s::@29 data
The node data.
yaml_strdup(const yaml_char_t *str)
static int yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_mark_t mark
The anchor mark.
yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event)
Parse the input stream and produce the next parsing event.
yaml_version_directive_t * version_directive
The version directive.
int end_implicit
Is the document end indicator implicit?
yaml_mark_t start_mark
The beginning of the node.
Cannot compose a YAML document.
struct yaml_event_s::@20::@22 document_start
The document parameters (for YAML_DOCUMENT_START_EVENT).
static int yaml_parser_register_anchor(yaml_parser_t *parser, int index, yaml_char_t *anchor)
#define SCALAR_NODE_INIT(node, node_tag, node_value, node_length,node_style, start_mark, end_mark)
yaml_node_t * end
The end of the stack.
#define MAPPING_NODE_INIT(node, node_tag, node_pairs_start, node_pairs_end,node_style, start_mark, end_mark)
yaml_mark_t end_mark
The end of the event.
struct yaml_node_s::@29::@32 mapping
The mapping parameters (for YAML_MAPPING_NODE).
#define INITIAL_STACK_SIZE
unsigned char yaml_char_t
The character type (UTF-8 octet).
const unsigned char * start
The string start pointer.
const char * context
The error context.
static int yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *first_event)
An element of a mapping node.
yaml_document_delete(yaml_document_t *document)
Delete a YAML document and all its nodes.
int yaml_node_item_t
An element of a sequence node.
yaml_char_t * anchor
The anchor.
#define STACK_EMPTY(context, stack)
int key
The key of the element.
#define YAML_DEFAULT_SEQUENCE_TAG
The default sequence tag is !!seq.
static int yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event)
static int yaml_parser_set_composer_error(yaml_parser_t *parser, const char *problem, yaml_mark_t problem_mark)
int * top
The top of the stack.
struct yaml_parser_s::@46 aliases
The alias data.
static int yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_mark_t end_mark
The end of the node.
#define YAML_DECLARE(type)
The public API declaration.
static void yaml_parser_delete_aliases(yaml_parser_t *parser)
#define STACK_DEL(context, stack)
yaml_node_t * top
The top of the stack.
yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
Parse the input stream and produce the next YAML document.
This structure holds aliases data.
yaml_error_type_t error
Error type.
int start_implicit
Is the document start indicator implicit?
int value
The value of the element.
yaml_node_item_t * start
The beginning of the stack.
struct yaml_event_s::@20::@27 mapping_start
The mapping parameters (for YAML_MAPPING_START_EVENT).
struct yaml_node_s::@29::@31 sequence
The sequence parameters (for YAML_SEQUENCE_NODE).
yaml_mark_t start_mark
The beginning of the document.
static int yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_mark_t context_mark
The context position.
yaml_mark_t problem_mark
The problem position.
static int yaml_parser_load_node(yaml_parser_t *parser, yaml_event_t *first_event)
struct yaml_event_s::@20::@24 alias
The alias parameters (for YAML_ALIAS_EVENT).
#define YAML_DEFAULT_SCALAR_TAG
The default scalar tag is !!str.
union yaml_event_s::@20 data
The event data.
#define POP(context, stack)
struct yaml_document_s::@35 nodes
The document nodes.
yaml_node_t * start
The beginning of the stack.
static int yaml_parser_set_composer_error_context(yaml_parser_t *parser, const char *context, yaml_mark_t context_mark, const char *problem, yaml_mark_t problem_mark)
yaml_document_t * document
The currently parsed document.
#define assert(condition)
#define SEQUENCE_NODE_INIT(node, node_tag, node_items_start, node_items_end,node_style, start_mark, end_mark)
const char * problem
Error description.
#define STACK_INIT(context, stack, size)
#define YAML_DEFAULT_MAPPING_TAG
The default mapping tag is !!map.
struct yaml_document_s::@36 tag_directives
The list of tag directives.
struct yaml_event_s::@20::@26 sequence_start
The sequence parameters (for YAML_SEQUENCE_START_EVENT).
yaml_event_type_t type
The event type.
struct yaml_event_s::@20::@25 scalar
The scalar parameters (for YAML_SCALAR_EVENT).
yaml_mark_t end_mark
The end of the document.
yaml_mark_t start_mark
The beginning of the event.