Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/flex-with-call-summaries.c

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