Coverage Report

Created: 2026-08-14 06:37

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