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