Changeset 184


Ignore:
Timestamp:
06/06/06 15:43:34 (9 years ago)
Author:
xi
Message:

Add scanner definitions.

Add a basic description of all tokens produced by the scanner.

Location:
libyaml/trunk
Files:
1 added
2 edited

Legend:

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

    r183 r184  
    2121 
    2222/** 
    23  * @defgroup Export Definitions 
     23 * @defgroup export Export Definitions 
    2424 * @{ 
    2525 */ 
     
    115115 
    116116/** 
    117  * @defgroup Node Styles 
     117 * @defgroup styles Node Styles 
    118118 * @{ 
    119119 */ 
     
    152152 
    153153/** 
    154  * @defgroup Tokens 
     154 * @defgroup tokens Tokens 
    155155 * @{ 
    156156 */ 
     
    534534 
    535535/** 
     536 * This structure holds information about a potential simple key. 
     537 */ 
     538 
     539typedef struct { 
     540    /** Is a simple key possible? */ 
     541    int possible; 
     542 
     543    /** Is a simple key required? */ 
     544    int required; 
     545 
     546    /** The number of the token. */ 
     547    size_t token_number; 
     548 
     549    /** The position index. */ 
     550    size_t index; 
     551 
     552    /** The position line. */ 
     553    size_t line; 
     554 
     555    /** The position column. */ 
     556    size_t column; 
     557 
     558    /** The position mark. */ 
     559    yaml_mark_t mark; 
     560} yaml_simple_key_t; 
     561 
     562/** 
    536563 * The parser structure. 
    537564 * 
     
    620647     */ 
    621648 
     649    /** 
     650     * @name Scanner stuff 
     651     * @{ 
     652     */ 
     653 
     654    /** Have we started to scan the input stream? */ 
     655    int stream_start_produced; 
     656 
     657    /** Have we reached the end of the input stream? */ 
     658    int stream_end_produced; 
     659 
     660    /** The number of unclosed '[' and '{' indicators. */ 
     661    int flow_level; 
     662 
     663    /** The tokens queue, which contains the current produced tokens. */ 
     664    yaml_token_t *tokens; 
     665 
     666    /** The size of the tokens queue. */ 
     667    size_t tokens_size; 
     668 
     669    /** The head of the tokens queue. */ 
     670    size_t tokens_head; 
     671 
     672    /** The tail of the tokens queue. */ 
     673    size_t tokens_tail; 
     674 
     675    /** The number of tokens fetched from the tokens queue. */ 
     676    size_t tokens_parsed; 
     677 
     678    /** The stack of indentation levels. */ 
     679    int *indents; 
     680 
     681    /** The size of the indents stack. */ 
     682    size_t indents_size; 
     683 
     684    /** The number of items in the indents stack. */ 
     685    size_t indents_length; 
     686 
     687    /** The current indentation level. */ 
     688    int indent; 
     689 
     690    /** May a simple key occur at the current position? */ 
     691    int simple_key_allowed; 
     692 
     693    /** The stack of potential simple keys. */ 
     694    yaml_simple_key_t *simple_keys; 
     695 
     696    /** The size of the simple keys stack. */ 
     697    size_t simple_keys_size; 
     698 
     699    /** 
     700     * @} 
     701     */ 
     702 
    622703} yaml_parser_t; 
    623704 
     
    694775YAML_DECLARE(void) 
    695776yaml_parser_set_encoding(yaml_parser_t *parser, yaml_encoding_t encoding); 
     777 
     778/** 
     779 * Get the next token. 
     780 * 
     781 * The token is removed from the internal token queue and the application is 
     782 * responsible for destroing the token object. 
     783 * 
     784 * @param[in]   parser      A parser object. 
     785 * 
     786 * @returns A token object, or @c NULL on error. 
     787 */ 
     788 
     789YAML_DECLARE(yaml_token_t *) 
     790yaml_parser_get_token(yaml_parser_t *parser); 
     791 
     792/** 
     793 * Peek the next token. 
     794 * 
     795 * The token is not removed from the internal token queue and will be returned 
     796 * again on a subsequent call of @c yaml_parser_get_token or 
     797 * @c yaml_parser_peek_token. The application should not destroy the token 
     798 * object. 
     799 * 
     800 * @param[in]   parser      A parser object. 
     801 * 
     802 * @returns A token object, or @c NULL on error. 
     803 */ 
     804 
     805YAML_DECLARE(yaml_token_t *) 
     806yaml_parser_peek_token(yaml_parser_t *parser); 
    696807 
    697808/** @} */ 
  • libyaml/trunk/src/Makefile.am

    r179 r184  
    11AM_CPPFLAGS = -I$(top_srcdir)/include 
    22lib_LTLIBRARIES = libyaml.la 
    3 libyaml_la_SOURCES = version.c api.c reader.c 
     3libyaml_la_SOURCES = version.c api.c reader.c scanner.c 
    44libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) 
Note: See TracChangeset for help on using the changeset viewer.