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