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