summaryrefslogtreecommitdiff
path: root/ext/syck
diff options
context:
space:
mode:
authorwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-09 21:25:50 +0000
committerwhy <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-09 21:25:50 +0000
commit55f4dc4c9a5345c28d0da750d1ee00fbb0870885 (patch)
tree904359659b75882365348decb2ca0789ca1ac803 /ext/syck
parent605adb86e2c2889c13e07cadf328f8032eebae7c (diff)
Initial checkin of YAML substances.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck')
-rw-r--r--ext/syck/extconf.rb5
-rw-r--r--ext/syck/gram.c1494
-rw-r--r--ext/syck/gram.h79
-rw-r--r--ext/syck/handler.c231
-rw-r--r--ext/syck/implicit.c860
-rw-r--r--ext/syck/node.c306
-rw-r--r--ext/syck/rubyext.c569
-rw-r--r--ext/syck/syck.c460
-rw-r--r--ext/syck/syck.h257
-rw-r--r--ext/syck/token.c1638
10 files changed, 5899 insertions, 0 deletions
diff --git a/ext/syck/extconf.rb b/ext/syck/extconf.rb
new file mode 100644
index 0000000..6c10448
--- /dev/null
+++ b/ext/syck/extconf.rb
@@ -0,0 +1,5 @@
+require 'mkmf'
+
+have_header( "st.h" )
+create_makefile( "syck" )
+
diff --git a/ext/syck/gram.c b/ext/syck/gram.c
new file mode 100644
index 0000000..5ea28ce
--- /dev/null
+++ b/ext/syck/gram.c
@@ -0,0 +1,1494 @@
+/* A Bison parser, made from gram.y, by GNU bison 1.75. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Written by Richard Stallman by simplifying the original so called
+ ``semantic'' parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Pure parsers. */
+#define YYPURE 1
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ ANCHOR = 258,
+ ALIAS = 259,
+ TRANSFER = 260,
+ ITRANSFER = 261,
+ WORD = 262,
+ PLAIN = 263,
+ BLOCK = 264,
+ DOCSEP = 265,
+ IOPEN = 266,
+ INDENT = 267,
+ IEND = 268
+ };
+#endif
+#define ANCHOR 258
+#define ALIAS 259
+#define TRANSFER 260
+#define ITRANSFER 261
+#define WORD 262
+#define PLAIN 263
+#define BLOCK 264
+#define DOCSEP 265
+#define IOPEN 266
+#define INDENT 267
+#define IEND 268
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 14 "gram.y"
+
+
+#include "syck.h"
+
+#define YYPARSE_PARAM parser
+#define YYLEX_PARAM parser
+
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#ifndef YYSTYPE
+#line 23 "gram.y"
+typedef union {
+ SYMID nodeId;
+ SyckNode *nodeData;
+ char *name;
+} yystype;
+/* Line 193 of /usr/local/share/bison/yacc.c. */
+#line 114 "y.tab.c"
+# define YYSTYPE yystype
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+#ifndef YYLTYPE
+typedef struct yyltype
+{
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+} yyltype;
+# define YYLTYPE yyltype
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+/* Copy the second part of user declarations. */
+
+
+/* Line 213 of /usr/local/share/bison/yacc.c. */
+#line 135 "y.tab.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# else
+# ifndef YYSTACK_USE_ALLOCA
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC malloc
+# define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short yyss;
+ YYSTYPE yyvs;
+ };
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAX)
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+ typedef signed char yysigned_char;
+#else
+ typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 32
+#define YYLAST 132
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 23
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 21
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 46
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 73
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 268
+
+#define YYTRANSLATE(X) \
+ ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const unsigned char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 16, 21, 14, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 15, 2,
+ 2, 2, 2, 22, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 17, 2, 18, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 19, 2, 20, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const unsigned char yyprhs[] =
+{
+ 0, 0, 3, 5, 8, 9, 11, 13, 16, 18,
+ 22, 24, 25, 27, 30, 32, 34, 37, 40, 42,
+ 44, 47, 49, 51, 53, 55, 57, 61, 64, 66,
+ 70, 73, 77, 80, 82, 86, 90, 94, 96, 102,
+ 104, 108, 111, 115, 119, 122, 124
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+ 24, 0, -1, 31, -1, 10, 25, -1, -1, 30,
+ -1, 31, -1, 3, 25, -1, 4, -1, 27, 25,
+ 28, -1, 25, -1, -1, 11, -1, 27, 12, -1,
+ 13, -1, 12, -1, 5, 30, -1, 6, 30, -1,
+ 7, -1, 8, -1, 5, 31, -1, 9, -1, 32,
+ -1, 35, -1, 37, -1, 42, -1, 27, 34, 28,
+ -1, 14, 26, -1, 33, -1, 34, 29, 33, -1,
+ 34, 29, -1, 17, 36, 18, -1, 17, 18, -1,
+ 25, -1, 36, 21, 25, -1, 27, 40, 28, -1,
+ 30, 15, 26, -1, 38, -1, 22, 25, 29, 15,
+ 26, -1, 39, -1, 40, 29, 39, -1, 40, 29,
+ -1, 25, 15, 26, -1, 19, 43, 20, -1, 19,
+ 20, -1, 41, -1, 43, 21, 41, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const unsigned short yyrline[] =
+{
+ 0, 44, 44, 48, 52, 58, 59, 60, 69, 77,
+ 83, 84, 102, 103, 106, 109, 117, 122, 130, 143,
+ 150, 155, 156, 157, 158, 159, 165, 171, 177, 181,
+ 186, 195, 199, 205, 209, 219, 225, 240, 241, 249,
+ 250, 255, 264, 272, 276, 282, 283
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "ANCHOR", "ALIAS", "TRANSFER", "ITRANSFER",
+ "WORD", "PLAIN", "BLOCK", "DOCSEP", "IOPEN", "INDENT", "IEND", "'-'",
+ "':'", "'+'", "'['", "']'", "'{'", "'}'", "','", "'?'", "$accept",
+ "doc", "atom", "atom_or_empty", "indent_open", "indent_end",
+ "indent_sep", "word_rep", "struct_rep", "implicit_seq", "basic_seq",
+ "in_implicit_seq", "inline_seq", "in_inline_seq", "implicit_map",
+ "basic_mapping", "complex_mapping", "in_implicit_map", "basic_mapping2",
+ "inline_map", "in_inline_map", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const unsigned short yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 45, 58, 43, 91, 93, 123,
+ 125, 44, 63
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const unsigned char yyr1[] =
+{
+ 0, 23, 24, 24, 24, 25, 25, 25, 25, 25,
+ 26, 26, 27, 27, 28, 29, 30, 30, 30, 30,
+ 31, 31, 31, 31, 31, 31, 32, 33, 34, 34,
+ 34, 35, 35, 36, 36, 37, 38, 39, 39, 40,
+ 40, 40, 41, 42, 42, 43, 43
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const unsigned char yyr2[] =
+{
+ 0, 2, 1, 2, 0, 1, 1, 2, 1, 3,
+ 1, 0, 1, 2, 1, 1, 2, 2, 1, 1,
+ 2, 1, 1, 1, 1, 1, 3, 2, 1, 3,
+ 2, 3, 2, 1, 3, 3, 3, 1, 5, 1,
+ 3, 2, 3, 3, 2, 1, 3
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const unsigned char yydefact[] =
+{
+ 4, 0, 21, 0, 12, 0, 0, 0, 0, 2,
+ 22, 23, 24, 25, 20, 0, 8, 0, 0, 18,
+ 19, 3, 0, 5, 6, 32, 33, 0, 44, 0,
+ 45, 0, 1, 0, 13, 11, 0, 0, 28, 0,
+ 37, 39, 0, 7, 16, 17, 0, 5, 31, 0,
+ 11, 43, 0, 10, 27, 0, 11, 15, 14, 26,
+ 30, 35, 41, 9, 34, 42, 46, 0, 36, 29,
+ 40, 11, 38
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+ -1, 7, 53, 54, 22, 59, 60, 23, 24, 10,
+ 38, 39, 11, 27, 12, 40, 41, 42, 30, 13,
+ 31
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -49
+static const yysigned_char yypact[] =
+{
+ 7, 113, -49, 97, -49, 80, 52, 15, 68, -49,
+ -49, -49, -49, -49, -49, 97, -49, 104, 88, -49,
+ -49, -49, 24, -49, -49, -49, -49, 19, -49, 4,
+ -49, 28, -49, 88, -49, 97, 97, 6, -49, 32,
+ -49, -49, 32, -49, -49, -49, 26, 6, -49, 97,
+ 97, -49, 97, -49, -49, 30, 97, -49, -49, -49,
+ 39, -49, 59, -49, -49, -49, -49, 47, -49, -49,
+ -49, 97, -49
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const yysigned_char yypgoto[] =
+{
+ -49, -49, -2, -48, 5, -35, 37, -8, 51, -49,
+ 10, -49, -49, -49, -49, -49, 16, -49, 25, -49,
+ -49
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, parse error. */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+ 37, 21, 65, 26, 29, 8, 8, 61, 68, 44,
+ 45, 63, 1, 43, 47, 32, 2, 3, 4, 50,
+ 46, 56, 8, 72, 5, 44, 6, 15, 16, 17,
+ 18, 19, 20, 2, 55, 4, 34, 48, 35, 58,
+ 49, 5, 57, 6, 57, 58, 36, 64, 51, 52,
+ 29, 9, 14, 35, 37, 15, 16, 17, 18, 19,
+ 20, 2, 71, 4, 33, 18, 19, 20, 14, 5,
+ 69, 6, 28, 33, 18, 19, 20, 66, 70, 62,
+ 34, 36, 35, 15, 16, 17, 18, 19, 20, 2,
+ 36, 4, 67, 33, 18, 19, 20, 5, 25, 6,
+ 15, 16, 17, 18, 19, 20, 2, 0, 4, 17,
+ 18, 19, 20, 2, 5, 4, 6, 0, 1, 0,
+ 0, 5, 2, 6, 4, 0, 0, 0, 0, 0,
+ 5, 0, 6
+};
+
+static const yysigned_char yycheck[] =
+{
+ 8, 3, 50, 5, 6, 0, 1, 42, 56, 17,
+ 18, 46, 5, 15, 22, 0, 9, 10, 11, 15,
+ 22, 15, 17, 71, 17, 33, 19, 3, 4, 5,
+ 6, 7, 8, 9, 36, 11, 12, 18, 14, 13,
+ 21, 17, 12, 19, 12, 13, 22, 49, 20, 21,
+ 52, 0, 1, 14, 62, 3, 4, 5, 6, 7,
+ 8, 9, 15, 11, 5, 6, 7, 8, 17, 17,
+ 60, 19, 20, 5, 6, 7, 8, 52, 62, 42,
+ 12, 22, 14, 3, 4, 5, 6, 7, 8, 9,
+ 22, 11, 55, 5, 6, 7, 8, 17, 18, 19,
+ 3, 4, 5, 6, 7, 8, 9, -1, 11, 5,
+ 6, 7, 8, 9, 17, 11, 19, -1, 5, -1,
+ -1, 17, 9, 19, 11, -1, -1, -1, -1, -1,
+ 17, -1, 19
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const unsigned char yystos[] =
+{
+ 0, 5, 9, 10, 11, 17, 19, 24, 27, 31,
+ 32, 35, 37, 42, 31, 3, 4, 5, 6, 7,
+ 8, 25, 27, 30, 31, 18, 25, 36, 20, 25,
+ 41, 43, 0, 5, 12, 14, 22, 30, 33, 34,
+ 38, 39, 40, 25, 30, 30, 25, 30, 18, 21,
+ 15, 20, 21, 25, 26, 25, 15, 12, 13, 28,
+ 29, 28, 29, 28, 25, 26, 41, 29, 26, 33,
+ 39, 15, 26
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+
+#define YYFAIL goto yyerrlab
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror ("syntax error: cannot back up"); \
+ YYERROR; \
+ } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ Current.first_line = Rhs[1].first_line; \
+ Current.first_column = Rhs[1].first_column; \
+ Current.last_line = Rhs[N].last_line; \
+ Current.last_column = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, YYLEX_PARAM)
+#else
+# define YYLEX yylex (&yylval)
+#endif
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+# define YYDSYMPRINT(Args) \
+do { \
+ if (yydebug) \
+ yysymprint Args; \
+} while (0)
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+#endif /* !YYDEBUG */
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+#if YYDEBUG
+/*-----------------------------.
+| Print this symbol on YYOUT. |
+`-----------------------------*/
+
+static void
+#if defined (__STDC__) || defined (__cplusplus)
+yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
+#else
+yysymprint (yyout, yytype, yyvalue)
+ FILE* yyout;
+ int yytype;
+ YYSTYPE yyvalue;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvalue;
+
+ if (yytype < YYNTOKENS)
+ {
+ YYFPRINTF (yyout, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+ YYPRINT (yyout, yytoknum[yytype], yyvalue);
+# endif
+ }
+ else
+ YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
+
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ YYFPRINTF (yyout, ")");
+}
+#endif /* YYDEBUG. */
+
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+static void
+#if defined (__STDC__) || defined (__cplusplus)
+yydestruct (int yytype, YYSTYPE yyvalue)
+#else
+yydestruct (yytype, yyvalue)
+ int yytype;
+ YYSTYPE yyvalue;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvalue;
+
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL
+# else
+# define YYPARSE_PARAM_ARG YYPARSE_PARAM
+# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+# endif
+#else /* !YYPARSE_PARAM */
+# define YYPARSE_PARAM_ARG
+# define YYPARSE_PARAM_DECL
+#endif /* !YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+# ifdef YYPARSE_PARAM
+int yyparse (void *);
+# else
+int yyparse (void);
+# endif
+#endif
+
+
+
+
+int
+yyparse (YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ /* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+
+/* Number of parse errors so far. */
+int yynerrs;
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yychar1 = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short yyssa[YYINITDEPTH];
+ short *yyss = yyssa;
+ register short *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK (yyvsp--, yyssp--)
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with. */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more. */
+
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE (yychar);
+
+ /* We have to keep this `#if YYDEBUG', since we use variables
+ which are defined only if `YYDEBUG' is set. */
+ YYDPRINTF ((stderr, "Next token is "));
+ YYDSYMPRINT ((stderr, yychar1, yylval));
+ YYDPRINTF ((stderr, "\n"));
+ }
+
+ /* If the proper action on seeing token YYCHAR1 is to reduce or to
+ detect an error, take that action. */
+ yyn += yychar1;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
+ yychar, yytname[yychar1]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables which
+ are defined only if `YYDEBUG' is set. */
+ if (yydebug)
+ {
+ int yyi;
+
+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
+ yyn - 1, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+ switch (yyn)
+ {
+ case 2:
+#line 45 "gram.y"
+ {
+ ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
+ }
+ break;
+
+ case 3:
+#line 49 "gram.y"
+ {
+ ((SyckParser *)parser)->root = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
+ }
+ break;
+
+ case 4:
+#line 53 "gram.y"
+ {
+ ((SyckParser *)parser)->eof = 1;
+ }
+ break;
+
+ case 7:
+#line 61 "gram.y"
+ {
+ /*
+ * _Anchors_: The language binding must keep a separate symbol table
+ * for anchors. The actual ID in the symbol table is returned to the
+ * higher nodes, though.
+ */
+ yyval.nodeData = syck_hdlr_add_anchor( (SyckParser *)parser, yyvsp[-1].name, yyvsp[0].nodeData );
+ }
+ break;
+
+ case 8:
+#line 70 "gram.y"
+ {
+ /*
+ * _Aliases_: The anchor symbol table is scanned for the anchor name.
+ * The anchor's ID in the language's symbol table is returned.
+ */
+ yyval.nodeData = syck_hdlr_add_alias( (SyckParser *)parser, yyvsp[0].name );
+ }
+ break;
+
+ case 9:
+#line 78 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 11:
+#line 85 "gram.y"
+ {
+ SyckNode *n = syck_new_str( "" );
+ if ( ((SyckParser *)parser)->taguri_expansion == 1 )
+ {
+ syck_taguri( n, "yaml.org,2002", "null", 4 );
+ }
+ else
+ {
+ n->type_id = syck_strndup( "null", 4 );
+ }
+ yyval.nodeData = n;
+ }
+ break;
+
+ case 16:
+#line 118 "gram.y"
+ {
+ syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
+ yyval.nodeData = yyvsp[0].nodeData;
+ }
+ break;
+
+ case 17:
+#line 123 "gram.y"
+ {
+ if ( ((SyckParser *)parser)->implicit_typing == 1 )
+ {
+ try_tag_implicit( yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
+ }
+ yyval.nodeData = yyvsp[0].nodeData;
+ }
+ break;
+
+ case 18:
+#line 131 "gram.y"
+ {
+ SyckNode *n = yyvsp[0].nodeData;
+ if ( ((SyckParser *)parser)->taguri_expansion == 1 )
+ {
+ syck_taguri( n, "yaml.org,2002", "str", 3 );
+ }
+ else
+ {
+ n->type_id = syck_strndup( "str", 3 );
+ }
+ yyval.nodeData = n;
+ }
+ break;
+
+ case 20:
+#line 151 "gram.y"
+ {
+ syck_add_transfer( yyvsp[-1].name, yyvsp[0].nodeData, ((SyckParser *)parser)->taguri_expansion );
+ yyval.nodeData = yyvsp[0].nodeData;
+ }
+ break;
+
+ case 26:
+#line 166 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 27:
+#line 172 "gram.y"
+ {
+ yyval.nodeId = syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData );
+ }
+ break;
+
+ case 28:
+#line 178 "gram.y"
+ {
+ yyval.nodeData = syck_new_seq( yyvsp[0].nodeId );
+ }
+ break;
+
+ case 29:
+#line 182 "gram.y"
+ {
+ syck_seq_add( yyvsp[-2].nodeData, yyvsp[0].nodeId );
+ yyval.nodeData = yyvsp[-2].nodeData;
+ }
+ break;
+
+ case 30:
+#line 187 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 31:
+#line 196 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 32:
+#line 200 "gram.y"
+ {
+ yyval.nodeData = syck_alloc_seq();
+ }
+ break;
+
+ case 33:
+#line 206 "gram.y"
+ {
+ yyval.nodeData = syck_new_seq( syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
+ }
+ break;
+
+ case 34:
+#line 210 "gram.y"
+ {
+ syck_seq_add( yyvsp[-2].nodeData, syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
+ yyval.nodeData = yyvsp[-2].nodeData;
+ }
+ break;
+
+ case 35:
+#line 220 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 36:
+#line 226 "gram.y"
+ {
+ yyval.nodeData = syck_new_map(
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-2].nodeData ),
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
+ }
+ break;
+
+ case 38:
+#line 242 "gram.y"
+ {
+ yyval.nodeData = syck_new_map(
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-3].nodeData ),
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
+ }
+ break;
+
+ case 40:
+#line 251 "gram.y"
+ {
+ syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
+ yyval.nodeData = yyvsp[-2].nodeData;
+ }
+ break;
+
+ case 41:
+#line 256 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 42:
+#line 265 "gram.y"
+ {
+ yyval.nodeData = syck_new_map(
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-2].nodeData ),
+ syck_hdlr_add_node( (SyckParser *)parser, yyvsp[0].nodeData ) );
+ }
+ break;
+
+ case 43:
+#line 273 "gram.y"
+ {
+ yyval.nodeData = yyvsp[-1].nodeData;
+ }
+ break;
+
+ case 44:
+#line 277 "gram.y"
+ {
+ yyval.nodeData = syck_alloc_map();
+ }
+ break;
+
+ case 46:
+#line 284 "gram.y"
+ {
+ syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
+ yyval.nodeData = yyvsp[-2].nodeData;
+ }
+ break;
+
+
+ }
+
+/* Line 1016 of /usr/local/share/bison/yacc.c. */
+#line 1273 "y.tab.c"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ int yytype = YYTRANSLATE (yychar);
+ char *yymsg;
+ int yyx, yycount;
+
+ yycount = 0;
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+ yysize += yystrlen ("parse error, unexpected ") + 1;
+ yysize += yystrlen (yytname[yytype]);
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[yytype]);
+
+ if (yycount < 5)
+ {
+ yycount = 0;
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *));
+ yyx++)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ const char *yyq = ! yycount ? ", expecting " : " or ";
+ yyp = yystpcpy (yyp, yyq);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yycount++;
+ }
+ }
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exhausted");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror ("parse error");
+ }
+ goto yyerrlab1;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action. |
+`----------------------------------------------------*/
+yyerrlab1:
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ {
+ /* Pop the error token. */
+ YYPOPSTACK;
+ /* Pop the rest of the stack. */
+ while (yyssp > yyss)
+ {
+ YYDPRINTF ((stderr, "Error: popping "));
+ YYDSYMPRINT ((stderr,
+ yystos[*yyssp],
+ *yyvsp));
+ YYDPRINTF ((stderr, "\n"));
+ yydestruct (yystos[*yyssp], *yyvsp);
+ YYPOPSTACK;
+ }
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
+ yychar, yytname[yychar1]));
+ yydestruct (yychar1, yylval);
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+ YYDPRINTF ((stderr, "Error: popping "));
+ YYDSYMPRINT ((stderr,
+ yystos[*yyssp], *yyvsp));
+ YYDPRINTF ((stderr, "\n"));
+
+ yydestruct (yystos[yystate], *yyvsp);
+ yyvsp--;
+ yystate = *--yyssp;
+
+
+#if YYDEBUG
+ if (yydebug)
+ {
+ short *yyssp1 = yyss - 1;
+ YYFPRINTF (stderr, "Error: state stack now");
+ while (yyssp1 != yyssp)
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here. |
+`----------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+
+
+#line 290 "gram.y"
+
+
+
diff --git a/ext/syck/gram.h b/ext/syck/gram.h
new file mode 100644
index 0000000..46d6c82
--- /dev/null
+++ b/ext/syck/gram.h
@@ -0,0 +1,79 @@
+/* A Bison parser, made from gram.y, by GNU bison 1.75. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+#ifndef BISON_Y_TAB_H
+# define BISON_Y_TAB_H
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ ANCHOR = 258,
+ ALIAS = 259,
+ TRANSFER = 260,
+ ITRANSFER = 261,
+ WORD = 262,
+ PLAIN = 263,
+ BLOCK = 264,
+ DOCSEP = 265,
+ IOPEN = 266,
+ INDENT = 267,
+ IEND = 268
+ };
+#endif
+#define ANCHOR 258
+#define ALIAS 259
+#define TRANSFER 260
+#define ITRANSFER 261
+#define WORD 262
+#define PLAIN 263
+#define BLOCK 264
+#define DOCSEP 265
+#define IOPEN 266
+#define INDENT 267
+#define IEND 268
+
+
+
+
+#ifndef YYSTYPE
+#line 23 "gram.y"
+typedef union {
+ SYMID nodeId;
+ SyckNode *nodeData;
+ char *name;
+} yystype;
+/* Line 1281 of /usr/local/share/bison/yacc.c. */
+#line 72 "y.tab.h"
+# define YYSTYPE yystype
+#endif
+
+
+
+
+#endif /* not BISON_Y_TAB_H */
+
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
new file mode 100644
index 0000000..50ba3e4
--- /dev/null
+++ b/ext/syck/handler.c
@@ -0,0 +1,231 @@
+//
+// handler.h
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#include "syck.h"
+
+SYMID
+syck_hdlr_add_node( SyckParser *p, SyckNode *n )
+{
+ SYMID id;
+ if ( ! n->id )
+ {
+ n->id = (p->handler)( p, n );
+ }
+ id = n->id;
+
+ if ( n->anchor == NULL )
+ {
+ syck_free_node( n );
+ }
+ return id;
+}
+
+SyckNode *
+syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
+{
+ n->anchor = a;
+ st_insert( p->anchors, (st_data_t)a, (st_data_t)n );
+ return n;
+}
+
+SyckNode *
+syck_hdlr_add_alias( SyckParser *p, char *a )
+{
+ SyckNode *n;
+
+ if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) )
+ {
+ return n;
+ }
+
+ return syck_new_str( "..." );
+}
+
+void
+syck_add_transfer( char *uri, SyckNode *n, int taguri )
+{
+ char *comma = NULL;
+ char *slash = uri;
+ char *domain = NULL;
+
+ if ( taguri == 0 )
+ {
+ n->type_id = uri;
+ return;
+ }
+
+ if ( uri[0] == '!' )
+ {
+ syck_xprivate( n, uri + 1, strlen( uri ) - 1 );
+ S_FREE( uri );
+ return;
+ }
+
+ while ( *(++slash) != '\0' )
+ {
+ if ( *slash == '/' )
+ break;
+
+ if ( *slash == ',' )
+ comma = slash;
+ }
+
+ if ( *slash == '\0' )
+ {
+ syck_taguri( n, "yaml.org,2002", uri, strlen( uri ) );
+ }
+ else if ( comma == NULL )
+ {
+ domain = S_ALLOC_N( char, ( slash - uri ) + 15 );
+ domain[0] = '\0';
+ strncat( domain, uri, slash - uri );
+ strcat( domain, ".yaml.org,2002" );
+ syck_taguri( n, domain, slash + 1, strlen( uri ) - ( slash - uri + 1 ) );
+ S_FREE( domain );
+ }
+ else
+ {
+ domain = S_ALLOC_N( char, slash - uri );
+ domain[0] = '\0';
+ strncat( domain, uri, slash - uri );
+ syck_taguri( n, domain, slash + 1, strlen( uri ) - ( slash - uri + 1 ) );
+ S_FREE( domain );
+ }
+ S_FREE( uri );
+}
+
+void
+syck_xprivate( SyckNode *n, char *type_id, int type_len )
+{
+ if ( n->type_id != NULL )
+ S_FREE( n->type_id );
+
+ n->type_id = S_ALLOC_N( char, type_len + 14 );
+ n->type_id[0] = '\0';
+ strcat( n->type_id, "x-private:" );
+ strncat( n->type_id, type_id, type_len );
+}
+
+void
+syck_taguri( SyckNode *n, char *domain, char *type_id, int type_len )
+{
+ if ( n->type_id != NULL )
+ S_FREE( n->type_id );
+
+ n->type_id = S_ALLOC_N( char, strlen( domain ) + type_len + 14 );
+ n->type_id[0] = '\0';
+ strcat( n->type_id, "taguri:" );
+ strcat( n->type_id, domain );
+ strcat( n->type_id, ":" );
+ strncat( n->type_id, type_id, type_len );
+}
+
+int
+syck_try_implicit( SyckNode *n )
+{
+ return 1;
+}
+
+void
+syck_fold_format( struct SyckStr *n, int blockType, int indt_len, int nlDisp )
+{
+ char *spc;
+ char *eol = NULL;
+ char *first_nl = NULL;
+ char *fc = n->ptr;
+ int keep_nl = 0;
+ int nl_count = 0;
+
+ //
+ // Scan the sucker for newlines and strip indent
+ //
+ while ( fc < n->ptr + n->len )
+ {
+ if ( *fc == '\n' )
+ {
+ spc = fc;
+ while ( *(++spc) == ' ' )
+ {
+ if ( blockType != BLOCK_PLAIN && spc - fc > indt_len )
+ break;
+ }
+
+ if ( blockType != BLOCK_LIT && *spc != ' ' )
+ {
+ if ( eol != NULL ) fc = eol;
+ if ( first_nl == NULL && keep_nl == 1 )
+ {
+ first_nl = fc;
+ *first_nl = ' ';
+ }
+ if ( nl_count == 1 )
+ {
+ *first_nl = '\n';
+ keep_nl = 0;
+ }
+ }
+
+ fc += keep_nl;
+ if ( fc != spc && ( n->len - ( spc - n->ptr ) ) > 0 )
+ {
+ S_MEMMOVE( fc, spc, char, n->len - ( spc - n->ptr ) );
+ }
+
+ n->len -= spc - fc;
+ keep_nl = 1;
+ eol = NULL;
+ nl_count++;
+ }
+ else
+ {
+ //
+ // eol tracks the last space on a line
+ //
+ if ( *fc == ' ' )
+ {
+ if ( eol == NULL ) eol = fc;
+ }
+ else
+ {
+ eol = NULL;
+ }
+ first_nl = NULL;
+ nl_count = 0;
+ fc++;
+ }
+ }
+
+ n->ptr[n->len] = '\n';
+
+ //
+ // Chomp or keep?
+ //
+ if ( nlDisp != NL_KEEP )
+ {
+ fc = n->ptr + n->len - 1;
+ while ( *fc == '\n' )
+ fc--;
+
+ if ( nlDisp != NL_CHOMP )
+ fc += 1;
+
+ n->len = fc - n->ptr + 1;
+ }
+ else
+ {
+ //
+ // Force last line break which I gave back
+ // to the tokenizer.
+ //
+ n->len++;
+ n->ptr[n->len] = '\n';
+ }
+ n->ptr[ n->len ] = '\0';
+}
+
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
new file mode 100644
index 0000000..4ba80e2
--- /dev/null
+++ b/ext/syck/implicit.c
@@ -0,0 +1,860 @@
+/* Generated by re2c 0.5 on Mon Apr 21 23:42:24 2003 */
+#line 1 "lib/implicit.re"
+//
+// implicit.re
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#include "syck.h"
+
+#define YYCTYPE char
+#define YYCURSOR cursor
+#define YYMARKER marker
+#define YYLIMIT limit
+#define YYFILL(n)
+
+#define TAG_IMPLICIT( tid ) \
+ if ( taguri == 1 ) \
+ { \
+ syck_taguri( n, "yaml.org,2002", tid, strlen( tid ) ); \
+ } else { \
+ n->type_id = syck_strndup( tid, strlen( tid ) ); \
+ } \
+ return;
+
+void
+try_tag_implicit( SyckNode *n, int taguri )
+{
+ char *cursor, *limit, *marker;
+ if ( n->kind != syck_str_kind )
+ return;
+
+ cursor = n->data.str->ptr;
+ limit = cursor + n->data.str->len;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 193, 0, 4, 0,
+ 215, 231, 231, 231, 231, 231, 231, 231,
+ 167, 167, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 128, 128, 128, 128, 128, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy0;
+yy1: ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 26) YYFILL(26);
+ yych = *YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= '/'){
+ if(yych <= '+'){
+ if(yych <= '\000') goto yy2;
+ if(yych <= '*') goto yy20;
+ goto yy15;
+ } else {
+ if(yych <= ',') goto yy20;
+ if(yych <= '-') goto yy16;
+ if(yych <= '.') goto yy19;
+ goto yy20;
+ }
+ } else {
+ if(yych <= 'F'){
+ if(yych <= '0') goto yy17;
+ if(yych <= '9') goto yy18;
+ if(yych <= 'E') goto yy20;
+ goto yy14;
+ } else {
+ if(yych <= 'M') goto yy20;
+ if(yych <= 'N') goto yy6;
+ if(yych <= 'O') goto yy12;
+ goto yy20;
+ }
+ }
+ } else {
+ if(yych <= 'n'){
+ if(yych <= 'Y'){
+ if(yych <= 'T') goto yy8;
+ if(yych <= 'X') goto yy20;
+ goto yy10;
+ } else {
+ if(yych == 'f') goto yy13;
+ if(yych <= 'm') goto yy20;
+ goto yy5;
+ }
+ } else {
+ if(yych <= 'x'){
+ if(yych <= 'o') goto yy11;
+ if(yych == 't') goto yy7;
+ goto yy20;
+ } else {
+ if(yych <= 'y') goto yy9;
+ if(yych == '~') goto yy3;
+ goto yy20;
+ }
+ }
+ }
+yy2: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy4;
+ }
+yy3: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy185;
+yy4:
+#line 99
+ { TAG_IMPLICIT( "str" ); }
+yy5: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'o') goto yy158;
+ if(yych == 'u') goto yy188;
+ goto yy4;
+yy6: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'U'){
+ if(yych == 'O') goto yy158;
+ if(yych <= 'T') goto yy4;
+ goto yy181;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy4;
+ goto yy158;
+ } else {
+ if(yych == 'u') goto yy182;
+ goto yy4;
+ }
+ }
+yy7: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'r') goto yy179;
+ goto yy4;
+yy8: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'R') goto yy175;
+ if(yych == 'r') goto yy176;
+ goto yy4;
+yy9: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'e') goto yy174;
+ goto yy4;
+yy10: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'E') goto yy172;
+ if(yych == 'e') goto yy173;
+ goto yy4;
+yy11: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'f') goto yy171;
+ if(yych == 'n') goto yy168;
+ goto yy4;
+yy12: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych == 'F') goto yy166;
+ if(yych <= 'M') goto yy4;
+ goto yy168;
+ } else {
+ if(yych <= 'f'){
+ if(yych <= 'e') goto yy4;
+ goto yy167;
+ } else {
+ if(yych == 'n') goto yy168;
+ goto yy4;
+ }
+ }
+yy13: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'a') goto yy163;
+ goto yy4;
+yy14: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'A') goto yy154;
+ if(yych == 'a') goto yy155;
+ goto yy4;
+yy15: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy153;
+ goto yy4;
+ } else {
+ if(yych <= '0') goto yy144;
+ if(yych <= '9') goto yy38;
+ goto yy4;
+ }
+yy16: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy143;
+ goto yy4;
+ } else {
+ if(yych <= '0') goto yy144;
+ if(yych <= '9') goto yy38;
+ goto yy4;
+ }
+yy17: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= '+'){
+ if(yych <= '\000') goto yy42;
+ goto yy4;
+ } else {
+ if(yych <= ',') goto yy128;
+ if(yych <= '-') goto yy4;
+ goto yy40;
+ }
+ } else {
+ if(yych <= '9'){
+ if(yych <= '/') goto yy4;
+ if(yych <= '7') goto yy126;
+ goto yy127;
+ } else {
+ if(yych == 'x') goto yy130;
+ goto yy4;
+ }
+ }
+yy18: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\000') goto yy42;
+ if(yych == ',') goto yy38;
+ goto yy4;
+ } else {
+ if(yych <= '.') goto yy40;
+ if(yych <= '/') goto yy4;
+ if(yych <= '9') goto yy37;
+ goto yy4;
+ }
+yy19: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'N'){
+ if(yych == 'I') goto yy24;
+ if(yych <= 'M') goto yy4;
+ goto yy22;
+ } else {
+ if(yych <= 'i'){
+ if(yych <= 'h') goto yy4;
+ goto yy23;
+ } else {
+ if(yych == 'n') goto yy21;
+ goto yy4;
+ }
+ }
+yy20: yych = *++YYCURSOR;
+ goto yy4;
+yy21: yych = *++YYCURSOR;
+ if(yych == 'a') goto yy36;
+ goto yy2;
+yy22: yych = *++YYCURSOR;
+ if(yych == 'A') goto yy31;
+ if(yych == 'a') goto yy32;
+ goto yy2;
+yy23: yych = *++YYCURSOR;
+ if(yych == 'n') goto yy30;
+ goto yy2;
+yy24: yych = *++YYCURSOR;
+ if(yych == 'N') goto yy25;
+ if(yych == 'n') goto yy26;
+ goto yy2;
+yy25: yych = *++YYCURSOR;
+ if(yych == 'F') goto yy27;
+ goto yy2;
+yy26: yych = *++YYCURSOR;
+ if(yych != 'f') goto yy2;
+yy27: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy28: yych = *++YYCURSOR;
+yy29:
+#line 85
+ { TAG_IMPLICIT( "float#inf" ); }
+yy30: yych = *++YYCURSOR;
+ if(yych == 'f') goto yy27;
+ goto yy2;
+yy31: yych = *++YYCURSOR;
+ if(yych == 'N') goto yy33;
+ goto yy2;
+yy32: yych = *++YYCURSOR;
+ if(yych != 'N') goto yy2;
+yy33: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy34: yych = *++YYCURSOR;
+yy35:
+#line 89
+ { TAG_IMPLICIT( "float#nan" ); }
+yy36: yych = *++YYCURSOR;
+ if(yych == 'n') goto yy33;
+ goto yy2;
+yy37: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy39;
+ if(yych <= '9') goto yy56;
+ goto yy39;
+yy38: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy39: if(yybm[0+yych] & 1) goto yy38;
+ if(yych <= '\000') goto yy42;
+ if(yych != '.') goto yy2;
+yy40: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy41: if(yybm[0+yych] & 2) goto yy40;
+ if(yych <= '.'){
+ if(yych <= '+'){
+ if(yych <= '\000') goto yy46;
+ goto yy2;
+ } else {
+ if(yych <= ',') goto yy44;
+ if(yych <= '-') goto yy2;
+ goto yy48;
+ }
+ } else {
+ if(yych <= 'E'){
+ if(yych <= 'D') goto yy2;
+ goto yy50;
+ } else {
+ if(yych == 'e') goto yy50;
+ goto yy2;
+ }
+ }
+yy42: yych = *++YYCURSOR;
+yy43:
+#line 79
+ { TAG_IMPLICIT( "int" ); }
+yy44: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy45: if(yych <= ','){
+ if(yych <= '\000') goto yy46;
+ if(yych <= '+') goto yy2;
+ goto yy44;
+ } else {
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy44;
+ goto yy2;
+ }
+yy46: yych = *++YYCURSOR;
+yy47:
+#line 81
+ { TAG_IMPLICIT( "float#fix" ); }
+yy48: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy49: if(yybm[0+yych] & 4) goto yy48;
+ if(yych == 'E') goto yy50;
+ if(yych != 'e') goto yy2;
+yy50: yych = *++YYCURSOR;
+ if(yych == '+') goto yy51;
+ if(yych != '-') goto yy2;
+yy51: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy2;
+ goto yy53;
+yy52: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy53: if(yych <= '\000') goto yy54;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy52;
+ goto yy2;
+yy54: yych = *++YYCURSOR;
+yy55:
+#line 83
+ { TAG_IMPLICIT( "float#exp" ); }
+yy56: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy39;
+ if(yych >= ':') goto yy39;
+yy57: yych = *++YYCURSOR;
+ if(yych != '-') goto yy39;
+yy58: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy59: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy60: yych = *++YYCURSOR;
+ if(yych != '-') goto yy2;
+yy61: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy62: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy63: yych = *++YYCURSOR;
+ if(yych <= 'S'){
+ if(yych <= '\000') goto yy64;
+ if(yych <= '/') goto yy69;
+ if(yych <= '9') goto yy2;
+ goto yy69;
+ } else {
+ if(yych <= 'T') goto yy66;
+ if(yych == 't') goto yy67;
+ goto yy69;
+ }
+yy64: yych = *++YYCURSOR;
+yy65:
+#line 91
+ { TAG_IMPLICIT( "timestamp#ymd" ); }
+yy66: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy112;
+ goto yy2;
+yy67: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy92;
+ goto yy2;
+yy68: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy69: if(yybm[0+yych] & 8) goto yy68;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy70: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy71: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy72: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy73: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy74: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy75: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy76: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy77: yych = *++YYCURSOR;
+ if(yych <= '\037'){
+ if(yych == '\t') goto yy80;
+ goto yy2;
+ } else {
+ if(yych <= ' ') goto yy80;
+ if(yych != '.') goto yy2;
+ }
+yy78: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy79: if(yybm[0+yych] & 16) goto yy78;
+ if(yych <= '0') goto yy2;
+ if(yych <= '9') goto yy90;
+ goto yy2;
+yy80: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy81: if(yych <= '*'){
+ if(yych <= '\t'){
+ if(yych <= '\b') goto yy2;
+ goto yy80;
+ } else {
+ if(yych == ' ') goto yy80;
+ goto yy2;
+ }
+ } else {
+ if(yych <= '-'){
+ if(yych == ',') goto yy2;
+ goto yy83;
+ } else {
+ if(yych != 'Z') goto yy2;
+ }
+ }
+yy82: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy87;
+ goto yy2;
+yy83: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy84: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy85: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy87;
+ if(yych != ':') goto yy2;
+yy86: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy89;
+ goto yy2;
+yy87: yych = *++YYCURSOR;
+yy88:
+#line 95
+ { TAG_IMPLICIT( "timestamp#spaced" ); }
+yy89: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy82;
+ goto yy2;
+yy90: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy91: if(yybm[0+yych] & 16) goto yy78;
+ if(yych <= '\037'){
+ if(yych == '\t') goto yy80;
+ goto yy2;
+ } else {
+ if(yych <= ' ') goto yy80;
+ if(yych <= '0') goto yy2;
+ if(yych <= '9') goto yy90;
+ goto yy2;
+ }
+yy92: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy93: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy94: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy95: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy96: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy97: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy98: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy99: yych = *++YYCURSOR;
+ if(yych <= '-'){
+ if(yych == '+') goto yy103;
+ if(yych <= ',') goto yy2;
+ goto yy103;
+ } else {
+ if(yych <= '.') goto yy100;
+ if(yych == 'Z') goto yy102;
+ goto yy2;
+ }
+yy100: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy101: if(yych <= '/') goto yy2;
+ if(yych <= '0') goto yy100;
+ if(yych <= '9') goto yy110;
+ goto yy2;
+yy102: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy107;
+ goto yy2;
+yy103: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy104: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy105: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy107;
+ if(yych != ':') goto yy2;
+yy106: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy109;
+ goto yy2;
+yy107: yych = *++YYCURSOR;
+yy108:
+#line 93
+ { TAG_IMPLICIT( "timestamp#iso8601" ); }
+yy109: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy102;
+ goto yy2;
+yy110: ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
+ yych = *YYCURSOR;
+yy111: if(yych <= '/'){
+ if(yych <= '+'){
+ if(yych <= '*') goto yy2;
+ goto yy103;
+ } else {
+ if(yych == '-') goto yy103;
+ goto yy2;
+ }
+ } else {
+ if(yych <= '9'){
+ if(yych <= '0') goto yy100;
+ goto yy110;
+ } else {
+ if(yych == 'Z') goto yy102;
+ goto yy2;
+ }
+ }
+yy112: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy113: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy114: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy115: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy116: yych = *++YYCURSOR;
+ if(yych != ':') goto yy2;
+yy117: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy118: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy2;
+ if(yych >= ':') goto yy2;
+yy119: yych = *++YYCURSOR;
+ if(yych <= '-'){
+ if(yych == '+') goto yy103;
+ if(yych <= ',') goto yy2;
+ goto yy103;
+ } else {
+ if(yych <= '.') goto yy120;
+ if(yych == 'Z') goto yy122;
+ goto yy2;
+ }
+yy120: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy121: if(yych <= '/') goto yy2;
+ if(yych <= '0') goto yy120;
+ if(yych <= '9') goto yy124;
+ goto yy2;
+yy122: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy123: yych = *++YYCURSOR;
+ goto yy108;
+yy124: ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
+ yych = *YYCURSOR;
+yy125: if(yych <= '/'){
+ if(yych <= '+'){
+ if(yych <= '*') goto yy2;
+ goto yy103;
+ } else {
+ if(yych == '-') goto yy103;
+ goto yy2;
+ }
+ } else {
+ if(yych <= '9'){
+ if(yych <= '0') goto yy120;
+ goto yy124;
+ } else {
+ if(yych == 'Z') goto yy122;
+ goto yy2;
+ }
+ }
+yy126: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy129;
+ if(yych <= '7') goto yy141;
+ if(yych <= '9') goto yy139;
+ goto yy129;
+yy127: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy138;
+ if(yych <= '9') goto yy139;
+ goto yy138;
+yy128: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy129: if(yybm[0+yych] & 64) goto yy128;
+ if(yych <= '.'){
+ if(yych <= '\000') goto yy135;
+ if(yych <= '-') goto yy2;
+ goto yy40;
+ } else {
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy137;
+ goto yy2;
+ }
+yy130: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy2;
+ goto yy132;
+yy131: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy132: if(yybm[0+yych] & 128) goto yy131;
+ if(yych >= '\001') goto yy2;
+yy133: yych = *++YYCURSOR;
+yy134:
+#line 75
+ { TAG_IMPLICIT( "int#hex" ); }
+yy135: yych = *++YYCURSOR;
+yy136:
+#line 77
+ { TAG_IMPLICIT( "int#oct" ); }
+yy137: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy138: if(yych <= '-'){
+ if(yych == ',') goto yy137;
+ goto yy2;
+ } else {
+ if(yych <= '.') goto yy40;
+ if(yych <= '/') goto yy2;
+ if(yych <= '9') goto yy137;
+ goto yy2;
+ }
+yy139: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy138;
+ if(yych >= ':') goto yy138;
+yy140: yych = *++YYCURSOR;
+ if(yych == '-') goto yy58;
+ goto yy138;
+yy141: yych = *++YYCURSOR;
+ if(yych <= '/') goto yy129;
+ if(yych <= '7') goto yy142;
+ if(yych <= '9') goto yy140;
+ goto yy129;
+yy142: yych = *++YYCURSOR;
+ if(yych == '-') goto yy58;
+ goto yy129;
+yy143: yych = *++YYCURSOR;
+ if(yych == 'I') goto yy146;
+ if(yych == 'i') goto yy145;
+ goto yy2;
+yy144: yych = *++YYCURSOR;
+ if(yych <= '\000') goto yy42;
+ if(yych == 'x') goto yy130;
+ goto yy129;
+yy145: yych = *++YYCURSOR;
+ if(yych == 'n') goto yy152;
+ goto yy2;
+yy146: yych = *++YYCURSOR;
+ if(yych == 'N') goto yy147;
+ if(yych == 'n') goto yy148;
+ goto yy2;
+yy147: yych = *++YYCURSOR;
+ if(yych == 'F') goto yy149;
+ goto yy2;
+yy148: yych = *++YYCURSOR;
+ if(yych != 'f') goto yy2;
+yy149: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy150: yych = *++YYCURSOR;
+yy151:
+#line 87
+ { TAG_IMPLICIT( "float#neginf" ); }
+yy152: yych = *++YYCURSOR;
+ if(yych == 'f') goto yy149;
+ goto yy2;
+yy153: yych = *++YYCURSOR;
+ if(yych == 'I') goto yy24;
+ if(yych == 'i') goto yy23;
+ goto yy2;
+yy154: yych = *++YYCURSOR;
+ if(yych == 'L') goto yy161;
+ goto yy2;
+yy155: yych = *++YYCURSOR;
+ if(yych != 'l') goto yy2;
+yy156: yych = *++YYCURSOR;
+ if(yych != 's') goto yy2;
+yy157: yych = *++YYCURSOR;
+ if(yych != 'e') goto yy2;
+yy158: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy159: yych = *++YYCURSOR;
+yy160:
+#line 73
+ { TAG_IMPLICIT( "bool#no" ); }
+yy161: yych = *++YYCURSOR;
+ if(yych != 'S') goto yy2;
+yy162: yych = *++YYCURSOR;
+ if(yych == 'E') goto yy158;
+ goto yy2;
+yy163: yych = *++YYCURSOR;
+ if(yych != 'l') goto yy2;
+yy164: yych = *++YYCURSOR;
+ if(yych != 's') goto yy2;
+yy165: yych = *++YYCURSOR;
+ if(yych == 'e') goto yy158;
+ goto yy2;
+yy166: yych = *++YYCURSOR;
+ if(yych == 'F') goto yy158;
+ goto yy2;
+yy167: yych = *++YYCURSOR;
+ if(yych == 'f') goto yy158;
+ goto yy2;
+yy168: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy169: yych = *++YYCURSOR;
+yy170:
+#line 71
+ { TAG_IMPLICIT( "bool#yes" ); }
+yy171: yych = *++YYCURSOR;
+ if(yych == 'f') goto yy158;
+ goto yy2;
+yy172: yych = *++YYCURSOR;
+ if(yych == 'S') goto yy168;
+ goto yy2;
+yy173: yych = *++YYCURSOR;
+ if(yych == 's') goto yy168;
+ goto yy2;
+yy174: yych = *++YYCURSOR;
+ if(yych == 's') goto yy168;
+ goto yy2;
+yy175: yych = *++YYCURSOR;
+ if(yych == 'U') goto yy178;
+ goto yy2;
+yy176: yych = *++YYCURSOR;
+ if(yych != 'u') goto yy2;
+yy177: yych = *++YYCURSOR;
+ if(yych == 'e') goto yy168;
+ goto yy2;
+yy178: yych = *++YYCURSOR;
+ if(yych == 'E') goto yy168;
+ goto yy2;
+yy179: yych = *++YYCURSOR;
+ if(yych != 'u') goto yy2;
+yy180: yych = *++YYCURSOR;
+ if(yych == 'e') goto yy168;
+ goto yy2;
+yy181: yych = *++YYCURSOR;
+ if(yych == 'L') goto yy187;
+ goto yy2;
+yy182: yych = *++YYCURSOR;
+ if(yych != 'l') goto yy2;
+yy183: yych = *++YYCURSOR;
+ if(yych != 'l') goto yy2;
+yy184: yych = *++YYCURSOR;
+ if(yych >= '\001') goto yy2;
+yy185: yych = *++YYCURSOR;
+yy186:
+#line 69
+ { TAG_IMPLICIT( "null" ); }
+yy187: yych = *++YYCURSOR;
+ if(yych == 'L') goto yy184;
+ goto yy2;
+yy188: yych = *++YYCURSOR;
+ if(yych != 'l') goto yy2;
+yy189: yych = *++YYCURSOR;
+ if(yych == 'l') goto yy184;
+ goto yy2;
+}
+#line 101
+
+
+}
+
diff --git a/ext/syck/node.c b/ext/syck/node.c
new file mode 100644
index 0000000..f009cc5
--- /dev/null
+++ b/ext/syck/node.c
@@ -0,0 +1,306 @@
+//
+// node.c
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#include "syck.h"
+
+//
+// Node allocation functions
+//
+SyckNode *
+syck_alloc_node( enum syck_kind_tag type )
+{
+ SyckNode *s;
+
+ s = S_ALLOC( SyckNode );
+ s->kind = type;
+ s->id = NULL;
+ s->type_id = NULL;
+ s->anchor = NULL;
+
+ return s;
+}
+
+void
+syck_free_node( SyckNode *n )
+{
+ syck_free_members( n );
+ if ( n->type_id != NULL )
+ S_FREE( n->type_id );
+ if ( n->anchor != NULL )
+ S_FREE( n->anchor );
+ S_FREE( n );
+}
+
+SyckNode *
+syck_alloc_map()
+{
+ SyckNode *n;
+ struct SyckMap *m;
+
+ m = S_ALLOC( struct SyckMap );
+ m->idx = 0;
+ m->capa = ALLOC_CT;
+ m->keys = S_ALLOC_N( SYMID, m->capa );
+ m->values = S_ALLOC_N( SYMID, m->capa );
+
+ n = syck_alloc_node( syck_map_kind );
+ n->data.pairs = m;
+
+ return n;
+}
+
+SyckNode *
+syck_alloc_seq()
+{
+ SyckNode *n;
+ struct SyckSeq *s;
+
+ s = S_ALLOC( struct SyckSeq );
+ s->idx = 0;
+ s->capa = ALLOC_CT;
+ s->items = S_ALLOC_N( SYMID, s->capa );
+
+ n = syck_alloc_node( syck_seq_kind );
+ n->data.list = s;
+
+ return n;
+}
+
+SyckNode *
+syck_alloc_str()
+{
+ SyckNode *n;
+ struct SyckStr *s;
+
+ s = S_ALLOC( struct SyckStr );
+ s->len = 0;
+ s->ptr = NULL;
+
+ n = syck_alloc_node( syck_str_kind );
+ n->data.str = s;
+
+ return n;
+}
+
+SyckNode *
+syck_new_str( char *str )
+{
+ return syck_new_str2( str, strlen( str ) );
+}
+
+SyckNode *
+syck_new_str2( char *str, long len )
+{
+ SyckNode *n;
+
+ n = syck_alloc_str();
+ n->data.str->ptr = S_ALLOC_N( char, len + 1 );
+ n->data.str->len = len;
+ memcpy( n->data.str->ptr, str, len );
+ n->data.str->ptr[len] = '\0';
+
+ return n;
+}
+
+void
+syck_str_blow_away_commas( SyckNode *n )
+{
+ char *go, *end;
+
+ go = n->data.str->ptr;
+ end = go + n->data.str->len;
+ while ( *(++go) != '\0' )
+ {
+ if ( *go == ',' )
+ {
+ n->data.str->len -= 1;
+ memmove( go, go + 1, end - go );
+ end -= 1;
+ }
+ }
+}
+
+char *
+syck_str_read( SyckNode *n )
+{
+ ASSERT( n != NULL );
+ return n->data.str->ptr;
+}
+
+SyckNode *
+syck_new_map( SYMID key, SYMID value )
+{
+ SyckNode *n;
+
+ n = syck_alloc_map();
+ syck_map_add( n, key, value );
+
+ return n;
+}
+
+void
+syck_map_add( SyckNode *map, SYMID key, SYMID value )
+{
+ struct SyckMap *m;
+ long idx;
+
+ ASSERT( map != NULL );
+ ASSERT( map->data.pairs != NULL );
+
+ m = map->data.pairs;
+ idx = m->idx;
+ m->idx += 1;
+ if ( m->idx > m->capa )
+ {
+ m->capa += ALLOC_CT;
+ S_REALLOC_N( m->keys, SYMID, m->capa );
+ S_REALLOC_N( m->values, SYMID, m->capa );
+ }
+ m->keys[idx] = key;
+ m->values[idx] = value;
+}
+
+void
+syck_map_update( SyckNode *map1, SyckNode *map2 )
+{
+ struct SyckMap *m1, *m2;
+ long new_idx, new_capa;
+ ASSERT( map1 != NULL );
+ ASSERT( map2 != NULL );
+
+ m1 = map1->data.pairs;
+ m2 = map2->data.pairs;
+ if ( m2->idx < 1 ) return;
+
+ new_idx = m1->idx;
+ new_idx += m2->idx;
+ new_capa = m1->capa;
+ while ( new_idx > new_capa )
+ {
+ new_capa += ALLOC_CT;
+ }
+ if ( new_capa > m1->capa )
+ {
+ m1->capa = new_capa;
+ S_REALLOC_N( m1->keys, SYMID, m1->capa );
+ S_REALLOC_N( m1->values, SYMID, m1->capa );
+ }
+ new_idx = 0;
+ for ( new_idx = 0; new_idx < m2->idx; m1->idx++, new_idx++ )
+ {
+ m1->keys[m1->idx] = m2->keys[new_idx];
+ m1->values[m1->idx] = m2->values[new_idx];
+ }
+}
+
+long
+syck_map_count( SyckNode *map )
+{
+ ASSERT( map != NULL );
+ ASSERT( map->data.pairs != NULL );
+ return map->data.pairs->idx;
+}
+
+SYMID
+syck_map_read( SyckNode *map, enum map_part p, long idx )
+{
+ struct SyckMap *m;
+
+ ASSERT( map != NULL );
+ m = map->data.pairs;
+ ASSERT( m != NULL );
+ if ( p == map_key )
+ {
+ return m->keys[idx];
+ }
+ else
+ {
+ return m->values[idx];
+ }
+}
+
+SyckNode *
+syck_new_seq( SYMID value )
+{
+ SyckNode *n;
+
+ n = syck_alloc_seq();
+ syck_seq_add( n, value );
+
+ return n;
+}
+
+void
+syck_seq_add( SyckNode *arr, SYMID value )
+{
+ struct SyckSeq *s;
+ long idx;
+
+ ASSERT( arr != NULL );
+ ASSERT( arr->data.list != NULL );
+
+ s = arr->data.list;
+ idx = s->idx;
+ s->idx += 1;
+ if ( s->idx > s->capa )
+ {
+ s->capa += ALLOC_CT;
+ S_REALLOC_N( s->items, SYMID, s->capa );
+ }
+ s->items[idx] = value;
+}
+
+long
+syck_seq_count( SyckNode *seq )
+{
+ ASSERT( seq != NULL );
+ ASSERT( seq->data.list != NULL );
+ return seq->data.list->idx;
+}
+
+SYMID
+syck_seq_read( SyckNode *seq, long idx )
+{
+ struct SyckSeq *s;
+
+ ASSERT( seq != NULL );
+ s = seq->data.list;
+ ASSERT( s != NULL );
+ return s->items[idx];
+}
+
+void
+syck_free_members( SyckNode *n )
+{
+ int i;
+ switch ( n->kind )
+ {
+ case syck_str_kind:
+ if ( n->data.str->ptr != NULL )
+ {
+ S_FREE( n->data.str->ptr );
+ n->data.str->ptr = NULL;
+ n->data.str->len = 0;
+ S_FREE( n->data.str );
+ }
+ break;
+
+ case syck_seq_kind:
+ S_FREE( n->data.list->items );
+ S_FREE( n->data.list );
+ break;
+
+ case syck_map_kind:
+ S_FREE( n->data.pairs->keys );
+ S_FREE( n->data.pairs->values );
+ S_FREE( n->data.pairs );
+ break;
+ }
+}
+
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
new file mode 100644
index 0000000..66aa7e4
--- /dev/null
+++ b/ext/syck/rubyext.c
@@ -0,0 +1,569 @@
+//
+// rubyext.c
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#include "ruby.h"
+#include "syck.h"
+#include <sys/types.h>
+#include <time.h>
+
+static ID s_utc, s_read, s_binmode;
+static VALUE sym_model, sym_generic;
+static VALUE sym_scalar, sym_seq, sym_map;
+VALUE cNode;
+
+//
+// my private collection of numerical oddities.
+//
+static double S_zero() { return 0.0; }
+static double S_one() { return 1.0; }
+static double S_inf() { return S_one() / S_zero(); }
+static double S_nan() { return S_zero() / S_zero(); }
+
+static VALUE syck_node_transform( VALUE );
+
+//
+// read from io.
+//
+long
+rb_syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
+{
+ long len = 0;
+
+ ASSERT( str != NULL );
+ max_size -= skip;
+ if ( max_size < 0 ) max_size = 0;
+
+ if ( max_size > 0 )
+ {
+ //
+ // call io#read.
+ //
+ VALUE src = (VALUE)str->ptr;
+ VALUE n = LONG2NUM(max_size);
+ VALUE str = rb_funcall2(src, s_read, 1, &n);
+ if (!NIL_P(str))
+ {
+ len = RSTRING(str)->len;
+ memcpy( buf + skip, RSTRING(str)->ptr, len );
+ }
+ }
+ len += skip;
+ buf[len] = '\0';
+ return len;
+}
+
+//
+// determine: are we reading from a string or io?
+//
+void
+syck_parser_assign_io(parser, port)
+ SyckParser *parser;
+ VALUE port;
+{
+ if (rb_respond_to(port, rb_intern("to_str"))) {
+ //arg.taint = OBJ_TAINTED(port); /* original taintedness */
+ //StringValue(port); /* possible conversion */
+ syck_parser_str( parser, RSTRING(port)->ptr, RSTRING(port)->len, NULL );
+ }
+ else if (rb_respond_to(port, s_read)) {
+ if (rb_respond_to(port, s_binmode)) {
+ rb_funcall2(port, s_binmode, 0, 0);
+ }
+ //arg.taint = Qfalse;
+ syck_parser_str( parser, (char *)port, 0, rb_syck_io_str_read );
+ }
+ else {
+ rb_raise(rb_eTypeError, "instance of IO needed");
+ }
+}
+
+//
+// creating timestamps
+//
+SYMID
+rb_syck_mktime(str)
+ char *str;
+{
+ VALUE time;
+ char *ptr = str;
+ VALUE year, mon, day, hour, min, sec;
+
+ // Year
+ ptr[4] = '\0';
+ year = INT2FIX(strtol(ptr, NULL, 10));
+
+ // Month
+ ptr += 4;
+ while ( !isdigit( *ptr ) ) ptr++;
+ mon = INT2FIX(strtol(ptr, NULL, 10));
+
+ // Day
+ ptr += 2;
+ while ( !isdigit( *ptr ) ) ptr++;
+ day = INT2FIX(strtol(ptr, NULL, 10));
+
+ // Hour
+ ptr += 2;
+ while ( !isdigit( *ptr ) ) ptr++;
+ hour = INT2FIX(strtol(ptr, NULL, 10));
+
+ // Minute
+ ptr += 2;
+ while ( !isdigit( *ptr ) ) ptr++;
+ min = INT2FIX(strtol(ptr, NULL, 10));
+
+ // Second
+ ptr += 2;
+ while ( !isdigit( *ptr ) ) ptr++;
+ sec = INT2FIX(strtol(ptr, NULL, 10));
+
+ time = rb_funcall(rb_cTime, s_utc, 6, year, mon, day, hour, min, sec );
+ return time;
+}
+
+//
+// {generic mode} node handler
+// - Loads data into Node classes
+//
+SYMID
+rb_syck_parse_handler(p, n)
+ SyckParser *p;
+ SyckNode *n;
+{
+ VALUE t, v, obj;
+ int i;
+
+ obj = rb_obj_alloc(cNode);
+ if ( n->type_id != NULL )
+ {
+ t = rb_str_new2(n->type_id);
+ rb_iv_set(obj, "@type_id", t);
+ }
+
+ switch (n->kind)
+ {
+ case syck_str_kind:
+ rb_iv_set(obj, "@kind", sym_scalar);
+ v = rb_str_new( n->data.str->ptr, n->data.str->len );
+ break;
+
+ case syck_seq_kind:
+ rb_iv_set(obj, "@kind", sym_seq);
+ v = rb_ary_new2( n->data.list->idx );
+ for ( i = 0; i < n->data.list->idx; i++ )
+ {
+ rb_ary_store( v, i, syck_seq_read( n, i ) );
+ }
+ break;
+
+ case syck_map_kind:
+ rb_iv_set(obj, "@kind", sym_map);
+ v = rb_hash_new();
+ for ( i = 0; i < n->data.pairs->idx; i++ )
+ {
+ VALUE key = syck_node_transform( syck_map_read( n, map_key, i ) );
+ VALUE val = rb_ary_new();
+ rb_ary_push(val, syck_map_read( n, map_key, i ));
+ rb_ary_push(val, syck_map_read( n, map_value, i ));
+
+ rb_hash_aset( v, key, val );
+ }
+ break;
+ }
+
+ if ( p->bonus != 0 )
+ {
+ VALUE proc = (VALUE)p->bonus;
+ rb_funcall(proc, rb_intern("call"), 1, v);
+ }
+ rb_iv_set(obj, "@value", v);
+ return obj;
+}
+
+//
+// {native mode} node handler
+// - Converts data into native Ruby types
+//
+SYMID
+rb_syck_load_handler(p, n)
+ SyckParser *p;
+ SyckNode *n;
+{
+ VALUE obj;
+ long i;
+ int str = 0;
+
+ switch (n->kind)
+ {
+ case syck_str_kind:
+ if ( n->type_id == NULL || strcmp( n->type_id, "str" ) == 0 )
+ {
+ obj = rb_str_new( n->data.str->ptr, n->data.str->len );
+ }
+ else if ( strcmp( n->type_id, "null" ) == 0 )
+ {
+ obj = Qnil;
+ }
+ else if ( strcmp( n->type_id, "bool#yes" ) == 0 )
+ {
+ obj = Qtrue;
+ }
+ else if ( strcmp( n->type_id, "bool#no" ) == 0 )
+ {
+ obj = Qfalse;
+ }
+ else if ( strcmp( n->type_id, "int#hex" ) == 0 )
+ {
+ obj = rb_cstr2inum( n->data.str->ptr, 16 );
+ }
+ else if ( strcmp( n->type_id, "int#oct" ) == 0 )
+ {
+ obj = rb_cstr2inum( n->data.str->ptr, 8 );
+ }
+ else if ( strncmp( n->type_id, "int", 3 ) == 0 )
+ {
+ syck_str_blow_away_commas( n );
+ obj = rb_cstr2inum( n->data.str->ptr, 10 );
+ }
+ else if ( strcmp( n->type_id, "float#nan" ) == 0 )
+ {
+ obj = rb_float_new( S_nan() );
+ }
+ else if ( strcmp( n->type_id, "float#inf" ) == 0 )
+ {
+ obj = rb_float_new( S_inf() );
+ }
+ else if ( strcmp( n->type_id, "float#neginf" ) == 0 )
+ {
+ obj = rb_float_new( -S_inf() );
+ }
+ else if ( strncmp( n->type_id, "float", 5 ) == 0 )
+ {
+ double f;
+ syck_str_blow_away_commas( n );
+ f = strtod( n->data.str->ptr, NULL );
+ obj = rb_float_new( f );
+ }
+ else if ( strcmp( n->type_id, "timestamp#iso8601" ) == 0 )
+ {
+ obj = rb_syck_mktime( n->data.str->ptr );
+ }
+ else if ( strcmp( n->type_id, "timestamp#spaced" ) == 0 )
+ {
+ obj = rb_syck_mktime( n->data.str->ptr );
+ }
+ else if ( strcmp( n->type_id, "timestamp#ymd" ) == 0 )
+ {
+ S_REALLOC_N( n->data.str->ptr, char, 22 );
+ strcat( n->data.str->ptr, "t12:00:00Z" );
+ obj = rb_syck_mktime( n->data.str->ptr );
+ }
+ else if ( strncmp( n->type_id, "timestamp", 9 ) == 0 )
+ {
+ obj = rb_syck_mktime( n->data.str->ptr );
+ }
+ else
+ {
+ obj = rb_str_new( n->data.str->ptr, n->data.str->len );
+ }
+ break;
+
+ case syck_seq_kind:
+ obj = rb_ary_new2( n->data.list->idx );
+ for ( i = 0; i < n->data.list->idx; i++ )
+ {
+ rb_ary_store( obj, i, syck_seq_read( n, i ) );
+ }
+ break;
+
+ case syck_map_kind:
+ obj = rb_hash_new();
+ for ( i = 0; i < n->data.pairs->idx; i++ )
+ {
+ rb_hash_aset( obj, syck_map_read( n, map_key, i ), syck_map_read( n, map_value, i ) );
+ }
+ break;
+ }
+ if ( p->bonus != 0 )
+ {
+ VALUE proc = (VALUE)p->bonus;
+ rb_funcall(proc, rb_intern("call"), 1, obj);
+ }
+ return obj;
+}
+
+//
+// friendly errors.
+//
+void
+rb_syck_err_handler(p, msg)
+ SyckParser *p;
+ char *msg;
+{
+ char *endl = p->cursor;
+
+ while ( *endl != '\0' && *endl != '\n' )
+ endl++;
+
+ endl[0] = '\0';
+ rb_raise(rb_eLoadError, "%s on line %d, col %d: `%s'",
+ msg,
+ p->linect,
+ p->cursor - p->lineptr,
+ p->lineptr);
+}
+
+//
+// data loaded based on the model requested.
+//
+void
+syck_set_model( parser, model )
+ SyckParser *parser;
+ VALUE model;
+{
+ if ( model == sym_generic )
+ {
+ syck_parser_handler( parser, rb_syck_parse_handler );
+ syck_parser_error_handler( parser, rb_syck_err_handler );
+ syck_parser_implicit_typing( parser, 1 );
+ syck_parser_taguri_expansion( parser, 1 );
+ }
+ else
+ {
+ syck_parser_handler( parser, rb_syck_load_handler );
+ syck_parser_error_handler( parser, rb_syck_err_handler );
+ syck_parser_implicit_typing( parser, 1 );
+ syck_parser_taguri_expansion( parser, 0 );
+ }
+}
+
+//
+// wrap syck_parse().
+//
+static VALUE
+rb_run_syck_parse(parser)
+ SyckParser *parser;
+{
+ return syck_parse(parser);
+}
+
+//
+// free parser.
+//
+static VALUE
+rb_syck_ensure(parser)
+ SyckParser *parser;
+{
+ syck_free_parser( parser );
+ return 0;
+}
+
+//
+// YAML::Syck::Parser.new
+//
+VALUE
+syck_parser_new(argc, argv, class)
+ int argc;
+ VALUE *argv;
+ VALUE class;
+{
+ VALUE pobj, options, init_argv[1];
+ SyckParser *parser = syck_new_parser();
+
+ rb_scan_args(argc, argv, "01", &options);
+ pobj = Data_Wrap_Struct( class, 0, syck_free_parser, parser );
+
+ if ( ! rb_obj_is_instance_of( options, rb_cHash ) )
+ {
+ options = rb_hash_new();
+ }
+ init_argv[0] = options;
+ rb_obj_call_init(pobj, 1, init_argv);
+ return pobj;
+}
+
+//
+// YAML::Syck::Parser.initialize( options )
+//
+static VALUE
+syck_parser_initialize( self, options )
+ VALUE self, options;
+{
+ rb_iv_set(self, "@options", options);
+ return self;
+}
+
+//
+// YAML::Syck::Parser.load( IO or String )
+//
+VALUE
+syck_parser_load(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE port, proc, v, model;
+ SyckParser *parser;
+
+ rb_scan_args(argc, argv, "11", &port, &proc);
+ Data_Get_Struct(self, SyckParser, parser);
+ syck_parser_assign_io(parser, port);
+
+ model = rb_hash_aref( rb_iv_get( self, "@options" ), sym_model );
+ syck_set_model( parser, model );
+
+ parser->bonus = 0;
+ if ( !NIL_P( proc ) )
+ {
+ parser->bonus = (void *)proc;
+ }
+
+ v = syck_parse( parser );
+ if ( v == NULL )
+ {
+ return Qnil;
+ }
+
+ //v = rb_ensure(rb_run_syck_parse, (VALUE)&parser, rb_syck_ensure, (VALUE)&parser);
+
+ return v;
+}
+
+//
+// YAML::Syck::Parser.load_documents( IO or String ) { |doc| }
+//
+VALUE
+syck_parser_load_documents(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ VALUE port, proc, v, model;
+ SyckParser *parser;
+
+ rb_scan_args(argc, argv, "1&", &port, &proc);
+ Data_Get_Struct(self, SyckParser, parser);
+ syck_parser_assign_io(parser, port);
+
+ model = rb_hash_aref( rb_iv_get( self, "@options" ), sym_model );
+ syck_set_model( parser, model );
+ parser->bonus = 0;
+
+ while ( 1 )
+ {
+ v = syck_parse( parser );
+ if ( parser->eof == 1 )
+ {
+ break;
+ }
+ rb_funcall( proc, rb_intern("call"), 1, v );
+ }
+
+ return Qnil;
+}
+
+//
+// YAML::Syck::Node.initialize
+//
+static VALUE
+syck_node_initialize( self, type_id, val )
+ VALUE self, type_id, val;
+{
+ rb_iv_set( self, "@type_id", type_id );
+ rb_iv_set( self, "@value", val );
+}
+
+static VALUE
+syck_node_thash( entry, t )
+ VALUE entry, t;
+{
+ VALUE key, val;
+ key = rb_ary_entry( entry, 0 );
+ val = syck_node_transform( rb_ary_entry( rb_ary_entry( entry, 1 ), 1 ) );
+ rb_hash_aset( t, key, val );
+}
+
+static VALUE
+syck_node_ahash( entry, t )
+ VALUE entry, t;
+{
+ VALUE val = syck_node_transform( entry );
+ rb_ary_push( t, val );
+}
+
+//
+// YAML::Syck::Node.transform
+//
+static VALUE
+syck_node_transform( self )
+ VALUE self;
+{
+ VALUE t = Qnil;
+ VALUE val = rb_iv_get( self, "@value" );
+ if ( rb_obj_is_instance_of( val, rb_cHash ) )
+ {
+ t = rb_hash_new();
+ rb_iterate( rb_each, val, syck_node_thash, t );
+ }
+ else if ( rb_obj_is_instance_of( val, rb_cArray ) )
+ {
+ t = rb_ary_new();
+ rb_iterate( rb_each, val, syck_node_ahash, t );
+ }
+ else
+ {
+ t = val;
+ }
+ return t;
+}
+
+//
+// Initialize Syck extension
+//
+void
+Init_syck()
+{
+ VALUE rb_yaml = rb_define_module( "YAML" );
+ VALUE rb_syck = rb_define_module_under( rb_yaml, "Syck" );
+ VALUE cParser = rb_define_class_under( rb_syck, "Parser", rb_cObject );
+ rb_define_const( rb_syck, "VERSION", rb_str_new2( SYCK_VERSION ) );
+
+ //
+ // Global symbols
+ //
+ s_utc = rb_intern("utc");
+ s_read = rb_intern("read");
+ s_binmode = rb_intern("binmode");
+ sym_model = ID2SYM(rb_intern("Model"));
+ sym_generic = ID2SYM(rb_intern("Generic"));
+ sym_map = ID2SYM(rb_intern("map"));
+ sym_scalar = ID2SYM(rb_intern("scalar"));
+ sym_seq = ID2SYM(rb_intern("seq"));
+
+ //
+ // Define YAML::Syck::Parser class
+ //
+ rb_define_attr( cParser, "options", 1, 1 );
+ rb_define_singleton_method(cParser, "new", syck_parser_new, -1);
+ rb_define_method(cParser, "initialize", syck_parser_initialize, 1);
+ rb_define_method(cParser, "load", syck_parser_load, -1);
+ rb_define_method(cParser, "load_documents", syck_parser_load_documents, -1);
+
+ //
+ // Define YAML::Syck::Node class
+ //
+ cNode = rb_define_class_under( rb_syck, "Node", rb_cObject );
+ rb_define_attr( cNode, "kind", 1, 1 );
+ rb_define_attr( cNode, "type_id", 1, 1 );
+ rb_define_attr( cNode, "value", 1, 1 );
+ rb_define_attr( cNode, "anchor", 1, 1 );
+ rb_define_method( cNode, "initialize", syck_node_initialize, 2);
+ rb_define_method( cNode, "transform", syck_node_transform, 0);
+}
+
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
new file mode 100644
index 0000000..feb72e7
--- /dev/null
+++ b/ext/syck/syck.c
@@ -0,0 +1,460 @@
+//
+// syck.c
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+#include <stdio.h>
+#include <string.h>
+
+#include "syck.h"
+
+#define SYCK_YAML_MAJOR 1
+#define SYCK_YAML_MINOR 0
+#define SYCK_BUFFERSIZE 262144
+
+//
+// Custom assert
+//
+void
+syck_assert( char *file_name, unsigned line_num )
+{
+ fflush( NULL );
+ fprintf( stderr, "\nAssertion failed: %s, line %u\n",
+ file_name, line_num );
+ fflush( stderr );
+ abort();
+}
+
+char *
+syck_strndup( char *buf, long len )
+{
+ char *new = S_ALLOC_N( char, len + 1 );
+ S_MEMZERO( new, char, len + 1 );
+ S_MEMCPY( new, buf, char, len );
+}
+
+//
+// Default IO functions
+//
+long
+syck_io_file_read( char *buf, SyckIoFile *file, long max_size, long skip )
+{
+ char *beg;
+ long len = 0;
+
+ ASSERT( file != NULL );
+
+ max_size -= skip;
+ len = fread( buf + skip, max_size, sizeof( char ), file->ptr );
+#if REDEBUG
+ printf( "LEN: %d\n", len );
+#endif
+ len += skip;
+ buf[len] = '\0';
+#if REDEBUG
+ printf( "POS: %d\n", len );
+ printf( "BUFFER: %s\n", buf );
+#endif
+ return len;
+}
+
+long
+syck_io_str_read( char *buf, SyckIoStr *str, long max_size, long skip )
+{
+ char *beg;
+ long len = 0;
+
+ ASSERT( str != NULL );
+ beg = str->ptr;
+ if ( max_size >= 0 )
+ {
+ max_size -= skip;
+ if ( max_size < 0 ) max_size = 0;
+
+ str->ptr += max_size;
+ if ( str->ptr > str->end )
+ {
+ str->ptr = str->end;
+ }
+ }
+ else
+ {
+ // Use exact string length
+ while ( str->ptr < str->end ) {
+ if (*(str->ptr++) == '\n') break;
+ }
+ }
+ if ( beg < str->ptr )
+ {
+ len = str->ptr - beg;
+ S_MEMCPY( buf + skip, beg, char, len );
+ }
+#if REDEBUG
+ printf( "LEN: %d\n", len );
+#endif
+ len += skip;
+ buf[len] = '\0';
+#if REDEBUG
+ printf( "POS: %d\n", len );
+ printf( "BUFFER: %s\n", buf );
+#endif
+ return len;
+}
+
+void
+syck_parser_reset_levels( SyckParser *p )
+{
+ p->lvl_idx = 1;
+ p->levels[0].spaces = -1;
+ p->levels[0].domain = "yaml.org,2002/";
+ p->levels[0].status = syck_lvl_header;
+}
+
+void
+syck_parser_reset_cursor( SyckParser *p )
+{
+ if ( p->buffer == NULL )
+ {
+ p->buffer = S_ALLOC_N( char, p->bufsize );
+ }
+ p->buffer[0] = '\0';
+
+ p->cursor = NULL;
+ p->lineptr = NULL;
+ p->token = NULL;
+ p->toktmp = NULL;
+ p->marker = NULL;
+ p->limit = NULL;
+
+ p->linect = 0;
+ p->eof = 0;
+ p->last_token = 0;
+ p->force_token = 0;
+}
+
+//
+// Allocate the parser
+//
+SyckParser *
+syck_new_parser()
+{
+ SyckParser *p;
+ p = S_ALLOC( SyckParser );
+ p->lvl_capa = ALLOC_CT;
+ p->levels = S_ALLOC_N( SyckLevel, p->lvl_capa );
+ p->io_type = syck_io_str;
+ p->io.str = NULL;
+ p->syms = NULL;
+ p->anchors = st_init_strtable();
+ p->implicit_typing = 1;
+ p->taguri_expansion = 0;
+ p->bufsize = SYCK_BUFFERSIZE;
+ p->buffer = NULL;
+ syck_parser_reset_levels( p );
+ return p;
+}
+
+int
+syck_add_sym( SyckParser *p, char *data )
+{
+ SYMID id = 0;
+ if ( p->syms == NULL )
+ {
+ p->syms = st_init_numtable();
+ }
+ id = p->syms->num_entries;
+ st_insert( p->syms, id, (st_data_t)data );
+ return id;
+}
+
+int
+syck_lookup_sym( SyckParser *p, SYMID id, char **data )
+{
+ if ( p->syms == NULL ) return 0;
+ return st_lookup( p->syms, id, (st_data_t *)data );
+}
+
+int
+syck_st_free_nodes( char *key, SyckNode *n, char *arg )
+{
+ syck_free_node( n );
+ return ST_CONTINUE;
+}
+
+void
+syck_free_parser( SyckParser *p )
+{
+ char *key;
+ SyckNode *node;
+
+ //
+ // Free the adhoc symbol table
+ //
+ if ( p->syms != NULL )
+ {
+ st_free_table( p->syms );
+ }
+
+ //
+ // Free the anchor table
+ //
+ st_foreach( p->anchors, syck_st_free_nodes, (st_data_t)NULL );
+ st_free_table( p->anchors );
+
+ //
+ // Free all else
+ //
+ S_FREE( p->levels );
+ if ( p->buffer != NULL )
+ {
+ S_FREE( p->buffer );
+ }
+ free_any_io( p );
+ S_FREE( p );
+}
+
+void
+syck_parser_handler( SyckParser *p, SyckNodeHandler hdlr )
+{
+ ASSERT( p != NULL );
+ p->handler = hdlr;
+}
+
+void
+syck_parser_implicit_typing( SyckParser *p, int flag )
+{
+ p->implicit_typing = ( flag == 0 ? 0 : 1 );
+}
+
+void
+syck_parser_taguri_expansion( SyckParser *p, int flag )
+{
+ p->taguri_expansion = ( flag == 0 ? 0 : 1 );
+}
+
+void
+syck_parser_error_handler( SyckParser *p, SyckErrorHandler hdlr )
+{
+ ASSERT( p != NULL );
+ p->error_handler = hdlr;
+}
+
+void
+syck_parser_file( SyckParser *p, FILE *fp, SyckIoFileRead read )
+{
+ ASSERT( p != NULL );
+ free_any_io( p );
+ syck_parser_reset_cursor( p );
+ p->io_type = syck_io_file;
+ p->io.file = S_ALLOC( SyckIoFile );
+ p->io.file->ptr = fp;
+ if ( read != NULL )
+ {
+ p->io.file->read = read;
+ }
+ else
+ {
+ p->io.file->read = syck_io_file_read;
+ }
+}
+
+void
+syck_parser_str( SyckParser *p, char *ptr, long len, SyckIoStrRead read )
+{
+ ASSERT( p != NULL );
+ free_any_io( p );
+ syck_parser_reset_cursor( p );
+ p->io_type = syck_io_str;
+ p->io.str = S_ALLOC( SyckIoStr );
+ p->io.str->beg = ptr;
+ p->io.str->ptr = ptr;
+ p->io.str->end = ptr + len;
+ if ( read != NULL )
+ {
+ p->io.str->read = read;
+ }
+ else
+ {
+ p->io.str->read = syck_io_str_read;
+ }
+}
+
+void
+syck_parser_str_auto( SyckParser *p, char *ptr, SyckIoStrRead read )
+{
+ syck_parser_str( p, ptr, strlen( ptr ), read );
+}
+
+SyckLevel *
+syck_parser_current_level( SyckParser *p )
+{
+ return &p->levels[p->lvl_idx-1];
+}
+
+void
+syck_parser_pop_level( SyckParser *p )
+{
+ ASSERT( p != NULL );
+
+ // The root level should never be popped
+ if ( p->lvl_idx <= 1 ) return;
+
+ p->lvl_idx -= 1;
+ if ( p->levels[p->lvl_idx - 1].domain != p->levels[p->lvl_idx].domain )
+ {
+ free( p->levels[p->lvl_idx].domain );
+ }
+}
+
+void
+syck_parser_add_level( SyckParser *p, int len, enum syck_level_status status )
+{
+ ASSERT( p != NULL );
+ if ( p->lvl_idx + 1 > p->lvl_capa )
+ {
+ p->lvl_capa += ALLOC_CT;
+ S_REALLOC_N( p->levels, SyckLevel, p->lvl_capa );
+ }
+
+ ASSERT( len > p->levels[p->lvl_idx-1].spaces );
+ p->levels[p->lvl_idx].spaces = len;
+ p->levels[p->lvl_idx].domain = p->levels[p->lvl_idx-1].domain;
+ p->levels[p->lvl_idx].status = status;
+ p->lvl_idx += 1;
+}
+
+void
+free_any_io( SyckParser *p )
+{
+ ASSERT( p != NULL );
+ switch ( p->io_type )
+ {
+ case syck_io_str:
+ if ( p->io.str != NULL )
+ {
+ S_FREE( p->io.str );
+ p->io.str = NULL;
+ }
+ break;
+
+ case syck_io_file:
+ if ( p->io.file != NULL )
+ {
+ S_FREE( p->io.file );
+ p->io.file = NULL;
+ }
+ break;
+ }
+}
+
+long
+syck_move_tokens( SyckParser *p )
+{
+ long count, skip;
+ ASSERT( p->buffer != NULL );
+
+ if ( p->token == NULL )
+ return 0;
+
+ skip = p->limit - p->token;
+ if ( skip < 1 )
+ return 0;
+
+#if REDEBUG
+ printf( "DIFF: %d\n", skip );
+#endif
+
+ if ( ( count = p->token - p->buffer ) )
+ {
+ S_MEMMOVE( p->buffer, p->token, char, skip );
+ p->token = p->buffer;
+ p->marker -= count;
+ p->cursor -= count;
+ p->toktmp -= count;
+ p->limit -= count;
+ p->lineptr -= count;
+ }
+ return skip;
+}
+
+void
+syck_check_limit( SyckParser *p, long len )
+{
+ if ( p->cursor == NULL )
+ {
+ p->cursor = p->buffer;
+ p->lineptr = p->buffer;
+ p->marker = p->buffer;
+ }
+ p->limit = p->buffer + len;
+}
+
+long
+syck_parser_read( SyckParser *p )
+{
+ long len = 0;
+ long skip = 0;
+ ASSERT( p != NULL );
+ switch ( p->io_type )
+ {
+ case syck_io_str:
+ skip = syck_move_tokens( p );
+ len = (p->io.str->read)( p->buffer, p->io.str, SYCK_BUFFERSIZE - 1, skip );
+ break;
+
+ case syck_io_file:
+ skip = syck_move_tokens( p );
+ len = (p->io.file->read)( p->buffer, p->io.file, SYCK_BUFFERSIZE - 1, skip );
+ break;
+ }
+ syck_check_limit( p, len );
+ return len;
+}
+
+long
+syck_parser_readlen( SyckParser *p, long max_size )
+{
+ long len = 0;
+ long skip = 0;
+ ASSERT( p != NULL );
+ switch ( p->io_type )
+ {
+ case syck_io_str:
+ skip = syck_move_tokens( p );
+ len = (p->io.str->read)( p->buffer, p->io.str, max_size, skip );
+ break;
+
+ case syck_io_file:
+ skip = syck_move_tokens( p );
+ len = (p->io.file->read)( p->buffer, p->io.file, max_size, skip );
+ break;
+ }
+ syck_check_limit( p, len );
+ return len;
+}
+
+SYMID
+syck_parse( SyckParser *p )
+{
+ char *line;
+
+ ASSERT( p != NULL );
+
+ p->root = NULL;
+ syck_parser_reset_levels( p );
+ yyparse( p );
+ return p->root;
+}
+
+void
+syck_default_error_handler( SyckParser *p, char *msg )
+{
+ printf( "Error at [Line %d, Col %d]: %s\n",
+ p->linect,
+ p->cursor - p->lineptr,
+ msg );
+}
+
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
new file mode 100644
index 0000000..431c859
--- /dev/null
+++ b/ext/syck/syck.h
@@ -0,0 +1,257 @@
+//
+// syck.h
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#ifndef SYCK_H
+#define SYCK_H
+
+#define SYCK_VERSION "0.25"
+
+#include <stdio.h>
+#ifdef HAVE_ST_H
+#include <st.h>
+#else
+#include "syck_st.h"
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+//
+// Memory Allocation
+//
+#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
+#include <alloca.h>
+#endif
+
+#if DEBUG
+ void syck_assert( char *, unsigned );
+# define ASSERT(f) \
+ if ( f ) \
+ {} \
+ else \
+ syck_assert( __FILE__, __LINE__ )
+#else
+# define ASSERT(f)
+#endif
+
+#ifndef NULL
+# define NULL (void *)0
+#endif
+
+#define ALLOC_CT 8
+#define S_ALLOC_N(type,n) (type*)malloc(sizeof(type)*(n))
+#define S_ALLOC(type) (type*)malloc(sizeof(type))
+#define S_REALLOC_N(var,type,n) (var)=(type*)realloc((char*)(var),sizeof(type)*(n))
+#define S_FREE(n) free(n); n = NULL;
+
+#define S_ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
+
+#define S_MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n))
+#define S_MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n))
+#define S_MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))
+#define S_MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n))
+
+#define BLOCK_FOLD 10
+#define BLOCK_LIT 20
+#define BLOCK_PLAIN 30
+#define NL_CHOMP 130
+#define NL_KEEP 140
+
+//
+// Node definitions
+//
+#define SYMID unsigned long
+
+typedef struct _syck_parser SyckParser;
+typedef struct _syck_file SyckIoFile;
+typedef struct _syck_str SyckIoStr;
+typedef struct _syck_node SyckNode;
+typedef struct _syck_level SyckLevel;
+
+enum syck_kind_tag {
+ syck_map_kind,
+ syck_seq_kind,
+ syck_str_kind
+};
+
+enum map_part {
+ map_key,
+ map_value
+};
+
+struct _syck_node {
+ // Symbol table ID
+ SYMID id;
+ // Underlying kind
+ enum syck_kind_tag kind;
+ // Fully qualified tag-uri for type
+ char *type_id;
+ // Anchor name
+ char *anchor;
+ union {
+ // Storage for map data
+ struct SyckMap {
+ SYMID *keys;
+ SYMID *values;
+ long capa;
+ long idx;
+ } *pairs;
+ // Storage for sequence data
+ struct SyckSeq {
+ SYMID *items;
+ long capa;
+ long idx;
+ } *list;
+ // Storage for string data
+ struct SyckStr {
+ char *ptr;
+ long len;
+ } *str;
+ } data;
+};
+
+//
+// Parser definitions
+//
+typedef SYMID (*SyckNodeHandler)(SyckParser *, SyckNode *);
+typedef void (*SyckErrorHandler)(SyckParser *, char *);
+typedef long (*SyckIoFileRead)(char *, SyckIoFile *, long, long);
+typedef long (*SyckIoStrRead)(char *, SyckIoStr *, long, long);
+
+enum syck_io_type {
+ syck_io_str,
+ syck_io_file
+};
+
+enum syck_level_status {
+ syck_lvl_header,
+ syck_lvl_doc,
+ syck_lvl_seq,
+ syck_lvl_block,
+ syck_lvl_str,
+ syck_lvl_inline,
+ syck_lvl_end,
+ syck_lvl_pause
+};
+
+struct _syck_parser {
+ // Root node
+ SYMID root;
+ // Implicit typing flag
+ int implicit_typing, taguri_expansion;
+ // Scripting language function to handle nodes
+ SyckNodeHandler handler;
+ // Error handler
+ SyckErrorHandler error_handler;
+ // IO type
+ enum syck_io_type io_type;
+ // Custom buffer size
+ size_t bufsize;
+ // Buffer pointers
+ char *buffer, *lineptr, *toktmp, *token, *cursor, *marker, *limit;
+ // Line counter
+ int linect;
+ // Last token from yylex()
+ int last_token;
+ // Force a token upon next call to yylex()
+ int force_token;
+ // EOF flag
+ int eof;
+ union {
+ struct _syck_file {
+ FILE *ptr;
+ SyckIoFileRead read;
+ } *file;
+ struct _syck_str {
+ char *beg, *ptr, *end;
+ SyckIoStrRead read;
+ } *str;
+ } io;
+ // Symbol table
+ st_table *anchors;
+ // Optional symbol table for SYMIDs
+ st_table *syms;
+ // Levels of indentation
+ struct _syck_level {
+ int spaces;
+ char *domain;
+ enum syck_level_status status;
+ } *levels;
+ int lvl_idx;
+ int lvl_capa;
+ void *bonus;
+};
+
+//
+// Handler prototypes
+//
+SYMID syck_hdlr_add_node( SyckParser *, SyckNode * );
+SyckNode *syck_hdlr_add_anchor( SyckParser *, char *, SyckNode * );
+SyckNode *syck_hdlr_add_alias( SyckParser *, char * );
+void syck_add_transfer( char *, SyckNode *, int );
+void syck_xprivate( SyckNode *, char *, int );
+void syck_taguri( SyckNode *, char *, char *, int );
+int syck_add_sym( SyckParser *, char * );
+int syck_lookup_sym( SyckParser *, SYMID, char ** );
+int syck_try_implicit( SyckNode * );
+void syck_fold_format( struct SyckStr *, int, int, int );
+void try_tag_implicit( SyckNode *, int );
+
+//
+// API prototypes
+//
+char *syck_strndup( char *, long );
+long syck_io_file_read( char *, SyckIoFile *, long, long );
+long syck_io_str_read( char *, SyckIoStr *, long, long );
+SyckParser *syck_new_parser();
+void syck_free_parser( SyckParser * );
+void syck_parser_implicit_typing( SyckParser *, int );
+void syck_parser_taguri_expansion( SyckParser *, int );
+void syck_parser_handler( SyckParser *, SyckNodeHandler );
+void syck_parser_error_handler( SyckParser *, SyckErrorHandler );
+void syck_parser_file( SyckParser *, FILE *, SyckIoFileRead );
+void syck_parser_str( SyckParser *, char *, long, SyckIoStrRead );
+void syck_parser_str_auto( SyckParser *, char *, SyckIoStrRead );
+SyckLevel *syck_parser_current_level( SyckParser * );
+void syck_parser_add_level( SyckParser *, int, enum syck_level_status );
+void free_any_io( SyckParser * );
+long syck_parser_read( SyckParser * );
+long syck_parser_readlen( SyckParser *, long );
+void syck_parser_init( SyckParser *, int );
+SYMID syck_parse( SyckParser * );
+void syck_default_error_handler( SyckParser *, char * );
+
+//
+// Allocation prototypes
+//
+SyckNode *syck_alloc_map();
+SyckNode *syck_alloc_seq();
+SyckNode *syck_alloc_str();
+void syck_free_node( SyckNode * );
+void syck_free_members( SyckNode * );
+SyckNode *syck_new_str( char * );
+SyckNode *syck_new_str2( char *, long );
+void syck_str_blow_away_commas( SyckNode * );
+char *syck_str_read( SyckNode * );
+SyckNode *syck_new_map( SYMID, SYMID );
+void syck_map_add( SyckNode *, SYMID, SYMID );
+SYMID syck_map_read( SyckNode *, enum map_part, long );
+long syck_map_count( SyckNode * );
+void syck_map_update( SyckNode *, SyckNode * );
+SyckNode *syck_new_seq( SYMID );
+void syck_seq_add( SyckNode *, SYMID );
+SYMID syck_seq_read( SyckNode *, long );
+long syck_seq_count( SyckNode * );
+
+#if defined(__cplusplus)
+} /* extern "C" { */
+#endif
+
+#endif /* ifndef SYCK_H */
diff --git a/ext/syck/token.c b/ext/syck/token.c
new file mode 100644
index 0000000..17ca2d2
--- /dev/null
+++ b/ext/syck/token.c
@@ -0,0 +1,1638 @@
+/* Generated by re2c 0.5 on Thu May 8 08:06:37 2003 */
+#line 1 "token.re"
+//
+// token.re
+//
+// $Author$
+// $Date$
+//
+// Copyright (C) 2003 why the lucky stiff
+//
+
+#include "syck.h"
+#include "gram.h"
+
+//
+// Allocate quoted strings in chunks
+//
+#define QUOTELEN 1024
+
+//
+// They do my bidding...
+//
+#define YYCTYPE char
+#define YYCURSOR parser->cursor
+#define YYMARKER parser->marker
+#define YYLIMIT parser->limit
+#define YYTOKEN parser->token
+#define YYTOKTMP parser->toktmp
+#define YYLINEPTR parser->lineptr
+#define YYLINE parser->linect
+#define YYFILL(n) syck_parser_read(parser)
+
+//
+// Repositions the cursor at `n' offset from the token start.
+// Only works in `Header' and `Document' sections.
+//
+#define YYPOS(n) YYCURSOR = YYTOKEN + n
+
+//
+// Track line numbers
+//
+#define NEWLINE(ptr) YYLINE++; YYLINEPTR = ptr + 1
+
+//
+// I like seeing the level operations as macros...
+//
+#define ADD_LEVEL(len, status) syck_parser_add_level( parser, len, status )
+#define POP_LEVEL() syck_parser_pop_level( parser )
+#define CURRENT_LEVEL() syck_parser_current_level( parser )
+
+//
+// Force a token next time around yylex()
+//
+#define FORCE_NEXT_TOKEN(tok) parser->force_token = tok;
+
+//
+// Nice little macro to ensure we're IOPENed to the current level.
+// * Only use this macro in the "Document" section *
+//
+#define ENSURE_IOPEN(last_lvl, to_len, reset) \
+ if ( last_lvl->spaces < to_len ) \
+ { \
+ if ( last_lvl->status == syck_lvl_inline ) \
+ { \
+ goto Document; \
+ } \
+ else \
+ { \
+ ADD_LEVEL( to_len, syck_lvl_doc ); \
+ if ( reset == 1 ) YYPOS(0); \
+ return IOPEN; \
+ } \
+ }
+
+//
+// Nice little macro to ensure closure of levels.
+// * Only use this macro in the "Document" section *
+//
+#define ENSURE_IEND(last_lvl, to_len) \
+ if ( last_lvl->spaces > to_len ) \
+ { \
+ syck_parser_pop_level( parser ); \
+ YYPOS(0); \
+ return IEND; \
+ }
+
+//
+// Concatenates quoted string items and manages allocation
+// to the quoted string
+//
+#define QUOTECAT(s, c, i, l) \
+ { \
+ if ( i + 1 >= c ) \
+ { \
+ c += QUOTELEN; \
+ S_REALLOC_N( s, char, c ); \
+ } \
+ s[i++] = l; \
+ s[i] = '\0'; \
+ }
+
+//
+// Tags a plain scalar with a transfer method
+// * Use only in "Plain" section *
+//
+#define RETURN_IMPLICIT(fold) \
+ { \
+ SyckLevel *i_lvl = CURRENT_LEVEL(); \
+ YYCURSOR = YYTOKTMP; \
+ yylval->nodeData = syck_new_str2( YYTOKEN, YYCURSOR - YYTOKEN ); \
+ if ( fold ) { \
+ syck_fold_format( yylval->nodeData->data.str, BLOCK_PLAIN, i_lvl->spaces, NL_CHOMP ); \
+ } \
+ if ( parser->implicit_typing == 1 ) \
+ { \
+ try_tag_implicit( yylval->nodeData, parser->taguri_expansion ); \
+ } \
+ return PLAIN; \
+ }
+
+//
+// Handles newlines, calculates indent
+//
+#define GOBBLE_UP_INDENT( ict, start ) \
+ char *indent = start; \
+ NEWLINE(indent); \
+ while ( indent < YYCURSOR ) \
+ { \
+ if ( *(++indent) == '\n' ) \
+ { \
+ NEWLINE(indent); \
+ } \
+ } \
+ ict = 0; \
+ if ( *YYCURSOR == '\0' ) \
+ { \
+ ict = -1; \
+ start = YYCURSOR; \
+ } \
+ else if ( *YYLINEPTR == ' ' ) \
+ { \
+ ict = YYCURSOR - YYLINEPTR; \
+ }
+
+//
+// If an indent exists at the current level, back up.
+//
+#define GET_TRUE_INDENT(indt_len) \
+ { \
+ SyckLevel *lvl_deep = CURRENT_LEVEL(); \
+ indt_len = lvl_deep->spaces; \
+ if ( indt_len == YYTOKEN - YYLINEPTR ) \
+ { \
+ SyckLevel *lvl_over; \
+ parser->lvl_idx--; \
+ lvl_over = CURRENT_LEVEL(); \
+ indt_len = lvl_over->spaces; \
+ parser->lvl_idx++; \
+ } \
+ }
+
+//
+// Argjh! I hate globals! Here for yyerror() only!
+//
+SyckParser *syck_parser_ptr = NULL;
+
+//
+// Accessory funcs later in this file.
+//
+void eat_comments( SyckParser * );
+
+//
+// My own re-entrant yylex() using re2c.
+// You really get used to the limited regexp.
+// It's really nice to not rely on backtracking and such.
+//
+int
+yylex( YYSTYPE *yylval, SyckParser *parser )
+{
+ syck_parser_ptr = parser;
+ if ( YYCURSOR == NULL )
+ {
+ syck_parser_read( parser );
+ }
+
+ if ( parser->force_token != 0 )
+ {
+ int t = parser->force_token;
+ parser->force_token = 0;
+ return t;
+ }
+
+#line 206
+
+
+ if ( YYLINEPTR != YYCURSOR )
+ {
+ goto Document;
+ }
+
+Header:
+
+ YYTOKEN = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 96, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 192, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy0;
+yy1: ++YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
+ yych = *YYCURSOR;
+ if(yych <= '"'){
+ if(yych <= '\000') goto yy6;
+ if(yych == '\n') goto yy8;
+ goto yy10;
+ } else {
+ if(yych <= '#') goto yy4;
+ if(yych != '-') goto yy10;
+ }
+yy2: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy15;
+yy3:
+#line 247
+ { YYPOS(0);
+ goto Document;
+ }
+yy4: yych = *++YYCURSOR;
+yy5:
+#line 233
+ { eat_comments( parser );
+ goto Header;
+ }
+yy6: yych = *++YYCURSOR;
+yy7:
+#line 237
+ { SyckLevel *lvl = CURRENT_LEVEL();
+ ENSURE_IEND(lvl, -1);
+ return 0;
+ }
+yy8: yych = *++YYCURSOR;
+ goto yy12;
+yy9:
+#line 242
+ { int indt_len;
+ GOBBLE_UP_INDENT( indt_len, YYTOKEN );
+ goto Header;
+ }
+yy10: yych = *++YYCURSOR;
+ goto yy3;
+yy11: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy12: if(yybm[0+yych] & 32) goto yy11;
+ if(yych != ' ') goto yy9;
+yy13: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy14: if(yybm[0+yych] & 64) goto yy13;
+ goto yy9;
+yy15: yych = *++YYCURSOR;
+ if(yych == '-') goto yy17;
+yy16: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy3;
+ }
+yy17: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 128) goto yy18;
+ if(yych == '\n') goto yy21;
+ goto yy16;
+yy18: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy19: if(yybm[0+yych] & 128) goto yy18;
+yy20:
+#line 219
+ { SyckLevel *lvl = CURRENT_LEVEL();
+ if ( lvl->status == syck_lvl_header )
+ {
+ YYPOS(3);
+ goto Directive;
+ }
+ else
+ {
+ ENSURE_IEND(lvl, -1);
+ YYPOS(0);
+ return 0;
+ }
+ }
+yy21: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy22: if(yych == '\n') goto yy21;
+ goto yy20;
+}
+#line 251
+
+
+Document:
+ {
+ SyckLevel *lvl = CURRENT_LEVEL();
+ if ( lvl->status == syck_lvl_header )
+ {
+ lvl->status = syck_lvl_doc;
+ }
+
+ YYTOKEN = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 160, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 136, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 16, 0, 16, 64, 64,
+ 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 0, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy23;
+yy24: ++YYCURSOR;
+yy23:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= ','){
+ if(yych <= '"'){
+ if(yych <= '\n'){
+ if(yych <= '\000') goto yy47;
+ if(yych <= '\t') goto yy49;
+ } else {
+ if(yych <= '\037') goto yy49;
+ if(yych <= ' ') goto yy45;
+ if(yych <= '!') goto yy36;
+ goto yy40;
+ }
+ } else {
+ if(yych <= '\''){
+ if(yych <= '#') goto yy43;
+ if(yych <= '%') goto yy49;
+ if(yych <= '&') goto yy34;
+ goto yy38;
+ } else {
+ if(yych == '*') goto yy35;
+ if(yych <= '+') goto yy49;
+ goto yy31;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= ':'){
+ if(yych <= '-') goto yy33;
+ if(yych <= '9') goto yy49;
+ goto yy31;
+ } else {
+ if(yych <= '=') goto yy49;
+ if(yych <= '>') goto yy42;
+ if(yych <= '?') goto yy33;
+ goto yy49;
+ }
+ } else {
+ if(yych <= 'z'){
+ if(yych <= '[') goto yy27;
+ if(yych == ']') goto yy29;
+ goto yy49;
+ } else {
+ if(yych <= '{') goto yy27;
+ if(yych <= '|') goto yy42;
+ if(yych <= '}') goto yy29;
+ goto yy49;
+ }
+ }
+ }
+yy25: yych = *++YYCURSOR;
+ goto yy77;
+yy26:
+#line 265
+ { // Isolate spaces
+ int indt_len;
+ GOBBLE_UP_INDENT( indt_len, YYTOKEN );
+ lvl = CURRENT_LEVEL();
+
+ // Check for open indent
+ ENSURE_IEND(lvl, indt_len);
+ ENSURE_IOPEN(lvl, indt_len, 0);
+ return INDENT;
+ }
+yy27: yych = *++YYCURSOR;
+yy28:
+#line 276
+ { ENSURE_IOPEN(lvl, 0, 1);
+ lvl = CURRENT_LEVEL();
+ ADD_LEVEL(lvl->spaces + 1, syck_lvl_inline);
+ return YYTOKEN[0];
+ }
+yy29: yych = *++YYCURSOR;
+yy30:
+#line 282
+ { POP_LEVEL();
+ return YYTOKEN[0];
+ }
+yy31: yych = *++YYCURSOR;
+ if(yych == '\n') goto yy74;
+ if(yych == ' ') goto yy71;
+yy32:
+#line 331
+ { ENSURE_IOPEN(lvl, 0, 1);
+ goto Plain;
+ }
+yy33: yych = *++YYCURSOR;
+ if(yych == '\n') goto yy69;
+ if(yych == ' ') goto yy66;
+ goto yy32;
+yy34: yych = *++YYCURSOR;
+ if(yych <= '-') goto yy32;
+ if(yych == '`') goto yy32;
+ if(yych <= 'z') goto yy63;
+ goto yy32;
+yy35: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 64) goto yy60;
+ goto yy32;
+yy36: yych = *++YYCURSOR;
+yy37:
+#line 308
+ { goto TransferMethod; }
+yy38: yych = *++YYCURSOR;
+yy39:
+#line 310
+ { goto SingleQuote; }
+yy40: yych = *++YYCURSOR;
+yy41:
+#line 312
+ { goto DoubleQuote; }
+yy42: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) goto yy58;
+ if(yych <= '+'){
+ if(yych == ' ') goto yy55;
+ if(yych <= '*') goto yy32;
+ goto yy52;
+ } else {
+ if(yych <= '-'){
+ if(yych <= ',') goto yy32;
+ goto yy52;
+ } else {
+ if(yych <= '/') goto yy32;
+ if(yych <= '9') goto yy52;
+ goto yy32;
+ }
+ }
+yy43: yych = *++YYCURSOR;
+yy44:
+#line 321
+ { eat_comments( parser );
+ goto Document;
+ }
+yy45: yych = *++YYCURSOR;
+ goto yy51;
+yy46:
+#line 325
+ { goto Document; }
+yy47: yych = *++YYCURSOR;
+yy48:
+#line 327
+ { ENSURE_IEND(lvl, -1);
+ return 0;
+ }
+yy49: yych = *++YYCURSOR;
+ goto yy32;
+yy50: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy51: if(yybm[0+yych] & 8) goto yy50;
+ goto yy46;
+yy52: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy53: if(yybm[0+yych] & 32) goto yy58;
+ if(yych <= '+'){
+ if(yych == ' ') goto yy55;
+ if(yych >= '+') goto yy52;
+ } else {
+ if(yych <= '-'){
+ if(yych >= '-') goto yy52;
+ } else {
+ if(yych <= '/') goto yy54;
+ if(yych <= '9') goto yy52;
+ }
+ }
+yy54: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy32;
+ }
+yy55: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy56: if(yych == ' ') goto yy55;
+yy57:
+#line 314
+ { if ( *( YYCURSOR - 1 ) == '\n' )
+ {
+ YYCURSOR--;
+ }
+ goto ScalarBlock;
+ }
+yy58: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy59: if(yybm[0+yych] & 32) goto yy58;
+ goto yy57;
+yy60: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy61: if(yybm[0+yych] & 64) goto yy60;
+yy62:
+#line 304
+ { yylval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
+ return ALIAS;
+ }
+yy63: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy64: if(yych <= '-') goto yy65;
+ if(yych == '`') goto yy65;
+ if(yych <= 'z') goto yy63;
+yy65:
+#line 300
+ { yylval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
+ return ANCHOR;
+ }
+yy66: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy67: if(yych == ' ') goto yy66;
+yy68:
+#line 290
+ { ENSURE_IOPEN(lvl, YYTOKEN - YYLINEPTR, 1);
+ FORCE_NEXT_TOKEN(IOPEN);
+ if ( *( YYCURSOR - 1 ) == '\n' )
+ {
+ YYCURSOR--;
+ }
+ ADD_LEVEL(YYCURSOR - YYLINEPTR, syck_lvl_doc);
+ return YYTOKEN[0];
+ }
+yy69: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy70: if(yych == '\n') goto yy69;
+ goto yy68;
+yy71: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy72: if(yych == ' ') goto yy71;
+yy73:
+#line 286
+ { YYPOS(1);
+ return YYTOKEN[0];
+ }
+yy74: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy75: if(yych == '\n') goto yy74;
+ goto yy73;
+yy76: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy77: if(yych == '\n') goto yy76;
+ if(yych != ' ') goto yy26;
+yy78: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy79: if(yybm[0+yych] & 128) goto yy78;
+ goto yy26;
+}
+#line 335
+
+ }
+
+Directive:
+ {
+ YYTOKTMP = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 128, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 0, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy80;
+yy81: ++YYCURSOR;
+yy80:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= ' '){
+ if(yych <= '\000') goto yy82;
+ if(yych <= '\037') goto yy87;
+ goto yy85;
+ } else {
+ if(yych == '%') goto yy83;
+ goto yy87;
+ }
+yy82: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy84;
+ }
+yy83: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-') goto yy84;
+ if(yych == '`') goto yy84;
+ if(yych <= 'z') goto yy90;
+yy84:
+#line 348
+ { YYCURSOR = YYTOKTMP;
+ return DOCSEP;
+ }
+yy85: yych = *++YYCURSOR;
+ goto yy89;
+yy86:
+#line 346
+ { goto Directive; }
+yy87: yych = *++YYCURSOR;
+ goto yy84;
+yy88: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy89: if(yybm[0+yych] & 32) goto yy88;
+ goto yy86;
+yy90: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy91: if(yybm[0+yych] & 64) goto yy90;
+ if(yych != ':') goto yy82;
+yy92: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 128) goto yy93;
+ goto yy82;
+yy93: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy94: if(yybm[0+yych] & 128) goto yy93;
+yy95:
+#line 344
+ { goto Directive; }
+}
+#line 351
+
+
+ }
+
+Plain:
+ {
+ SyckLevel *plvl;
+ int parentIndent;
+ int multiLine = 0;
+ YYCURSOR = YYTOKEN;
+ plvl = CURRENT_LEVEL();
+ GET_TRUE_INDENT(parentIndent);
+
+Plain2:
+ YYTOKTMP = YYCURSOR;
+
+Plain3:
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 192, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 160, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy96;
+yy97: ++YYCURSOR;
+yy96:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= ','){
+ if(yych <= '\n'){
+ if(yych <= '\000') goto yy105;
+ if(yych <= '\t') goto yy109;
+ } else {
+ if(yych == ' ') goto yy107;
+ if(yych <= '+') goto yy109;
+ goto yy104;
+ }
+ } else {
+ if(yych <= '\\'){
+ if(yych == ':') goto yy100;
+ goto yy109;
+ } else {
+ if(yych <= ']') goto yy102;
+ if(yych == '}') goto yy102;
+ goto yy109;
+ }
+ }
+yy98: yych = *++YYCURSOR;
+ goto yy122;
+yy99:
+#line 371
+ { int indt_len;
+ SyckLevel *lvl;
+ char *tok = YYTOKTMP;
+ GOBBLE_UP_INDENT( indt_len, tok );
+ lvl = CURRENT_LEVEL();
+
+ if ( indt_len <= parentIndent )
+ {
+ RETURN_IMPLICIT(multiLine);
+ }
+
+ multiLine = 1;
+ goto Plain2;
+ }
+yy100: yych = *++YYCURSOR;
+ if(yych == '\n') goto yy119;
+ if(yych == ' ') goto yy116;
+yy101:
+#line 400
+ { goto Plain2; }
+yy102: yych = *++YYCURSOR;
+yy103:
+#line 388
+ { if ( plvl->status != syck_lvl_inline ) goto Plain2;
+ RETURN_IMPLICIT(multiLine);
+ }
+yy104: yych = *++YYCURSOR;
+ if(yybm[0+yych] & 64) goto yy114;
+ if(yych == ' ') goto yy112;
+ goto yy101;
+yy105: yych = *++YYCURSOR;
+yy106:
+#line 392
+ { RETURN_IMPLICIT(multiLine); }
+yy107: yych = *++YYCURSOR;
+ if(yych == '#') goto yy110;
+yy108:
+#line 398
+ { goto Plain3; }
+yy109: yych = *++YYCURSOR;
+ goto yy101;
+yy110: yych = *++YYCURSOR;
+yy111:
+#line 394
+ { eat_comments( parser );
+ RETURN_IMPLICIT(multiLine);
+ }
+yy112: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy113: if(yybm[0+yych] & 32) goto yy112;
+ goto yy103;
+yy114: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy115: if(yybm[0+yych] & 64) goto yy114;
+ goto yy103;
+yy116: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy117: if(yych == ' ') goto yy116;
+yy118:
+#line 386
+ { RETURN_IMPLICIT(multiLine); }
+yy119: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy120: if(yych == '\n') goto yy119;
+ goto yy118;
+yy121: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy122: if(yych == '\n') goto yy121;
+ if(yych != ' ') goto yy99;
+yy123: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy124: if(yybm[0+yych] & 128) goto yy123;
+ goto yy99;
+}
+#line 402
+
+ }
+
+SingleQuote:
+ {
+ int qidx = 0;
+ int qcapa = 100;
+ char *qstr = S_ALLOC_N( char, qcapa );
+
+SingleQuote2:
+ YYTOKTMP = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 192, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy125;
+yy126: ++YYCURSOR;
+yy125:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '\n'){
+ if(yych <= '\000') goto yy131;
+ if(yych <= '\t') goto yy132;
+ } else {
+ if(yych == '\'') goto yy129;
+ goto yy132;
+ }
+yy127: yych = *++YYCURSOR;
+ goto yy137;
+yy128:
+#line 416
+ { int indt_len;
+ int nl_count = 0;
+ SyckLevel *lvl;
+ GOBBLE_UP_INDENT( indt_len, YYTOKTMP );
+ lvl = CURRENT_LEVEL();
+
+ if ( lvl->status != syck_lvl_str )
+ {
+ ADD_LEVEL( indt_len, syck_lvl_str );
+ }
+ else if ( indt_len < lvl->spaces )
+ {
+ // Error!
+ }
+
+ while ( YYTOKTMP < YYCURSOR )
+ {
+ if ( *YYTOKTMP++ == '\n' )
+ nl_count++;
+ }
+ if ( nl_count <= 1 )
+ {
+ QUOTECAT(qstr, qcapa, qidx, ' ');
+ }
+ else
+ {
+ int i;
+ for ( i = 0; i < nl_count - 1; i++ )
+ {
+ QUOTECAT(qstr, qcapa, qidx, '\n');
+ }
+ }
+
+ goto SingleQuote2;
+ }
+yy129: yych = *++YYCURSOR;
+ if(yych == '\'') goto yy134;
+yy130:
+#line 456
+ { SyckLevel *lvl;
+ SyckNode *n = syck_alloc_str();
+ lvl = CURRENT_LEVEL();
+
+ if ( lvl->status == syck_lvl_str )
+ {
+ POP_LEVEL();
+ }
+ n->data.str->ptr = qstr;
+ n->data.str->len = qidx;
+ yylval->nodeData = n;
+ return PLAIN;
+ }
+yy131: yych = *++YYCURSOR;
+ goto yy130;
+yy132: yych = *++YYCURSOR;
+yy133:
+#line 470
+ { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
+ goto SingleQuote2;
+ }
+yy134: yych = *++YYCURSOR;
+yy135:
+#line 452
+ { QUOTECAT(qstr, qcapa, qidx, '\'');
+ goto SingleQuote2;
+ }
+yy136: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy137: if(yybm[0+yych] & 64) goto yy136;
+ if(yych != ' ') goto yy128;
+yy138: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy139: if(yybm[0+yych] & 128) goto yy138;
+ goto yy128;
+}
+#line 474
+
+
+ }
+
+
+DoubleQuote:
+ {
+ int keep_nl = 1;
+ int qidx = 0;
+ int qcapa = 100;
+ char *qstr = S_ALLOC_N( char, qcapa );
+
+DoubleQuote2:
+ YYTOKTMP = YYCURSOR;
+
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 192, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 160, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy140;
+yy141: ++YYCURSOR;
+yy140:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '!'){
+ if(yych <= '\000') goto yy146;
+ if(yych != '\n') goto yy149;
+ } else {
+ if(yych <= '"') goto yy148;
+ if(yych == '\\') goto yy144;
+ goto yy149;
+ }
+yy142: yych = *++YYCURSOR;
+ goto yy158;
+yy143:
+#line 492
+ { int indt_len;
+ int nl_count = 0;
+ SyckLevel *lvl;
+ GOBBLE_UP_INDENT( indt_len, YYTOKTMP );
+ lvl = CURRENT_LEVEL();
+
+ if ( lvl->status != syck_lvl_str )
+ {
+ ADD_LEVEL( indt_len, syck_lvl_str );
+ }
+ else if ( indt_len < lvl->spaces )
+ {
+ // Error!
+ }
+
+ if ( keep_nl == 1 )
+ {
+ while ( YYTOKTMP < YYCURSOR )
+ {
+ if ( *YYTOKTMP++ == '\n' )
+ nl_count++;
+ }
+ if ( nl_count <= 1 )
+ {
+ QUOTECAT(qstr, qcapa, qidx, ' ');
+ }
+ else
+ {
+ int i;
+ for ( i = 0; i < nl_count - 1; i++ )
+ {
+ QUOTECAT(qstr, qcapa, qidx, '\n');
+ }
+ }
+ }
+
+ keep_nl = 1;
+ goto DoubleQuote2;
+ }
+yy144: yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yybm[0+yych] & 32) goto yy150;
+ if(yych <= 'd'){
+ if(yych <= '"'){
+ if(yych == '\n') goto yy153;
+ if(yych >= '"') goto yy155;
+ } else {
+ if(yych <= '\\'){
+ if(yych >= '\\') goto yy155;
+ } else {
+ if(yych <= '`') goto yy145;
+ if(yych <= 'b') goto yy155;
+ }
+ }
+ } else {
+ if(yych <= 'r'){
+ if(yych <= 'm'){
+ if(yych <= 'f') goto yy155;
+ } else {
+ if(yych <= 'n') goto yy155;
+ if(yych >= 'r') goto yy155;
+ }
+ } else {
+ if(yych <= 't'){
+ if(yych >= 't') goto yy155;
+ } else {
+ if(yych == 'v') goto yy155;
+ }
+ }
+ }
+yy145:
+#line 567
+ { QUOTECAT(qstr, qcapa, qidx, *(YYCURSOR - 1));
+ goto DoubleQuote2;
+ }
+yy146: yych = *++YYCURSOR;
+yy147:
+#line 553
+ { SyckLevel *lvl;
+ SyckNode *n = syck_alloc_str();
+ lvl = CURRENT_LEVEL();
+
+ if ( lvl->status == syck_lvl_str )
+ {
+ POP_LEVEL();
+ }
+ n->data.str->ptr = qstr;
+ n->data.str->len = qidx;
+ yylval->nodeData = n;
+ return PLAIN;
+ }
+yy148: yych = *++YYCURSOR;
+ goto yy147;
+yy149: yych = *++YYCURSOR;
+ goto yy145;
+yy150: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy151: if(yybm[0+yych] & 32) goto yy150;
+ if(yych == '\n') goto yy153;
+yy152: YYCURSOR = YYMARKER;
+ switch(yyaccept){
+ case 0: goto yy145;
+ }
+yy153: yych = *++YYCURSOR;
+yy154:
+#line 548
+ { keep_nl = 0;
+ YYCURSOR--;
+ goto DoubleQuote2;
+ }
+yy155: yych = *++YYCURSOR;
+yy156:
+#line 532
+ { char ch = *( YYCURSOR - 1 );
+ switch ( ch )
+ {
+ case 'a': ch = '\a'; break;
+ case 'b': ch = '\b'; break;
+ case 'e': ch = '\e'; break;
+ case 'f': ch = '\f'; break;
+ case 'n': ch = '\n'; break;
+ case 'r': ch = '\r'; break;
+ case 't': ch = '\t'; break;
+ case 'v': ch = '\v'; break;
+ }
+ QUOTECAT(qstr, qcapa, qidx, ch);
+ goto DoubleQuote2;
+ }
+yy157: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy158: if(yybm[0+yych] & 64) goto yy157;
+ if(yych != ' ') goto yy143;
+yy159: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy160: if(yybm[0+yych] & 128) goto yy159;
+ goto yy143;
+}
+#line 571
+
+ }
+
+TransferMethod:
+ {
+ YYTOKTMP = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 64, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy161;
+yy162: ++YYCURSOR;
+yy161:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '\n'){
+ if(yych <= '\000') goto yy163;
+ if(yych <= '\t') goto yy167;
+ goto yy166;
+ } else {
+ if(yych == ' ') goto yy164;
+ goto yy167;
+ }
+yy163:yy164: yych = *++YYCURSOR;
+ goto yy172;
+yy165:
+#line 580
+ { SyckLevel *lvl;
+ YYCURSOR = YYTOKTMP;
+ if ( YYCURSOR == YYTOKEN + 1 )
+ {
+ return ITRANSFER;
+ }
+
+ lvl = CURRENT_LEVEL();
+
+ //
+ // URL Prefixing
+ //
+ if ( *(YYTOKEN + 1) == '^' )
+ {
+ yylval->name = S_ALLOC_N( char, YYCURSOR - YYTOKEN + strlen( lvl->domain ) );
+ yylval->name[0] = '\0';
+ strcat( yylval->name, lvl->domain );
+ strncat( yylval->name, YYTOKEN + 2, YYCURSOR - YYTOKEN - 2 );
+ }
+ else
+ {
+ char *carat = YYTOKEN + 1;
+ while ( (++carat) < YYCURSOR )
+ {
+ if ( *carat == '^' )
+ break;
+ }
+
+ if ( carat < YYCURSOR )
+ {
+ lvl->domain = syck_strndup( YYTOKEN + 1, carat - YYTOKEN - 1 );
+ yylval->name = S_ALLOC_N( char, YYCURSOR - carat + strlen( lvl->domain ) );
+ yylval->name[0] = '\0';
+ strcat( yylval->name, lvl->domain );
+ strncat( yylval->name, carat + 1, YYCURSOR - carat - 1 );
+ }
+ else
+ {
+ yylval->name = syck_strndup( YYTOKEN + 1, YYCURSOR - YYTOKEN - 1 );
+ }
+ }
+ return TRANSFER;
+ }
+yy166: yych = *++YYCURSOR;
+ goto yy170;
+yy167: yych = *++YYCURSOR;
+yy168:
+#line 624
+ { goto TransferMethod; }
+yy169: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy170: if(yybm[0+yych] & 64) goto yy169;
+ goto yy165;
+yy171: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy172: if(yybm[0+yych] & 128) goto yy171;
+ goto yy165;
+}
+#line 626
+
+ }
+
+ScalarBlock:
+ {
+ int blockType = 0;
+ int nlDoWhat = 0;
+ int forceIndent = -1;
+ char *yyt = YYTOKEN;
+ SyckLevel *lvl = CURRENT_LEVEL();
+ int parentIndent;
+ GET_TRUE_INDENT(parentIndent);
+
+ switch ( *yyt )
+ {
+ case '|': blockType = BLOCK_LIT; break;
+ case '>': blockType = BLOCK_FOLD; break;
+ }
+
+ while ( ++yyt <= YYCURSOR )
+ {
+ if ( *yyt == '-' )
+ {
+ nlDoWhat = NL_CHOMP;
+ }
+ else if ( *yyt == '+' )
+ {
+ nlDoWhat = NL_KEEP;
+ }
+ else if ( isdigit( *yyt ) )
+ {
+ forceIndent = strtol( yyt, NULL, 10 ) + parentIndent;
+ }
+ }
+
+ YYTOKEN = YYCURSOR;
+
+ScalarBlock2:
+ YYTOKTMP = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 192, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy173;
+yy174: ++YYCURSOR;
+yy173:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '\n'){
+ if(yych <= '\000') goto yy177;
+ if(yych <= '\t') goto yy181;
+ } else {
+ if(yych == '#') goto yy179;
+ goto yy181;
+ }
+yy175: yych = *++YYCURSOR;
+ goto yy184;
+yy176:
+#line 668
+ { int indt_len;
+ GOBBLE_UP_INDENT( indt_len, YYTOKTMP );
+ lvl = CURRENT_LEVEL();
+
+ if ( indt_len > parentIndent && lvl->status != syck_lvl_block )
+ {
+ ADD_LEVEL( forceIndent > 0 ? forceIndent : indt_len, syck_lvl_block );
+ }
+
+ lvl = CURRENT_LEVEL();
+ if ( lvl->status != syck_lvl_block )
+ {
+ yylval->nodeData = syck_new_str2( YYTOKEN, 0 );
+ YYCURSOR = YYTOKTMP;
+ return BLOCK;
+ }
+ else if ( indt_len < lvl->spaces )
+ {
+ YYCURSOR--;
+ yylval->nodeData = syck_new_str2( YYTOKEN, YYCURSOR - YYTOKEN );
+ syck_fold_format( yylval->nodeData->data.str, blockType, lvl->spaces, nlDoWhat );
+ if ( lvl->status == syck_lvl_block )
+ {
+ POP_LEVEL();
+ }
+ YYCURSOR = YYTOKTMP;
+ return BLOCK;
+ }
+ goto ScalarBlock2;
+ }
+yy177: yych = *++YYCURSOR;
+yy178:
+#line 700
+ { lvl = CURRENT_LEVEL();
+ YYCURSOR--;
+ yylval->nodeData = syck_new_str2( YYTOKEN, YYCURSOR - YYTOKEN );
+ syck_fold_format( yylval->nodeData->data.str, blockType, lvl->spaces, nlDoWhat );
+ POP_LEVEL();
+ return BLOCK;
+ }
+yy179: yych = *++YYCURSOR;
+yy180:
+#line 708
+ { lvl = CURRENT_LEVEL();
+ if ( lvl->status != syck_lvl_block )
+ {
+ eat_comments( parser );
+ YYTOKEN = YYCURSOR;
+ }
+ goto ScalarBlock2;
+ }
+yy181: yych = *++YYCURSOR;
+yy182:
+#line 717
+ { goto ScalarBlock2; }
+yy183: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy184: if(yybm[0+yych] & 64) goto yy183;
+ if(yych != ' ') goto yy176;
+yy185: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy186: if(yybm[0+yych] & 128) goto yy185;
+ goto yy176;
+}
+#line 719
+
+ }
+
+}
+
+void
+eat_comments( SyckParser *parser )
+{
+ char *tok;
+
+Comment:
+ {
+ tok = YYCURSOR;
+
+{
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 128, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ goto yy187;
+yy188: ++YYCURSOR;
+yy187:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '\000') goto yy189;
+ if(yych == '\n') goto yy191;
+ goto yy192;
+yy189: yych = *++YYCURSOR;
+yy190:
+#line 735
+ { SyckLevel *lvl = CURRENT_LEVEL();
+ YYCURSOR = tok;
+ return;
+ }
+yy191: yych = *++YYCURSOR;
+ goto yy195;
+yy192: yych = *++YYCURSOR;
+yy193:
+#line 740
+ { goto Comment;
+ }
+yy194: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy195: if(yybm[0+yych] & 128) goto yy194;
+ goto yy190;
+}
+#line 743
+
+
+ }
+
+}
+
+int
+yywrap()
+{
+ return 1;
+}
+
+void
+yyerror( char *msg )
+{
+ if ( syck_parser_ptr->error_handler == NULL )
+ syck_parser_ptr->error_handler = syck_default_error_handler;
+
+ syck_parser_ptr->root = NULL;
+ (syck_parser_ptr->error_handler)(syck_parser_ptr, msg);
+}
+