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