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