Ignore:
Timestamp:
07/04/06 15:39:56 (8 years ago)
Author:
xi
Message:

Start working on the parser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libyaml/trunk/include/yaml.h

    r200 r201  
    791791 
    792792/** 
     793 * The states of the parser. 
     794 */ 
     795typedef 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/** 
    793823 * The parser structure. 
    794824 * 
     
    940970     */ 
    941971 
     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 
    9421017} yaml_parser_t; 
    9431018 
     
    10451120yaml_parser_peek_token(yaml_parser_t *parser); 
    10461121 
     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 
     1132YAML_DECLARE(yaml_event_t *) 
     1133yaml_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 
     1147YAML_DECLARE(yaml_event_t *) 
     1148yaml_parser_peek_event(yaml_parser_t *parser); 
     1149 
    10471150/** @} */ 
    10481151 
Note: See TracChangeset for help on using the changeset viewer.