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