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