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 31
618 #define YY_END_OF_BUFFER 32
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[128] =
627     {   0,
628         0,    0,   32,   30,   15,   14,   30,   12,   13,   10,
629        28,   11,   28,   28,   28,   28,   28,   28,   28,   28,
630        28,   28,   28,   28,   28,   16,    0,   29,   28,   28,
631        28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
632        22,   28,   28,   28,   28,   28,   28,   16,   28,   26,
633        28,    4,   28,   28,   28,   28,   28,   28,   28,   28,
634        28,   28,   28,   28,   28,   28,   28,   27,   28,   28,
635        28,   28,   28,   28,   28,   28,   28,    1,   28,   28,
636        28,   28,   28,   25,   28,   28,   18,    2,   28,   28,
637        21,   28,   28,   28,   28,   24,   28,   23,    9,   28,
638 
639         3,   28,   28,    8,   28,   28,   20,   28,   17,   19,
640        28,   28,   28,   28,   28,    5,   28,   28,   28,   28,
641         7,   28,   28,   28,   28,    6,    0
642     } ;
643 
644 static const YY_CHAR yy_ec[256] =
645     {   0,
646         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
647         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
648         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
649         1,    2,    1,    4,    5,    1,    1,    1,    1,    6,
650         7,    1,    1,    8,    9,    1,    1,    9,    9,    9,
651         9,    9,    9,    9,    9,    9,    9,    1,    1,    1,
652        10,    1,    1,    1,    9,    9,   11,   12,   13,   14,
653         9,    9,   15,    9,    9,   16,    9,   17,   18,    9,
654         9,   19,    9,   20,   21,    9,    9,    9,    9,    9,
655         1,    1,    1,    1,   22,    1,   23,   24,   25,   26,
656 
657        27,    9,   28,   29,   30,    9,    9,   31,    9,   32,
658        33,   34,   35,   36,   37,   38,   39,    9,   40,   41,
659        42,    9,    1,    1,    1,    1,    1,    1,    1,    1,
660         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
661         1,    1,    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 
668         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
669         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
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
674     } ;
675 
676 static const YY_CHAR yy_meta[43] =
677     {   0,
678         1,    1,    2,    1,    1,    1,    1,    1,    3,    1,
679         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
680         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
681         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
682         3,    3
683     } ;
684 
685 static const flex_int16_t yy_base[131] =
686     {   0,
687         0,  143,  147,  149,  149,  149,  142,  149,  149,  149,
688         0,  149,  127,   25,  129,  111,   11,   16,  115,  109,
689        17,  107,  110,  105,   16,    0,  133,  149,    0,  117,
690       115,  118,  121,   93,   98,  100,   96,  101,  102,   19,
691         0,   99,   85,  101,  100,   92,   91,    0,  109,    0,
692       103,    0,   87,   79,   85,   78,   91,   82,   27,   85,
693        79,   72,   73,   71,   72,   74,   92,    0,   73,   66,
694        76,   74,   62,   76,   57,   72,   60,    0,   53,   67,
695        55,   53,   63,    0,   68,   51,    0,    0,   61,   51,
696         0,   59,   47,   50,   57,    0,   55,    0,    0,   45,
697 
698         0,   53,   42,    0,   51,   55,    0,   53,    0,    0,
699        53,   38,   39,   39,   44,    0,   40,   38,   42,   44,
700         0,   28,   35,   31,   30,    0,  149,   57,   52,   60
701     } ;
702 
703 static const flex_int16_t yy_def[131] =
704     {   0,
705       127,    1,  127,  127,  127,  127,  128,  127,  127,  127,
706       129,  127,  129,  129,  129,  129,  129,  129,  129,  129,
707       129,  129,  129,  129,  129,  130,  128,  127,  129,  129,
708       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
709       129,  129,  129,  129,  129,  129,  129,  130,  129,  129,
710       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
711       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
712       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
713       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
714       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
715 
716       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
717       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
718       129,  129,  129,  129,  129,  129,    0,  127,  127,  127
719     } ;
720 
721 static const flex_int16_t yy_nxt[192] =
722     {   0,
723         4,    5,    6,    7,    4,    8,    9,   10,   11,   12,
724        11,   11,   11,   13,   11,   11,   14,   15,   11,   11,
725        11,   16,   11,   17,   18,   19,   11,   11,   11,   20,
726        11,   11,   21,   11,   11,   22,   23,   24,   25,   11,
727        11,   11,   31,   35,   59,   32,   37,   46,   41,   36,
728        42,   38,   47,   75,   29,   60,   76,   27,   27,   27,
729        48,  126,   48,  125,  124,  123,  122,  121,  120,  119,
730       118,  117,  116,  115,  114,  113,  112,  111,  110,  109,
731       108,  107,  106,  105,  104,  103,  102,  101,  100,   99,
732        98,   97,   96,   95,   94,   93,   92,   91,   90,   89,
733 
734        88,   87,   86,   85,   84,   83,   82,   81,   80,   79,
735        78,   77,   74,   73,   72,   71,   70,   69,   68,   67,
736        66,   65,   64,   63,   62,   61,   58,   57,   56,   55,
737        54,   53,   52,   51,   50,   49,   28,   45,   44,   43,
738        40,   39,   34,   33,   30,   28,  127,   26,    3,  127,
739       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
740       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
741       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
742       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
743       127
744 
745     } ;
746 
747 static const flex_int16_t yy_chk[192] =
748     {   0,
749         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
750         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
751         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
752         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
753         1,    1,   14,   17,   40,   14,   18,   25,   21,   17,
754        21,   18,   25,   59,  129,   40,   59,  128,  128,  128,
755       130,  125,  130,  124,  123,  122,  120,  119,  118,  117,
756       115,  114,  113,  112,  111,  108,  106,  105,  103,  102,
757       100,   97,   95,   94,   93,   92,   90,   89,   86,   85,
758        83,   82,   81,   80,   79,   77,   76,   75,   74,   73,
759 
760        72,   71,   70,   69,   67,   66,   65,   64,   63,   62,
761        61,   60,   58,   57,   56,   55,   54,   53,   51,   49,
762        47,   46,   45,   44,   43,   42,   39,   38,   37,   36,
763        35,   34,   33,   32,   31,   30,   27,   24,   23,   22,
764        20,   19,   16,   15,   13,    7,    3,    2,  127,  127,
765       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
766       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
767       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
768       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
769       127
770 
771     } ;
772 
773 static yy_state_type yy_last_accepting_state;
774 static char *yy_last_accepting_cpos;
775 
776 extern int yy_flex_debug;
777 int yy_flex_debug = 0;
778 
779 /* The intent behind this definition is that it'll catch
780  * any uses of REJECT which flex missed.
781  */
782 #define REJECT reject_used_but_not_detected
783 #define yymore() yymore_used_but_not_detected
784 #define YY_MORE_ADJ 0
785 #define YY_RESTORE_YY_MORE_OFFSET
786 char *yytext;
787 #line 1 "bootscanner.l"
788 #line 2 "bootscanner.l"
789 /*-------------------------------------------------------------------------
790  *
791  * bootscanner.l
792  *	  a lexical scanner for the bootstrap parser
793  *
794  * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
795  * Portions Copyright (c) 1994, Regents of the University of California
796  *
797  *
798  * IDENTIFICATION
799  *	  src/backend/bootstrap/bootscanner.l
800  *
801  *-------------------------------------------------------------------------
802  */
803 #include "postgres.h"
804 
805 #include "access/attnum.h"
806 #include "access/htup.h"
807 #include "access/itup.h"
808 #include "access/tupdesc.h"
809 #include "bootstrap/bootstrap.h"
810 #include "catalog/pg_am.h"
811 #include "catalog/pg_attribute.h"
812 #include "catalog/pg_class.h"
813 #include "nodes/nodes.h"
814 #include "nodes/parsenodes.h"
815 #include "nodes/pg_list.h"
816 #include "nodes/primnodes.h"
817 #include "parser/scansup.h"
818 #include "rewrite/prs2lock.h"
819 #include "storage/block.h"
820 #include "storage/fd.h"
821 #include "storage/itemptr.h"
822 #include "storage/off.h"
823 #include "utils/rel.h"
824 
825 /* Not needed now that this file is compiled as part of bootparse. */
826 /* #include "bootparse.h" */
827 
828 /* LCOV_EXCL_START */
829 
830 /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
831 #undef fprintf
832 #define fprintf(file, fmt, msg)  fprintf_to_ereport(fmt, msg)
833 
834 static void
fprintf_to_ereport(const char * fmt,const char * msg)835 fprintf_to_ereport(const char *fmt, const char *msg)
836 {
837 	ereport(ERROR, (errmsg_internal("%s", msg)));
838 }
839 
840 
841 static int	yyline = 1;			/* line number for error reporting */
842 
843 #line 844 "bootscanner.c"
844 #define YY_NO_INPUT 1
845 /*
846  * Keyword tokens return the keyword text (as a constant string) in yylval.kw,
847  * just in case that's needed because we want to treat the keyword as an
848  * unreserved identifier.  Note that _null_ is not treated as a keyword
849  * for this purpose; it's the one "reserved word" in the bootstrap syntax.
850  *
851  * Notice that all the keywords are case-sensitive, and for historical
852  * reasons some must be upper case.
853  *
854  * String tokens return a palloc'd string in yylval.str.
855  */
856 #line 857 "bootscanner.c"
857 
858 #define INITIAL 0
859 
860 #ifndef YY_NO_UNISTD_H
861 /* Special case for "unistd.h", since it is non-ANSI. We include it way
862  * down here because we want the user's section 1 to have been scanned first.
863  * The user has a chance to override it with an option.
864  */
865 #include <unistd.h>
866 #endif
867 
868 #ifndef YY_EXTRA_TYPE
869 #define YY_EXTRA_TYPE void *
870 #endif
871 
872 static int yy_init_globals ( void );
873 
874 /* Accessor methods to globals.
875    These are made visible to non-reentrant scanners for convenience. */
876 
877 int yylex_destroy ( void );
878 
879 int yyget_debug ( void );
880 
881 void yyset_debug ( int debug_flag  );
882 
883 YY_EXTRA_TYPE yyget_extra ( void );
884 
885 void yyset_extra ( YY_EXTRA_TYPE user_defined  );
886 
887 FILE *yyget_in ( void );
888 
889 void yyset_in  ( FILE * _in_str  );
890 
891 FILE *yyget_out ( void );
892 
893 void yyset_out  ( FILE * _out_str  );
894 
895 			int yyget_leng ( void );
896 
897 char *yyget_text ( void );
898 
899 int yyget_lineno ( void );
900 
901 void yyset_lineno ( int _line_number  );
902 
903 /* Macros after this point can all be overridden by user definitions in
904  * section 1.
905  */
906 
907 #ifndef YY_SKIP_YYWRAP
908 #ifdef __cplusplus
909 extern "C" int yywrap ( void );
910 #else
911 extern int yywrap ( void );
912 #endif
913 #endif
914 
915 #ifndef YY_NO_UNPUT
916 
917 #endif
918 
919 #ifndef yytext_ptr
920 static void yy_flex_strncpy ( char *, const char *, int );
921 #endif
922 
923 #ifdef YY_NEED_STRLEN
924 static int yy_flex_strlen ( const char * );
925 #endif
926 
927 #ifndef YY_NO_INPUT
928 #ifdef __cplusplus
929 static int yyinput ( void );
930 #else
931 static int input ( void );
932 #endif
933 
934 #endif
935 
936 /* Amount of stuff to slurp up with each read. */
937 #ifndef YY_READ_BUF_SIZE
938 #ifdef __ia64__
939 /* On IA-64, the buffer size is 16k, not 8k */
940 #define YY_READ_BUF_SIZE 16384
941 #else
942 #define YY_READ_BUF_SIZE 8192
943 #endif /* __ia64__ */
944 #endif
945 
946 /* Copy whatever the last rule matched to the standard output. */
947 #ifndef ECHO
948 /* This used to be an fputs(), but since the string might contain NUL's,
949  * we now use fwrite().
950  */
951 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
952 #endif
953 
954 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
955  * is returned in "result".
956  */
957 #ifndef YY_INPUT
958 #define YY_INPUT(buf,result,max_size) \
959 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
960 		{ \
961 		int c = '*'; \
962 		int n; \
963 		for ( n = 0; n < max_size && \
964 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
965 			buf[n] = (char) c; \
966 		if ( c == '\n' ) \
967 			buf[n++] = (char) c; \
968 		if ( c == EOF && ferror( yyin ) ) \
969 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
970 		result = n; \
971 		} \
972 	else \
973 		{ \
974 		errno=0; \
975 		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
976 			{ \
977 			if( errno != EINTR) \
978 				{ \
979 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
980 				break; \
981 				} \
982 			errno=0; \
983 			clearerr(yyin); \
984 			} \
985 		}\
986 \
987 
988 #endif
989 
990 /* No semi-colon after return; correct usage is to write "yyterminate();" -
991  * we don't want an extra ';' after the "return" because that will cause
992  * some compilers to complain about unreachable statements.
993  */
994 #ifndef yyterminate
995 #define yyterminate() return YY_NULL
996 #endif
997 
998 /* Number of entries by which start-condition stack grows. */
999 #ifndef YY_START_STACK_INCR
1000 #define YY_START_STACK_INCR 25
1001 #endif
1002 
1003 /* Report a fatal error. */
1004 #ifndef YY_FATAL_ERROR
1005 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1006 #endif
1007 
1008 /* end tables serialization structures and prototypes */
1009 
1010 /* Default declaration of generated scanner - a define so the user can
1011  * easily add parameters.
1012  */
1013 #ifndef YY_DECL
1014 #define YY_DECL_IS_OURS 1
1015 
1016 extern int yylex (void);
1017 
1018 #define YY_DECL int yylex (void)
1019 #endif /* !YY_DECL */
1020 
1021 /* Code executed at the beginning of each rule, after yytext and yyleng
1022  * have been set up.
1023  */
1024 #ifndef YY_USER_ACTION
1025 #define YY_USER_ACTION
1026 #endif
1027 
1028 /* Code executed at the end of each rule. */
1029 #ifndef YY_BREAK
1030 #define YY_BREAK /*LINTED*/break;
1031 #endif
1032 
1033 #define YY_RULE_SETUP \
1034 	if ( yyleng > 0 ) \
1035 		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1036 				(yytext[yyleng - 1] == '\n'); \
1037 	YY_USER_ACTION
1038 
1039 /** The main scanner function which does all the work.
1040  */
1041 YY_DECL
1042 {
1043 	yy_state_type yy_current_state;
1044 	char *yy_cp, *yy_bp;
1045 	int yy_act;
1046 
1047 	if ( !(yy_init) )
1048 		{
1049 		(yy_init) = 1;
1050 
1051 #ifdef YY_USER_INIT
1052 		YY_USER_INIT;
1053 #endif
1054 
1055 		if ( ! (yy_start) )
1056 			(yy_start) = 1;	/* first start state */
1057 
1058 		if ( ! yyin )
1059 			yyin = stdin;
1060 
1061 		if ( ! yyout )
1062 			yyout = stdout;
1063 
1064 		if ( ! YY_CURRENT_BUFFER ) {
1065 			yyensure_buffer_stack ();
1066 			YY_CURRENT_BUFFER_LVALUE =
1067 				yy_create_buffer( yyin, YY_BUF_SIZE );
1068 		}
1069 
1070 		yy_load_buffer_state(  );
1071 		}
1072 
1073 	{
1074 #line 83 "bootscanner.l"
1075 
1076 
1077 #line 1078 "bootscanner.c"
1078 
1079 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
1080 		{
1081 		yy_cp = (yy_c_buf_p);
1082 
1083 		/* Support of yytext. */
1084 		*yy_cp = (yy_hold_char);
1085 
1086 		/* yy_bp points to the position in yy_ch_buf of the start of
1087 		 * the current run.
1088 		 */
1089 		yy_bp = yy_cp;
1090 
1091 		yy_current_state = (yy_start);
1092 		yy_current_state += YY_AT_BOL();
1093 yy_match:
1094 		do
1095 			{
1096 			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1097 			if ( yy_accept[yy_current_state] )
1098 				{
1099 				(yy_last_accepting_state) = yy_current_state;
1100 				(yy_last_accepting_cpos) = yy_cp;
1101 				}
1102 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1103 				{
1104 				yy_current_state = (int) yy_def[yy_current_state];
1105 				if ( yy_current_state >= 128 )
1106 					yy_c = yy_meta[yy_c];
1107 				}
1108 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1109 			++yy_cp;
1110 			}
1111 		while ( yy_current_state != 127 );
1112 		yy_cp = (yy_last_accepting_cpos);
1113 		yy_current_state = (yy_last_accepting_state);
1114 
1115 yy_find_action:
1116 		yy_act = yy_accept[yy_current_state];
1117 
1118 		YY_DO_BEFORE_ACTION;
1119 
1120 do_action:	/* This label is used only to access EOF actions. */
1121 
1122 		switch ( yy_act )
1123 	{ /* beginning of action switch */
1124 			case 0: /* must back up */
1125 			/* undo the effects of YY_DO_BEFORE_ACTION */
1126 			*yy_cp = (yy_hold_char);
1127 			yy_cp = (yy_last_accepting_cpos);
1128 			yy_current_state = (yy_last_accepting_state);
1129 			goto yy_find_action;
1130 
1131 case 1:
1132 YY_RULE_SETUP
1133 #line 85 "bootscanner.l"
1134 { yylval.kw = "open"; return OPEN; }
1135 	YY_BREAK
1136 case 2:
1137 YY_RULE_SETUP
1138 #line 87 "bootscanner.l"
1139 { yylval.kw = "close"; return XCLOSE; }
1140 	YY_BREAK
1141 case 3:
1142 YY_RULE_SETUP
1143 #line 89 "bootscanner.l"
1144 { yylval.kw = "create"; return XCREATE; }
1145 	YY_BREAK
1146 case 4:
1147 YY_RULE_SETUP
1148 #line 91 "bootscanner.l"
1149 { yylval.kw = "OID"; return OBJ_ID; }
1150 	YY_BREAK
1151 case 5:
1152 YY_RULE_SETUP
1153 #line 92 "bootscanner.l"
1154 { yylval.kw = "bootstrap"; return XBOOTSTRAP; }
1155 	YY_BREAK
1156 case 6:
1157 YY_RULE_SETUP
1158 #line 93 "bootscanner.l"
1159 { yylval.kw = "shared_relation"; return XSHARED_RELATION; }
1160 	YY_BREAK
1161 case 7:
1162 YY_RULE_SETUP
1163 #line 94 "bootscanner.l"
1164 { yylval.kw = "rowtype_oid"; return XROWTYPE_OID; }
1165 	YY_BREAK
1166 case 8:
1167 YY_RULE_SETUP
1168 #line 96 "bootscanner.l"
1169 { yylval.kw = "insert"; return INSERT_TUPLE; }
1170 	YY_BREAK
1171 case 9:
1172 YY_RULE_SETUP
1173 #line 98 "bootscanner.l"
1174 { return NULLVAL; }
1175 	YY_BREAK
1176 case 10:
1177 YY_RULE_SETUP
1178 #line 100 "bootscanner.l"
1179 { return COMMA; }
1180 	YY_BREAK
1181 case 11:
1182 YY_RULE_SETUP
1183 #line 101 "bootscanner.l"
1184 { return EQUALS; }
1185 	YY_BREAK
1186 case 12:
1187 YY_RULE_SETUP
1188 #line 102 "bootscanner.l"
1189 { return LPAREN; }
1190 	YY_BREAK
1191 case 13:
1192 YY_RULE_SETUP
1193 #line 103 "bootscanner.l"
1194 { return RPAREN; }
1195 	YY_BREAK
1196 case 14:
1197 /* rule 14 can match eol */
1198 YY_RULE_SETUP
1199 #line 105 "bootscanner.l"
1200 { yyline++; }
1201 	YY_BREAK
1202 case 15:
1203 YY_RULE_SETUP
1204 #line 106 "bootscanner.l"
1205 ;
1206 	YY_BREAK
1207 case 16:
1208 YY_RULE_SETUP
1209 #line 108 "bootscanner.l"
1210 ;		/* drop everything after "#" for comments */
1211 	YY_BREAK
1212 case 17:
1213 YY_RULE_SETUP
1214 #line 110 "bootscanner.l"
1215 { yylval.kw = "declare"; return XDECLARE; }
1216 	YY_BREAK
1217 case 18:
1218 YY_RULE_SETUP
1219 #line 111 "bootscanner.l"
1220 { yylval.kw = "build"; return XBUILD; }
1221 	YY_BREAK
1222 case 19:
1223 YY_RULE_SETUP
1224 #line 112 "bootscanner.l"
1225 { yylval.kw = "indices"; return INDICES; }
1226 	YY_BREAK
1227 case 20:
1228 YY_RULE_SETUP
1229 #line 113 "bootscanner.l"
1230 { yylval.kw = "unique"; return UNIQUE; }
1231 	YY_BREAK
1232 case 21:
1233 YY_RULE_SETUP
1234 #line 114 "bootscanner.l"
1235 { yylval.kw = "index"; return INDEX; }
1236 	YY_BREAK
1237 case 22:
1238 YY_RULE_SETUP
1239 #line 115 "bootscanner.l"
1240 { yylval.kw = "on"; return ON; }
1241 	YY_BREAK
1242 case 23:
1243 YY_RULE_SETUP
1244 #line 116 "bootscanner.l"
1245 { yylval.kw = "using"; return USING; }
1246 	YY_BREAK
1247 case 24:
1248 YY_RULE_SETUP
1249 #line 117 "bootscanner.l"
1250 { yylval.kw = "toast"; return XTOAST; }
1251 	YY_BREAK
1252 case 25:
1253 YY_RULE_SETUP
1254 #line 118 "bootscanner.l"
1255 { yylval.kw = "FORCE"; return XFORCE; }
1256 	YY_BREAK
1257 case 26:
1258 YY_RULE_SETUP
1259 #line 119 "bootscanner.l"
1260 { yylval.kw = "NOT"; return XNOT; }
1261 	YY_BREAK
1262 case 27:
1263 YY_RULE_SETUP
1264 #line 120 "bootscanner.l"
1265 { yylval.kw = "NULL"; return XNULL; }
1266 	YY_BREAK
1267 case 28:
1268 YY_RULE_SETUP
1269 #line 122 "bootscanner.l"
1270 {
1271 					yylval.str = scanstr(yytext);
1272 					return ID;
1273 				}
1274 	YY_BREAK
1275 case 29:
1276 /* rule 29 can match eol */
1277 YY_RULE_SETUP
1278 #line 126 "bootscanner.l"
1279 {
1280 					/* leading and trailing quotes are not passed to scanstr */
1281 					yytext[strlen(yytext) - 1] = '\0';
1282 					yylval.str = scanstr(yytext+1);
1283 					yytext[strlen(yytext)] = '"';	/* restore yytext */
1284 					return ID;
1285 				}
1286 	YY_BREAK
1287 case 30:
1288 YY_RULE_SETUP
1289 #line 134 "bootscanner.l"
1290 {
1291 					elog(ERROR, "syntax error at line %d: unexpected character \"%s\"", yyline, yytext);
1292 				}
1293 	YY_BREAK
1294 case 31:
1295 YY_RULE_SETUP
1296 #line 138 "bootscanner.l"
1297 YY_FATAL_ERROR( "flex scanner jammed" );
1298 	YY_BREAK
1299 #line 1300 "bootscanner.c"
1300 case YY_STATE_EOF(INITIAL):
1301 	yyterminate();
1302 
1303 	case YY_END_OF_BUFFER:
1304 		{
1305 		/* Amount of text matched not including the EOB char. */
1306 		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1307 
1308 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1309 		*yy_cp = (yy_hold_char);
1310 		YY_RESTORE_YY_MORE_OFFSET
1311 
1312 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1313 			{
1314 			/* We're scanning a new file or input source.  It's
1315 			 * possible that this happened because the user
1316 			 * just pointed yyin at a new source and called
1317 			 * yylex().  If so, then we have to assure
1318 			 * consistency between YY_CURRENT_BUFFER and our
1319 			 * globals.  Here is the right place to do so, because
1320 			 * this is the first action (other than possibly a
1321 			 * back-up) that will match for the new input source.
1322 			 */
1323 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1324 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1325 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1326 			}
1327 
1328 		/* Note that here we test for yy_c_buf_p "<=" to the position
1329 		 * of the first EOB in the buffer, since yy_c_buf_p will
1330 		 * already have been incremented past the NUL character
1331 		 * (since all states make transitions on EOB to the
1332 		 * end-of-buffer state).  Contrast this with the test
1333 		 * in input().
1334 		 */
1335 		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1336 			{ /* This was really a NUL. */
1337 			yy_state_type yy_next_state;
1338 
1339 			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1340 
1341 			yy_current_state = yy_get_previous_state(  );
1342 
1343 			/* Okay, we're now positioned to make the NUL
1344 			 * transition.  We couldn't have
1345 			 * yy_get_previous_state() go ahead and do it
1346 			 * for us because it doesn't know how to deal
1347 			 * with the possibility of jamming (and we don't
1348 			 * want to build jamming into it because then it
1349 			 * will run more slowly).
1350 			 */
1351 
1352 			yy_next_state = yy_try_NUL_trans( yy_current_state );
1353 
1354 			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1355 
1356 			if ( yy_next_state )
1357 				{
1358 				/* Consume the NUL. */
1359 				yy_cp = ++(yy_c_buf_p);
1360 				yy_current_state = yy_next_state;
1361 				goto yy_match;
1362 				}
1363 
1364 			else
1365 				{
1366 				yy_cp = (yy_last_accepting_cpos);
1367 				yy_current_state = (yy_last_accepting_state);
1368 				goto yy_find_action;
1369 				}
1370 			}
1371 
1372 		else switch ( yy_get_next_buffer(  ) )
1373 			{
1374 			case EOB_ACT_END_OF_FILE:
1375 				{
1376 				(yy_did_buffer_switch_on_eof) = 0;
1377 
1378 				if ( yywrap(  ) )
1379 					{
1380 					/* Note: because we've taken care in
1381 					 * yy_get_next_buffer() to have set up
1382 					 * yytext, we can now set up
1383 					 * yy_c_buf_p so that if some total
1384 					 * hoser (like flex itself) wants to
1385 					 * call the scanner after we return the
1386 					 * YY_NULL, it'll still work - another
1387 					 * YY_NULL will get returned.
1388 					 */
1389 					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1390 
1391 					yy_act = YY_STATE_EOF(YY_START);
1392 					goto do_action;
1393 					}
1394 
1395 				else
1396 					{
1397 					if ( ! (yy_did_buffer_switch_on_eof) )
1398 						YY_NEW_FILE;
1399 					}
1400 				break;
1401 				}
1402 
1403 			case EOB_ACT_CONTINUE_SCAN:
1404 				(yy_c_buf_p) =
1405 					(yytext_ptr) + yy_amount_of_matched_text;
1406 
1407 				yy_current_state = yy_get_previous_state(  );
1408 
1409 				yy_cp = (yy_c_buf_p);
1410 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1411 				goto yy_match;
1412 
1413 			case EOB_ACT_LAST_MATCH:
1414 				(yy_c_buf_p) =
1415 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1416 
1417 				yy_current_state = yy_get_previous_state(  );
1418 
1419 				yy_cp = (yy_c_buf_p);
1420 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1421 				goto yy_find_action;
1422 			}
1423 		break;
1424 		}
1425 
1426 	default:
1427 		YY_FATAL_ERROR(
1428 			"fatal flex scanner internal error--no action found" );
1429 	} /* end of action switch */
1430 		} /* end of scanning one token */
1431 	} /* end of user's declarations */
1432 } /* end of yylex */
1433 
1434 /* yy_get_next_buffer - try to read in a new buffer
1435  *
1436  * Returns a code representing an action:
1437  *	EOB_ACT_LAST_MATCH -
1438  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1439  *	EOB_ACT_END_OF_FILE - end of file
1440  */
yy_get_next_buffer(void)1441 static int yy_get_next_buffer (void)
1442 {
1443     	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1444 	char *source = (yytext_ptr);
1445 	int number_to_move, i;
1446 	int ret_val;
1447 
1448 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1449 		YY_FATAL_ERROR(
1450 		"fatal flex scanner internal error--end of buffer missed" );
1451 
1452 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1453 		{ /* Don't try to fill the buffer, so this is an EOF. */
1454 		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1455 			{
1456 			/* We matched a single character, the EOB, so
1457 			 * treat this as a final EOF.
1458 			 */
1459 			return EOB_ACT_END_OF_FILE;
1460 			}
1461 
1462 		else
1463 			{
1464 			/* We matched some text prior to the EOB, first
1465 			 * process it.
1466 			 */
1467 			return EOB_ACT_LAST_MATCH;
1468 			}
1469 		}
1470 
1471 	/* Try to read more data. */
1472 
1473 	/* First move last chars to start of buffer. */
1474 	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1475 
1476 	for ( i = 0; i < number_to_move; ++i )
1477 		*(dest++) = *(source++);
1478 
1479 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1480 		/* don't do the read, it's not guaranteed to return an EOF,
1481 		 * just force an EOF
1482 		 */
1483 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1484 
1485 	else
1486 		{
1487 			int num_to_read =
1488 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1489 
1490 		while ( num_to_read <= 0 )
1491 			{ /* Not enough room in the buffer - grow it. */
1492 
1493 			/* just a shorter name for the current buffer */
1494 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1495 
1496 			int yy_c_buf_p_offset =
1497 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
1498 
1499 			if ( b->yy_is_our_buffer )
1500 				{
1501 				int new_size = b->yy_buf_size * 2;
1502 
1503 				if ( new_size <= 0 )
1504 					b->yy_buf_size += b->yy_buf_size / 8;
1505 				else
1506 					b->yy_buf_size *= 2;
1507 
1508 				b->yy_ch_buf = (char *)
1509 					/* Include room in for 2 EOB chars. */
1510 					yyrealloc( (void *) b->yy_ch_buf,
1511 							 (yy_size_t) (b->yy_buf_size + 2)  );
1512 				}
1513 			else
1514 				/* Can't grow it, we don't own it. */
1515 				b->yy_ch_buf = NULL;
1516 
1517 			if ( ! b->yy_ch_buf )
1518 				YY_FATAL_ERROR(
1519 				"fatal error - scanner input buffer overflow" );
1520 
1521 			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1522 
1523 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1524 						number_to_move - 1;
1525 
1526 			}
1527 
1528 		if ( num_to_read > YY_READ_BUF_SIZE )
1529 			num_to_read = YY_READ_BUF_SIZE;
1530 
1531 		/* Read in more data. */
1532 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1533 			(yy_n_chars), num_to_read );
1534 
1535 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1536 		}
1537 
1538 	if ( (yy_n_chars) == 0 )
1539 		{
1540 		if ( number_to_move == YY_MORE_ADJ )
1541 			{
1542 			ret_val = EOB_ACT_END_OF_FILE;
1543 			yyrestart( yyin  );
1544 			}
1545 
1546 		else
1547 			{
1548 			ret_val = EOB_ACT_LAST_MATCH;
1549 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1550 				YY_BUFFER_EOF_PENDING;
1551 			}
1552 		}
1553 
1554 	else
1555 		ret_val = EOB_ACT_CONTINUE_SCAN;
1556 
1557 	if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1558 		/* Extend the array by 50%, plus the number we really need. */
1559 		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1560 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1561 			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
1562 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1563 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1564 		/* "- 2" to take care of EOB's */
1565 		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1566 	}
1567 
1568 	(yy_n_chars) += number_to_move;
1569 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1570 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1571 
1572 	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1573 
1574 	return ret_val;
1575 }
1576 
1577 /* yy_get_previous_state - get the state just before the EOB char was reached */
1578 
yy_get_previous_state(void)1579     static yy_state_type yy_get_previous_state (void)
1580 {
1581 	yy_state_type yy_current_state;
1582 	char *yy_cp;
1583 
1584 	yy_current_state = (yy_start);
1585 	yy_current_state += YY_AT_BOL();
1586 
1587 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1588 		{
1589 		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1590 		if ( yy_accept[yy_current_state] )
1591 			{
1592 			(yy_last_accepting_state) = yy_current_state;
1593 			(yy_last_accepting_cpos) = yy_cp;
1594 			}
1595 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1596 			{
1597 			yy_current_state = (int) yy_def[yy_current_state];
1598 			if ( yy_current_state >= 128 )
1599 				yy_c = yy_meta[yy_c];
1600 			}
1601 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1602 		}
1603 
1604 	return yy_current_state;
1605 }
1606 
1607 /* yy_try_NUL_trans - try to make a transition on the NUL character
1608  *
1609  * synopsis
1610  *	next_state = yy_try_NUL_trans( current_state );
1611  */
yy_try_NUL_trans(yy_state_type yy_current_state)1612     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1613 {
1614 	int yy_is_jam;
1615     	char *yy_cp = (yy_c_buf_p);
1616 
1617 	YY_CHAR yy_c = 1;
1618 	if ( yy_accept[yy_current_state] )
1619 		{
1620 		(yy_last_accepting_state) = yy_current_state;
1621 		(yy_last_accepting_cpos) = yy_cp;
1622 		}
1623 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1624 		{
1625 		yy_current_state = (int) yy_def[yy_current_state];
1626 		if ( yy_current_state >= 128 )
1627 			yy_c = yy_meta[yy_c];
1628 		}
1629 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1630 	yy_is_jam = (yy_current_state == 127);
1631 
1632 		return yy_is_jam ? 0 : yy_current_state;
1633 }
1634 
1635 #ifndef YY_NO_UNPUT
1636 
1637 #endif
1638 
1639 #ifndef YY_NO_INPUT
1640 #ifdef __cplusplus
yyinput(void)1641     static int yyinput (void)
1642 #else
1643     static int input  (void)
1644 #endif
1645 
1646 {
1647 	int c;
1648 
1649 	*(yy_c_buf_p) = (yy_hold_char);
1650 
1651 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1652 		{
1653 		/* yy_c_buf_p now points to the character we want to return.
1654 		 * If this occurs *before* the EOB characters, then it's a
1655 		 * valid NUL; if not, then we've hit the end of the buffer.
1656 		 */
1657 		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1658 			/* This was really a NUL. */
1659 			*(yy_c_buf_p) = '\0';
1660 
1661 		else
1662 			{ /* need more input */
1663 			int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1664 			++(yy_c_buf_p);
1665 
1666 			switch ( yy_get_next_buffer(  ) )
1667 				{
1668 				case EOB_ACT_LAST_MATCH:
1669 					/* This happens because yy_g_n_b()
1670 					 * sees that we've accumulated a
1671 					 * token and flags that we need to
1672 					 * try matching the token before
1673 					 * proceeding.  But for input(),
1674 					 * there's no matching to consider.
1675 					 * So convert the EOB_ACT_LAST_MATCH
1676 					 * to EOB_ACT_END_OF_FILE.
1677 					 */
1678 
1679 					/* Reset buffer status. */
1680 					yyrestart( yyin );
1681 
1682 					/*FALLTHROUGH*/
1683 
1684 				case EOB_ACT_END_OF_FILE:
1685 					{
1686 					if ( yywrap(  ) )
1687 						return 0;
1688 
1689 					if ( ! (yy_did_buffer_switch_on_eof) )
1690 						YY_NEW_FILE;
1691 #ifdef __cplusplus
1692 					return yyinput();
1693 #else
1694 					return input();
1695 #endif
1696 					}
1697 
1698 				case EOB_ACT_CONTINUE_SCAN:
1699 					(yy_c_buf_p) = (yytext_ptr) + offset;
1700 					break;
1701 				}
1702 			}
1703 		}
1704 
1705 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
1706 	*(yy_c_buf_p) = '\0';	/* preserve yytext */
1707 	(yy_hold_char) = *++(yy_c_buf_p);
1708 
1709 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1710 
1711 	return c;
1712 }
1713 #endif	/* ifndef YY_NO_INPUT */
1714 
1715 /** Immediately switch to a different input stream.
1716  * @param input_file A readable stream.
1717  *
1718  * @note This function does not reset the start condition to @c INITIAL .
1719  */
yyrestart(FILE * input_file)1720     void yyrestart  (FILE * input_file )
1721 {
1722 
1723 	if ( ! YY_CURRENT_BUFFER ){
1724         yyensure_buffer_stack ();
1725 		YY_CURRENT_BUFFER_LVALUE =
1726             yy_create_buffer( yyin, YY_BUF_SIZE );
1727 	}
1728 
1729 	yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1730 	yy_load_buffer_state(  );
1731 }
1732 
1733 /** Switch to a different input buffer.
1734  * @param new_buffer The new input buffer.
1735  *
1736  */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1737     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1738 {
1739 
1740 	/* TODO. We should be able to replace this entire function body
1741 	 * with
1742 	 *		yypop_buffer_state();
1743 	 *		yypush_buffer_state(new_buffer);
1744      */
1745 	yyensure_buffer_stack ();
1746 	if ( YY_CURRENT_BUFFER == new_buffer )
1747 		return;
1748 
1749 	if ( YY_CURRENT_BUFFER )
1750 		{
1751 		/* Flush out information for old buffer. */
1752 		*(yy_c_buf_p) = (yy_hold_char);
1753 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1754 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1755 		}
1756 
1757 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1758 	yy_load_buffer_state(  );
1759 
1760 	/* We don't actually know whether we did this switch during
1761 	 * EOF (yywrap()) processing, but the only time this flag
1762 	 * is looked at is after yywrap() is called, so it's safe
1763 	 * to go ahead and always set it.
1764 	 */
1765 	(yy_did_buffer_switch_on_eof) = 1;
1766 }
1767 
yy_load_buffer_state(void)1768 static void yy_load_buffer_state  (void)
1769 {
1770     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1771 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1772 	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1773 	(yy_hold_char) = *(yy_c_buf_p);
1774 }
1775 
1776 /** Allocate and initialize an input buffer state.
1777  * @param file A readable stream.
1778  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1779  *
1780  * @return the allocated buffer state.
1781  */
yy_create_buffer(FILE * file,int size)1782     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
1783 {
1784 	YY_BUFFER_STATE b;
1785 
1786 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
1787 	if ( ! b )
1788 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1789 
1790 	b->yy_buf_size = size;
1791 
1792 	/* yy_ch_buf has to be 2 characters longer than the size given because
1793 	 * we need to put in 2 end-of-buffer characters.
1794 	 */
1795 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
1796 	if ( ! b->yy_ch_buf )
1797 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1798 
1799 	b->yy_is_our_buffer = 1;
1800 
1801 	yy_init_buffer( b, file );
1802 
1803 	return b;
1804 }
1805 
1806 /** Destroy the buffer.
1807  * @param b a buffer created with yy_create_buffer()
1808  *
1809  */
yy_delete_buffer(YY_BUFFER_STATE b)1810     void yy_delete_buffer (YY_BUFFER_STATE  b )
1811 {
1812 
1813 	if ( ! b )
1814 		return;
1815 
1816 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1817 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1818 
1819 	if ( b->yy_is_our_buffer )
1820 		yyfree( (void *) b->yy_ch_buf  );
1821 
1822 	yyfree( (void *) b  );
1823 }
1824 
1825 /* Initializes or reinitializes a buffer.
1826  * This function is sometimes called more than once on the same buffer,
1827  * such as during a yyrestart() or at EOF.
1828  */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1829     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1830 
1831 {
1832 	int oerrno = errno;
1833 
1834 	yy_flush_buffer( b );
1835 
1836 	b->yy_input_file = file;
1837 	b->yy_fill_buffer = 1;
1838 
1839     /* If b is the current buffer, then yy_init_buffer was _probably_
1840      * called from yyrestart() or through yy_get_next_buffer.
1841      * In that case, we don't want to reset the lineno or column.
1842      */
1843     if (b != YY_CURRENT_BUFFER){
1844         b->yy_bs_lineno = 1;
1845         b->yy_bs_column = 0;
1846     }
1847 
1848         b->yy_is_interactive = 0;
1849 
1850 	errno = oerrno;
1851 }
1852 
1853 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1854  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1855  *
1856  */
yy_flush_buffer(YY_BUFFER_STATE b)1857     void yy_flush_buffer (YY_BUFFER_STATE  b )
1858 {
1859     	if ( ! b )
1860 		return;
1861 
1862 	b->yy_n_chars = 0;
1863 
1864 	/* We always need two end-of-buffer characters.  The first causes
1865 	 * a transition to the end-of-buffer state.  The second causes
1866 	 * a jam in that state.
1867 	 */
1868 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1869 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1870 
1871 	b->yy_buf_pos = &b->yy_ch_buf[0];
1872 
1873 	b->yy_at_bol = 1;
1874 	b->yy_buffer_status = YY_BUFFER_NEW;
1875 
1876 	if ( b == YY_CURRENT_BUFFER )
1877 		yy_load_buffer_state(  );
1878 }
1879 
1880 /** Pushes the new state onto the stack. The new state becomes
1881  *  the current state. This function will allocate the stack
1882  *  if necessary.
1883  *  @param new_buffer The new state.
1884  *
1885  */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)1886 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1887 {
1888     	if (new_buffer == NULL)
1889 		return;
1890 
1891 	yyensure_buffer_stack();
1892 
1893 	/* This block is copied from yy_switch_to_buffer. */
1894 	if ( YY_CURRENT_BUFFER )
1895 		{
1896 		/* Flush out information for old buffer. */
1897 		*(yy_c_buf_p) = (yy_hold_char);
1898 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1899 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1900 		}
1901 
1902 	/* Only push if top exists. Otherwise, replace top. */
1903 	if (YY_CURRENT_BUFFER)
1904 		(yy_buffer_stack_top)++;
1905 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1906 
1907 	/* copied from yy_switch_to_buffer. */
1908 	yy_load_buffer_state(  );
1909 	(yy_did_buffer_switch_on_eof) = 1;
1910 }
1911 
1912 /** Removes and deletes the top of the stack, if present.
1913  *  The next element becomes the new top.
1914  *
1915  */
yypop_buffer_state(void)1916 void yypop_buffer_state (void)
1917 {
1918     	if (!YY_CURRENT_BUFFER)
1919 		return;
1920 
1921 	yy_delete_buffer(YY_CURRENT_BUFFER );
1922 	YY_CURRENT_BUFFER_LVALUE = NULL;
1923 	if ((yy_buffer_stack_top) > 0)
1924 		--(yy_buffer_stack_top);
1925 
1926 	if (YY_CURRENT_BUFFER) {
1927 		yy_load_buffer_state(  );
1928 		(yy_did_buffer_switch_on_eof) = 1;
1929 	}
1930 }
1931 
1932 /* Allocates the stack if it does not exist.
1933  *  Guarantees space for at least one push.
1934  */
yyensure_buffer_stack(void)1935 static void yyensure_buffer_stack (void)
1936 {
1937 	yy_size_t num_to_alloc;
1938 
1939 	if (!(yy_buffer_stack)) {
1940 
1941 		/* First allocation is just for 2 elements, since we don't know if this
1942 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1943 		 * immediate realloc on the next call.
1944          */
1945       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1946 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1947 								(num_to_alloc * sizeof(struct yy_buffer_state*)
1948 								);
1949 		if ( ! (yy_buffer_stack) )
1950 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1951 
1952 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1953 
1954 		(yy_buffer_stack_max) = num_to_alloc;
1955 		(yy_buffer_stack_top) = 0;
1956 		return;
1957 	}
1958 
1959 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1960 
1961 		/* Increase the buffer to prepare for a possible push. */
1962 		yy_size_t grow_size = 8 /* arbitrary grow size */;
1963 
1964 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
1965 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1966 								((yy_buffer_stack),
1967 								num_to_alloc * sizeof(struct yy_buffer_state*)
1968 								);
1969 		if ( ! (yy_buffer_stack) )
1970 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1971 
1972 		/* zero only the new slots.*/
1973 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1974 		(yy_buffer_stack_max) = num_to_alloc;
1975 	}
1976 }
1977 
1978 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1979  * @param base the character buffer
1980  * @param size the size in bytes of the character buffer
1981  *
1982  * @return the newly allocated buffer state object.
1983  */
yy_scan_buffer(char * base,yy_size_t size)1984 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
1985 {
1986 	YY_BUFFER_STATE b;
1987 
1988 	if ( size < 2 ||
1989 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
1990 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
1991 		/* They forgot to leave room for the EOB's. */
1992 		return NULL;
1993 
1994 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
1995 	if ( ! b )
1996 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1997 
1998 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
1999 	b->yy_buf_pos = b->yy_ch_buf = base;
2000 	b->yy_is_our_buffer = 0;
2001 	b->yy_input_file = NULL;
2002 	b->yy_n_chars = b->yy_buf_size;
2003 	b->yy_is_interactive = 0;
2004 	b->yy_at_bol = 1;
2005 	b->yy_fill_buffer = 0;
2006 	b->yy_buffer_status = YY_BUFFER_NEW;
2007 
2008 	yy_switch_to_buffer( b  );
2009 
2010 	return b;
2011 }
2012 
2013 /** Setup the input buffer state to scan a string. The next call to yylex() will
2014  * scan from a @e copy of @a str.
2015  * @param yystr a NUL-terminated string to scan
2016  *
2017  * @return the newly allocated buffer state object.
2018  * @note If you want to scan bytes that may contain NUL values, then use
2019  *       yy_scan_bytes() instead.
2020  */
yy_scan_string(const char * yystr)2021 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2022 {
2023 
2024 	return yy_scan_bytes( yystr, (int) strlen(yystr) );
2025 }
2026 
2027 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2028  * scan from a @e copy of @a bytes.
2029  * @param yybytes the byte buffer to scan
2030  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2031  *
2032  * @return the newly allocated buffer state object.
2033  */
yy_scan_bytes(const char * yybytes,int _yybytes_len)2034 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
2035 {
2036 	YY_BUFFER_STATE b;
2037 	char *buf;
2038 	yy_size_t n;
2039 	int i;
2040 
2041 	/* Get memory for full buffer, including space for trailing EOB's. */
2042 	n = (yy_size_t) (_yybytes_len + 2);
2043 	buf = (char *) yyalloc( n  );
2044 	if ( ! buf )
2045 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2046 
2047 	for ( i = 0; i < _yybytes_len; ++i )
2048 		buf[i] = yybytes[i];
2049 
2050 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2051 
2052 	b = yy_scan_buffer( buf, n );
2053 	if ( ! b )
2054 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2055 
2056 	/* It's okay to grow etc. this buffer, and we should throw it
2057 	 * away when we're done.
2058 	 */
2059 	b->yy_is_our_buffer = 1;
2060 
2061 	return b;
2062 }
2063 
2064 #ifndef YY_EXIT_FAILURE
2065 #define YY_EXIT_FAILURE 2
2066 #endif
2067 
yy_fatal_error(const char * msg)2068 static void yynoreturn yy_fatal_error (const char* msg )
2069 {
2070 			fprintf( stderr, "%s\n", msg );
2071 	exit( YY_EXIT_FAILURE );
2072 }
2073 
2074 /* Redefine yyless() so it works in section 3 code. */
2075 
2076 #undef yyless
2077 #define yyless(n) \
2078 	do \
2079 		{ \
2080 		/* Undo effects of setting up yytext. */ \
2081         int yyless_macro_arg = (n); \
2082         YY_LESS_LINENO(yyless_macro_arg);\
2083 		yytext[yyleng] = (yy_hold_char); \
2084 		(yy_c_buf_p) = yytext + yyless_macro_arg; \
2085 		(yy_hold_char) = *(yy_c_buf_p); \
2086 		*(yy_c_buf_p) = '\0'; \
2087 		yyleng = yyless_macro_arg; \
2088 		} \
2089 	while ( 0 )
2090 
2091 /* Accessor  methods (get/set functions) to struct members. */
2092 
2093 /** Get the current line number.
2094  *
2095  */
yyget_lineno(void)2096 int yyget_lineno  (void)
2097 {
2098 
2099     return yylineno;
2100 }
2101 
2102 /** Get the input stream.
2103  *
2104  */
yyget_in(void)2105 FILE *yyget_in  (void)
2106 {
2107         return yyin;
2108 }
2109 
2110 /** Get the output stream.
2111  *
2112  */
yyget_out(void)2113 FILE *yyget_out  (void)
2114 {
2115         return yyout;
2116 }
2117 
2118 /** Get the length of the current token.
2119  *
2120  */
yyget_leng(void)2121 int yyget_leng  (void)
2122 {
2123         return yyleng;
2124 }
2125 
2126 /** Get the current token.
2127  *
2128  */
2129 
yyget_text(void)2130 char *yyget_text  (void)
2131 {
2132         return yytext;
2133 }
2134 
2135 /** Set the current line number.
2136  * @param _line_number line number
2137  *
2138  */
yyset_lineno(int _line_number)2139 void yyset_lineno (int  _line_number )
2140 {
2141 
2142     yylineno = _line_number;
2143 }
2144 
2145 /** Set the input stream. This does not discard the current
2146  * input buffer.
2147  * @param _in_str A readable stream.
2148  *
2149  * @see yy_switch_to_buffer
2150  */
yyset_in(FILE * _in_str)2151 void yyset_in (FILE *  _in_str )
2152 {
2153         yyin = _in_str ;
2154 }
2155 
yyset_out(FILE * _out_str)2156 void yyset_out (FILE *  _out_str )
2157 {
2158         yyout = _out_str ;
2159 }
2160 
yyget_debug(void)2161 int yyget_debug  (void)
2162 {
2163         return yy_flex_debug;
2164 }
2165 
yyset_debug(int _bdebug)2166 void yyset_debug (int  _bdebug )
2167 {
2168         yy_flex_debug = _bdebug ;
2169 }
2170 
yy_init_globals(void)2171 static int yy_init_globals (void)
2172 {
2173         /* Initialization is the same as for the non-reentrant scanner.
2174      * This function is called from yylex_destroy(), so don't allocate here.
2175      */
2176 
2177     (yy_buffer_stack) = NULL;
2178     (yy_buffer_stack_top) = 0;
2179     (yy_buffer_stack_max) = 0;
2180     (yy_c_buf_p) = NULL;
2181     (yy_init) = 0;
2182     (yy_start) = 0;
2183 
2184 /* Defined in main.c */
2185 #ifdef YY_STDINIT
2186     yyin = stdin;
2187     yyout = stdout;
2188 #else
2189     yyin = NULL;
2190     yyout = NULL;
2191 #endif
2192 
2193     /* For future reference: Set errno on error, since we are called by
2194      * yylex_init()
2195      */
2196     return 0;
2197 }
2198 
2199 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)2200 int yylex_destroy  (void)
2201 {
2202 
2203     /* Pop the buffer stack, destroying each element. */
2204 	while(YY_CURRENT_BUFFER){
2205 		yy_delete_buffer( YY_CURRENT_BUFFER  );
2206 		YY_CURRENT_BUFFER_LVALUE = NULL;
2207 		yypop_buffer_state();
2208 	}
2209 
2210 	/* Destroy the stack itself. */
2211 	yyfree((yy_buffer_stack) );
2212 	(yy_buffer_stack) = NULL;
2213 
2214     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2215      * yylex() is called, initialization will occur. */
2216     yy_init_globals( );
2217 
2218     return 0;
2219 }
2220 
2221 /*
2222  * Internal utility routines.
2223  */
2224 
2225 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)2226 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2227 {
2228 
2229 	int i;
2230 	for ( i = 0; i < n; ++i )
2231 		s1[i] = s2[i];
2232 }
2233 #endif
2234 
2235 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)2236 static int yy_flex_strlen (const char * s )
2237 {
2238 	int n;
2239 	for ( n = 0; s[n]; ++n )
2240 		;
2241 
2242 	return n;
2243 }
2244 #endif
2245 
yyalloc(yy_size_t size)2246 void *yyalloc (yy_size_t  size )
2247 {
2248 			return malloc(size);
2249 }
2250 
yyrealloc(void * ptr,yy_size_t size)2251 void *yyrealloc  (void * ptr, yy_size_t  size )
2252 {
2253 
2254 	/* The cast to (char *) in the following accommodates both
2255 	 * implementations that use char* generic pointers, and those
2256 	 * that use void* generic pointers.  It works with the latter
2257 	 * because both ANSI C and C++ allow castless assignment from
2258 	 * any pointer type to void*, and deal with argument conversions
2259 	 * as though doing an assignment.
2260 	 */
2261 	return realloc(ptr, size);
2262 }
2263 
yyfree(void * ptr)2264 void yyfree (void * ptr )
2265 {
2266 			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
2267 }
2268 
2269 #define YYTABLES_NAME "yytables"
2270 
2271 #line 138 "bootscanner.l"
2272 
2273 
2274 /* LCOV_EXCL_STOP */
2275 
2276 void
yyerror(const char * message)2277 yyerror(const char *message)
2278 {
2279 	elog(ERROR, "%s at line %d", message, yyline);
2280 }
2281 
2282