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