| | 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 | |
|---|
| | 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 | |
|---|
| | 789 | YAML_DECLARE(yaml_token_t *) |
|---|
| | 790 | yaml_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 | |
|---|
| | 805 | YAML_DECLARE(yaml_token_t *) |
|---|
| | 806 | yaml_parser_peek_token(yaml_parser_t *parser); |
|---|