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