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