| | 793 | * The states of the parser. |
|---|
| | 794 | */ |
|---|
| | 795 | typedef enum { |
|---|
| | 796 | YAML_PARSE_END_STATE, |
|---|
| | 797 | YAML_PARSE_STREAM_START_STATE, |
|---|
| | 798 | YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE, |
|---|
| | 799 | YAML_PARSE_DOCUMENT_START_STATE, |
|---|
| | 800 | YAML_PARSE_DOCUMENT_CONTENT_STATE, |
|---|
| | 801 | YAML_PARSE_DOCUMENT_END_STATE, |
|---|
| | 802 | YAML_PARSE_BLOCK_NODE_STATE, |
|---|
| | 803 | YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE, |
|---|
| | 804 | YAML_PARSE_FLOW_NODE_STATE, |
|---|
| | 805 | YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE, |
|---|
| | 806 | YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE, |
|---|
| | 807 | YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE, |
|---|
| | 808 | YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE, |
|---|
| | 809 | YAML_PARSE_BLOCK_MAPPING_KEY_STATE, |
|---|
| | 810 | YAML_PARSE_BLOCK_MAPPING_VALUE_STATE, |
|---|
| | 811 | YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE, |
|---|
| | 812 | YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE, |
|---|
| | 813 | YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE, |
|---|
| | 814 | YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE, |
|---|
| | 815 | YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE, |
|---|
| | 816 | YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE, |
|---|
| | 817 | YAML_PARSE_FLOW_MAPPING_KEY_STATE, |
|---|
| | 818 | YAML_PARSE_FLOW_MAPPING_VALUE_STATE, |
|---|
| | 819 | YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE |
|---|
| | 820 | } yaml_parser_state_t; |
|---|
| | 821 | |
|---|
| | 822 | /** |
|---|
| | 972 | /** |
|---|
| | 973 | * @name Parser stuff |
|---|
| | 974 | * @{ |
|---|
| | 975 | */ |
|---|
| | 976 | |
|---|
| | 977 | /** The parser states stack. */ |
|---|
| | 978 | yaml_parser_state_t *states; |
|---|
| | 979 | |
|---|
| | 980 | /** The size of the parser states stack. */ |
|---|
| | 981 | size_t states_size; |
|---|
| | 982 | |
|---|
| | 983 | /** The number of items in the parser states stack. */ |
|---|
| | 984 | size_t states_length; |
|---|
| | 985 | |
|---|
| | 986 | /** The current parser state. */ |
|---|
| | 987 | yaml_parser_state_t state; |
|---|
| | 988 | |
|---|
| | 989 | /** The stack of marks. */ |
|---|
| | 990 | yaml_mark_t *marks; |
|---|
| | 991 | |
|---|
| | 992 | /** The size of the marks stack. */ |
|---|
| | 993 | size_t marks_size; |
|---|
| | 994 | |
|---|
| | 995 | /** The number of items in the marks stack. */ |
|---|
| | 996 | size_t marks_length; |
|---|
| | 997 | |
|---|
| | 998 | /** The current event. */ |
|---|
| | 999 | yaml_event_t *current_event; |
|---|
| | 1000 | |
|---|
| | 1001 | /** The YAML version directive. */ |
|---|
| | 1002 | yaml_version_directive_t *version_directive; |
|---|
| | 1003 | |
|---|
| | 1004 | /** The list of TAG directives. */ |
|---|
| | 1005 | yaml_tag_directive_t **tag_directives; |
|---|
| | 1006 | |
|---|
| | 1007 | /** The size of the TAG directives list. */ |
|---|
| | 1008 | size_t tag_directives_size; |
|---|
| | 1009 | |
|---|
| | 1010 | /** The number of items in the TAG directives list. */ |
|---|
| | 1011 | size_t tag_directives_length; |
|---|
| | 1012 | |
|---|
| | 1013 | /** |
|---|
| | 1014 | * @} |
|---|
| | 1015 | */ |
|---|
| | 1016 | |
|---|
| | 1122 | /** |
|---|
| | 1123 | * Get the next event. |
|---|
| | 1124 | * |
|---|
| | 1125 | * The application is responsible for destroing the event object. |
|---|
| | 1126 | * |
|---|
| | 1127 | * @param[in] parser A parser object. |
|---|
| | 1128 | * |
|---|
| | 1129 | * @returns An event object, or @c NULL on error. |
|---|
| | 1130 | */ |
|---|
| | 1131 | |
|---|
| | 1132 | YAML_DECLARE(yaml_event_t *) |
|---|
| | 1133 | yaml_parser_get_event(yaml_parser_t *parser); |
|---|
| | 1134 | |
|---|
| | 1135 | /** |
|---|
| | 1136 | * Peek the next event. |
|---|
| | 1137 | * |
|---|
| | 1138 | * The event will be returned again on a subsequent call of |
|---|
| | 1139 | * @c yaml_parser_get_event or @c yaml_parser_peek_event. The application |
|---|
| | 1140 | * should not destroy the event object. |
|---|
| | 1141 | * |
|---|
| | 1142 | * @param[in] parser A parser object. |
|---|
| | 1143 | * |
|---|
| | 1144 | * @returns An event object, or @c NULL on error. |
|---|
| | 1145 | */ |
|---|
| | 1146 | |
|---|
| | 1147 | YAML_DECLARE(yaml_event_t *) |
|---|
| | 1148 | yaml_parser_peek_event(yaml_parser_t *parser); |
|---|
| | 1149 | |
|---|