Ruby
2.0.0p247(2013-06-27revision41674)
|
#include "yaml_private.h"
Go to the source code of this file.
#define PEEK_TOKEN | ( | parser | ) |
((parser->token_available || yaml_parser_fetch_more_tokens(parser)) ? \ parser->tokens.head : NULL)
Definition at line 48 of file parser.c.
Referenced by yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_mapping_value(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_document_content(), yaml_parser_parse_document_end(), yaml_parser_parse_document_start(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_mapping_value(), yaml_parser_parse_flow_sequence_entry(), yaml_parser_parse_flow_sequence_entry_mapping_end(), yaml_parser_parse_flow_sequence_entry_mapping_key(), yaml_parser_parse_flow_sequence_entry_mapping_value(), yaml_parser_parse_indentless_sequence_entry(), yaml_parser_parse_node(), yaml_parser_parse_stream_start(), and yaml_parser_process_directives().
#define SKIP_TOKEN | ( | parser | ) |
(parser->token_available = 0, \ parser->tokens_parsed ++, \ parser->stream_end_produced = \ (parser->tokens.head->type == YAML_STREAM_END_TOKEN), \ parser->tokens.head ++)
Definition at line 56 of file parser.c.
Referenced by yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_mapping_value(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_document_end(), yaml_parser_parse_document_start(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_mapping_value(), yaml_parser_parse_flow_sequence_entry(), yaml_parser_parse_flow_sequence_entry_mapping_key(), yaml_parser_parse_flow_sequence_entry_mapping_value(), yaml_parser_parse_indentless_sequence_entry(), yaml_parser_parse_node(), yaml_parser_parse_stream_start(), and yaml_parser_process_directives().
static int yaml_parser_append_tag_directive | ( | yaml_parser_t * | parser, |
yaml_tag_directive_t | value, | ||
int | allow_duplicates, | ||
yaml_mark_t | mark | ||
) | [static] |
Definition at line 1341 of file parser.c.
References yaml_parser_s::error, yaml_tag_directive_s::handle, NULL, yaml_tag_directive_s::prefix, PUSH, yaml_parser_s::start, yaml_parser_s::tag_directives, yaml_parser_s::top, yaml_free(), YAML_MEMORY_ERROR, yaml_parser_set_parser_error(), and yaml_strdup().
Referenced by yaml_parser_process_directives().
static int yaml_parser_parse_block_mapping_key | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | first | ||
) | [static] |
Definition at line 835 of file parser.c.
References yaml_token_s::end_mark, MAPPING_END_EVENT_INIT, mark(), yaml_parser_s::marks, PEEK_TOKEN, POP, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_BLOCK_END_TOKEN, YAML_KEY_TOKEN, YAML_PARSE_BLOCK_MAPPING_VALUE_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), yaml_parser_set_parser_error_context(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_block_mapping_value | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 901 of file parser.c.
References yaml_token_s::end_mark, mark(), PEEK_TOKEN, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_BLOCK_END_TOKEN, YAML_KEY_TOKEN, YAML_PARSE_BLOCK_MAPPING_KEY_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_block_sequence_entry | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | first | ||
) | [static] |
Definition at line 726 of file parser.c.
References yaml_token_s::end_mark, mark(), yaml_parser_s::marks, PEEK_TOKEN, POP, PUSH, SEQUENCE_END_EVENT_INIT, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_BLOCK_END_TOKEN, YAML_BLOCK_ENTRY_TOKEN, YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and yaml_parser_set_parser_error_context().
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_document_content | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 440 of file parser.c.
References PEEK_TOKEN, POP, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_DOCUMENT_END_TOKEN, YAML_DOCUMENT_START_TOKEN, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), YAML_STREAM_END_TOKEN, YAML_TAG_DIRECTIVE_TOKEN, and YAML_VERSION_DIRECTIVE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_document_end | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 470 of file parser.c.
References DOCUMENT_END_EVENT_INIT, yaml_token_s::end_mark, yaml_tag_directive_s::handle, PEEK_TOKEN, POP, yaml_tag_directive_s::prefix, SKIP_TOKEN, STACK_EMPTY, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::tag_directives, token, yaml_token_s::type, YAML_DOCUMENT_END_TOKEN, yaml_free(), and YAML_PARSE_DOCUMENT_START_STATE.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_document_start | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | implicit | ||
) | [static] |
Definition at line 342 of file parser.c.
References DOCUMENT_START_EVENT_INIT, yaml_token_s::end_mark, NULL, PEEK_TOKEN, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, STREAM_END_EVENT_INIT, token, yaml_token_s::type, YAML_DOCUMENT_END_TOKEN, YAML_DOCUMENT_START_TOKEN, yaml_free(), YAML_PARSE_BLOCK_NODE_STATE, YAML_PARSE_DOCUMENT_CONTENT_STATE, YAML_PARSE_DOCUMENT_END_STATE, YAML_PARSE_END_STATE, yaml_parser_process_directives(), yaml_parser_set_parser_error(), YAML_STREAM_END_TOKEN, YAML_TAG_DIRECTIVE_TOKEN, and YAML_VERSION_DIRECTIVE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_mapping_key | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | first | ||
) | [static] |
Definition at line 1103 of file parser.c.
References yaml_token_s::end_mark, MAPPING_END_EVENT_INIT, yaml_parser_s::marks, PEEK_TOKEN, POP, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_FLOW_ENTRY_TOKEN, YAML_FLOW_MAPPING_END_TOKEN, YAML_KEY_TOKEN, YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE, YAML_PARSE_FLOW_MAPPING_VALUE_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), yaml_parser_set_parser_error_context(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_mapping_value | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | empty | ||
) | [static] |
Definition at line 1174 of file parser.c.
References PEEK_TOKEN, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_FLOW_ENTRY_TOKEN, YAML_FLOW_MAPPING_END_TOKEN, YAML_PARSE_FLOW_MAPPING_KEY_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_sequence_entry | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | first | ||
) | [static] |
Definition at line 951 of file parser.c.
References yaml_token_s::end_mark, MAPPING_START_EVENT_INIT, yaml_parser_s::marks, NULL, PEEK_TOKEN, POP, PUSH, SEQUENCE_END_EVENT_INIT, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_FLOW_ENTRY_TOKEN, YAML_FLOW_MAPPING_STYLE, YAML_FLOW_SEQUENCE_END_TOKEN, YAML_KEY_TOKEN, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE, YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE, yaml_parser_parse_node(), and yaml_parser_set_parser_error_context().
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_sequence_entry_mapping_end | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 1074 of file parser.c.
References MAPPING_END_EVENT_INIT, PEEK_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, token, and YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_sequence_entry_mapping_key | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 1013 of file parser.c.
References yaml_token_s::end_mark, mark(), PEEK_TOKEN, PUSH, SKIP_TOKEN, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_FLOW_ENTRY_TOKEN, YAML_FLOW_SEQUENCE_END_TOKEN, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_flow_sequence_entry_mapping_value | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 1043 of file parser.c.
References PEEK_TOKEN, PUSH, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_FLOW_ENTRY_TOKEN, YAML_FLOW_SEQUENCE_END_TOKEN, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_indentless_sequence_entry | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 785 of file parser.c.
References yaml_token_s::end_mark, mark(), PEEK_TOKEN, POP, PUSH, SEQUENCE_END_EVENT_INIT, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, token, yaml_token_s::type, YAML_BLOCK_END_TOKEN, YAML_BLOCK_ENTRY_TOKEN, YAML_KEY_TOKEN, YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE, yaml_parser_parse_node(), yaml_parser_process_empty_scalar(), and YAML_VALUE_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_parse_node | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
int | block, | ||
int | indentless_sequence | ||
) | [static] |
Definition at line 529 of file parser.c.
References yaml_token_s::alias, ALIAS_EVENT_INIT, yaml_token_s::anchor, yaml_token_s::data, yaml_token_s::end_mark, yaml_parser_s::error, yaml_tag_directive_s::handle, MAPPING_START_EVENT_INIT, NULL, PEEK_TOKEN, POP, yaml_tag_directive_s::prefix, yaml_token_s::scalar, SCALAR_EVENT_INIT, SEQUENCE_START_EVENT_INIT, SKIP_TOKEN, yaml_parser_s::start, yaml_token_s::start_mark, yaml_parser_s::state, yaml_parser_s::states, strlen(), yaml_token_s::tag, yaml_parser_s::tag_directives, token, yaml_parser_s::top, yaml_token_s::type, YAML_ALIAS_TOKEN, YAML_ANCHOR_TOKEN, YAML_BLOCK_ENTRY_TOKEN, YAML_BLOCK_MAPPING_START_TOKEN, YAML_BLOCK_MAPPING_STYLE, YAML_BLOCK_SEQUENCE_START_TOKEN, YAML_BLOCK_SEQUENCE_STYLE, YAML_FLOW_MAPPING_START_TOKEN, YAML_FLOW_MAPPING_STYLE, YAML_FLOW_SEQUENCE_START_TOKEN, YAML_FLOW_SEQUENCE_STYLE, yaml_free(), yaml_malloc(), YAML_MEMORY_ERROR, YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE, YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE, YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE, YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE, YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE, yaml_parser_set_parser_error_context(), YAML_PLAIN_SCALAR_STYLE, YAML_SCALAR_TOKEN, and YAML_TAG_TOKEN.
Referenced by yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_mapping_value(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_document_content(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_mapping_value(), yaml_parser_parse_flow_sequence_entry(), yaml_parser_parse_flow_sequence_entry_mapping_key(), yaml_parser_parse_flow_sequence_entry_mapping_value(), yaml_parser_parse_indentless_sequence_entry(), and yaml_parser_state_machine().
static int yaml_parser_parse_stream_start | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 313 of file parser.c.
References yaml_token_s::data, PEEK_TOKEN, SKIP_TOKEN, yaml_token_s::start_mark, yaml_parser_s::state, yaml_token_s::stream_start, STREAM_START_EVENT_INIT, token, yaml_token_s::type, YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE, yaml_parser_set_parser_error(), and YAML_STREAM_START_TOKEN.
Referenced by yaml_parser_state_machine().
static int yaml_parser_process_directives | ( | yaml_parser_t * | parser, |
yaml_version_directive_t ** | version_directive_ref, | ||
yaml_tag_directive_t ** | tag_directives_start_ref, | ||
yaml_tag_directive_t ** | tag_directives_end_ref | ||
) | [static] |
Definition at line 1233 of file parser.c.
References yaml_token_s::data, yaml_parser_s::error, yaml_tag_directive_s::handle, INITIAL_STACK_SIZE, yaml_version_directive_s::major, yaml_version_directive_s::minor, NULL, PEEK_TOKEN, POP, yaml_tag_directive_s::prefix, PUSH, SKIP_TOKEN, STACK_DEL, STACK_EMPTY, STACK_INIT, yaml_token_s::start_mark, yaml_token_s::tag_directive, token, top, yaml_token_s::type, yaml_token_s::version_directive, yaml_free(), yaml_malloc(), YAML_MEMORY_ERROR, yaml_parser_append_tag_directive(), yaml_parser_set_parser_error(), YAML_TAG_DIRECTIVE_TOKEN, and YAML_VERSION_DIRECTIVE_TOKEN.
Referenced by yaml_parser_parse_document_start().
static int yaml_parser_process_empty_scalar | ( | yaml_parser_t * | parser, |
yaml_event_t * | event, | ||
yaml_mark_t | mark | ||
) | [static] |
Definition at line 1210 of file parser.c.
References yaml_parser_s::error, NULL, SCALAR_EVENT_INIT, yaml_malloc(), YAML_MEMORY_ERROR, and YAML_PLAIN_SCALAR_STYLE.
Referenced by yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_mapping_value(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_document_content(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_mapping_value(), yaml_parser_parse_flow_sequence_entry_mapping_key(), yaml_parser_parse_flow_sequence_entry_mapping_value(), and yaml_parser_parse_indentless_sequence_entry().
static int yaml_parser_set_parser_error | ( | yaml_parser_t * | parser, |
const char * | problem, | ||
yaml_mark_t | problem_mark | ||
) | [static] |
Definition at line 196 of file parser.c.
References yaml_parser_s::error, yaml_parser_s::problem, yaml_parser_s::problem_mark, and YAML_PARSER_ERROR.
Referenced by yaml_parser_append_tag_directive(), yaml_parser_parse_document_start(), yaml_parser_parse_stream_start(), and yaml_parser_process_directives().
static int yaml_parser_set_parser_error_context | ( | yaml_parser_t * | parser, |
const char * | context, | ||
yaml_mark_t | context_mark, | ||
const char * | problem, | ||
yaml_mark_t | problem_mark | ||
) | [static] |
Definition at line 207 of file parser.c.
References yaml_parser_s::context, yaml_parser_s::context_mark, yaml_parser_s::error, yaml_parser_s::problem, yaml_parser_s::problem_mark, and YAML_PARSER_ERROR.
Referenced by yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_sequence_entry(), and yaml_parser_parse_node().
static int yaml_parser_state_machine | ( | yaml_parser_t * | parser, |
yaml_event_t * | event | ||
) | [static] |
Definition at line 226 of file parser.c.
References assert, yaml_parser_s::state, YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE, YAML_PARSE_BLOCK_MAPPING_KEY_STATE, YAML_PARSE_BLOCK_MAPPING_VALUE_STATE, YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE, YAML_PARSE_BLOCK_NODE_STATE, YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE, YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE, YAML_PARSE_DOCUMENT_CONTENT_STATE, YAML_PARSE_DOCUMENT_END_STATE, YAML_PARSE_DOCUMENT_START_STATE, YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE, YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE, YAML_PARSE_FLOW_MAPPING_KEY_STATE, YAML_PARSE_FLOW_MAPPING_VALUE_STATE, YAML_PARSE_FLOW_NODE_STATE, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE, YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE, YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE, YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE, YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE, YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE, YAML_PARSE_STREAM_START_STATE, yaml_parser_parse_block_mapping_key(), yaml_parser_parse_block_mapping_value(), yaml_parser_parse_block_sequence_entry(), yaml_parser_parse_document_content(), yaml_parser_parse_document_end(), yaml_parser_parse_document_start(), yaml_parser_parse_flow_mapping_key(), yaml_parser_parse_flow_mapping_value(), yaml_parser_parse_flow_sequence_entry(), yaml_parser_parse_flow_sequence_entry_mapping_end(), yaml_parser_parse_flow_sequence_entry_mapping_key(), yaml_parser_parse_flow_sequence_entry_mapping_value(), yaml_parser_parse_indentless_sequence_entry(), yaml_parser_parse_node(), and yaml_parser_parse_stream_start().
Referenced by yaml_parser_parse().