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