Coverage Report

Created: 2025-08-12 06:43

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