1 #line 2 "bootscanner.c"
2
3 #line 4 "bootscanner.c"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer boot_yy_create_buffer
10 #define yy_delete_buffer boot_yy_delete_buffer
11 #define yy_scan_buffer boot_yy_scan_buffer
12 #define yy_scan_string boot_yy_scan_string
13 #define yy_scan_bytes boot_yy_scan_bytes
14 #define yy_init_buffer boot_yy_init_buffer
15 #define yy_flush_buffer boot_yy_flush_buffer
16 #define yy_load_buffer_state boot_yy_load_buffer_state
17 #define yy_switch_to_buffer boot_yy_switch_to_buffer
18 #define yypush_buffer_state boot_yypush_buffer_state
19 #define yypop_buffer_state boot_yypop_buffer_state
20 #define yyensure_buffer_stack boot_yyensure_buffer_stack
21 #define yy_flex_debug boot_yy_flex_debug
22 #define yyin boot_yyin
23 #define yyleng boot_yyleng
24 #define yylex boot_yylex
25 #define yylineno boot_yylineno
26 #define yyout boot_yyout
27 #define yyrestart boot_yyrestart
28 #define yytext boot_yytext
29 #define yywrap boot_yywrap
30 #define yyalloc boot_yyalloc
31 #define yyrealloc boot_yyrealloc
32 #define yyfree boot_yyfree
33
34 #define FLEX_SCANNER
35 #define YY_FLEX_MAJOR_VERSION 2
36 #define YY_FLEX_MINOR_VERSION 6
37 #define YY_FLEX_SUBMINOR_VERSION 4
38 #if YY_FLEX_SUBMINOR_VERSION > 0
39 #define FLEX_BETA
40 #endif
41
42 #ifdef yy_create_buffer
43 #define boot_yy_create_buffer_ALREADY_DEFINED
44 #else
45 #define yy_create_buffer boot_yy_create_buffer
46 #endif
47
48 #ifdef yy_delete_buffer
49 #define boot_yy_delete_buffer_ALREADY_DEFINED
50 #else
51 #define yy_delete_buffer boot_yy_delete_buffer
52 #endif
53
54 #ifdef yy_scan_buffer
55 #define boot_yy_scan_buffer_ALREADY_DEFINED
56 #else
57 #define yy_scan_buffer boot_yy_scan_buffer
58 #endif
59
60 #ifdef yy_scan_string
61 #define boot_yy_scan_string_ALREADY_DEFINED
62 #else
63 #define yy_scan_string boot_yy_scan_string
64 #endif
65
66 #ifdef yy_scan_bytes
67 #define boot_yy_scan_bytes_ALREADY_DEFINED
68 #else
69 #define yy_scan_bytes boot_yy_scan_bytes
70 #endif
71
72 #ifdef yy_init_buffer
73 #define boot_yy_init_buffer_ALREADY_DEFINED
74 #else
75 #define yy_init_buffer boot_yy_init_buffer
76 #endif
77
78 #ifdef yy_flush_buffer
79 #define boot_yy_flush_buffer_ALREADY_DEFINED
80 #else
81 #define yy_flush_buffer boot_yy_flush_buffer
82 #endif
83
84 #ifdef yy_load_buffer_state
85 #define boot_yy_load_buffer_state_ALREADY_DEFINED
86 #else
87 #define yy_load_buffer_state boot_yy_load_buffer_state
88 #endif
89
90 #ifdef yy_switch_to_buffer
91 #define boot_yy_switch_to_buffer_ALREADY_DEFINED
92 #else
93 #define yy_switch_to_buffer boot_yy_switch_to_buffer
94 #endif
95
96 #ifdef yypush_buffer_state
97 #define boot_yypush_buffer_state_ALREADY_DEFINED
98 #else
99 #define yypush_buffer_state boot_yypush_buffer_state
100 #endif
101
102 #ifdef yypop_buffer_state
103 #define boot_yypop_buffer_state_ALREADY_DEFINED
104 #else
105 #define yypop_buffer_state boot_yypop_buffer_state
106 #endif
107
108 #ifdef yyensure_buffer_stack
109 #define boot_yyensure_buffer_stack_ALREADY_DEFINED
110 #else
111 #define yyensure_buffer_stack boot_yyensure_buffer_stack
112 #endif
113
114 #ifdef yylex
115 #define boot_yylex_ALREADY_DEFINED
116 #else
117 #define yylex boot_yylex
118 #endif
119
120 #ifdef yyrestart
121 #define boot_yyrestart_ALREADY_DEFINED
122 #else
123 #define yyrestart boot_yyrestart
124 #endif
125
126 #ifdef yylex_init
127 #define boot_yylex_init_ALREADY_DEFINED
128 #else
129 #define yylex_init boot_yylex_init
130 #endif
131
132 #ifdef yylex_init_extra
133 #define boot_yylex_init_extra_ALREADY_DEFINED
134 #else
135 #define yylex_init_extra boot_yylex_init_extra
136 #endif
137
138 #ifdef yylex_destroy
139 #define boot_yylex_destroy_ALREADY_DEFINED
140 #else
141 #define yylex_destroy boot_yylex_destroy
142 #endif
143
144 #ifdef yyget_debug
145 #define boot_yyget_debug_ALREADY_DEFINED
146 #else
147 #define yyget_debug boot_yyget_debug
148 #endif
149
150 #ifdef yyset_debug
151 #define boot_yyset_debug_ALREADY_DEFINED
152 #else
153 #define yyset_debug boot_yyset_debug
154 #endif
155
156 #ifdef yyget_extra
157 #define boot_yyget_extra_ALREADY_DEFINED
158 #else
159 #define yyget_extra boot_yyget_extra
160 #endif
161
162 #ifdef yyset_extra
163 #define boot_yyset_extra_ALREADY_DEFINED
164 #else
165 #define yyset_extra boot_yyset_extra
166 #endif
167
168 #ifdef yyget_in
169 #define boot_yyget_in_ALREADY_DEFINED
170 #else
171 #define yyget_in boot_yyget_in
172 #endif
173
174 #ifdef yyset_in
175 #define boot_yyset_in_ALREADY_DEFINED
176 #else
177 #define yyset_in boot_yyset_in
178 #endif
179
180 #ifdef yyget_out
181 #define boot_yyget_out_ALREADY_DEFINED
182 #else
183 #define yyget_out boot_yyget_out
184 #endif
185
186 #ifdef yyset_out
187 #define boot_yyset_out_ALREADY_DEFINED
188 #else
189 #define yyset_out boot_yyset_out
190 #endif
191
192 #ifdef yyget_leng
193 #define boot_yyget_leng_ALREADY_DEFINED
194 #else
195 #define yyget_leng boot_yyget_leng
196 #endif
197
198 #ifdef yyget_text
199 #define boot_yyget_text_ALREADY_DEFINED
200 #else
201 #define yyget_text boot_yyget_text
202 #endif
203
204 #ifdef yyget_lineno
205 #define boot_yyget_lineno_ALREADY_DEFINED
206 #else
207 #define yyget_lineno boot_yyget_lineno
208 #endif
209
210 #ifdef yyset_lineno
211 #define boot_yyset_lineno_ALREADY_DEFINED
212 #else
213 #define yyset_lineno boot_yyset_lineno
214 #endif
215
216 #ifdef yywrap
217 #define boot_yywrap_ALREADY_DEFINED
218 #else
219 #define yywrap boot_yywrap
220 #endif
221
222 #ifdef yyalloc
223 #define boot_yyalloc_ALREADY_DEFINED
224 #else
225 #define yyalloc boot_yyalloc
226 #endif
227
228 #ifdef yyrealloc
229 #define boot_yyrealloc_ALREADY_DEFINED
230 #else
231 #define yyrealloc boot_yyrealloc
232 #endif
233
234 #ifdef yyfree
235 #define boot_yyfree_ALREADY_DEFINED
236 #else
237 #define yyfree boot_yyfree
238 #endif
239
240 #ifdef yytext
241 #define boot_yytext_ALREADY_DEFINED
242 #else
243 #define yytext boot_yytext
244 #endif
245
246 #ifdef yyleng
247 #define boot_yyleng_ALREADY_DEFINED
248 #else
249 #define yyleng boot_yyleng
250 #endif
251
252 #ifdef yyin
253 #define boot_yyin_ALREADY_DEFINED
254 #else
255 #define yyin boot_yyin
256 #endif
257
258 #ifdef yyout
259 #define boot_yyout_ALREADY_DEFINED
260 #else
261 #define yyout boot_yyout
262 #endif
263
264 #ifdef yy_flex_debug
265 #define boot_yy_flex_debug_ALREADY_DEFINED
266 #else
267 #define yy_flex_debug boot_yy_flex_debug
268 #endif
269
270 #ifdef yylineno
271 #define boot_yylineno_ALREADY_DEFINED
272 #else
273 #define yylineno boot_yylineno
274 #endif
275
276 /* First, we deal with platform-specific or compiler-specific issues. */
277
278 /* begin standard C headers. */
279 #include <stdio.h>
280 #include <string.h>
281 #include <errno.h>
282 #include <stdlib.h>
283
284 /* end standard C headers. */
285
286 /* flex integer type definitions */
287
288 #ifndef FLEXINT_H
289 #define FLEXINT_H
290
291 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292
293 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294
295 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296 * if you want the limit (max/min) macros for int types.
297 */
298 #ifndef __STDC_LIMIT_MACROS
299 #define __STDC_LIMIT_MACROS 1
300 #endif
301
302 #include <inttypes.h>
303 typedef int8_t flex_int8_t;
304 typedef uint8_t flex_uint8_t;
305 typedef int16_t flex_int16_t;
306 typedef uint16_t flex_uint16_t;
307 typedef int32_t flex_int32_t;
308 typedef uint32_t flex_uint32_t;
309 #else
310 typedef signed char flex_int8_t;
311 typedef short int flex_int16_t;
312 typedef int flex_int32_t;
313 typedef unsigned char flex_uint8_t;
314 typedef unsigned short int flex_uint16_t;
315 typedef unsigned int flex_uint32_t;
316
317 /* Limits of integral types. */
318 #ifndef INT8_MIN
319 #define INT8_MIN (-128)
320 #endif
321 #ifndef INT16_MIN
322 #define INT16_MIN (-32767-1)
323 #endif
324 #ifndef INT32_MIN
325 #define INT32_MIN (-2147483647-1)
326 #endif
327 #ifndef INT8_MAX
328 #define INT8_MAX (127)
329 #endif
330 #ifndef INT16_MAX
331 #define INT16_MAX (32767)
332 #endif
333 #ifndef INT32_MAX
334 #define INT32_MAX (2147483647)
335 #endif
336 #ifndef UINT8_MAX
337 #define UINT8_MAX (255U)
338 #endif
339 #ifndef UINT16_MAX
340 #define UINT16_MAX (65535U)
341 #endif
342 #ifndef UINT32_MAX
343 #define UINT32_MAX (4294967295U)
344 #endif
345
346 #ifndef SIZE_MAX
347 #define SIZE_MAX (~(size_t)0)
348 #endif
349
350 #endif /* ! C99 */
351
352 #endif /* ! FLEXINT_H */
353
354 /* begin standard C++ headers. */
355
356 /* TODO: this is always defined, so inline it */
357 #define yyconst const
358
359 #if defined(__GNUC__) && __GNUC__ >= 3
360 #define yynoreturn __attribute__((__noreturn__))
361 #else
362 #define yynoreturn
363 #endif
364
365 /* Returned upon end-of-file. */
366 #define YY_NULL 0
367
368 /* Promotes a possibly negative, possibly signed char to an
369 * integer in range [0..255] for use as an array index.
370 */
371 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372
373 /* Enter a start condition. This macro really ought to take a parameter,
374 * but we do it the disgusting crufty way forced on us by the ()-less
375 * definition of BEGIN.
376 */
377 #define BEGIN (yy_start) = 1 + 2 *
378 /* Translate the current start state into a value that can be later handed
379 * to BEGIN to return to the state. The YYSTATE alias is for lex
380 * compatibility.
381 */
382 #define YY_START (((yy_start) - 1) / 2)
383 #define YYSTATE YY_START
384 /* Action number for EOF rule of a given start state. */
385 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386 /* Special action meaning "start processing a new file". */
387 #define YY_NEW_FILE yyrestart( yyin )
388 #define YY_END_OF_BUFFER_CHAR 0
389
390 /* Size of default input buffer. */
391 #ifndef YY_BUF_SIZE
392 #ifdef __ia64__
393 /* On IA-64, the buffer size is 16k, not 8k.
394 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395 * Ditto for the __ia64__ case accordingly.
396 */
397 #define YY_BUF_SIZE 32768
398 #else
399 #define YY_BUF_SIZE 16384
400 #endif /* __ia64__ */
401 #endif
402
403 /* The state buf must be large enough to hold one state per character in the main buffer.
404 */
405 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406
407 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
408 #define YY_TYPEDEF_YY_BUFFER_STATE
409 typedef struct yy_buffer_state *YY_BUFFER_STATE;
410 #endif
411
412 #ifndef YY_TYPEDEF_YY_SIZE_T
413 #define YY_TYPEDEF_YY_SIZE_T
414 typedef size_t yy_size_t;
415 #endif
416
417 extern int yyleng;
418
419 extern FILE *yyin, *yyout;
420
421 #define EOB_ACT_CONTINUE_SCAN 0
422 #define EOB_ACT_END_OF_FILE 1
423 #define EOB_ACT_LAST_MATCH 2
424
425 #define YY_LESS_LINENO(n)
426 #define YY_LINENO_REWIND_TO(ptr)
427
428 /* Return all but the first "n" matched characters back to the input stream. */
429 #define yyless(n) \
430 do \
431 { \
432 /* Undo effects of setting up yytext. */ \
433 int yyless_macro_arg = (n); \
434 YY_LESS_LINENO(yyless_macro_arg);\
435 *yy_cp = (yy_hold_char); \
436 YY_RESTORE_YY_MORE_OFFSET \
437 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
438 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
439 } \
440 while ( 0 )
441 #define unput(c) yyunput( c, (yytext_ptr) )
442
443 #ifndef YY_STRUCT_YY_BUFFER_STATE
444 #define YY_STRUCT_YY_BUFFER_STATE
445 struct yy_buffer_state
446 {
447 FILE *yy_input_file;
448
449 char *yy_ch_buf; /* input buffer */
450 char *yy_buf_pos; /* current position in input buffer */
451
452 /* Size of input buffer in bytes, not including room for EOB
453 * characters.
454 */
455 int yy_buf_size;
456
457 /* Number of characters read into yy_ch_buf, not including EOB
458 * characters.
459 */
460 int yy_n_chars;
461
462 /* Whether we "own" the buffer - i.e., we know we created it,
463 * and can realloc() it to grow it, and should free() it to
464 * delete it.
465 */
466 int yy_is_our_buffer;
467
468 /* Whether this is an "interactive" input source; if so, and
469 * if we're using stdio for input, then we want to use getc()
470 * instead of fread(), to make sure we stop fetching input after
471 * each newline.
472 */
473 int yy_is_interactive;
474
475 /* Whether we're considered to be at the beginning of a line.
476 * If so, '^' rules will be active on the next match, otherwise
477 * not.
478 */
479 int yy_at_bol;
480
481 int yy_bs_lineno; /**< The line count. */
482 int yy_bs_column; /**< The column count. */
483
484 /* Whether to try to fill the input buffer when we reach the
485 * end of it.
486 */
487 int yy_fill_buffer;
488
489 int yy_buffer_status;
490
491 #define YY_BUFFER_NEW 0
492 #define YY_BUFFER_NORMAL 1
493 /* When an EOF's been seen but there's still some text to process
494 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
495 * shouldn't try reading from the input source any more. We might
496 * still have a bunch of tokens to match, though, because of
497 * possible backing-up.
498 *
499 * When we actually see the EOF, we change the status to "new"
500 * (via yyrestart()), so that the user can continue scanning by
501 * just pointing yyin at a new input file.
502 */
503 #define YY_BUFFER_EOF_PENDING 2
504
505 };
506 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
507
508 /* Stack of input buffers. */
509 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
510 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
511 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
512
513 /* We provide macros for accessing buffer states in case in the
514 * future we want to put the buffer states in a more general
515 * "scanner state".
516 *
517 * Returns the top of the stack, or NULL.
518 */
519 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
520 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
521 : NULL)
522 /* Same as previous macro, but useful when we know that the buffer stack is not
523 * NULL or when we need an lvalue. For internal use only.
524 */
525 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
526
527 /* yy_hold_char holds the character lost when yytext is formed. */
528 static char yy_hold_char;
529 static int yy_n_chars; /* number of characters read into yy_ch_buf */
530 int yyleng;
531
532 /* Points to current character in buffer. */
533 static char *yy_c_buf_p = NULL;
534 static int yy_init = 0; /* whether we need to initialize */
535 static int yy_start = 0; /* start state number */
536
537 /* Flag which is used to allow yywrap()'s to do buffer switches
538 * instead of setting up a fresh yyin. A bit of a hack ...
539 */
540 static int yy_did_buffer_switch_on_eof;
541
542 void yyrestart ( FILE *input_file );
543 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
544 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
545 void yy_delete_buffer ( YY_BUFFER_STATE b );
546 void yy_flush_buffer ( YY_BUFFER_STATE b );
547 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
548 void yypop_buffer_state ( void );
549
550 static void yyensure_buffer_stack ( void );
551 static void yy_load_buffer_state ( void );
552 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
553 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
554
555 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
556 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
557 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
558
559 void *yyalloc ( yy_size_t );
560 void *yyrealloc ( void *, yy_size_t );
561 void yyfree ( void * );
562
563 #define yy_new_buffer yy_create_buffer
564 #define yy_set_interactive(is_interactive) \
565 { \
566 if ( ! YY_CURRENT_BUFFER ){ \
567 yyensure_buffer_stack (); \
568 YY_CURRENT_BUFFER_LVALUE = \
569 yy_create_buffer( yyin, YY_BUF_SIZE ); \
570 } \
571 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
572 }
573 #define yy_set_bol(at_bol) \
574 { \
575 if ( ! YY_CURRENT_BUFFER ){\
576 yyensure_buffer_stack (); \
577 YY_CURRENT_BUFFER_LVALUE = \
578 yy_create_buffer( yyin, YY_BUF_SIZE ); \
579 } \
580 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
581 }
582 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
583
584 /* Begin user sect3 */
585
586 #define boot_yywrap() (/*CONSTCOND*/1)
587 #define YY_SKIP_YYWRAP
588 typedef flex_uint8_t YY_CHAR;
589
590 FILE *yyin = NULL, *yyout = NULL;
591
592 typedef int yy_state_type;
593
594 extern int yylineno;
595 int yylineno = 1;
596
597 extern char *yytext;
598 #ifdef yytext_ptr
599 #undef yytext_ptr
600 #endif
601 #define yytext_ptr yytext
602
603 static yy_state_type yy_get_previous_state ( void );
604 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
605 static int yy_get_next_buffer ( void );
606 static void yynoreturn yy_fatal_error ( const char* msg );
607
608 /* Done after the current pattern has been matched and before the
609 * corresponding action - sets up yytext.
610 */
611 #define YY_DO_BEFORE_ACTION \
612 (yytext_ptr) = yy_bp; \
613 yyleng = (int) (yy_cp - yy_bp); \
614 (yy_hold_char) = *yy_cp; \
615 *yy_cp = '\0'; \
616 (yy_c_buf_p) = yy_cp;
617 #define YY_NUM_RULES 34
618 #define YY_END_OF_BUFFER 35
619 /* This struct is not used in this scanner,
620 but its presence is necessary. */
621 struct yy_trans_info
622 {
623 flex_int32_t yy_verify;
624 flex_int32_t yy_nxt;
625 };
626 static const flex_int16_t yy_accept[150] =
627 { 0,
628 0, 0, 35, 33, 16, 15, 17, 33, 13, 14,
629 11, 31, 31, 12, 31, 31, 31, 33, 31, 31,
630 31, 31, 31, 31, 31, 31, 31, 31, 31, 18,
631 0, 32, 31, 0, 31, 0, 31, 31, 31, 31,
632 0, 31, 31, 31, 31, 31, 31, 31, 24, 31,
633 31, 31, 31, 31, 31, 31, 18, 0, 30, 31,
634 28, 31, 4, 0, 31, 31, 31, 31, 31, 31,
635 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
636 29, 31, 31, 31, 31, 31, 31, 31, 31, 31,
637 1, 31, 31, 31, 31, 31, 31, 27, 31, 31,
638
639 20, 2, 31, 31, 23, 31, 31, 31, 31, 26,
640 31, 25, 31, 9, 31, 3, 31, 31, 10, 31,
641 31, 22, 31, 31, 19, 21, 31, 31, 31, 31,
642 31, 31, 31, 5, 31, 31, 31, 31, 31, 31,
643 8, 31, 31, 31, 7, 31, 31, 6, 0
644 } ;
645
646 static const YY_CHAR yy_ec[256] =
647 { 0,
648 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 4, 1, 5, 6, 1, 1, 1, 1, 7,
652 8, 1, 1, 9, 10, 1, 1, 11, 11, 11,
653 11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
654 12, 1, 1, 1, 13, 13, 14, 15, 16, 17,
655 13, 13, 18, 13, 13, 19, 13, 20, 21, 13,
656 13, 22, 13, 23, 24, 13, 13, 13, 13, 13,
657 25, 26, 27, 1, 28, 1, 29, 30, 31, 32,
658
659 33, 13, 34, 35, 36, 13, 13, 37, 13, 38,
660 39, 40, 41, 42, 43, 44, 45, 13, 46, 47,
661 48, 13, 1, 1, 1, 1, 1, 1, 1, 1,
662 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
663 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
664 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
666 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669
670 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
672 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
673 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
674 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
675 1, 1, 1, 1, 1
676 } ;
677
678 static const YY_CHAR yy_meta[49] =
679 { 0,
680 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
681 3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
682 3, 3, 3, 3, 4, 3, 1, 3, 3, 3,
683 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
684 3, 3, 3, 3, 3, 3, 3, 3
685 } ;
686
687 static const flex_int16_t yy_base[154] =
688 { 0,
689 0, 77, 82, 671, 671, 671, 671, 76, 671, 671,
690 671, 34, 39, 671, 41, 47, 51, 47, 49, 53,
691 60, 70, 74, 79, 81, 83, 100, 103, 106, 0,
692 51, 671, 29, 43, 111, 100, 123, 128, 133, 140,
693 42, 137, 146, 150, 154, 158, 163, 171, 180, 182,
694 185, 191, 199, 208, 211, 213, 0, 103, 671, 216,
695 225, 230, 233, 41, 235, 238, 242, 244, 252, 263,
696 265, 270, 282, 284, 287, 289, 292, 296, 301, 314,
697 321, 325, 327, 331, 333, 335, 339, 357, 359, 361,
698 363, 366, 368, 371, 385, 392, 395, 397, 399, 403,
699
700 406, 423, 425, 427, 429, 431, 434, 436, 455, 457,
701 460, 463, 465, 469, 474, 482, 486, 488, 492, 495,
702 499, 512, 516, 519, 524, 526, 529, 533, 536, 543,
703 546, 553, 555, 563, 566, 572, 574, 580, 591, 593,
704 597, 601, 603, 605, 611, 614, 622, 624, 671, 660,
705 47, 662, 666
706 } ;
707
708 static const flex_int16_t yy_def[154] =
709 { 0,
710 149, 1, 149, 149, 149, 149, 149, 150, 149, 149,
711 149, 151, 152, 149, 152, 152, 152, 149, 152, 152,
712 152, 152, 152, 152, 152, 152, 152, 152, 152, 153,
713 150, 149, 151, 149, 152, 149, 152, 152, 152, 152,
714 149, 152, 152, 152, 152, 152, 152, 152, 152, 152,
715 152, 152, 152, 152, 152, 152, 153, 149, 149, 152,
716 152, 152, 152, 149, 152, 152, 152, 152, 152, 152,
717 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
718 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
719 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
720
721 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
722 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
723 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
724 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
725 152, 152, 152, 152, 152, 152, 152, 152, 0, 149,
726 149, 149, 149
727 } ;
728
729 static const flex_int16_t yy_nxt[720] =
730 { 0,
731 4, 5, 6, 7, 8, 4, 9, 10, 11, 12,
732 13, 14, 13, 13, 13, 13, 15, 13, 13, 16,
733 17, 13, 13, 13, 4, 18, 4, 19, 13, 20,
734 21, 22, 13, 13, 13, 23, 13, 13, 24, 13,
735 13, 25, 26, 27, 28, 29, 13, 13, 33, 33,
736 33, 33, 64, 41, 34, 32, 33, 41, 33, 34,
737 33, 37, 33, 36, 34, 36, 34, 38, 40, 33,
738 39, 36, 34, 36, 34, 36, 34, 36, 34, 33,
739 32, 149, 30, 33, 36, 34, 42, 149, 33, 149,
740 33, 43, 33, 149, 36, 34, 45, 44, 36, 34,
741
742 149, 46, 47, 36, 34, 36, 34, 36, 34, 33,
743 58, 48, 33, 58, 149, 33, 49, 52, 50, 51,
744 33, 149, 149, 149, 36, 34, 59, 36, 34, 59,
745 36, 34, 33, 149, 149, 36, 34, 33, 53, 149,
746 54, 56, 33, 149, 60, 55, 33, 36, 34, 33,
747 61, 62, 36, 34, 63, 33, 149, 36, 34, 33,
748 149, 36, 34, 33, 36, 34, 149, 33, 149, 149,
749 36, 34, 33, 149, 36, 34, 149, 149, 36, 34,
750 33, 65, 36, 34, 66, 67, 149, 36, 34, 33,
751 69, 33, 68, 70, 33, 36, 34, 149, 149, 149,
752
753 33, 149, 71, 149, 36, 34, 36, 34, 33, 36,
754 34, 149, 149, 72, 73, 36, 34, 33, 149, 75,
755 33, 149, 33, 36, 34, 33, 149, 76, 149, 80,
756 74, 149, 36, 34, 33, 36, 34, 36, 34, 33,
757 36, 34, 33, 77, 33, 149, 78, 33, 81, 36,
758 34, 33, 149, 33, 36, 34, 79, 36, 34, 36,
759 34, 33, 36, 34, 149, 149, 36, 34, 36, 34,
760 149, 82, 33, 149, 33, 149, 36, 34, 84, 33,
761 86, 83, 149, 149, 149, 149, 85, 36, 34, 36,
762 34, 33, 149, 33, 36, 34, 33, 88, 33, 87,
763
764 89, 33, 90, 149, 149, 33, 36, 34, 36, 34,
765 33, 36, 34, 36, 34, 149, 36, 34, 149, 91,
766 36, 34, 149, 33, 149, 36, 34, 92, 93, 98,
767 33, 94, 95, 96, 33, 97, 33, 149, 36, 34,
768 33, 149, 33, 149, 33, 36, 34, 149, 33, 36,
769 34, 36, 34, 149, 149, 36, 34, 36, 34, 36,
770 34, 99, 101, 36, 34, 102, 33, 104, 33, 100,
771 33, 149, 33, 149, 149, 33, 149, 33, 103, 149,
772 33, 36, 34, 36, 34, 36, 34, 36, 34, 106,
773 36, 34, 36, 34, 33, 36, 34, 149, 149, 149,
774
775 109, 33, 107, 105, 33, 149, 33, 149, 33, 36,
776 34, 149, 33, 108, 110, 33, 36, 34, 149, 36,
777 34, 36, 34, 36, 34, 112, 114, 36, 34, 111,
778 36, 34, 33, 113, 33, 149, 33, 149, 33, 149,
779 33, 149, 149, 33, 149, 33, 115, 36, 34, 36,
780 34, 36, 34, 36, 34, 36, 34, 116, 36, 34,
781 36, 34, 149, 118, 33, 149, 33, 149, 117, 33,
782 149, 149, 33, 149, 33, 120, 149, 119, 33, 36,
783 34, 36, 34, 33, 36, 34, 121, 36, 34, 36,
784 34, 33, 122, 36, 34, 33, 149, 33, 36, 34,
785
786 149, 33, 149, 149, 33, 149, 36, 34, 33, 123,
787 36, 34, 36, 34, 149, 124, 36, 34, 125, 36,
788 34, 33, 149, 36, 34, 33, 128, 127, 33, 149,
789 126, 149, 149, 33, 149, 33, 36, 34, 33, 149,
790 36, 34, 33, 36, 34, 33, 149, 130, 36, 34,
791 36, 34, 33, 36, 34, 33, 131, 36, 34, 129,
792 36, 34, 33, 133, 33, 149, 149, 36, 34, 149,
793 36, 34, 33, 149, 132, 33, 149, 36, 34, 36,
794 34, 33, 134, 33, 135, 136, 149, 36, 34, 33,
795 36, 34, 149, 137, 149, 149, 36, 34, 36, 34,
796
797 33, 138, 33, 149, 36, 34, 33, 149, 139, 140,
798 33, 141, 33, 149, 33, 36, 34, 36, 34, 142,
799 33, 36, 34, 33, 143, 36, 34, 36, 34, 36,
800 34, 33, 149, 33, 149, 36, 34, 149, 36, 34,
801 146, 149, 149, 149, 144, 145, 36, 34, 36, 34,
802 149, 149, 147, 149, 149, 149, 149, 149, 149, 148,
803 31, 31, 31, 31, 35, 35, 57, 149, 57, 57,
804 3, 149, 149, 149, 149, 149, 149, 149, 149, 149,
805 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
806 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
807
808 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
809 149, 149, 149, 149, 149, 149, 149, 149, 149
810 } ;
811
812 static const flex_int16_t yy_chk[720] =
813 { 0,
814 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
815 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
816 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
817 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
818 1, 1, 1, 1, 1, 1, 1, 1, 13, 151,
819 15, 64, 41, 34, 33, 31, 16, 18, 19, 12,
820 17, 15, 20, 13, 13, 15, 15, 16, 17, 21,
821 16, 16, 16, 19, 19, 17, 17, 20, 20, 22,
822 8, 3, 2, 23, 21, 21, 19, 0, 24, 0,
823 25, 20, 26, 0, 22, 22, 21, 20, 23, 23,
824
825 0, 21, 22, 24, 24, 25, 25, 26, 26, 27,
826 36, 23, 28, 58, 0, 29, 24, 26, 24, 25,
827 35, 0, 0, 0, 27, 27, 36, 28, 28, 58,
828 29, 29, 37, 0, 0, 35, 35, 38, 27, 0,
829 28, 29, 39, 0, 37, 28, 42, 37, 37, 40,
830 38, 39, 38, 38, 40, 43, 0, 39, 39, 44,
831 0, 42, 42, 45, 40, 40, 0, 46, 0, 0,
832 43, 43, 47, 0, 44, 44, 0, 0, 45, 45,
833 48, 42, 46, 46, 43, 44, 0, 47, 47, 49,
834 46, 50, 45, 47, 51, 48, 48, 0, 0, 0,
835
836 52, 0, 48, 0, 49, 49, 50, 50, 53, 51,
837 51, 0, 0, 48, 50, 52, 52, 54, 0, 52,
838 55, 0, 56, 53, 53, 60, 0, 53, 0, 60,
839 51, 0, 54, 54, 61, 55, 55, 56, 56, 62,
840 60, 60, 63, 54, 65, 0, 55, 66, 62, 61,
841 61, 67, 0, 68, 62, 62, 56, 63, 63, 65,
842 65, 69, 66, 66, 0, 0, 67, 67, 68, 68,
843 0, 65, 70, 0, 71, 0, 69, 69, 67, 72,
844 69, 66, 0, 0, 0, 0, 68, 70, 70, 71,
845 71, 73, 0, 74, 72, 72, 75, 71, 76, 70,
846
847 71, 77, 72, 0, 0, 78, 73, 73, 74, 74,
848 79, 75, 75, 76, 76, 0, 77, 77, 0, 73,
849 78, 78, 0, 80, 0, 79, 79, 74, 75, 80,
850 81, 76, 77, 78, 82, 79, 83, 0, 80, 80,
851 84, 0, 85, 0, 86, 81, 81, 0, 87, 82,
852 82, 83, 83, 0, 0, 84, 84, 85, 85, 86,
853 86, 82, 84, 87, 87, 85, 88, 87, 89, 83,
854 90, 0, 91, 0, 0, 92, 0, 93, 86, 0,
855 94, 88, 88, 89, 89, 90, 90, 91, 91, 89,
856 92, 92, 93, 93, 95, 94, 94, 0, 0, 0,
857
858 93, 96, 90, 88, 97, 0, 98, 0, 99, 95,
859 95, 0, 100, 92, 94, 101, 96, 96, 0, 97,
860 97, 98, 98, 99, 99, 96, 99, 100, 100, 95,
861 101, 101, 102, 97, 103, 0, 104, 0, 105, 0,
862 106, 0, 0, 107, 0, 108, 100, 102, 102, 103,
863 103, 104, 104, 105, 105, 106, 106, 103, 107, 107,
864 108, 108, 0, 106, 109, 0, 110, 0, 104, 111,
865 0, 0, 112, 0, 113, 108, 0, 107, 114, 109,
866 109, 110, 110, 115, 111, 111, 109, 112, 112, 113,
867 113, 116, 111, 114, 114, 117, 0, 118, 115, 115,
868
869 0, 119, 0, 0, 120, 0, 116, 116, 121, 113,
870 117, 117, 118, 118, 0, 115, 119, 119, 117, 120,
871 120, 122, 0, 121, 121, 123, 121, 120, 124, 0,
872 118, 0, 0, 125, 0, 126, 122, 122, 127, 0,
873 123, 123, 128, 124, 124, 129, 0, 124, 125, 125,
874 126, 126, 130, 127, 127, 131, 127, 128, 128, 123,
875 129, 129, 132, 129, 133, 0, 0, 130, 130, 0,
876 131, 131, 134, 0, 128, 135, 0, 132, 132, 133,
877 133, 136, 130, 137, 131, 132, 0, 134, 134, 138,
878 135, 135, 0, 133, 0, 0, 136, 136, 137, 137,
879
880 139, 135, 140, 0, 138, 138, 141, 0, 136, 137,
881 142, 138, 143, 0, 144, 139, 139, 140, 140, 139,
882 145, 141, 141, 146, 140, 142, 142, 143, 143, 144,
883 144, 147, 0, 148, 0, 145, 145, 0, 146, 146,
884 144, 0, 0, 0, 142, 143, 147, 147, 148, 148,
885 0, 0, 146, 0, 0, 0, 0, 0, 0, 147,
886 150, 150, 150, 150, 152, 152, 153, 0, 153, 153,
887 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
888 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
889 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
890
891 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
892 149, 149, 149, 149, 149, 149, 149, 149, 149
893 } ;
894
895 static yy_state_type yy_last_accepting_state;
896 static char *yy_last_accepting_cpos;
897
898 extern int yy_flex_debug;
899 int yy_flex_debug = 0;
900
901 /* The intent behind this definition is that it'll catch
902 * any uses of REJECT which flex missed.
903 */
904 #define REJECT reject_used_but_not_detected
905 #define yymore() yymore_used_but_not_detected
906 #define YY_MORE_ADJ 0
907 #define YY_RESTORE_YY_MORE_OFFSET
908 char *yytext;
909 #line 1 "bootscanner.l"
910 #line 2 "bootscanner.l"
911 /*-------------------------------------------------------------------------
912 *
913 * bootscanner.l
914 * a lexical scanner for the bootstrap parser
915 *
916 * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
917 * Portions Copyright (c) 1994, Regents of the University of California
918 *
919 *
920 * IDENTIFICATION
921 * src/backend/bootstrap/bootscanner.l
922 *
923 *-------------------------------------------------------------------------
924 */
925 #include "postgres.h"
926
927 #include "access/attnum.h"
928 #include "access/htup.h"
929 #include "access/itup.h"
930 #include "access/tupdesc.h"
931 #include "bootstrap/bootstrap.h"
932 #include "catalog/pg_am.h"
933 #include "catalog/pg_attribute.h"
934 #include "catalog/pg_class.h"
935 #include "nodes/nodes.h"
936 #include "nodes/parsenodes.h"
937 #include "nodes/pg_list.h"
938 #include "nodes/primnodes.h"
939 #include "parser/scansup.h"
940 #include "rewrite/prs2lock.h"
941 #include "storage/block.h"
942 #include "storage/fd.h"
943 #include "storage/itemptr.h"
944 #include "storage/off.h"
945 #include "utils/rel.h"
946
947 /* Not needed now that this file is compiled as part of bootparse. */
948 /* #include "bootparse.h" */
949
950
951 /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
952 #undef fprintf
953 #define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg)
954
955 static void
fprintf_to_ereport(const char * fmt,const char * msg)956 fprintf_to_ereport(const char *fmt, const char *msg)
957 {
958 ereport(ERROR, (errmsg_internal("%s", msg)));
959 }
960
961
962 static int yyline = 1; /* line number for error reporting */
963
964 #line 965 "bootscanner.c"
965 #define YY_NO_INPUT 1
966 #line 967 "bootscanner.c"
967
968 #define INITIAL 0
969
970 #ifndef YY_NO_UNISTD_H
971 /* Special case for "unistd.h", since it is non-ANSI. We include it way
972 * down here because we want the user's section 1 to have been scanned first.
973 * The user has a chance to override it with an option.
974 */
975 #include <unistd.h>
976 #endif
977
978 #ifndef YY_EXTRA_TYPE
979 #define YY_EXTRA_TYPE void *
980 #endif
981
982 static int yy_init_globals ( void );
983
984 /* Accessor methods to globals.
985 These are made visible to non-reentrant scanners for convenience. */
986
987 int yylex_destroy ( void );
988
989 int yyget_debug ( void );
990
991 void yyset_debug ( int debug_flag );
992
993 YY_EXTRA_TYPE yyget_extra ( void );
994
995 void yyset_extra ( YY_EXTRA_TYPE user_defined );
996
997 FILE *yyget_in ( void );
998
999 void yyset_in ( FILE * _in_str );
1000
1001 FILE *yyget_out ( void );
1002
1003 void yyset_out ( FILE * _out_str );
1004
1005 int yyget_leng ( void );
1006
1007 char *yyget_text ( void );
1008
1009 int yyget_lineno ( void );
1010
1011 void yyset_lineno ( int _line_number );
1012
1013 /* Macros after this point can all be overridden by user definitions in
1014 * section 1.
1015 */
1016
1017 #ifndef YY_SKIP_YYWRAP
1018 #ifdef __cplusplus
1019 extern "C" int yywrap ( void );
1020 #else
1021 extern int yywrap ( void );
1022 #endif
1023 #endif
1024
1025 #ifndef YY_NO_UNPUT
1026
1027 #endif
1028
1029 #ifndef yytext_ptr
1030 static void yy_flex_strncpy ( char *, const char *, int );
1031 #endif
1032
1033 #ifdef YY_NEED_STRLEN
1034 static int yy_flex_strlen ( const char * );
1035 #endif
1036
1037 #ifndef YY_NO_INPUT
1038 #ifdef __cplusplus
1039 static int yyinput ( void );
1040 #else
1041 static int input ( void );
1042 #endif
1043
1044 #endif
1045
1046 /* Amount of stuff to slurp up with each read. */
1047 #ifndef YY_READ_BUF_SIZE
1048 #ifdef __ia64__
1049 /* On IA-64, the buffer size is 16k, not 8k */
1050 #define YY_READ_BUF_SIZE 16384
1051 #else
1052 #define YY_READ_BUF_SIZE 8192
1053 #endif /* __ia64__ */
1054 #endif
1055
1056 /* Copy whatever the last rule matched to the standard output. */
1057 #ifndef ECHO
1058 /* This used to be an fputs(), but since the string might contain NUL's,
1059 * we now use fwrite().
1060 */
1061 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1062 #endif
1063
1064 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1065 * is returned in "result".
1066 */
1067 #ifndef YY_INPUT
1068 #define YY_INPUT(buf,result,max_size) \
1069 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1070 { \
1071 int c = '*'; \
1072 int n; \
1073 for ( n = 0; n < max_size && \
1074 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1075 buf[n] = (char) c; \
1076 if ( c == '\n' ) \
1077 buf[n++] = (char) c; \
1078 if ( c == EOF && ferror( yyin ) ) \
1079 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1080 result = n; \
1081 } \
1082 else \
1083 { \
1084 errno=0; \
1085 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1086 { \
1087 if( errno != EINTR) \
1088 { \
1089 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1090 break; \
1091 } \
1092 errno=0; \
1093 clearerr(yyin); \
1094 } \
1095 }\
1096 \
1097
1098 #endif
1099
1100 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1101 * we don't want an extra ';' after the "return" because that will cause
1102 * some compilers to complain about unreachable statements.
1103 */
1104 #ifndef yyterminate
1105 #define yyterminate() return YY_NULL
1106 #endif
1107
1108 /* Number of entries by which start-condition stack grows. */
1109 #ifndef YY_START_STACK_INCR
1110 #define YY_START_STACK_INCR 25
1111 #endif
1112
1113 /* Report a fatal error. */
1114 #ifndef YY_FATAL_ERROR
1115 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1116 #endif
1117
1118 /* end tables serialization structures and prototypes */
1119
1120 /* Default declaration of generated scanner - a define so the user can
1121 * easily add parameters.
1122 */
1123 #ifndef YY_DECL
1124 #define YY_DECL_IS_OURS 1
1125
1126 extern int yylex (void);
1127
1128 #define YY_DECL int yylex (void)
1129 #endif /* !YY_DECL */
1130
1131 /* Code executed at the beginning of each rule, after yytext and yyleng
1132 * have been set up.
1133 */
1134 #ifndef YY_USER_ACTION
1135 #define YY_USER_ACTION
1136 #endif
1137
1138 /* Code executed at the end of each rule. */
1139 #ifndef YY_BREAK
1140 #define YY_BREAK /*LINTED*/break;
1141 #endif
1142
1143 #define YY_RULE_SETUP \
1144 if ( yyleng > 0 ) \
1145 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1146 (yytext[yyleng - 1] == '\n'); \
1147 YY_USER_ACTION
1148
1149 /** The main scanner function which does all the work.
1150 */
1151 YY_DECL
1152 {
1153 yy_state_type yy_current_state;
1154 char *yy_cp, *yy_bp;
1155 int yy_act;
1156
1157 if ( !(yy_init) )
1158 {
1159 (yy_init) = 1;
1160
1161 #ifdef YY_USER_INIT
1162 YY_USER_INIT;
1163 #endif
1164
1165 if ( ! (yy_start) )
1166 (yy_start) = 1; /* first start state */
1167
1168 if ( ! yyin )
1169 yyin = stdin;
1170
1171 if ( ! yyout )
1172 yyout = stdout;
1173
1174 if ( ! YY_CURRENT_BUFFER ) {
1175 yyensure_buffer_stack ();
1176 YY_CURRENT_BUFFER_LVALUE =
1177 yy_create_buffer( yyin, YY_BUF_SIZE );
1178 }
1179
1180 yy_load_buffer_state( );
1181 }
1182
1183 {
1184 #line 73 "bootscanner.l"
1185
1186
1187 #line 1188 "bootscanner.c"
1188
1189 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1190 {
1191 yy_cp = (yy_c_buf_p);
1192
1193 /* Support of yytext. */
1194 *yy_cp = (yy_hold_char);
1195
1196 /* yy_bp points to the position in yy_ch_buf of the start of
1197 * the current run.
1198 */
1199 yy_bp = yy_cp;
1200
1201 yy_current_state = (yy_start);
1202 yy_current_state += YY_AT_BOL();
1203 yy_match:
1204 do
1205 {
1206 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1207 if ( yy_accept[yy_current_state] )
1208 {
1209 (yy_last_accepting_state) = yy_current_state;
1210 (yy_last_accepting_cpos) = yy_cp;
1211 }
1212 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1213 {
1214 yy_current_state = (int) yy_def[yy_current_state];
1215 if ( yy_current_state >= 150 )
1216 yy_c = yy_meta[yy_c];
1217 }
1218 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1219 ++yy_cp;
1220 }
1221 while ( yy_current_state != 149 );
1222 yy_cp = (yy_last_accepting_cpos);
1223 yy_current_state = (yy_last_accepting_state);
1224
1225 yy_find_action:
1226 yy_act = yy_accept[yy_current_state];
1227
1228 YY_DO_BEFORE_ACTION;
1229
1230 do_action: /* This label is used only to access EOF actions. */
1231
1232 switch ( yy_act )
1233 { /* beginning of action switch */
1234 case 0: /* must back up */
1235 /* undo the effects of YY_DO_BEFORE_ACTION */
1236 *yy_cp = (yy_hold_char);
1237 yy_cp = (yy_last_accepting_cpos);
1238 yy_current_state = (yy_last_accepting_state);
1239 goto yy_find_action;
1240
1241 case 1:
1242 YY_RULE_SETUP
1243 #line 75 "bootscanner.l"
1244 { return(OPEN); }
1245 YY_BREAK
1246 case 2:
1247 YY_RULE_SETUP
1248 #line 77 "bootscanner.l"
1249 { return(XCLOSE); }
1250 YY_BREAK
1251 case 3:
1252 YY_RULE_SETUP
1253 #line 79 "bootscanner.l"
1254 { return(XCREATE); }
1255 YY_BREAK
1256 case 4:
1257 YY_RULE_SETUP
1258 #line 81 "bootscanner.l"
1259 { return(OBJ_ID); }
1260 YY_BREAK
1261 case 5:
1262 YY_RULE_SETUP
1263 #line 82 "bootscanner.l"
1264 { return(XBOOTSTRAP); }
1265 YY_BREAK
1266 case 6:
1267 YY_RULE_SETUP
1268 #line 83 "bootscanner.l"
1269 { return(XSHARED_RELATION); }
1270 YY_BREAK
1271 case 7:
1272 YY_RULE_SETUP
1273 #line 84 "bootscanner.l"
1274 { return(XWITHOUT_OIDS); }
1275 YY_BREAK
1276 case 8:
1277 YY_RULE_SETUP
1278 #line 85 "bootscanner.l"
1279 { return(XROWTYPE_OID); }
1280 YY_BREAK
1281 case 9:
1282 YY_RULE_SETUP
1283 #line 86 "bootscanner.l"
1284 { return(NULLVAL); }
1285 YY_BREAK
1286 case 10:
1287 YY_RULE_SETUP
1288 #line 88 "bootscanner.l"
1289 { return(INSERT_TUPLE); }
1290 YY_BREAK
1291 case 11:
1292 YY_RULE_SETUP
1293 #line 90 "bootscanner.l"
1294 { return(COMMA); }
1295 YY_BREAK
1296 case 12:
1297 YY_RULE_SETUP
1298 #line 91 "bootscanner.l"
1299 { return(EQUALS); }
1300 YY_BREAK
1301 case 13:
1302 YY_RULE_SETUP
1303 #line 92 "bootscanner.l"
1304 { return(LPAREN); }
1305 YY_BREAK
1306 case 14:
1307 YY_RULE_SETUP
1308 #line 93 "bootscanner.l"
1309 { return(RPAREN); }
1310 YY_BREAK
1311 case 15:
1312 /* rule 15 can match eol */
1313 YY_RULE_SETUP
1314 #line 95 "bootscanner.l"
1315 { yyline++; }
1316 YY_BREAK
1317 case 16:
1318 YY_RULE_SETUP
1319 #line 96 "bootscanner.l"
1320 ;
1321 YY_BREAK
1322 case 17:
1323 YY_RULE_SETUP
1324 #line 97 "bootscanner.l"
1325 ;
1326 YY_BREAK
1327 case 18:
1328 YY_RULE_SETUP
1329 #line 99 "bootscanner.l"
1330 ; /* drop everything after "#" for comments */
1331 YY_BREAK
1332 case 19:
1333 YY_RULE_SETUP
1334 #line 102 "bootscanner.l"
1335 { return(XDECLARE); }
1336 YY_BREAK
1337 case 20:
1338 YY_RULE_SETUP
1339 #line 103 "bootscanner.l"
1340 { return(XBUILD); }
1341 YY_BREAK
1342 case 21:
1343 YY_RULE_SETUP
1344 #line 104 "bootscanner.l"
1345 { return(INDICES); }
1346 YY_BREAK
1347 case 22:
1348 YY_RULE_SETUP
1349 #line 105 "bootscanner.l"
1350 { return(UNIQUE); }
1351 YY_BREAK
1352 case 23:
1353 YY_RULE_SETUP
1354 #line 106 "bootscanner.l"
1355 { return(INDEX); }
1356 YY_BREAK
1357 case 24:
1358 YY_RULE_SETUP
1359 #line 107 "bootscanner.l"
1360 { return(ON); }
1361 YY_BREAK
1362 case 25:
1363 YY_RULE_SETUP
1364 #line 108 "bootscanner.l"
1365 { return(USING); }
1366 YY_BREAK
1367 case 26:
1368 YY_RULE_SETUP
1369 #line 109 "bootscanner.l"
1370 { return(XTOAST); }
1371 YY_BREAK
1372 case 27:
1373 YY_RULE_SETUP
1374 #line 110 "bootscanner.l"
1375 { return(XFORCE); }
1376 YY_BREAK
1377 case 28:
1378 YY_RULE_SETUP
1379 #line 111 "bootscanner.l"
1380 { return(XNOT); }
1381 YY_BREAK
1382 case 29:
1383 YY_RULE_SETUP
1384 #line 112 "bootscanner.l"
1385 { return(XNULL); }
1386 YY_BREAK
1387 case 30:
1388 YY_RULE_SETUP
1389 #line 114 "bootscanner.l"
1390 {
1391 yylval.str = MapArrayTypeName(yytext);
1392 return(ID);
1393 }
1394 YY_BREAK
1395 case 31:
1396 YY_RULE_SETUP
1397 #line 118 "bootscanner.l"
1398 {
1399 yylval.str = scanstr(yytext);
1400 return(ID);
1401 }
1402 YY_BREAK
1403 case 32:
1404 /* rule 32 can match eol */
1405 YY_RULE_SETUP
1406 #line 122 "bootscanner.l"
1407 {
1408 yytext[strlen(yytext)-1] = '\0'; /* strip off quotes */
1409 yylval.str = scanstr(yytext+1);
1410 yytext[strlen(yytext)] = '"'; /* restore quotes */
1411 return(ID);
1412 }
1413 YY_BREAK
1414 case 33:
1415 YY_RULE_SETUP
1416 #line 129 "bootscanner.l"
1417 {
1418 elog(ERROR, "syntax error at line %d: unexpected character \"%s\"", yyline, yytext);
1419 }
1420 YY_BREAK
1421 case 34:
1422 YY_RULE_SETUP
1423 #line 135 "bootscanner.l"
1424 YY_FATAL_ERROR( "flex scanner jammed" );
1425 YY_BREAK
1426 #line 1427 "bootscanner.c"
1427 case YY_STATE_EOF(INITIAL):
1428 yyterminate();
1429
1430 case YY_END_OF_BUFFER:
1431 {
1432 /* Amount of text matched not including the EOB char. */
1433 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1434
1435 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1436 *yy_cp = (yy_hold_char);
1437 YY_RESTORE_YY_MORE_OFFSET
1438
1439 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1440 {
1441 /* We're scanning a new file or input source. It's
1442 * possible that this happened because the user
1443 * just pointed yyin at a new source and called
1444 * yylex(). If so, then we have to assure
1445 * consistency between YY_CURRENT_BUFFER and our
1446 * globals. Here is the right place to do so, because
1447 * this is the first action (other than possibly a
1448 * back-up) that will match for the new input source.
1449 */
1450 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1451 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1452 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1453 }
1454
1455 /* Note that here we test for yy_c_buf_p "<=" to the position
1456 * of the first EOB in the buffer, since yy_c_buf_p will
1457 * already have been incremented past the NUL character
1458 * (since all states make transitions on EOB to the
1459 * end-of-buffer state). Contrast this with the test
1460 * in input().
1461 */
1462 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1463 { /* This was really a NUL. */
1464 yy_state_type yy_next_state;
1465
1466 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1467
1468 yy_current_state = yy_get_previous_state( );
1469
1470 /* Okay, we're now positioned to make the NUL
1471 * transition. We couldn't have
1472 * yy_get_previous_state() go ahead and do it
1473 * for us because it doesn't know how to deal
1474 * with the possibility of jamming (and we don't
1475 * want to build jamming into it because then it
1476 * will run more slowly).
1477 */
1478
1479 yy_next_state = yy_try_NUL_trans( yy_current_state );
1480
1481 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1482
1483 if ( yy_next_state )
1484 {
1485 /* Consume the NUL. */
1486 yy_cp = ++(yy_c_buf_p);
1487 yy_current_state = yy_next_state;
1488 goto yy_match;
1489 }
1490
1491 else
1492 {
1493 yy_cp = (yy_last_accepting_cpos);
1494 yy_current_state = (yy_last_accepting_state);
1495 goto yy_find_action;
1496 }
1497 }
1498
1499 else switch ( yy_get_next_buffer( ) )
1500 {
1501 case EOB_ACT_END_OF_FILE:
1502 {
1503 (yy_did_buffer_switch_on_eof) = 0;
1504
1505 if ( yywrap( ) )
1506 {
1507 /* Note: because we've taken care in
1508 * yy_get_next_buffer() to have set up
1509 * yytext, we can now set up
1510 * yy_c_buf_p so that if some total
1511 * hoser (like flex itself) wants to
1512 * call the scanner after we return the
1513 * YY_NULL, it'll still work - another
1514 * YY_NULL will get returned.
1515 */
1516 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1517
1518 yy_act = YY_STATE_EOF(YY_START);
1519 goto do_action;
1520 }
1521
1522 else
1523 {
1524 if ( ! (yy_did_buffer_switch_on_eof) )
1525 YY_NEW_FILE;
1526 }
1527 break;
1528 }
1529
1530 case EOB_ACT_CONTINUE_SCAN:
1531 (yy_c_buf_p) =
1532 (yytext_ptr) + yy_amount_of_matched_text;
1533
1534 yy_current_state = yy_get_previous_state( );
1535
1536 yy_cp = (yy_c_buf_p);
1537 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1538 goto yy_match;
1539
1540 case EOB_ACT_LAST_MATCH:
1541 (yy_c_buf_p) =
1542 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1543
1544 yy_current_state = yy_get_previous_state( );
1545
1546 yy_cp = (yy_c_buf_p);
1547 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1548 goto yy_find_action;
1549 }
1550 break;
1551 }
1552
1553 default:
1554 YY_FATAL_ERROR(
1555 "fatal flex scanner internal error--no action found" );
1556 } /* end of action switch */
1557 } /* end of scanning one token */
1558 } /* end of user's declarations */
1559 } /* end of yylex */
1560
1561 /* yy_get_next_buffer - try to read in a new buffer
1562 *
1563 * Returns a code representing an action:
1564 * EOB_ACT_LAST_MATCH -
1565 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1566 * EOB_ACT_END_OF_FILE - end of file
1567 */
yy_get_next_buffer(void)1568 static int yy_get_next_buffer (void)
1569 {
1570 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1571 char *source = (yytext_ptr);
1572 int number_to_move, i;
1573 int ret_val;
1574
1575 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1576 YY_FATAL_ERROR(
1577 "fatal flex scanner internal error--end of buffer missed" );
1578
1579 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1580 { /* Don't try to fill the buffer, so this is an EOF. */
1581 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1582 {
1583 /* We matched a single character, the EOB, so
1584 * treat this as a final EOF.
1585 */
1586 return EOB_ACT_END_OF_FILE;
1587 }
1588
1589 else
1590 {
1591 /* We matched some text prior to the EOB, first
1592 * process it.
1593 */
1594 return EOB_ACT_LAST_MATCH;
1595 }
1596 }
1597
1598 /* Try to read more data. */
1599
1600 /* First move last chars to start of buffer. */
1601 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1602
1603 for ( i = 0; i < number_to_move; ++i )
1604 *(dest++) = *(source++);
1605
1606 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1607 /* don't do the read, it's not guaranteed to return an EOF,
1608 * just force an EOF
1609 */
1610 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1611
1612 else
1613 {
1614 int num_to_read =
1615 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1616
1617 while ( num_to_read <= 0 )
1618 { /* Not enough room in the buffer - grow it. */
1619
1620 /* just a shorter name for the current buffer */
1621 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1622
1623 int yy_c_buf_p_offset =
1624 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1625
1626 if ( b->yy_is_our_buffer )
1627 {
1628 int new_size = b->yy_buf_size * 2;
1629
1630 if ( new_size <= 0 )
1631 b->yy_buf_size += b->yy_buf_size / 8;
1632 else
1633 b->yy_buf_size *= 2;
1634
1635 b->yy_ch_buf = (char *)
1636 /* Include room in for 2 EOB chars. */
1637 yyrealloc( (void *) b->yy_ch_buf,
1638 (yy_size_t) (b->yy_buf_size + 2) );
1639 }
1640 else
1641 /* Can't grow it, we don't own it. */
1642 b->yy_ch_buf = NULL;
1643
1644 if ( ! b->yy_ch_buf )
1645 YY_FATAL_ERROR(
1646 "fatal error - scanner input buffer overflow" );
1647
1648 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1649
1650 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1651 number_to_move - 1;
1652
1653 }
1654
1655 if ( num_to_read > YY_READ_BUF_SIZE )
1656 num_to_read = YY_READ_BUF_SIZE;
1657
1658 /* Read in more data. */
1659 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1660 (yy_n_chars), num_to_read );
1661
1662 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1663 }
1664
1665 if ( (yy_n_chars) == 0 )
1666 {
1667 if ( number_to_move == YY_MORE_ADJ )
1668 {
1669 ret_val = EOB_ACT_END_OF_FILE;
1670 yyrestart( yyin );
1671 }
1672
1673 else
1674 {
1675 ret_val = EOB_ACT_LAST_MATCH;
1676 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1677 YY_BUFFER_EOF_PENDING;
1678 }
1679 }
1680
1681 else
1682 ret_val = EOB_ACT_CONTINUE_SCAN;
1683
1684 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1685 /* Extend the array by 50%, plus the number we really need. */
1686 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1687 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1688 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1689 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1690 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1691 /* "- 2" to take care of EOB's */
1692 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1693 }
1694
1695 (yy_n_chars) += number_to_move;
1696 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1697 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1698
1699 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1700
1701 return ret_val;
1702 }
1703
1704 /* yy_get_previous_state - get the state just before the EOB char was reached */
1705
yy_get_previous_state(void)1706 static yy_state_type yy_get_previous_state (void)
1707 {
1708 yy_state_type yy_current_state;
1709 char *yy_cp;
1710
1711 yy_current_state = (yy_start);
1712 yy_current_state += YY_AT_BOL();
1713
1714 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1715 {
1716 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1717 if ( yy_accept[yy_current_state] )
1718 {
1719 (yy_last_accepting_state) = yy_current_state;
1720 (yy_last_accepting_cpos) = yy_cp;
1721 }
1722 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1723 {
1724 yy_current_state = (int) yy_def[yy_current_state];
1725 if ( yy_current_state >= 150 )
1726 yy_c = yy_meta[yy_c];
1727 }
1728 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1729 }
1730
1731 return yy_current_state;
1732 }
1733
1734 /* yy_try_NUL_trans - try to make a transition on the NUL character
1735 *
1736 * synopsis
1737 * next_state = yy_try_NUL_trans( current_state );
1738 */
yy_try_NUL_trans(yy_state_type yy_current_state)1739 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1740 {
1741 int yy_is_jam;
1742 char *yy_cp = (yy_c_buf_p);
1743
1744 YY_CHAR yy_c = 1;
1745 if ( yy_accept[yy_current_state] )
1746 {
1747 (yy_last_accepting_state) = yy_current_state;
1748 (yy_last_accepting_cpos) = yy_cp;
1749 }
1750 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1751 {
1752 yy_current_state = (int) yy_def[yy_current_state];
1753 if ( yy_current_state >= 150 )
1754 yy_c = yy_meta[yy_c];
1755 }
1756 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1757 yy_is_jam = (yy_current_state == 149);
1758
1759 return yy_is_jam ? 0 : yy_current_state;
1760 }
1761
1762 #ifndef YY_NO_UNPUT
1763
1764 #endif
1765
1766 #ifndef YY_NO_INPUT
1767 #ifdef __cplusplus
yyinput(void)1768 static int yyinput (void)
1769 #else
1770 static int input (void)
1771 #endif
1772
1773 {
1774 int c;
1775
1776 *(yy_c_buf_p) = (yy_hold_char);
1777
1778 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1779 {
1780 /* yy_c_buf_p now points to the character we want to return.
1781 * If this occurs *before* the EOB characters, then it's a
1782 * valid NUL; if not, then we've hit the end of the buffer.
1783 */
1784 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1785 /* This was really a NUL. */
1786 *(yy_c_buf_p) = '\0';
1787
1788 else
1789 { /* need more input */
1790 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1791 ++(yy_c_buf_p);
1792
1793 switch ( yy_get_next_buffer( ) )
1794 {
1795 case EOB_ACT_LAST_MATCH:
1796 /* This happens because yy_g_n_b()
1797 * sees that we've accumulated a
1798 * token and flags that we need to
1799 * try matching the token before
1800 * proceeding. But for input(),
1801 * there's no matching to consider.
1802 * So convert the EOB_ACT_LAST_MATCH
1803 * to EOB_ACT_END_OF_FILE.
1804 */
1805
1806 /* Reset buffer status. */
1807 yyrestart( yyin );
1808
1809 /*FALLTHROUGH*/
1810
1811 case EOB_ACT_END_OF_FILE:
1812 {
1813 if ( yywrap( ) )
1814 return 0;
1815
1816 if ( ! (yy_did_buffer_switch_on_eof) )
1817 YY_NEW_FILE;
1818 #ifdef __cplusplus
1819 return yyinput();
1820 #else
1821 return input();
1822 #endif
1823 }
1824
1825 case EOB_ACT_CONTINUE_SCAN:
1826 (yy_c_buf_p) = (yytext_ptr) + offset;
1827 break;
1828 }
1829 }
1830 }
1831
1832 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1833 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1834 (yy_hold_char) = *++(yy_c_buf_p);
1835
1836 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1837
1838 return c;
1839 }
1840 #endif /* ifndef YY_NO_INPUT */
1841
1842 /** Immediately switch to a different input stream.
1843 * @param input_file A readable stream.
1844 *
1845 * @note This function does not reset the start condition to @c INITIAL .
1846 */
yyrestart(FILE * input_file)1847 void yyrestart (FILE * input_file )
1848 {
1849
1850 if ( ! YY_CURRENT_BUFFER ){
1851 yyensure_buffer_stack ();
1852 YY_CURRENT_BUFFER_LVALUE =
1853 yy_create_buffer( yyin, YY_BUF_SIZE );
1854 }
1855
1856 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1857 yy_load_buffer_state( );
1858 }
1859
1860 /** Switch to a different input buffer.
1861 * @param new_buffer The new input buffer.
1862 *
1863 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1864 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1865 {
1866
1867 /* TODO. We should be able to replace this entire function body
1868 * with
1869 * yypop_buffer_state();
1870 * yypush_buffer_state(new_buffer);
1871 */
1872 yyensure_buffer_stack ();
1873 if ( YY_CURRENT_BUFFER == new_buffer )
1874 return;
1875
1876 if ( YY_CURRENT_BUFFER )
1877 {
1878 /* Flush out information for old buffer. */
1879 *(yy_c_buf_p) = (yy_hold_char);
1880 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1881 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1882 }
1883
1884 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1885 yy_load_buffer_state( );
1886
1887 /* We don't actually know whether we did this switch during
1888 * EOF (yywrap()) processing, but the only time this flag
1889 * is looked at is after yywrap() is called, so it's safe
1890 * to go ahead and always set it.
1891 */
1892 (yy_did_buffer_switch_on_eof) = 1;
1893 }
1894
yy_load_buffer_state(void)1895 static void yy_load_buffer_state (void)
1896 {
1897 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1898 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1899 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1900 (yy_hold_char) = *(yy_c_buf_p);
1901 }
1902
1903 /** Allocate and initialize an input buffer state.
1904 * @param file A readable stream.
1905 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1906 *
1907 * @return the allocated buffer state.
1908 */
yy_create_buffer(FILE * file,int size)1909 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1910 {
1911 YY_BUFFER_STATE b;
1912
1913 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1914 if ( ! b )
1915 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1916
1917 b->yy_buf_size = size;
1918
1919 /* yy_ch_buf has to be 2 characters longer than the size given because
1920 * we need to put in 2 end-of-buffer characters.
1921 */
1922 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1923 if ( ! b->yy_ch_buf )
1924 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1925
1926 b->yy_is_our_buffer = 1;
1927
1928 yy_init_buffer( b, file );
1929
1930 return b;
1931 }
1932
1933 /** Destroy the buffer.
1934 * @param b a buffer created with yy_create_buffer()
1935 *
1936 */
yy_delete_buffer(YY_BUFFER_STATE b)1937 void yy_delete_buffer (YY_BUFFER_STATE b )
1938 {
1939
1940 if ( ! b )
1941 return;
1942
1943 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1944 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1945
1946 if ( b->yy_is_our_buffer )
1947 yyfree( (void *) b->yy_ch_buf );
1948
1949 yyfree( (void *) b );
1950 }
1951
1952 /* Initializes or reinitializes a buffer.
1953 * This function is sometimes called more than once on the same buffer,
1954 * such as during a yyrestart() or at EOF.
1955 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1956 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1957
1958 {
1959 int oerrno = errno;
1960
1961 yy_flush_buffer( b );
1962
1963 b->yy_input_file = file;
1964 b->yy_fill_buffer = 1;
1965
1966 /* If b is the current buffer, then yy_init_buffer was _probably_
1967 * called from yyrestart() or through yy_get_next_buffer.
1968 * In that case, we don't want to reset the lineno or column.
1969 */
1970 if (b != YY_CURRENT_BUFFER){
1971 b->yy_bs_lineno = 1;
1972 b->yy_bs_column = 0;
1973 }
1974
1975 b->yy_is_interactive = 0;
1976
1977 errno = oerrno;
1978 }
1979
1980 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1981 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1982 *
1983 */
yy_flush_buffer(YY_BUFFER_STATE b)1984 void yy_flush_buffer (YY_BUFFER_STATE b )
1985 {
1986 if ( ! b )
1987 return;
1988
1989 b->yy_n_chars = 0;
1990
1991 /* We always need two end-of-buffer characters. The first causes
1992 * a transition to the end-of-buffer state. The second causes
1993 * a jam in that state.
1994 */
1995 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1996 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1997
1998 b->yy_buf_pos = &b->yy_ch_buf[0];
1999
2000 b->yy_at_bol = 1;
2001 b->yy_buffer_status = YY_BUFFER_NEW;
2002
2003 if ( b == YY_CURRENT_BUFFER )
2004 yy_load_buffer_state( );
2005 }
2006
2007 /** Pushes the new state onto the stack. The new state becomes
2008 * the current state. This function will allocate the stack
2009 * if necessary.
2010 * @param new_buffer The new state.
2011 *
2012 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)2013 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2014 {
2015 if (new_buffer == NULL)
2016 return;
2017
2018 yyensure_buffer_stack();
2019
2020 /* This block is copied from yy_switch_to_buffer. */
2021 if ( YY_CURRENT_BUFFER )
2022 {
2023 /* Flush out information for old buffer. */
2024 *(yy_c_buf_p) = (yy_hold_char);
2025 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2026 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2027 }
2028
2029 /* Only push if top exists. Otherwise, replace top. */
2030 if (YY_CURRENT_BUFFER)
2031 (yy_buffer_stack_top)++;
2032 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2033
2034 /* copied from yy_switch_to_buffer. */
2035 yy_load_buffer_state( );
2036 (yy_did_buffer_switch_on_eof) = 1;
2037 }
2038
2039 /** Removes and deletes the top of the stack, if present.
2040 * The next element becomes the new top.
2041 *
2042 */
yypop_buffer_state(void)2043 void yypop_buffer_state (void)
2044 {
2045 if (!YY_CURRENT_BUFFER)
2046 return;
2047
2048 yy_delete_buffer(YY_CURRENT_BUFFER );
2049 YY_CURRENT_BUFFER_LVALUE = NULL;
2050 if ((yy_buffer_stack_top) > 0)
2051 --(yy_buffer_stack_top);
2052
2053 if (YY_CURRENT_BUFFER) {
2054 yy_load_buffer_state( );
2055 (yy_did_buffer_switch_on_eof) = 1;
2056 }
2057 }
2058
2059 /* Allocates the stack if it does not exist.
2060 * Guarantees space for at least one push.
2061 */
yyensure_buffer_stack(void)2062 static void yyensure_buffer_stack (void)
2063 {
2064 yy_size_t num_to_alloc;
2065
2066 if (!(yy_buffer_stack)) {
2067
2068 /* First allocation is just for 2 elements, since we don't know if this
2069 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2070 * immediate realloc on the next call.
2071 */
2072 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2073 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2074 (num_to_alloc * sizeof(struct yy_buffer_state*)
2075 );
2076 if ( ! (yy_buffer_stack) )
2077 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2078
2079 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2080
2081 (yy_buffer_stack_max) = num_to_alloc;
2082 (yy_buffer_stack_top) = 0;
2083 return;
2084 }
2085
2086 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2087
2088 /* Increase the buffer to prepare for a possible push. */
2089 yy_size_t grow_size = 8 /* arbitrary grow size */;
2090
2091 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2092 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2093 ((yy_buffer_stack),
2094 num_to_alloc * sizeof(struct yy_buffer_state*)
2095 );
2096 if ( ! (yy_buffer_stack) )
2097 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2098
2099 /* zero only the new slots.*/
2100 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2101 (yy_buffer_stack_max) = num_to_alloc;
2102 }
2103 }
2104
2105 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2106 * @param base the character buffer
2107 * @param size the size in bytes of the character buffer
2108 *
2109 * @return the newly allocated buffer state object.
2110 */
yy_scan_buffer(char * base,yy_size_t size)2111 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2112 {
2113 YY_BUFFER_STATE b;
2114
2115 if ( size < 2 ||
2116 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2117 base[size-1] != YY_END_OF_BUFFER_CHAR )
2118 /* They forgot to leave room for the EOB's. */
2119 return NULL;
2120
2121 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2122 if ( ! b )
2123 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2124
2125 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2126 b->yy_buf_pos = b->yy_ch_buf = base;
2127 b->yy_is_our_buffer = 0;
2128 b->yy_input_file = NULL;
2129 b->yy_n_chars = b->yy_buf_size;
2130 b->yy_is_interactive = 0;
2131 b->yy_at_bol = 1;
2132 b->yy_fill_buffer = 0;
2133 b->yy_buffer_status = YY_BUFFER_NEW;
2134
2135 yy_switch_to_buffer( b );
2136
2137 return b;
2138 }
2139
2140 /** Setup the input buffer state to scan a string. The next call to yylex() will
2141 * scan from a @e copy of @a str.
2142 * @param yystr a NUL-terminated string to scan
2143 *
2144 * @return the newly allocated buffer state object.
2145 * @note If you want to scan bytes that may contain NUL values, then use
2146 * yy_scan_bytes() instead.
2147 */
yy_scan_string(const char * yystr)2148 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2149 {
2150
2151 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2152 }
2153
2154 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2155 * scan from a @e copy of @a bytes.
2156 * @param yybytes the byte buffer to scan
2157 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2158 *
2159 * @return the newly allocated buffer state object.
2160 */
yy_scan_bytes(const char * yybytes,int _yybytes_len)2161 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2162 {
2163 YY_BUFFER_STATE b;
2164 char *buf;
2165 yy_size_t n;
2166 int i;
2167
2168 /* Get memory for full buffer, including space for trailing EOB's. */
2169 n = (yy_size_t) (_yybytes_len + 2);
2170 buf = (char *) yyalloc( n );
2171 if ( ! buf )
2172 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2173
2174 for ( i = 0; i < _yybytes_len; ++i )
2175 buf[i] = yybytes[i];
2176
2177 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2178
2179 b = yy_scan_buffer( buf, n );
2180 if ( ! b )
2181 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2182
2183 /* It's okay to grow etc. this buffer, and we should throw it
2184 * away when we're done.
2185 */
2186 b->yy_is_our_buffer = 1;
2187
2188 return b;
2189 }
2190
2191 #ifndef YY_EXIT_FAILURE
2192 #define YY_EXIT_FAILURE 2
2193 #endif
2194
yy_fatal_error(const char * msg)2195 static void yynoreturn yy_fatal_error (const char* msg )
2196 {
2197 fprintf( stderr, "%s\n", msg );
2198 exit( YY_EXIT_FAILURE );
2199 }
2200
2201 /* Redefine yyless() so it works in section 3 code. */
2202
2203 #undef yyless
2204 #define yyless(n) \
2205 do \
2206 { \
2207 /* Undo effects of setting up yytext. */ \
2208 int yyless_macro_arg = (n); \
2209 YY_LESS_LINENO(yyless_macro_arg);\
2210 yytext[yyleng] = (yy_hold_char); \
2211 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2212 (yy_hold_char) = *(yy_c_buf_p); \
2213 *(yy_c_buf_p) = '\0'; \
2214 yyleng = yyless_macro_arg; \
2215 } \
2216 while ( 0 )
2217
2218 /* Accessor methods (get/set functions) to struct members. */
2219
2220 /** Get the current line number.
2221 *
2222 */
yyget_lineno(void)2223 int yyget_lineno (void)
2224 {
2225
2226 return yylineno;
2227 }
2228
2229 /** Get the input stream.
2230 *
2231 */
yyget_in(void)2232 FILE *yyget_in (void)
2233 {
2234 return yyin;
2235 }
2236
2237 /** Get the output stream.
2238 *
2239 */
yyget_out(void)2240 FILE *yyget_out (void)
2241 {
2242 return yyout;
2243 }
2244
2245 /** Get the length of the current token.
2246 *
2247 */
yyget_leng(void)2248 int yyget_leng (void)
2249 {
2250 return yyleng;
2251 }
2252
2253 /** Get the current token.
2254 *
2255 */
2256
yyget_text(void)2257 char *yyget_text (void)
2258 {
2259 return yytext;
2260 }
2261
2262 /** Set the current line number.
2263 * @param _line_number line number
2264 *
2265 */
yyset_lineno(int _line_number)2266 void yyset_lineno (int _line_number )
2267 {
2268
2269 yylineno = _line_number;
2270 }
2271
2272 /** Set the input stream. This does not discard the current
2273 * input buffer.
2274 * @param _in_str A readable stream.
2275 *
2276 * @see yy_switch_to_buffer
2277 */
yyset_in(FILE * _in_str)2278 void yyset_in (FILE * _in_str )
2279 {
2280 yyin = _in_str ;
2281 }
2282
yyset_out(FILE * _out_str)2283 void yyset_out (FILE * _out_str )
2284 {
2285 yyout = _out_str ;
2286 }
2287
yyget_debug(void)2288 int yyget_debug (void)
2289 {
2290 return yy_flex_debug;
2291 }
2292
yyset_debug(int _bdebug)2293 void yyset_debug (int _bdebug )
2294 {
2295 yy_flex_debug = _bdebug ;
2296 }
2297
yy_init_globals(void)2298 static int yy_init_globals (void)
2299 {
2300 /* Initialization is the same as for the non-reentrant scanner.
2301 * This function is called from yylex_destroy(), so don't allocate here.
2302 */
2303
2304 (yy_buffer_stack) = NULL;
2305 (yy_buffer_stack_top) = 0;
2306 (yy_buffer_stack_max) = 0;
2307 (yy_c_buf_p) = NULL;
2308 (yy_init) = 0;
2309 (yy_start) = 0;
2310
2311 /* Defined in main.c */
2312 #ifdef YY_STDINIT
2313 yyin = stdin;
2314 yyout = stdout;
2315 #else
2316 yyin = NULL;
2317 yyout = NULL;
2318 #endif
2319
2320 /* For future reference: Set errno on error, since we are called by
2321 * yylex_init()
2322 */
2323 return 0;
2324 }
2325
2326 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)2327 int yylex_destroy (void)
2328 {
2329
2330 /* Pop the buffer stack, destroying each element. */
2331 while(YY_CURRENT_BUFFER){
2332 yy_delete_buffer( YY_CURRENT_BUFFER );
2333 YY_CURRENT_BUFFER_LVALUE = NULL;
2334 yypop_buffer_state();
2335 }
2336
2337 /* Destroy the stack itself. */
2338 yyfree((yy_buffer_stack) );
2339 (yy_buffer_stack) = NULL;
2340
2341 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2342 * yylex() is called, initialization will occur. */
2343 yy_init_globals( );
2344
2345 return 0;
2346 }
2347
2348 /*
2349 * Internal utility routines.
2350 */
2351
2352 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)2353 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2354 {
2355
2356 int i;
2357 for ( i = 0; i < n; ++i )
2358 s1[i] = s2[i];
2359 }
2360 #endif
2361
2362 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)2363 static int yy_flex_strlen (const char * s )
2364 {
2365 int n;
2366 for ( n = 0; s[n]; ++n )
2367 ;
2368
2369 return n;
2370 }
2371 #endif
2372
yyalloc(yy_size_t size)2373 void *yyalloc (yy_size_t size )
2374 {
2375 return malloc(size);
2376 }
2377
yyrealloc(void * ptr,yy_size_t size)2378 void *yyrealloc (void * ptr, yy_size_t size )
2379 {
2380
2381 /* The cast to (char *) in the following accommodates both
2382 * implementations that use char* generic pointers, and those
2383 * that use void* generic pointers. It works with the latter
2384 * because both ANSI C and C++ allow castless assignment from
2385 * any pointer type to void*, and deal with argument conversions
2386 * as though doing an assignment.
2387 */
2388 return realloc(ptr, size);
2389 }
2390
yyfree(void * ptr)2391 void yyfree (void * ptr )
2392 {
2393 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2394 }
2395
2396 #define YYTABLES_NAME "yytables"
2397
2398 #line 135 "bootscanner.l"
2399
2400
2401 void
yyerror(const char * message)2402 yyerror(const char *message)
2403 {
2404 elog(ERROR, "%s at line %d", message, yyline);
2405 }
2406
2407