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