[77] | 1 | /* A Bison parser, made by GNU Bison 2.3. */ |
---|
| 2 | |
---|
| 3 | /* Skeleton implementation for Bison's Yacc-like parsers in C |
---|
| 4 | |
---|
| 5 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
---|
| 6 | Free Software Foundation, Inc. |
---|
| 7 | |
---|
| 8 | This program is free software; you can redistribute it and/or modify |
---|
| 9 | it under the terms of the GNU General Public License as published by |
---|
| 10 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 11 | any later version. |
---|
| 12 | |
---|
| 13 | This program is distributed in the hope that it will be useful, |
---|
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | GNU General Public License for more details. |
---|
| 17 | |
---|
| 18 | You should have received a copy of the GNU General Public License |
---|
| 19 | along with this program; if not, write to the Free Software |
---|
| 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
---|
| 21 | Boston, MA 02110-1301, USA. */ |
---|
| 22 | |
---|
| 23 | /* As a special exception, you may create a larger work that contains |
---|
| 24 | part or all of the Bison parser skeleton and distribute that work |
---|
| 25 | under terms of your choice, so long as that work isn't itself a |
---|
| 26 | parser generator using the skeleton or a modified version thereof |
---|
| 27 | as a parser skeleton. Alternatively, if you modify or redistribute |
---|
| 28 | the parser skeleton itself, you may (at your option) remove this |
---|
| 29 | special exception, which will cause the skeleton and the resulting |
---|
| 30 | Bison output files to be licensed under the GNU General Public |
---|
| 31 | License without this special exception. |
---|
| 32 | |
---|
| 33 | This special exception was added by the Free Software Foundation in |
---|
| 34 | version 2.2 of Bison. */ |
---|
| 35 | |
---|
| 36 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
---|
| 37 | simplifying the original so-called "semantic" parser. */ |
---|
| 38 | |
---|
| 39 | /* All symbols defined below should begin with yy or YY, to avoid |
---|
| 40 | infringing on user name space. This should be done even for local |
---|
| 41 | variables, as they might otherwise be expanded by user macros. |
---|
| 42 | There are some unavoidable exceptions within include files to |
---|
| 43 | define necessary library symbols; they are noted "INFRINGES ON |
---|
| 44 | USER NAME SPACE" below. */ |
---|
| 45 | |
---|
| 46 | /* Identify Bison output. */ |
---|
| 47 | #define YYBISON 1 |
---|
| 48 | |
---|
| 49 | /* Bison version. */ |
---|
| 50 | #define YYBISON_VERSION "2.3" |
---|
| 51 | |
---|
| 52 | /* Skeleton name. */ |
---|
| 53 | #define YYSKELETON_NAME "yacc.c" |
---|
| 54 | |
---|
| 55 | /* Pure parsers. */ |
---|
| 56 | #define YYPURE 1 |
---|
| 57 | |
---|
| 58 | /* Using locations. */ |
---|
| 59 | #define YYLSP_NEEDED 1 |
---|
| 60 | |
---|
| 61 | /* Substitute the variable and function names. */ |
---|
| 62 | #define yyparse fsd_conf_parse |
---|
| 63 | #define yylex fsd_conf_lex |
---|
| 64 | #define yyerror fsd_conf_error |
---|
| 65 | #define yylval fsd_conf_lval |
---|
| 66 | #define yychar fsd_conf_char |
---|
| 67 | #define yydebug fsd_conf_debug |
---|
| 68 | #define yynerrs fsd_conf_nerrs |
---|
| 69 | #define yylloc fsd_conf_lloc |
---|
| 70 | |
---|
| 71 | /* Tokens. */ |
---|
| 72 | #ifndef YYTOKENTYPE |
---|
| 73 | # define YYTOKENTYPE |
---|
| 74 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
---|
| 75 | know about them. */ |
---|
| 76 | enum yytokentype { |
---|
| 77 | INTEGER = 258, |
---|
| 78 | STRING = 259, |
---|
| 79 | LEXER_ERROR = 260 |
---|
| 80 | }; |
---|
| 81 | #endif |
---|
| 82 | /* Tokens. */ |
---|
| 83 | #define INTEGER 258 |
---|
| 84 | #define STRING 259 |
---|
| 85 | #define LEXER_ERROR 260 |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | /* Copy the first part of user declarations. */ |
---|
| 91 | #line 20 "conf_tab.y" |
---|
| 92 | |
---|
| 93 | #ifdef HAVE_MALLOC_H |
---|
| 94 | # include <malloc.h> |
---|
| 95 | #endif |
---|
| 96 | #include <drmaa_utils/conf_impl.h> |
---|
| 97 | #include <drmaa_utils/conf_tab.h> |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | /* Enabling traces. */ |
---|
| 101 | #ifndef YYDEBUG |
---|
| 102 | # define YYDEBUG 0 |
---|
| 103 | #endif |
---|
| 104 | |
---|
| 105 | /* Enabling verbose error messages. */ |
---|
| 106 | #ifdef YYERROR_VERBOSE |
---|
| 107 | # undef YYERROR_VERBOSE |
---|
| 108 | # define YYERROR_VERBOSE 1 |
---|
| 109 | #else |
---|
| 110 | # define YYERROR_VERBOSE 0 |
---|
| 111 | #endif |
---|
| 112 | |
---|
| 113 | /* Enabling the token table. */ |
---|
| 114 | #ifndef YYTOKEN_TABLE |
---|
| 115 | # define YYTOKEN_TABLE 0 |
---|
| 116 | #endif |
---|
| 117 | |
---|
| 118 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
---|
| 119 | typedef union YYSTYPE |
---|
| 120 | #line 36 "conf_tab.y" |
---|
| 121 | { |
---|
| 122 | int integer; |
---|
| 123 | char *string; |
---|
| 124 | fsd_conf_option_t *option; |
---|
| 125 | fsd_conf_dict_t *dictionary; |
---|
| 126 | fsd_conf_pair_t pair; |
---|
| 127 | } |
---|
| 128 | /* Line 193 of yacc.c. */ |
---|
| 129 | #line 130 "conf_tab.c" |
---|
| 130 | YYSTYPE; |
---|
| 131 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
---|
| 132 | # define YYSTYPE_IS_DECLARED 1 |
---|
| 133 | # define YYSTYPE_IS_TRIVIAL 1 |
---|
| 134 | #endif |
---|
| 135 | |
---|
| 136 | #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED |
---|
| 137 | typedef struct YYLTYPE |
---|
| 138 | { |
---|
| 139 | int first_line; |
---|
| 140 | int first_column; |
---|
| 141 | int last_line; |
---|
| 142 | int last_column; |
---|
| 143 | } YYLTYPE; |
---|
| 144 | # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ |
---|
| 145 | # define YYLTYPE_IS_DECLARED 1 |
---|
| 146 | # define YYLTYPE_IS_TRIVIAL 1 |
---|
| 147 | #endif |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | /* Copy the second part of user declarations. */ |
---|
| 151 | |
---|
| 152 | |
---|
| 153 | /* Line 216 of yacc.c. */ |
---|
| 154 | #line 155 "conf_tab.c" |
---|
| 155 | |
---|
| 156 | #ifdef short |
---|
| 157 | # undef short |
---|
| 158 | #endif |
---|
| 159 | |
---|
| 160 | #ifdef YYTYPE_UINT8 |
---|
| 161 | typedef YYTYPE_UINT8 yytype_uint8; |
---|
| 162 | #else |
---|
| 163 | typedef unsigned char yytype_uint8; |
---|
| 164 | #endif |
---|
| 165 | |
---|
| 166 | #ifdef YYTYPE_INT8 |
---|
| 167 | typedef YYTYPE_INT8 yytype_int8; |
---|
| 168 | #elif (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 169 | || defined __cplusplus || defined _MSC_VER) |
---|
| 170 | typedef signed char yytype_int8; |
---|
| 171 | #else |
---|
| 172 | typedef short int yytype_int8; |
---|
| 173 | #endif |
---|
| 174 | |
---|
| 175 | #ifdef YYTYPE_UINT16 |
---|
| 176 | typedef YYTYPE_UINT16 yytype_uint16; |
---|
| 177 | #else |
---|
| 178 | typedef unsigned short int yytype_uint16; |
---|
| 179 | #endif |
---|
| 180 | |
---|
| 181 | #ifdef YYTYPE_INT16 |
---|
| 182 | typedef YYTYPE_INT16 yytype_int16; |
---|
| 183 | #else |
---|
| 184 | typedef short int yytype_int16; |
---|
| 185 | #endif |
---|
| 186 | |
---|
| 187 | #ifndef YYSIZE_T |
---|
| 188 | # ifdef __SIZE_TYPE__ |
---|
| 189 | # define YYSIZE_T __SIZE_TYPE__ |
---|
| 190 | # elif defined size_t |
---|
| 191 | # define YYSIZE_T size_t |
---|
| 192 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 193 | || defined __cplusplus || defined _MSC_VER) |
---|
| 194 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 195 | # define YYSIZE_T size_t |
---|
| 196 | # else |
---|
| 197 | # define YYSIZE_T unsigned int |
---|
| 198 | # endif |
---|
| 199 | #endif |
---|
| 200 | |
---|
| 201 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
---|
| 202 | |
---|
| 203 | #ifndef YY_ |
---|
| 204 | # if defined YYENABLE_NLS && YYENABLE_NLS |
---|
| 205 | # if ENABLE_NLS |
---|
| 206 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 207 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
---|
| 208 | # endif |
---|
| 209 | # endif |
---|
| 210 | # ifndef YY_ |
---|
| 211 | # define YY_(msgid) msgid |
---|
| 212 | # endif |
---|
| 213 | #endif |
---|
| 214 | |
---|
| 215 | /* Suppress unused-variable warnings by "using" E. */ |
---|
| 216 | #if ! defined lint || defined __GNUC__ |
---|
| 217 | # define YYUSE(e) ((void) (e)) |
---|
| 218 | #else |
---|
| 219 | # define YYUSE(e) /* empty */ |
---|
| 220 | #endif |
---|
| 221 | |
---|
| 222 | /* Identity function, used to suppress warnings about constant conditions. */ |
---|
| 223 | #ifndef lint |
---|
| 224 | # define YYID(n) (n) |
---|
| 225 | #else |
---|
| 226 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 227 | || defined __cplusplus || defined _MSC_VER) |
---|
| 228 | static int |
---|
| 229 | YYID (int i) |
---|
| 230 | #else |
---|
| 231 | static int |
---|
| 232 | YYID (i) |
---|
| 233 | int i; |
---|
| 234 | #endif |
---|
| 235 | { |
---|
| 236 | return i; |
---|
| 237 | } |
---|
| 238 | #endif |
---|
| 239 | |
---|
| 240 | #if ! defined yyoverflow || YYERROR_VERBOSE |
---|
| 241 | |
---|
| 242 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
---|
| 243 | |
---|
| 244 | # ifdef YYSTACK_USE_ALLOCA |
---|
| 245 | # if YYSTACK_USE_ALLOCA |
---|
| 246 | # ifdef __GNUC__ |
---|
| 247 | # define YYSTACK_ALLOC __builtin_alloca |
---|
| 248 | # elif defined __BUILTIN_VA_ARG_INCR |
---|
| 249 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 250 | # elif defined _AIX |
---|
| 251 | # define YYSTACK_ALLOC __alloca |
---|
| 252 | # elif defined _MSC_VER |
---|
| 253 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 254 | # define alloca _alloca |
---|
| 255 | # else |
---|
| 256 | # define YYSTACK_ALLOC alloca |
---|
| 257 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 258 | || defined __cplusplus || defined _MSC_VER) |
---|
| 259 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 260 | # ifndef _STDLIB_H |
---|
| 261 | # define _STDLIB_H 1 |
---|
| 262 | # endif |
---|
| 263 | # endif |
---|
| 264 | # endif |
---|
| 265 | # endif |
---|
| 266 | # endif |
---|
| 267 | |
---|
| 268 | # ifdef YYSTACK_ALLOC |
---|
| 269 | /* Pacify GCC's `empty if-body' warning. */ |
---|
| 270 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
---|
| 271 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
| 272 | /* The OS might guarantee only one guard page at the bottom of the stack, |
---|
| 273 | and a page size can be as small as 4096 bytes. So we cannot safely |
---|
| 274 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
---|
| 275 | to allow for a few compiler-allocated temporary stack slots. */ |
---|
| 276 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
---|
| 277 | # endif |
---|
| 278 | # else |
---|
| 279 | # define YYSTACK_ALLOC YYMALLOC |
---|
| 280 | # define YYSTACK_FREE YYFREE |
---|
| 281 | # ifndef YYSTACK_ALLOC_MAXIMUM |
---|
| 282 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
---|
| 283 | # endif |
---|
| 284 | # if (defined __cplusplus && ! defined _STDLIB_H \ |
---|
| 285 | && ! ((defined YYMALLOC || defined malloc) \ |
---|
| 286 | && (defined YYFREE || defined free))) |
---|
| 287 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 288 | # ifndef _STDLIB_H |
---|
| 289 | # define _STDLIB_H 1 |
---|
| 290 | # endif |
---|
| 291 | # endif |
---|
| 292 | # ifndef YYMALLOC |
---|
| 293 | # define YYMALLOC malloc |
---|
| 294 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 295 | || defined __cplusplus || defined _MSC_VER) |
---|
| 296 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
---|
| 297 | # endif |
---|
| 298 | # endif |
---|
| 299 | # ifndef YYFREE |
---|
| 300 | # define YYFREE free |
---|
| 301 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 302 | || defined __cplusplus || defined _MSC_VER) |
---|
| 303 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
---|
| 304 | # endif |
---|
| 305 | # endif |
---|
| 306 | # endif |
---|
| 307 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
---|
| 308 | |
---|
| 309 | |
---|
| 310 | #if (! defined yyoverflow \ |
---|
| 311 | && (! defined __cplusplus \ |
---|
| 312 | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ |
---|
| 313 | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
---|
| 314 | |
---|
| 315 | /* A type that is properly aligned for any stack member. */ |
---|
| 316 | union yyalloc |
---|
| 317 | { |
---|
| 318 | yytype_int16 yyss; |
---|
| 319 | YYSTYPE yyvs; |
---|
| 320 | YYLTYPE yyls; |
---|
| 321 | }; |
---|
| 322 | |
---|
| 323 | /* The size of the maximum gap between one aligned stack and the next. */ |
---|
| 324 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
---|
| 325 | |
---|
| 326 | /* The size of an array large to enough to hold all stacks, each with |
---|
| 327 | N elements. */ |
---|
| 328 | # define YYSTACK_BYTES(N) \ |
---|
| 329 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
---|
| 330 | + 2 * YYSTACK_GAP_MAXIMUM) |
---|
| 331 | |
---|
| 332 | /* Copy COUNT objects from FROM to TO. The source and destination do |
---|
| 333 | not overlap. */ |
---|
| 334 | # ifndef YYCOPY |
---|
| 335 | # if defined __GNUC__ && 1 < __GNUC__ |
---|
| 336 | # define YYCOPY(To, From, Count) \ |
---|
| 337 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
---|
| 338 | # else |
---|
| 339 | # define YYCOPY(To, From, Count) \ |
---|
| 340 | do \ |
---|
| 341 | { \ |
---|
| 342 | YYSIZE_T yyi; \ |
---|
| 343 | for (yyi = 0; yyi < (Count); yyi++) \ |
---|
| 344 | (To)[yyi] = (From)[yyi]; \ |
---|
| 345 | } \ |
---|
| 346 | while (YYID (0)) |
---|
| 347 | # endif |
---|
| 348 | # endif |
---|
| 349 | |
---|
| 350 | /* Relocate STACK from its old location to the new one. The |
---|
| 351 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
---|
| 352 | elements in the stack, and YYPTR gives the new location of the |
---|
| 353 | stack. Advance YYPTR to a properly aligned location for the next |
---|
| 354 | stack. */ |
---|
| 355 | # define YYSTACK_RELOCATE(Stack) \ |
---|
| 356 | do \ |
---|
| 357 | { \ |
---|
| 358 | YYSIZE_T yynewbytes; \ |
---|
| 359 | YYCOPY (&yyptr->Stack, Stack, yysize); \ |
---|
| 360 | Stack = &yyptr->Stack; \ |
---|
| 361 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
---|
| 362 | yyptr += yynewbytes / sizeof (*yyptr); \ |
---|
| 363 | } \ |
---|
| 364 | while (YYID (0)) |
---|
| 365 | |
---|
| 366 | #endif |
---|
| 367 | |
---|
| 368 | /* YYFINAL -- State number of the termination state. */ |
---|
| 369 | #define YYFINAL 11 |
---|
| 370 | /* YYLAST -- Last index in YYTABLE. */ |
---|
| 371 | #define YYLAST 17 |
---|
| 372 | |
---|
| 373 | /* YYNTOKENS -- Number of terminals. */ |
---|
| 374 | #define YYNTOKENS 10 |
---|
| 375 | /* YYNNTS -- Number of nonterminals. */ |
---|
| 376 | #define YYNNTS 8 |
---|
| 377 | /* YYNRULES -- Number of rules. */ |
---|
| 378 | #define YYNRULES 14 |
---|
| 379 | /* YYNRULES -- Number of states. */ |
---|
| 380 | #define YYNSTATES 19 |
---|
| 381 | |
---|
| 382 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
---|
| 383 | #define YYUNDEFTOK 2 |
---|
| 384 | #define YYMAXUTOK 260 |
---|
| 385 | |
---|
| 386 | #define YYTRANSLATE(YYX) \ |
---|
| 387 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
---|
| 388 | |
---|
| 389 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
---|
| 390 | static const yytype_uint8 yytranslate[] = |
---|
| 391 | { |
---|
| 392 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 393 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 394 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 395 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 396 | 2, 2, 2, 2, 8, 2, 2, 2, 2, 2, |
---|
| 397 | 2, 2, 2, 2, 2, 2, 2, 2, 9, 2, |
---|
| 398 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 399 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 400 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 401 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 402 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 403 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 404 | 2, 2, 2, 6, 2, 7, 2, 2, 2, 2, |
---|
| 405 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 406 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 407 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 408 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 409 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 410 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 411 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 412 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 413 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 414 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 415 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 416 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
| 417 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
---|
| 418 | 5 |
---|
| 419 | }; |
---|
| 420 | |
---|
| 421 | #if YYDEBUG |
---|
| 422 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
---|
| 423 | YYRHS. */ |
---|
| 424 | static const yytype_uint8 yyprhs[] = |
---|
| 425 | { |
---|
| 426 | 0, 0, 3, 5, 7, 9, 13, 15, 18, 19, |
---|
| 427 | 21, 25, 29, 31, 33 |
---|
| 428 | }; |
---|
| 429 | |
---|
| 430 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
---|
| 431 | static const yytype_int8 yyrhs[] = |
---|
| 432 | { |
---|
| 433 | 11, 0, -1, 12, -1, 13, -1, 14, -1, 6, |
---|
| 434 | 14, 7, -1, 15, -1, 15, 8, -1, -1, 16, |
---|
| 435 | -1, 15, 8, 16, -1, 4, 9, 17, -1, 3, |
---|
| 436 | -1, 4, -1, 13, -1 |
---|
| 437 | }; |
---|
| 438 | |
---|
| 439 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
---|
| 440 | static const yytype_uint8 yyrline[] = |
---|
| 441 | { |
---|
| 442 | 0, 58, 58, 62, 63, 67, 71, 72, 73, 80, |
---|
| 443 | 95, 106, 110, 119, 128 |
---|
| 444 | }; |
---|
| 445 | #endif |
---|
| 446 | |
---|
| 447 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
---|
| 448 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
---|
| 449 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
---|
| 450 | static const char *const yytname[] = |
---|
| 451 | { |
---|
| 452 | "$end", "error", "$undefined", "INTEGER", "STRING", "LEXER_ERROR", |
---|
| 453 | "'{'", "'}'", "','", "':'", "$accept", "start", "conf", "dict", |
---|
| 454 | "dict_body", "pair_list", "pair", "value", 0 |
---|
| 455 | }; |
---|
| 456 | #endif |
---|
| 457 | |
---|
| 458 | # ifdef YYPRINT |
---|
| 459 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
---|
| 460 | token YYLEX-NUM. */ |
---|
| 461 | static const yytype_uint16 yytoknum[] = |
---|
| 462 | { |
---|
| 463 | 0, 256, 257, 258, 259, 260, 123, 125, 44, 58 |
---|
| 464 | }; |
---|
| 465 | # endif |
---|
| 466 | |
---|
| 467 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
---|
| 468 | static const yytype_uint8 yyr1[] = |
---|
| 469 | { |
---|
| 470 | 0, 10, 11, 12, 12, 13, 14, 14, 14, 15, |
---|
| 471 | 15, 16, 17, 17, 17 |
---|
| 472 | }; |
---|
| 473 | |
---|
| 474 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
---|
| 475 | static const yytype_uint8 yyr2[] = |
---|
| 476 | { |
---|
| 477 | 0, 2, 1, 1, 1, 3, 1, 2, 0, 1, |
---|
| 478 | 3, 3, 1, 1, 1 |
---|
| 479 | }; |
---|
| 480 | |
---|
| 481 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
---|
| 482 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero |
---|
| 483 | means the default is an error. */ |
---|
| 484 | static const yytype_uint8 yydefact[] = |
---|
| 485 | { |
---|
| 486 | 8, 0, 8, 0, 2, 3, 4, 6, 9, 0, |
---|
| 487 | 0, 1, 7, 12, 13, 14, 11, 5, 10 |
---|
| 488 | }; |
---|
| 489 | |
---|
| 490 | /* YYDEFGOTO[NTERM-NUM]. */ |
---|
| 491 | static const yytype_int8 yydefgoto[] = |
---|
| 492 | { |
---|
| 493 | -1, 3, 4, 5, 6, 7, 8, 16 |
---|
| 494 | }; |
---|
| 495 | |
---|
| 496 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
---|
| 497 | STATE-NUM. */ |
---|
| 498 | #define YYPACT_NINF -5 |
---|
| 499 | static const yytype_int8 yypact[] = |
---|
| 500 | { |
---|
| 501 | -2, -4, 2, 7, -5, -5, -5, 0, -5, -3, |
---|
| 502 | 3, -5, 2, -5, -5, -5, -5, -5, -5 |
---|
| 503 | }; |
---|
| 504 | |
---|
| 505 | /* YYPGOTO[NTERM-NUM]. */ |
---|
| 506 | static const yytype_int8 yypgoto[] = |
---|
| 507 | { |
---|
| 508 | -5, -5, -5, 4, 9, -5, 5, -5 |
---|
| 509 | }; |
---|
| 510 | |
---|
| 511 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
---|
| 512 | positive, shift that token. If negative, reduce the rule which |
---|
| 513 | number is the opposite. If zero, do what YYDEFACT says. |
---|
| 514 | If YYTABLE_NINF, syntax error. */ |
---|
| 515 | #define YYTABLE_NINF -1 |
---|
| 516 | static const yytype_uint8 yytable[] = |
---|
| 517 | { |
---|
| 518 | 13, 14, 1, 2, 2, 9, 1, 11, 12, 0, |
---|
| 519 | 17, 10, 0, 15, 0, 0, 0, 18 |
---|
| 520 | }; |
---|
| 521 | |
---|
| 522 | static const yytype_int8 yycheck[] = |
---|
| 523 | { |
---|
| 524 | 3, 4, 4, 6, 6, 9, 4, 0, 8, -1, |
---|
| 525 | 7, 2, -1, 9, -1, -1, -1, 12 |
---|
| 526 | }; |
---|
| 527 | |
---|
| 528 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
---|
| 529 | symbol of state STATE-NUM. */ |
---|
| 530 | static const yytype_uint8 yystos[] = |
---|
| 531 | { |
---|
| 532 | 0, 4, 6, 11, 12, 13, 14, 15, 16, 9, |
---|
| 533 | 14, 0, 8, 3, 4, 13, 17, 7, 16 |
---|
| 534 | }; |
---|
| 535 | |
---|
| 536 | #define yyerrok (yyerrstatus = 0) |
---|
| 537 | #define yyclearin (yychar = YYEMPTY) |
---|
| 538 | #define YYEMPTY (-2) |
---|
| 539 | #define YYEOF 0 |
---|
| 540 | |
---|
| 541 | #define YYACCEPT goto yyacceptlab |
---|
| 542 | #define YYABORT goto yyabortlab |
---|
| 543 | #define YYERROR goto yyerrorlab |
---|
| 544 | |
---|
| 545 | |
---|
| 546 | /* Like YYERROR except do call yyerror. This remains here temporarily |
---|
| 547 | to ease the transition to the new meaning of YYERROR, for GCC. |
---|
| 548 | Once GCC version 2 has supplanted version 1, this can go. */ |
---|
| 549 | |
---|
| 550 | #define YYFAIL goto yyerrlab |
---|
| 551 | |
---|
| 552 | #define YYRECOVERING() (!!yyerrstatus) |
---|
| 553 | |
---|
| 554 | #define YYBACKUP(Token, Value) \ |
---|
| 555 | do \ |
---|
| 556 | if (yychar == YYEMPTY && yylen == 1) \ |
---|
| 557 | { \ |
---|
| 558 | yychar = (Token); \ |
---|
| 559 | yylval = (Value); \ |
---|
| 560 | yytoken = YYTRANSLATE (yychar); \ |
---|
| 561 | YYPOPSTACK (1); \ |
---|
| 562 | goto yybackup; \ |
---|
| 563 | } \ |
---|
| 564 | else \ |
---|
| 565 | { \ |
---|
| 566 | yyerror (&yylloc, parser, lexer, YY_("syntax error: cannot back up")); \ |
---|
| 567 | YYERROR; \ |
---|
| 568 | } \ |
---|
| 569 | while (YYID (0)) |
---|
| 570 | |
---|
| 571 | |
---|
| 572 | #define YYTERROR 1 |
---|
| 573 | #define YYERRCODE 256 |
---|
| 574 | |
---|
| 575 | |
---|
| 576 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
---|
| 577 | If N is 0, then set CURRENT to the empty location which ends |
---|
| 578 | the previous symbol: RHS[0] (always defined). */ |
---|
| 579 | |
---|
| 580 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
---|
| 581 | #ifndef YYLLOC_DEFAULT |
---|
| 582 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
---|
| 583 | do \ |
---|
| 584 | if (YYID (N)) \ |
---|
| 585 | { \ |
---|
| 586 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
---|
| 587 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
---|
| 588 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
---|
| 589 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
---|
| 590 | } \ |
---|
| 591 | else \ |
---|
| 592 | { \ |
---|
| 593 | (Current).first_line = (Current).last_line = \ |
---|
| 594 | YYRHSLOC (Rhs, 0).last_line; \ |
---|
| 595 | (Current).first_column = (Current).last_column = \ |
---|
| 596 | YYRHSLOC (Rhs, 0).last_column; \ |
---|
| 597 | } \ |
---|
| 598 | while (YYID (0)) |
---|
| 599 | #endif |
---|
| 600 | |
---|
| 601 | |
---|
| 602 | /* YY_LOCATION_PRINT -- Print the location on the stream. |
---|
| 603 | This macro was not mandated originally: define only if we know |
---|
| 604 | we won't break user code: when these are the locations we know. */ |
---|
| 605 | |
---|
| 606 | #ifndef YY_LOCATION_PRINT |
---|
| 607 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
---|
| 608 | # define YY_LOCATION_PRINT(File, Loc) \ |
---|
| 609 | fprintf (File, "%d.%d-%d.%d", \ |
---|
| 610 | (Loc).first_line, (Loc).first_column, \ |
---|
| 611 | (Loc).last_line, (Loc).last_column) |
---|
| 612 | # else |
---|
| 613 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
---|
| 614 | # endif |
---|
| 615 | #endif |
---|
| 616 | |
---|
| 617 | |
---|
| 618 | /* YYLEX -- calling `yylex' with the right arguments. */ |
---|
| 619 | |
---|
| 620 | #ifdef YYLEX_PARAM |
---|
| 621 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
---|
| 622 | #else |
---|
| 623 | # define YYLEX yylex (&yylval, &yylloc, lexer) |
---|
| 624 | #endif |
---|
| 625 | |
---|
| 626 | /* Enable debugging if requested. */ |
---|
| 627 | #if YYDEBUG |
---|
| 628 | |
---|
| 629 | # ifndef YYFPRINTF |
---|
| 630 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
---|
| 631 | # define YYFPRINTF fprintf |
---|
| 632 | # endif |
---|
| 633 | |
---|
| 634 | # define YYDPRINTF(Args) \ |
---|
| 635 | do { \ |
---|
| 636 | if (yydebug) \ |
---|
| 637 | YYFPRINTF Args; \ |
---|
| 638 | } while (YYID (0)) |
---|
| 639 | |
---|
| 640 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
---|
| 641 | do { \ |
---|
| 642 | if (yydebug) \ |
---|
| 643 | { \ |
---|
| 644 | YYFPRINTF (stderr, "%s ", Title); \ |
---|
| 645 | yy_symbol_print (stderr, \ |
---|
| 646 | Type, Value, Location, parser, lexer); \ |
---|
| 647 | YYFPRINTF (stderr, "\n"); \ |
---|
| 648 | } \ |
---|
| 649 | } while (YYID (0)) |
---|
| 650 | |
---|
| 651 | |
---|
| 652 | /*--------------------------------. |
---|
| 653 | | Print this symbol on YYOUTPUT. | |
---|
| 654 | `--------------------------------*/ |
---|
| 655 | |
---|
| 656 | /*ARGSUSED*/ |
---|
| 657 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 658 | || defined __cplusplus || defined _MSC_VER) |
---|
| 659 | static void |
---|
| 660 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer) |
---|
| 661 | #else |
---|
| 662 | static void |
---|
| 663 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parser, lexer) |
---|
| 664 | FILE *yyoutput; |
---|
| 665 | int yytype; |
---|
| 666 | YYSTYPE const * const yyvaluep; |
---|
| 667 | YYLTYPE const * const yylocationp; |
---|
| 668 | fsd_conf_parser_t *parser; |
---|
| 669 | fsd_conf_lexer_t *lexer; |
---|
| 670 | #endif |
---|
| 671 | { |
---|
| 672 | if (!yyvaluep) |
---|
| 673 | return; |
---|
| 674 | YYUSE (yylocationp); |
---|
| 675 | YYUSE (parser); |
---|
| 676 | YYUSE (lexer); |
---|
| 677 | # ifdef YYPRINT |
---|
| 678 | if (yytype < YYNTOKENS) |
---|
| 679 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
---|
| 680 | # else |
---|
| 681 | YYUSE (yyoutput); |
---|
| 682 | # endif |
---|
| 683 | switch (yytype) |
---|
| 684 | { |
---|
| 685 | default: |
---|
| 686 | break; |
---|
| 687 | } |
---|
| 688 | } |
---|
| 689 | |
---|
| 690 | |
---|
| 691 | /*--------------------------------. |
---|
| 692 | | Print this symbol on YYOUTPUT. | |
---|
| 693 | `--------------------------------*/ |
---|
| 694 | |
---|
| 695 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 696 | || defined __cplusplus || defined _MSC_VER) |
---|
| 697 | static void |
---|
| 698 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer) |
---|
| 699 | #else |
---|
| 700 | static void |
---|
| 701 | yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, parser, lexer) |
---|
| 702 | FILE *yyoutput; |
---|
| 703 | int yytype; |
---|
| 704 | YYSTYPE const * const yyvaluep; |
---|
| 705 | YYLTYPE const * const yylocationp; |
---|
| 706 | fsd_conf_parser_t *parser; |
---|
| 707 | fsd_conf_lexer_t *lexer; |
---|
| 708 | #endif |
---|
| 709 | { |
---|
| 710 | if (yytype < YYNTOKENS) |
---|
| 711 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
---|
| 712 | else |
---|
| 713 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
---|
| 714 | |
---|
| 715 | YY_LOCATION_PRINT (yyoutput, *yylocationp); |
---|
| 716 | YYFPRINTF (yyoutput, ": "); |
---|
| 717 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parser, lexer); |
---|
| 718 | YYFPRINTF (yyoutput, ")"); |
---|
| 719 | } |
---|
| 720 | |
---|
| 721 | /*------------------------------------------------------------------. |
---|
| 722 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
---|
| 723 | | TOP (included). | |
---|
| 724 | `------------------------------------------------------------------*/ |
---|
| 725 | |
---|
| 726 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 727 | || defined __cplusplus || defined _MSC_VER) |
---|
| 728 | static void |
---|
| 729 | yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) |
---|
| 730 | #else |
---|
| 731 | static void |
---|
| 732 | yy_stack_print (bottom, top) |
---|
| 733 | yytype_int16 *bottom; |
---|
| 734 | yytype_int16 *top; |
---|
| 735 | #endif |
---|
| 736 | { |
---|
| 737 | YYFPRINTF (stderr, "Stack now"); |
---|
| 738 | for (; bottom <= top; ++bottom) |
---|
| 739 | YYFPRINTF (stderr, " %d", *bottom); |
---|
| 740 | YYFPRINTF (stderr, "\n"); |
---|
| 741 | } |
---|
| 742 | |
---|
| 743 | # define YY_STACK_PRINT(Bottom, Top) \ |
---|
| 744 | do { \ |
---|
| 745 | if (yydebug) \ |
---|
| 746 | yy_stack_print ((Bottom), (Top)); \ |
---|
| 747 | } while (YYID (0)) |
---|
| 748 | |
---|
| 749 | |
---|
| 750 | /*------------------------------------------------. |
---|
| 751 | | Report that the YYRULE is going to be reduced. | |
---|
| 752 | `------------------------------------------------*/ |
---|
| 753 | |
---|
| 754 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 755 | || defined __cplusplus || defined _MSC_VER) |
---|
| 756 | static void |
---|
| 757 | yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer) |
---|
| 758 | #else |
---|
| 759 | static void |
---|
| 760 | yy_reduce_print (yyvsp, yylsp, yyrule, parser, lexer) |
---|
| 761 | YYSTYPE *yyvsp; |
---|
| 762 | YYLTYPE *yylsp; |
---|
| 763 | int yyrule; |
---|
| 764 | fsd_conf_parser_t *parser; |
---|
| 765 | fsd_conf_lexer_t *lexer; |
---|
| 766 | #endif |
---|
| 767 | { |
---|
| 768 | int yynrhs = yyr2[yyrule]; |
---|
| 769 | int yyi; |
---|
| 770 | unsigned long int yylno = yyrline[yyrule]; |
---|
| 771 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
---|
| 772 | yyrule - 1, yylno); |
---|
| 773 | /* The symbols being reduced. */ |
---|
| 774 | for (yyi = 0; yyi < yynrhs; yyi++) |
---|
| 775 | { |
---|
| 776 | fprintf (stderr, " $%d = ", yyi + 1); |
---|
| 777 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
---|
| 778 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
---|
| 779 | , &(yylsp[(yyi + 1) - (yynrhs)]) , parser, lexer); |
---|
| 780 | fprintf (stderr, "\n"); |
---|
| 781 | } |
---|
| 782 | } |
---|
| 783 | |
---|
| 784 | # define YY_REDUCE_PRINT(Rule) \ |
---|
| 785 | do { \ |
---|
| 786 | if (yydebug) \ |
---|
| 787 | yy_reduce_print (yyvsp, yylsp, Rule, parser, lexer); \ |
---|
| 788 | } while (YYID (0)) |
---|
| 789 | |
---|
| 790 | /* Nonzero means print parse trace. It is left uninitialized so that |
---|
| 791 | multiple parsers can coexist. */ |
---|
| 792 | int yydebug; |
---|
| 793 | #else /* !YYDEBUG */ |
---|
| 794 | # define YYDPRINTF(Args) |
---|
| 795 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
---|
| 796 | # define YY_STACK_PRINT(Bottom, Top) |
---|
| 797 | # define YY_REDUCE_PRINT(Rule) |
---|
| 798 | #endif /* !YYDEBUG */ |
---|
| 799 | |
---|
| 800 | |
---|
| 801 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
---|
| 802 | #ifndef YYINITDEPTH |
---|
| 803 | # define YYINITDEPTH 200 |
---|
| 804 | #endif |
---|
| 805 | |
---|
| 806 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
---|
| 807 | if the built-in stack extension method is used). |
---|
| 808 | |
---|
| 809 | Do not make this value too large; the results are undefined if |
---|
| 810 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
---|
| 811 | evaluated with infinite-precision integer arithmetic. */ |
---|
| 812 | |
---|
| 813 | #ifndef YYMAXDEPTH |
---|
| 814 | # define YYMAXDEPTH 10000 |
---|
| 815 | #endif |
---|
| 816 | |
---|
| 817 | |
---|
| 818 | |
---|
| 819 | #if YYERROR_VERBOSE |
---|
| 820 | |
---|
| 821 | # ifndef yystrlen |
---|
| 822 | # if defined __GLIBC__ && defined _STRING_H |
---|
| 823 | # define yystrlen strlen |
---|
| 824 | # else |
---|
| 825 | /* Return the length of YYSTR. */ |
---|
| 826 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 827 | || defined __cplusplus || defined _MSC_VER) |
---|
| 828 | static YYSIZE_T |
---|
| 829 | yystrlen (const char *yystr) |
---|
| 830 | #else |
---|
| 831 | static YYSIZE_T |
---|
| 832 | yystrlen (yystr) |
---|
| 833 | const char *yystr; |
---|
| 834 | #endif |
---|
| 835 | { |
---|
| 836 | YYSIZE_T yylen; |
---|
| 837 | for (yylen = 0; yystr[yylen]; yylen++) |
---|
| 838 | continue; |
---|
| 839 | return yylen; |
---|
| 840 | } |
---|
| 841 | # endif |
---|
| 842 | # endif |
---|
| 843 | |
---|
| 844 | # ifndef yystpcpy |
---|
| 845 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
---|
| 846 | # define yystpcpy stpcpy |
---|
| 847 | # else |
---|
| 848 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
---|
| 849 | YYDEST. */ |
---|
| 850 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 851 | || defined __cplusplus || defined _MSC_VER) |
---|
| 852 | static char * |
---|
| 853 | yystpcpy (char *yydest, const char *yysrc) |
---|
| 854 | #else |
---|
| 855 | static char * |
---|
| 856 | yystpcpy (yydest, yysrc) |
---|
| 857 | char *yydest; |
---|
| 858 | const char *yysrc; |
---|
| 859 | #endif |
---|
| 860 | { |
---|
| 861 | char *yyd = yydest; |
---|
| 862 | const char *yys = yysrc; |
---|
| 863 | |
---|
| 864 | while ((*yyd++ = *yys++) != '\0') |
---|
| 865 | continue; |
---|
| 866 | |
---|
| 867 | return yyd - 1; |
---|
| 868 | } |
---|
| 869 | # endif |
---|
| 870 | # endif |
---|
| 871 | |
---|
| 872 | # ifndef yytnamerr |
---|
| 873 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
---|
| 874 | quotes and backslashes, so that it's suitable for yyerror. The |
---|
| 875 | heuristic is that double-quoting is unnecessary unless the string |
---|
| 876 | contains an apostrophe, a comma, or backslash (other than |
---|
| 877 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
---|
| 878 | null, do not copy; instead, return the length of what the result |
---|
| 879 | would have been. */ |
---|
| 880 | static YYSIZE_T |
---|
| 881 | yytnamerr (char *yyres, const char *yystr) |
---|
| 882 | { |
---|
| 883 | if (*yystr == '"') |
---|
| 884 | { |
---|
| 885 | YYSIZE_T yyn = 0; |
---|
| 886 | char const *yyp = yystr; |
---|
| 887 | |
---|
| 888 | for (;;) |
---|
| 889 | switch (*++yyp) |
---|
| 890 | { |
---|
| 891 | case '\'': |
---|
| 892 | case ',': |
---|
| 893 | goto do_not_strip_quotes; |
---|
| 894 | |
---|
| 895 | case '\\': |
---|
| 896 | if (*++yyp != '\\') |
---|
| 897 | goto do_not_strip_quotes; |
---|
| 898 | /* Fall through. */ |
---|
| 899 | default: |
---|
| 900 | if (yyres) |
---|
| 901 | yyres[yyn] = *yyp; |
---|
| 902 | yyn++; |
---|
| 903 | break; |
---|
| 904 | |
---|
| 905 | case '"': |
---|
| 906 | if (yyres) |
---|
| 907 | yyres[yyn] = '\0'; |
---|
| 908 | return yyn; |
---|
| 909 | } |
---|
| 910 | do_not_strip_quotes: ; |
---|
| 911 | } |
---|
| 912 | |
---|
| 913 | if (! yyres) |
---|
| 914 | return yystrlen (yystr); |
---|
| 915 | |
---|
| 916 | return yystpcpy (yyres, yystr) - yyres; |
---|
| 917 | } |
---|
| 918 | # endif |
---|
| 919 | |
---|
| 920 | /* Copy into YYRESULT an error message about the unexpected token |
---|
| 921 | YYCHAR while in state YYSTATE. Return the number of bytes copied, |
---|
| 922 | including the terminating null byte. If YYRESULT is null, do not |
---|
| 923 | copy anything; just return the number of bytes that would be |
---|
| 924 | copied. As a special case, return 0 if an ordinary "syntax error" |
---|
| 925 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during |
---|
| 926 | size calculation. */ |
---|
| 927 | static YYSIZE_T |
---|
| 928 | yysyntax_error (char *yyresult, int yystate, int yychar) |
---|
| 929 | { |
---|
| 930 | int yyn = yypact[yystate]; |
---|
| 931 | |
---|
| 932 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) |
---|
| 933 | return 0; |
---|
| 934 | else |
---|
| 935 | { |
---|
| 936 | int yytype = YYTRANSLATE (yychar); |
---|
| 937 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); |
---|
| 938 | YYSIZE_T yysize = yysize0; |
---|
| 939 | YYSIZE_T yysize1; |
---|
| 940 | int yysize_overflow = 0; |
---|
| 941 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
---|
| 942 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
---|
| 943 | int yyx; |
---|
| 944 | |
---|
| 945 | # if 0 |
---|
| 946 | /* This is so xgettext sees the translatable formats that are |
---|
| 947 | constructed on the fly. */ |
---|
| 948 | YY_("syntax error, unexpected %s"); |
---|
| 949 | YY_("syntax error, unexpected %s, expecting %s"); |
---|
| 950 | YY_("syntax error, unexpected %s, expecting %s or %s"); |
---|
| 951 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); |
---|
| 952 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); |
---|
| 953 | # endif |
---|
| 954 | char *yyfmt; |
---|
| 955 | char const *yyf; |
---|
| 956 | static char const yyunexpected[] = "syntax error, unexpected %s"; |
---|
| 957 | static char const yyexpecting[] = ", expecting %s"; |
---|
| 958 | static char const yyor[] = " or %s"; |
---|
| 959 | char yyformat[sizeof yyunexpected |
---|
| 960 | + sizeof yyexpecting - 1 |
---|
| 961 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) |
---|
| 962 | * (sizeof yyor - 1))]; |
---|
| 963 | char const *yyprefix = yyexpecting; |
---|
| 964 | |
---|
| 965 | /* Start YYX at -YYN if negative to avoid negative indexes in |
---|
| 966 | YYCHECK. */ |
---|
| 967 | int yyxbegin = yyn < 0 ? -yyn : 0; |
---|
| 968 | |
---|
| 969 | /* Stay within bounds of both yycheck and yytname. */ |
---|
| 970 | int yychecklim = YYLAST - yyn + 1; |
---|
| 971 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
---|
| 972 | int yycount = 1; |
---|
| 973 | |
---|
| 974 | yyarg[0] = yytname[yytype]; |
---|
| 975 | yyfmt = yystpcpy (yyformat, yyunexpected); |
---|
| 976 | |
---|
| 977 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
---|
| 978 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
---|
| 979 | { |
---|
| 980 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
---|
| 981 | { |
---|
| 982 | yycount = 1; |
---|
| 983 | yysize = yysize0; |
---|
| 984 | yyformat[sizeof yyunexpected - 1] = '\0'; |
---|
| 985 | break; |
---|
| 986 | } |
---|
| 987 | yyarg[yycount++] = yytname[yyx]; |
---|
| 988 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
---|
| 989 | yysize_overflow |= (yysize1 < yysize); |
---|
| 990 | yysize = yysize1; |
---|
| 991 | yyfmt = yystpcpy (yyfmt, yyprefix); |
---|
| 992 | yyprefix = yyor; |
---|
| 993 | } |
---|
| 994 | |
---|
| 995 | yyf = YY_(yyformat); |
---|
| 996 | yysize1 = yysize + yystrlen (yyf); |
---|
| 997 | yysize_overflow |= (yysize1 < yysize); |
---|
| 998 | yysize = yysize1; |
---|
| 999 | |
---|
| 1000 | if (yysize_overflow) |
---|
| 1001 | return YYSIZE_MAXIMUM; |
---|
| 1002 | |
---|
| 1003 | if (yyresult) |
---|
| 1004 | { |
---|
| 1005 | /* Avoid sprintf, as that infringes on the user's name space. |
---|
| 1006 | Don't have undefined behavior even if the translation |
---|
| 1007 | produced a string with the wrong number of "%s"s. */ |
---|
| 1008 | char *yyp = yyresult; |
---|
| 1009 | int yyi = 0; |
---|
| 1010 | while ((*yyp = *yyf) != '\0') |
---|
| 1011 | { |
---|
| 1012 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) |
---|
| 1013 | { |
---|
| 1014 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
---|
| 1015 | yyf += 2; |
---|
| 1016 | } |
---|
| 1017 | else |
---|
| 1018 | { |
---|
| 1019 | yyp++; |
---|
| 1020 | yyf++; |
---|
| 1021 | } |
---|
| 1022 | } |
---|
| 1023 | } |
---|
| 1024 | return yysize; |
---|
| 1025 | } |
---|
| 1026 | } |
---|
| 1027 | #endif /* YYERROR_VERBOSE */ |
---|
| 1028 | |
---|
| 1029 | |
---|
| 1030 | /*-----------------------------------------------. |
---|
| 1031 | | Release the memory associated to this symbol. | |
---|
| 1032 | `-----------------------------------------------*/ |
---|
| 1033 | |
---|
| 1034 | /*ARGSUSED*/ |
---|
| 1035 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 1036 | || defined __cplusplus || defined _MSC_VER) |
---|
| 1037 | static void |
---|
| 1038 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer) |
---|
| 1039 | #else |
---|
| 1040 | static void |
---|
| 1041 | yydestruct (yymsg, yytype, yyvaluep, yylocationp, parser, lexer) |
---|
| 1042 | const char *yymsg; |
---|
| 1043 | int yytype; |
---|
| 1044 | YYSTYPE *yyvaluep; |
---|
| 1045 | YYLTYPE *yylocationp; |
---|
| 1046 | fsd_conf_parser_t *parser; |
---|
| 1047 | fsd_conf_lexer_t *lexer; |
---|
| 1048 | #endif |
---|
| 1049 | { |
---|
| 1050 | YYUSE (yyvaluep); |
---|
| 1051 | YYUSE (yylocationp); |
---|
| 1052 | YYUSE (parser); |
---|
| 1053 | YYUSE (lexer); |
---|
| 1054 | |
---|
| 1055 | if (!yymsg) |
---|
| 1056 | yymsg = "Deleting"; |
---|
| 1057 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
---|
| 1058 | |
---|
| 1059 | switch (yytype) |
---|
| 1060 | { |
---|
| 1061 | case 4: /* "STRING" */ |
---|
| 1062 | #line 51 "conf_tab.y" |
---|
| 1063 | { free((yyvaluep->string)); }; |
---|
| 1064 | #line 1065 "conf_tab.c" |
---|
| 1065 | break; |
---|
| 1066 | case 12: /* "conf" */ |
---|
| 1067 | #line 47 "conf_tab.y" |
---|
| 1068 | { fsd_conf_dict_destroy((yyvaluep->dictionary)); }; |
---|
| 1069 | #line 1070 "conf_tab.c" |
---|
| 1070 | break; |
---|
| 1071 | case 13: /* "dict" */ |
---|
| 1072 | #line 47 "conf_tab.y" |
---|
| 1073 | { fsd_conf_dict_destroy((yyvaluep->dictionary)); }; |
---|
| 1074 | #line 1075 "conf_tab.c" |
---|
| 1075 | break; |
---|
| 1076 | case 14: /* "dict_body" */ |
---|
| 1077 | #line 47 "conf_tab.y" |
---|
| 1078 | { fsd_conf_dict_destroy((yyvaluep->dictionary)); }; |
---|
| 1079 | #line 1080 "conf_tab.c" |
---|
| 1080 | break; |
---|
| 1081 | case 15: /* "pair_list" */ |
---|
| 1082 | #line 47 "conf_tab.y" |
---|
| 1083 | { fsd_conf_dict_destroy((yyvaluep->dictionary)); }; |
---|
| 1084 | #line 1085 "conf_tab.c" |
---|
| 1085 | break; |
---|
| 1086 | case 17: /* "value" */ |
---|
| 1087 | #line 45 "conf_tab.y" |
---|
| 1088 | { fsd_conf_option_destroy((yyvaluep->option)); }; |
---|
| 1089 | #line 1090 "conf_tab.c" |
---|
| 1090 | break; |
---|
| 1091 | |
---|
| 1092 | default: |
---|
| 1093 | break; |
---|
| 1094 | } |
---|
| 1095 | } |
---|
| 1096 | |
---|
| 1097 | |
---|
| 1098 | /* Prevent warnings from -Wmissing-prototypes. */ |
---|
| 1099 | |
---|
| 1100 | #ifdef YYPARSE_PARAM |
---|
| 1101 | #if defined __STDC__ || defined __cplusplus |
---|
| 1102 | int yyparse (void *YYPARSE_PARAM); |
---|
| 1103 | #else |
---|
| 1104 | int yyparse (); |
---|
| 1105 | #endif |
---|
| 1106 | #else /* ! YYPARSE_PARAM */ |
---|
| 1107 | #if defined __STDC__ || defined __cplusplus |
---|
| 1108 | int yyparse (fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer); |
---|
| 1109 | #else |
---|
| 1110 | int yyparse (); |
---|
| 1111 | #endif |
---|
| 1112 | #endif /* ! YYPARSE_PARAM */ |
---|
| 1113 | |
---|
| 1114 | |
---|
| 1115 | |
---|
| 1116 | |
---|
| 1117 | |
---|
| 1118 | |
---|
| 1119 | /*----------. |
---|
| 1120 | | yyparse. | |
---|
| 1121 | `----------*/ |
---|
| 1122 | |
---|
| 1123 | #ifdef YYPARSE_PARAM |
---|
| 1124 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 1125 | || defined __cplusplus || defined _MSC_VER) |
---|
| 1126 | int |
---|
| 1127 | yyparse (void *YYPARSE_PARAM) |
---|
| 1128 | #else |
---|
| 1129 | int |
---|
| 1130 | yyparse (YYPARSE_PARAM) |
---|
| 1131 | void *YYPARSE_PARAM; |
---|
| 1132 | #endif |
---|
| 1133 | #else /* ! YYPARSE_PARAM */ |
---|
| 1134 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
---|
| 1135 | || defined __cplusplus || defined _MSC_VER) |
---|
| 1136 | int |
---|
| 1137 | yyparse (fsd_conf_parser_t *parser, fsd_conf_lexer_t *lexer) |
---|
| 1138 | #else |
---|
| 1139 | int |
---|
| 1140 | yyparse (parser, lexer) |
---|
| 1141 | fsd_conf_parser_t *parser; |
---|
| 1142 | fsd_conf_lexer_t *lexer; |
---|
| 1143 | #endif |
---|
| 1144 | #endif |
---|
| 1145 | { |
---|
| 1146 | /* The look-ahead symbol. */ |
---|
| 1147 | int yychar; |
---|
| 1148 | |
---|
| 1149 | /* The semantic value of the look-ahead symbol. */ |
---|
| 1150 | YYSTYPE yylval; |
---|
| 1151 | |
---|
| 1152 | /* Number of syntax errors so far. */ |
---|
| 1153 | int yynerrs; |
---|
| 1154 | /* Location data for the look-ahead symbol. */ |
---|
| 1155 | YYLTYPE yylloc; |
---|
| 1156 | |
---|
| 1157 | int yystate; |
---|
| 1158 | int yyn; |
---|
| 1159 | int yyresult; |
---|
| 1160 | /* Number of tokens to shift before error messages enabled. */ |
---|
| 1161 | int yyerrstatus; |
---|
| 1162 | /* Look-ahead token as an internal (translated) token number. */ |
---|
| 1163 | int yytoken = 0; |
---|
| 1164 | #if YYERROR_VERBOSE |
---|
| 1165 | /* Buffer for error messages, and its allocated size. */ |
---|
| 1166 | char yymsgbuf[128]; |
---|
| 1167 | char *yymsg = yymsgbuf; |
---|
| 1168 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
---|
| 1169 | #endif |
---|
| 1170 | |
---|
| 1171 | /* Three stacks and their tools: |
---|
| 1172 | `yyss': related to states, |
---|
| 1173 | `yyvs': related to semantic values, |
---|
| 1174 | `yyls': related to locations. |
---|
| 1175 | |
---|
| 1176 | Refer to the stacks thru separate pointers, to allow yyoverflow |
---|
| 1177 | to reallocate them elsewhere. */ |
---|
| 1178 | |
---|
| 1179 | /* The state stack. */ |
---|
| 1180 | yytype_int16 yyssa[YYINITDEPTH]; |
---|
| 1181 | yytype_int16 *yyss = yyssa; |
---|
| 1182 | yytype_int16 *yyssp; |
---|
| 1183 | |
---|
| 1184 | /* The semantic value stack. */ |
---|
| 1185 | YYSTYPE yyvsa[YYINITDEPTH]; |
---|
| 1186 | YYSTYPE *yyvs = yyvsa; |
---|
| 1187 | YYSTYPE *yyvsp; |
---|
| 1188 | |
---|
| 1189 | /* The location stack. */ |
---|
| 1190 | YYLTYPE yylsa[YYINITDEPTH]; |
---|
| 1191 | YYLTYPE *yyls = yylsa; |
---|
| 1192 | YYLTYPE *yylsp; |
---|
| 1193 | /* The locations where the error started and ended. */ |
---|
| 1194 | YYLTYPE yyerror_range[2]; |
---|
| 1195 | |
---|
| 1196 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
---|
| 1197 | |
---|
| 1198 | YYSIZE_T yystacksize = YYINITDEPTH; |
---|
| 1199 | |
---|
| 1200 | /* The variables used to return semantic value and location from the |
---|
| 1201 | action routines. */ |
---|
| 1202 | YYSTYPE yyval; |
---|
| 1203 | YYLTYPE yyloc; |
---|
| 1204 | |
---|
| 1205 | /* The number of symbols on the RHS of the reduced rule. |
---|
| 1206 | Keep to zero when no symbol should be popped. */ |
---|
| 1207 | int yylen = 0; |
---|
| 1208 | |
---|
| 1209 | YYDPRINTF ((stderr, "Starting parse\n")); |
---|
| 1210 | |
---|
| 1211 | yystate = 0; |
---|
| 1212 | yyerrstatus = 0; |
---|
| 1213 | yynerrs = 0; |
---|
| 1214 | yychar = YYEMPTY; /* Cause a token to be read. */ |
---|
| 1215 | |
---|
| 1216 | /* Initialize stack pointers. |
---|
| 1217 | Waste one element of value and location stack |
---|
| 1218 | so that they stay on the same level as the state stack. |
---|
| 1219 | The wasted elements are never initialized. */ |
---|
| 1220 | |
---|
| 1221 | yyssp = yyss; |
---|
| 1222 | yyvsp = yyvs; |
---|
| 1223 | yylsp = yyls; |
---|
| 1224 | #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
---|
| 1225 | /* Initialize the default location before parsing starts. */ |
---|
| 1226 | yylloc.first_line = yylloc.last_line = 1; |
---|
| 1227 | yylloc.first_column = yylloc.last_column = 0; |
---|
| 1228 | #endif |
---|
| 1229 | |
---|
| 1230 | goto yysetstate; |
---|
| 1231 | |
---|
| 1232 | /*------------------------------------------------------------. |
---|
| 1233 | | yynewstate -- Push a new state, which is found in yystate. | |
---|
| 1234 | `------------------------------------------------------------*/ |
---|
| 1235 | yynewstate: |
---|
| 1236 | /* In all cases, when you get here, the value and location stacks |
---|
| 1237 | have just been pushed. So pushing a state here evens the stacks. */ |
---|
| 1238 | yyssp++; |
---|
| 1239 | |
---|
| 1240 | yysetstate: |
---|
| 1241 | *yyssp = yystate; |
---|
| 1242 | |
---|
| 1243 | if (yyss + yystacksize - 1 <= yyssp) |
---|
| 1244 | { |
---|
| 1245 | /* Get the current used size of the three stacks, in elements. */ |
---|
| 1246 | YYSIZE_T yysize = yyssp - yyss + 1; |
---|
| 1247 | |
---|
| 1248 | #ifdef yyoverflow |
---|
| 1249 | { |
---|
| 1250 | /* Give user a chance to reallocate the stack. Use copies of |
---|
| 1251 | these so that the &'s don't force the real ones into |
---|
| 1252 | memory. */ |
---|
| 1253 | YYSTYPE *yyvs1 = yyvs; |
---|
| 1254 | yytype_int16 *yyss1 = yyss; |
---|
| 1255 | YYLTYPE *yyls1 = yyls; |
---|
| 1256 | |
---|
| 1257 | /* Each stack pointer address is followed by the size of the |
---|
| 1258 | data in use in that stack, in bytes. This used to be a |
---|
| 1259 | conditional around just the two extra args, but that might |
---|
| 1260 | be undefined if yyoverflow is a macro. */ |
---|
| 1261 | yyoverflow (YY_("memory exhausted"), |
---|
| 1262 | &yyss1, yysize * sizeof (*yyssp), |
---|
| 1263 | &yyvs1, yysize * sizeof (*yyvsp), |
---|
| 1264 | &yyls1, yysize * sizeof (*yylsp), |
---|
| 1265 | &yystacksize); |
---|
| 1266 | yyls = yyls1; |
---|
| 1267 | yyss = yyss1; |
---|
| 1268 | yyvs = yyvs1; |
---|
| 1269 | } |
---|
| 1270 | #else /* no yyoverflow */ |
---|
| 1271 | # ifndef YYSTACK_RELOCATE |
---|
| 1272 | goto yyexhaustedlab; |
---|
| 1273 | # else |
---|
| 1274 | /* Extend the stack our own way. */ |
---|
| 1275 | if (YYMAXDEPTH <= yystacksize) |
---|
| 1276 | goto yyexhaustedlab; |
---|
| 1277 | yystacksize *= 2; |
---|
| 1278 | if (YYMAXDEPTH < yystacksize) |
---|
| 1279 | yystacksize = YYMAXDEPTH; |
---|
| 1280 | |
---|
| 1281 | { |
---|
| 1282 | yytype_int16 *yyss1 = yyss; |
---|
| 1283 | union yyalloc *yyptr = |
---|
| 1284 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
---|
| 1285 | if (! yyptr) |
---|
| 1286 | goto yyexhaustedlab; |
---|
| 1287 | YYSTACK_RELOCATE (yyss); |
---|
| 1288 | YYSTACK_RELOCATE (yyvs); |
---|
| 1289 | YYSTACK_RELOCATE (yyls); |
---|
| 1290 | # undef YYSTACK_RELOCATE |
---|
| 1291 | if (yyss1 != yyssa) |
---|
| 1292 | YYSTACK_FREE (yyss1); |
---|
| 1293 | } |
---|
| 1294 | # endif |
---|
| 1295 | #endif /* no yyoverflow */ |
---|
| 1296 | |
---|
| 1297 | yyssp = yyss + yysize - 1; |
---|
| 1298 | yyvsp = yyvs + yysize - 1; |
---|
| 1299 | yylsp = yyls + yysize - 1; |
---|
| 1300 | |
---|
| 1301 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
---|
| 1302 | (unsigned long int) yystacksize)); |
---|
| 1303 | |
---|
| 1304 | if (yyss + yystacksize - 1 <= yyssp) |
---|
| 1305 | YYABORT; |
---|
| 1306 | } |
---|
| 1307 | |
---|
| 1308 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
---|
| 1309 | |
---|
| 1310 | goto yybackup; |
---|
| 1311 | |
---|
| 1312 | /*-----------. |
---|
| 1313 | | yybackup. | |
---|
| 1314 | `-----------*/ |
---|
| 1315 | yybackup: |
---|
| 1316 | |
---|
| 1317 | /* Do appropriate processing given the current state. Read a |
---|
| 1318 | look-ahead token if we need one and don't already have one. */ |
---|
| 1319 | |
---|
| 1320 | /* First try to decide what to do without reference to look-ahead token. */ |
---|
| 1321 | yyn = yypact[yystate]; |
---|
| 1322 | if (yyn == YYPACT_NINF) |
---|
| 1323 | goto yydefault; |
---|
| 1324 | |
---|
| 1325 | /* Not known => get a look-ahead token if don't already have one. */ |
---|
| 1326 | |
---|
| 1327 | /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
---|
| 1328 | if (yychar == YYEMPTY) |
---|
| 1329 | { |
---|
| 1330 | YYDPRINTF ((stderr, "Reading a token: ")); |
---|
| 1331 | yychar = YYLEX; |
---|
| 1332 | } |
---|
| 1333 | |
---|
| 1334 | if (yychar <= YYEOF) |
---|
| 1335 | { |
---|
| 1336 | yychar = yytoken = YYEOF; |
---|
| 1337 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
---|
| 1338 | } |
---|
| 1339 | else |
---|
| 1340 | { |
---|
| 1341 | yytoken = YYTRANSLATE (yychar); |
---|
| 1342 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
---|
| 1343 | } |
---|
| 1344 | |
---|
| 1345 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
---|
| 1346 | detect an error, take that action. */ |
---|
| 1347 | yyn += yytoken; |
---|
| 1348 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
---|
| 1349 | goto yydefault; |
---|
| 1350 | yyn = yytable[yyn]; |
---|
| 1351 | if (yyn <= 0) |
---|
| 1352 | { |
---|
| 1353 | if (yyn == 0 || yyn == YYTABLE_NINF) |
---|
| 1354 | goto yyerrlab; |
---|
| 1355 | yyn = -yyn; |
---|
| 1356 | goto yyreduce; |
---|
| 1357 | } |
---|
| 1358 | |
---|
| 1359 | if (yyn == YYFINAL) |
---|
| 1360 | YYACCEPT; |
---|
| 1361 | |
---|
| 1362 | /* Count tokens shifted since error; after three, turn off error |
---|
| 1363 | status. */ |
---|
| 1364 | if (yyerrstatus) |
---|
| 1365 | yyerrstatus--; |
---|
| 1366 | |
---|
| 1367 | /* Shift the look-ahead token. */ |
---|
| 1368 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
---|
| 1369 | |
---|
| 1370 | /* Discard the shifted token unless it is eof. */ |
---|
| 1371 | if (yychar != YYEOF) |
---|
| 1372 | yychar = YYEMPTY; |
---|
| 1373 | |
---|
| 1374 | yystate = yyn; |
---|
| 1375 | *++yyvsp = yylval; |
---|
| 1376 | *++yylsp = yylloc; |
---|
| 1377 | goto yynewstate; |
---|
| 1378 | |
---|
| 1379 | |
---|
| 1380 | /*-----------------------------------------------------------. |
---|
| 1381 | | yydefault -- do the default action for the current state. | |
---|
| 1382 | `-----------------------------------------------------------*/ |
---|
| 1383 | yydefault: |
---|
| 1384 | yyn = yydefact[yystate]; |
---|
| 1385 | if (yyn == 0) |
---|
| 1386 | goto yyerrlab; |
---|
| 1387 | goto yyreduce; |
---|
| 1388 | |
---|
| 1389 | |
---|
| 1390 | /*-----------------------------. |
---|
| 1391 | | yyreduce -- Do a reduction. | |
---|
| 1392 | `-----------------------------*/ |
---|
| 1393 | yyreduce: |
---|
| 1394 | /* yyn is the number of a rule to reduce with. */ |
---|
| 1395 | yylen = yyr2[yyn]; |
---|
| 1396 | |
---|
| 1397 | /* If YYLEN is nonzero, implement the default value of the action: |
---|
| 1398 | `$$ = $1'. |
---|
| 1399 | |
---|
| 1400 | Otherwise, the following line sets YYVAL to garbage. |
---|
| 1401 | This behavior is undocumented and Bison |
---|
| 1402 | users should not rely upon it. Assigning to YYVAL |
---|
| 1403 | unconditionally makes the parser a bit smaller, and it avoids a |
---|
| 1404 | GCC warning that YYVAL may be used uninitialized. */ |
---|
| 1405 | yyval = yyvsp[1-yylen]; |
---|
| 1406 | |
---|
| 1407 | /* Default location. */ |
---|
| 1408 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
---|
| 1409 | YY_REDUCE_PRINT (yyn); |
---|
| 1410 | switch (yyn) |
---|
| 1411 | { |
---|
| 1412 | case 2: |
---|
| 1413 | #line 58 "conf_tab.y" |
---|
| 1414 | { parser->result = (yyvsp[(1) - (1)].dictionary); (yyval.dictionary) = NULL; ;} |
---|
| 1415 | break; |
---|
| 1416 | |
---|
| 1417 | case 5: |
---|
| 1418 | #line 67 "conf_tab.y" |
---|
| 1419 | { (yyval.dictionary) = (yyvsp[(2) - (3)].dictionary); ;} |
---|
| 1420 | break; |
---|
| 1421 | |
---|
| 1422 | case 6: |
---|
| 1423 | #line 71 "conf_tab.y" |
---|
| 1424 | { (yyval.dictionary) = (yyvsp[(1) - (1)].dictionary); ;} |
---|
| 1425 | break; |
---|
| 1426 | |
---|
| 1427 | case 7: |
---|
| 1428 | #line 72 "conf_tab.y" |
---|
| 1429 | { (yyval.dictionary) = (yyvsp[(1) - (2)].dictionary); ;} |
---|
| 1430 | break; |
---|
| 1431 | |
---|
| 1432 | case 8: |
---|
| 1433 | #line 73 "conf_tab.y" |
---|
| 1434 | { |
---|
| 1435 | (yyval.dictionary) = fsd_conf_dict_create_noraise(); |
---|
| 1436 | if( (yyval.dictionary) == NULL ) YYABORT; |
---|
| 1437 | ;} |
---|
| 1438 | break; |
---|
| 1439 | |
---|
| 1440 | case 9: |
---|
| 1441 | #line 81 "conf_tab.y" |
---|
| 1442 | { |
---|
| 1443 | fsd_conf_dict_t *dict = NULL; |
---|
| 1444 | int rc; |
---|
| 1445 | dict = fsd_conf_dict_create_noraise(); |
---|
| 1446 | if( dict == NULL ) |
---|
| 1447 | YYABORT; |
---|
| 1448 | rc = fsd_conf_dict_set_noraise( dict, (yyvsp[(1) - (1)].pair).key, (yyvsp[(1) - (1)].pair).value ); |
---|
| 1449 | if( rc ) |
---|
| 1450 | { |
---|
| 1451 | fsd_conf_dict_destroy( dict ); |
---|
| 1452 | YYABORT; |
---|
| 1453 | } |
---|
| 1454 | (yyval.dictionary) = dict; |
---|
| 1455 | ;} |
---|
| 1456 | break; |
---|
| 1457 | |
---|
| 1458 | case 10: |
---|
| 1459 | #line 96 "conf_tab.y" |
---|
| 1460 | { |
---|
| 1461 | int rc; |
---|
| 1462 | rc = fsd_conf_dict_set_noraise( (yyvsp[(1) - (3)].dictionary), (yyvsp[(3) - (3)].pair).key, (yyvsp[(3) - (3)].pair).value ); |
---|
| 1463 | if( rc ) |
---|
| 1464 | YYABORT; |
---|
| 1465 | (yyval.dictionary) = (yyvsp[(1) - (3)].dictionary); /* explicit no op */ |
---|
| 1466 | ;} |
---|
| 1467 | break; |
---|
| 1468 | |
---|
| 1469 | case 11: |
---|
| 1470 | #line 106 "conf_tab.y" |
---|
| 1471 | { (yyval.pair).key = (yyvsp[(1) - (3)].string); (yyval.pair).value = (yyvsp[(3) - (3)].option); ;} |
---|
| 1472 | break; |
---|
| 1473 | |
---|
| 1474 | case 12: |
---|
| 1475 | #line 111 "conf_tab.y" |
---|
| 1476 | { |
---|
| 1477 | fsd_conf_option_t *o; |
---|
| 1478 | o = fsd_conf_option_create_noraise( FSD_CONF_INTEGER, &(yyvsp[(1) - (1)].integer) ); |
---|
| 1479 | if( o ) |
---|
| 1480 | (yyval.option) = o; |
---|
| 1481 | else |
---|
| 1482 | YYABORT; |
---|
| 1483 | ;} |
---|
| 1484 | break; |
---|
| 1485 | |
---|
| 1486 | case 13: |
---|
| 1487 | #line 120 "conf_tab.y" |
---|
| 1488 | { |
---|
| 1489 | fsd_conf_option_t *o; |
---|
| 1490 | o = fsd_conf_option_create_noraise( FSD_CONF_STRING, (yyvsp[(1) - (1)].string) ); |
---|
| 1491 | if( o ) |
---|
| 1492 | (yyval.option) = o; |
---|
| 1493 | else |
---|
| 1494 | YYABORT; |
---|
| 1495 | ;} |
---|
| 1496 | break; |
---|
| 1497 | |
---|
| 1498 | case 14: |
---|
| 1499 | #line 129 "conf_tab.y" |
---|
| 1500 | { |
---|
| 1501 | fsd_conf_option_t *o; |
---|
| 1502 | o = fsd_conf_option_create_noraise( FSD_CONF_DICT, (yyvsp[(1) - (1)].dictionary) ); |
---|
| 1503 | if( o ) |
---|
| 1504 | (yyval.option) = o; |
---|
| 1505 | else |
---|
| 1506 | YYABORT; |
---|
| 1507 | ;} |
---|
| 1508 | break; |
---|
| 1509 | |
---|
| 1510 | |
---|
| 1511 | /* Line 1267 of yacc.c. */ |
---|
| 1512 | #line 1513 "conf_tab.c" |
---|
| 1513 | default: break; |
---|
| 1514 | } |
---|
| 1515 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
---|
| 1516 | |
---|
| 1517 | YYPOPSTACK (yylen); |
---|
| 1518 | yylen = 0; |
---|
| 1519 | YY_STACK_PRINT (yyss, yyssp); |
---|
| 1520 | |
---|
| 1521 | *++yyvsp = yyval; |
---|
| 1522 | *++yylsp = yyloc; |
---|
| 1523 | |
---|
| 1524 | /* Now `shift' the result of the reduction. Determine what state |
---|
| 1525 | that goes to, based on the state we popped back to and the rule |
---|
| 1526 | number reduced by. */ |
---|
| 1527 | |
---|
| 1528 | yyn = yyr1[yyn]; |
---|
| 1529 | |
---|
| 1530 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
---|
| 1531 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
---|
| 1532 | yystate = yytable[yystate]; |
---|
| 1533 | else |
---|
| 1534 | yystate = yydefgoto[yyn - YYNTOKENS]; |
---|
| 1535 | |
---|
| 1536 | goto yynewstate; |
---|
| 1537 | |
---|
| 1538 | |
---|
| 1539 | /*------------------------------------. |
---|
| 1540 | | yyerrlab -- here on detecting error | |
---|
| 1541 | `------------------------------------*/ |
---|
| 1542 | yyerrlab: |
---|
| 1543 | /* If not already recovering from an error, report this error. */ |
---|
| 1544 | if (!yyerrstatus) |
---|
| 1545 | { |
---|
| 1546 | ++yynerrs; |
---|
| 1547 | #if ! YYERROR_VERBOSE |
---|
| 1548 | yyerror (&yylloc, parser, lexer, YY_("syntax error")); |
---|
| 1549 | #else |
---|
| 1550 | { |
---|
| 1551 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); |
---|
| 1552 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) |
---|
| 1553 | { |
---|
| 1554 | YYSIZE_T yyalloc = 2 * yysize; |
---|
| 1555 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) |
---|
| 1556 | yyalloc = YYSTACK_ALLOC_MAXIMUM; |
---|
| 1557 | if (yymsg != yymsgbuf) |
---|
| 1558 | YYSTACK_FREE (yymsg); |
---|
| 1559 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
---|
| 1560 | if (yymsg) |
---|
| 1561 | yymsg_alloc = yyalloc; |
---|
| 1562 | else |
---|
| 1563 | { |
---|
| 1564 | yymsg = yymsgbuf; |
---|
| 1565 | yymsg_alloc = sizeof yymsgbuf; |
---|
| 1566 | } |
---|
| 1567 | } |
---|
| 1568 | |
---|
| 1569 | if (0 < yysize && yysize <= yymsg_alloc) |
---|
| 1570 | { |
---|
| 1571 | (void) yysyntax_error (yymsg, yystate, yychar); |
---|
| 1572 | yyerror (&yylloc, parser, lexer, yymsg); |
---|
| 1573 | } |
---|
| 1574 | else |
---|
| 1575 | { |
---|
| 1576 | yyerror (&yylloc, parser, lexer, YY_("syntax error")); |
---|
| 1577 | if (yysize != 0) |
---|
| 1578 | goto yyexhaustedlab; |
---|
| 1579 | } |
---|
| 1580 | } |
---|
| 1581 | #endif |
---|
| 1582 | } |
---|
| 1583 | |
---|
| 1584 | yyerror_range[0] = yylloc; |
---|
| 1585 | |
---|
| 1586 | if (yyerrstatus == 3) |
---|
| 1587 | { |
---|
| 1588 | /* If just tried and failed to reuse look-ahead token after an |
---|
| 1589 | error, discard it. */ |
---|
| 1590 | |
---|
| 1591 | if (yychar <= YYEOF) |
---|
| 1592 | { |
---|
| 1593 | /* Return failure if at end of input. */ |
---|
| 1594 | if (yychar == YYEOF) |
---|
| 1595 | YYABORT; |
---|
| 1596 | } |
---|
| 1597 | else |
---|
| 1598 | { |
---|
| 1599 | yydestruct ("Error: discarding", |
---|
| 1600 | yytoken, &yylval, &yylloc, parser, lexer); |
---|
| 1601 | yychar = YYEMPTY; |
---|
| 1602 | } |
---|
| 1603 | } |
---|
| 1604 | |
---|
| 1605 | /* Else will try to reuse look-ahead token after shifting the error |
---|
| 1606 | token. */ |
---|
| 1607 | goto yyerrlab1; |
---|
| 1608 | |
---|
| 1609 | |
---|
| 1610 | /*---------------------------------------------------. |
---|
| 1611 | | yyerrorlab -- error raised explicitly by YYERROR. | |
---|
| 1612 | `---------------------------------------------------*/ |
---|
| 1613 | yyerrorlab: |
---|
| 1614 | |
---|
| 1615 | /* Pacify compilers like GCC when the user code never invokes |
---|
| 1616 | YYERROR and the label yyerrorlab therefore never appears in user |
---|
| 1617 | code. */ |
---|
| 1618 | if (/*CONSTCOND*/ 0) |
---|
| 1619 | goto yyerrorlab; |
---|
| 1620 | |
---|
| 1621 | yyerror_range[0] = yylsp[1-yylen]; |
---|
| 1622 | /* Do not reclaim the symbols of the rule which action triggered |
---|
| 1623 | this YYERROR. */ |
---|
| 1624 | YYPOPSTACK (yylen); |
---|
| 1625 | yylen = 0; |
---|
| 1626 | YY_STACK_PRINT (yyss, yyssp); |
---|
| 1627 | yystate = *yyssp; |
---|
| 1628 | goto yyerrlab1; |
---|
| 1629 | |
---|
| 1630 | |
---|
| 1631 | /*-------------------------------------------------------------. |
---|
| 1632 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
---|
| 1633 | `-------------------------------------------------------------*/ |
---|
| 1634 | yyerrlab1: |
---|
| 1635 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
---|
| 1636 | |
---|
| 1637 | for (;;) |
---|
| 1638 | { |
---|
| 1639 | yyn = yypact[yystate]; |
---|
| 1640 | if (yyn != YYPACT_NINF) |
---|
| 1641 | { |
---|
| 1642 | yyn += YYTERROR; |
---|
| 1643 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
---|
| 1644 | { |
---|
| 1645 | yyn = yytable[yyn]; |
---|
| 1646 | if (0 < yyn) |
---|
| 1647 | break; |
---|
| 1648 | } |
---|
| 1649 | } |
---|
| 1650 | |
---|
| 1651 | /* Pop the current state because it cannot handle the error token. */ |
---|
| 1652 | if (yyssp == yyss) |
---|
| 1653 | YYABORT; |
---|
| 1654 | |
---|
| 1655 | yyerror_range[0] = *yylsp; |
---|
| 1656 | yydestruct ("Error: popping", |
---|
| 1657 | yystos[yystate], yyvsp, yylsp, parser, lexer); |
---|
| 1658 | YYPOPSTACK (1); |
---|
| 1659 | yystate = *yyssp; |
---|
| 1660 | YY_STACK_PRINT (yyss, yyssp); |
---|
| 1661 | } |
---|
| 1662 | |
---|
| 1663 | if (yyn == YYFINAL) |
---|
| 1664 | YYACCEPT; |
---|
| 1665 | |
---|
| 1666 | *++yyvsp = yylval; |
---|
| 1667 | |
---|
| 1668 | yyerror_range[1] = yylloc; |
---|
| 1669 | /* Using YYLLOC is tempting, but would change the location of |
---|
| 1670 | the look-ahead. YYLOC is available though. */ |
---|
| 1671 | YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); |
---|
| 1672 | *++yylsp = yyloc; |
---|
| 1673 | |
---|
| 1674 | /* Shift the error token. */ |
---|
| 1675 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
---|
| 1676 | |
---|
| 1677 | yystate = yyn; |
---|
| 1678 | goto yynewstate; |
---|
| 1679 | |
---|
| 1680 | |
---|
| 1681 | /*-------------------------------------. |
---|
| 1682 | | yyacceptlab -- YYACCEPT comes here. | |
---|
| 1683 | `-------------------------------------*/ |
---|
| 1684 | yyacceptlab: |
---|
| 1685 | yyresult = 0; |
---|
| 1686 | goto yyreturn; |
---|
| 1687 | |
---|
| 1688 | /*-----------------------------------. |
---|
| 1689 | | yyabortlab -- YYABORT comes here. | |
---|
| 1690 | `-----------------------------------*/ |
---|
| 1691 | yyabortlab: |
---|
| 1692 | yyresult = 1; |
---|
| 1693 | goto yyreturn; |
---|
| 1694 | |
---|
| 1695 | #ifndef yyoverflow |
---|
| 1696 | /*-------------------------------------------------. |
---|
| 1697 | | yyexhaustedlab -- memory exhaustion comes here. | |
---|
| 1698 | `-------------------------------------------------*/ |
---|
| 1699 | yyexhaustedlab: |
---|
| 1700 | yyerror (&yylloc, parser, lexer, YY_("memory exhausted")); |
---|
| 1701 | yyresult = 2; |
---|
| 1702 | /* Fall through. */ |
---|
| 1703 | #endif |
---|
| 1704 | |
---|
| 1705 | yyreturn: |
---|
| 1706 | if (yychar != YYEOF && yychar != YYEMPTY) |
---|
| 1707 | yydestruct ("Cleanup: discarding lookahead", |
---|
| 1708 | yytoken, &yylval, &yylloc, parser, lexer); |
---|
| 1709 | /* Do not reclaim the symbols of the rule which action triggered |
---|
| 1710 | this YYABORT or YYACCEPT. */ |
---|
| 1711 | YYPOPSTACK (yylen); |
---|
| 1712 | YY_STACK_PRINT (yyss, yyssp); |
---|
| 1713 | while (yyssp != yyss) |
---|
| 1714 | { |
---|
| 1715 | yydestruct ("Cleanup: popping", |
---|
| 1716 | yystos[*yyssp], yyvsp, yylsp, parser, lexer); |
---|
| 1717 | YYPOPSTACK (1); |
---|
| 1718 | } |
---|
| 1719 | #ifndef yyoverflow |
---|
| 1720 | if (yyss != yyssa) |
---|
| 1721 | YYSTACK_FREE (yyss); |
---|
| 1722 | #endif |
---|
| 1723 | #if YYERROR_VERBOSE |
---|
| 1724 | if (yymsg != yymsgbuf) |
---|
| 1725 | YYSTACK_FREE (yymsg); |
---|
| 1726 | #endif |
---|
| 1727 | /* Make sure YYID is used. */ |
---|
| 1728 | return YYID (yyresult); |
---|
| 1729 | } |
---|
| 1730 | |
---|
| 1731 | |
---|
| 1732 | #line 139 "conf_tab.y" |
---|
| 1733 | |
---|
| 1734 | |
---|