Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / sdbinutils / binutils / deflex.c
blob47cd1754fe2c68ca711d60a257d8912ab56d7459
2 #line 2 "deflex.c"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 4
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
24 /* end standard C headers. */
26 /* flex integer type definitions */
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
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;
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
86 #ifndef SIZE_MAX
87 #define SIZE_MAX (~(size_t)0)
88 #endif
90 #endif /* ! C99 */
92 #endif /* ! FLEXINT_H */
94 /* begin standard C++ headers. */
96 /* TODO: this is always defined, so inline it */
97 #define yyconst const
99 #if defined(__GNUC__) && __GNUC__ >= 3
100 #define yynoreturn __attribute__((__noreturn__))
101 #else
102 #define yynoreturn
103 #endif
105 /* Returned upon end-of-file. */
106 #define YY_NULL 0
108 /* Promotes a possibly negative, possibly signed char to an
109 * integer in range [0..255] for use as an array index.
111 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
113 /* Enter a start condition. This macro really ought to take a parameter,
114 * but we do it the disgusting crufty way forced on us by the ()-less
115 * definition of BEGIN.
117 #define BEGIN (yy_start) = 1 + 2 *
118 /* Translate the current start state into a value that can be later handed
119 * to BEGIN to return to the state. The YYSTATE alias is for lex
120 * compatibility.
122 #define YY_START (((yy_start) - 1) / 2)
123 #define YYSTATE YY_START
124 /* Action number for EOF rule of a given start state. */
125 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
126 /* Special action meaning "start processing a new file". */
127 #define YY_NEW_FILE yyrestart( yyin )
128 #define YY_END_OF_BUFFER_CHAR 0
130 /* Size of default input buffer. */
131 #ifndef YY_BUF_SIZE
132 #ifdef __ia64__
133 /* On IA-64, the buffer size is 16k, not 8k.
134 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
135 * Ditto for the __ia64__ case accordingly.
137 #define YY_BUF_SIZE 32768
138 #else
139 #define YY_BUF_SIZE 16384
140 #endif /* __ia64__ */
141 #endif
143 /* The state buf must be large enough to hold one state per character in the main buffer.
145 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
147 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
148 #define YY_TYPEDEF_YY_BUFFER_STATE
149 typedef struct yy_buffer_state *YY_BUFFER_STATE;
150 #endif
152 #ifndef YY_TYPEDEF_YY_SIZE_T
153 #define YY_TYPEDEF_YY_SIZE_T
154 typedef size_t yy_size_t;
155 #endif
157 extern int yyleng;
159 extern FILE *yyin, *yyout;
161 #define EOB_ACT_CONTINUE_SCAN 0
162 #define EOB_ACT_END_OF_FILE 1
163 #define EOB_ACT_LAST_MATCH 2
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
168 /* Return all but the first "n" matched characters back to the input stream. */
169 #define yyless(n) \
170 do \
172 /* Undo effects of setting up yytext. */ \
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
178 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 while ( 0 )
181 #define unput(c) yyunput( c, (yytext_ptr) )
183 #ifndef YY_STRUCT_YY_BUFFER_STATE
184 #define YY_STRUCT_YY_BUFFER_STATE
185 struct yy_buffer_state
187 FILE *yy_input_file;
189 char *yy_ch_buf; /* input buffer */
190 char *yy_buf_pos; /* current position in input buffer */
192 /* Size of input buffer in bytes, not including room for EOB
193 * characters.
195 int yy_buf_size;
197 /* Number of characters read into yy_ch_buf, not including EOB
198 * characters.
200 int yy_n_chars;
202 /* Whether we "own" the buffer - i.e., we know we created it,
203 * and can realloc() it to grow it, and should free() it to
204 * delete it.
206 int yy_is_our_buffer;
208 /* Whether this is an "interactive" input source; if so, and
209 * if we're using stdio for input, then we want to use getc()
210 * instead of fread(), to make sure we stop fetching input after
211 * each newline.
213 int yy_is_interactive;
215 /* Whether we're considered to be at the beginning of a line.
216 * If so, '^' rules will be active on the next match, otherwise
217 * not.
219 int yy_at_bol;
221 int yy_bs_lineno; /**< The line count. */
222 int yy_bs_column; /**< The column count. */
224 /* Whether to try to fill the input buffer when we reach the
225 * end of it.
227 int yy_fill_buffer;
229 int yy_buffer_status;
231 #define YY_BUFFER_NEW 0
232 #define YY_BUFFER_NORMAL 1
233 /* When an EOF's been seen but there's still some text to process
234 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
235 * shouldn't try reading from the input source any more. We might
236 * still have a bunch of tokens to match, though, because of
237 * possible backing-up.
239 * When we actually see the EOF, we change the status to "new"
240 * (via yyrestart()), so that the user can continue scanning by
241 * just pointing yyin at a new input file.
243 #define YY_BUFFER_EOF_PENDING 2
246 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
248 /* Stack of input buffers. */
249 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
250 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
251 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
253 /* We provide macros for accessing buffer states in case in the
254 * future we want to put the buffer states in a more general
255 * "scanner state".
257 * Returns the top of the stack, or NULL.
259 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
260 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
261 : NULL)
262 /* Same as previous macro, but useful when we know that the buffer stack is not
263 * NULL or when we need an lvalue. For internal use only.
265 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
267 /* yy_hold_char holds the character lost when yytext is formed. */
268 static char yy_hold_char;
269 static int yy_n_chars; /* number of characters read into yy_ch_buf */
270 int yyleng;
272 /* Points to current character in buffer. */
273 static char *yy_c_buf_p = NULL;
274 static int yy_init = 0; /* whether we need to initialize */
275 static int yy_start = 0; /* start state number */
277 /* Flag which is used to allow yywrap()'s to do buffer switches
278 * instead of setting up a fresh yyin. A bit of a hack ...
280 static int yy_did_buffer_switch_on_eof;
282 void yyrestart ( FILE *input_file );
283 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
284 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
285 void yy_delete_buffer ( YY_BUFFER_STATE b );
286 void yy_flush_buffer ( YY_BUFFER_STATE b );
287 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
288 void yypop_buffer_state ( void );
290 static void yyensure_buffer_stack ( void );
291 static void yy_load_buffer_state ( void );
292 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
293 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
295 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
296 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
297 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
299 void *yyalloc ( yy_size_t );
300 void *yyrealloc ( void *, yy_size_t );
301 void yyfree ( void * );
303 #define yy_new_buffer yy_create_buffer
304 #define yy_set_interactive(is_interactive) \
306 if ( ! YY_CURRENT_BUFFER ){ \
307 yyensure_buffer_stack (); \
308 YY_CURRENT_BUFFER_LVALUE = \
309 yy_create_buffer( yyin, YY_BUF_SIZE ); \
311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313 #define yy_set_bol(at_bol) \
315 if ( ! YY_CURRENT_BUFFER ){\
316 yyensure_buffer_stack (); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 yy_create_buffer( yyin, YY_BUF_SIZE ); \
320 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
324 /* Begin user sect3 */
326 #define yywrap() (/*CONSTCOND*/1)
327 #define YY_SKIP_YYWRAP
328 typedef flex_uint8_t YY_CHAR;
330 FILE *yyin = NULL, *yyout = NULL;
332 typedef int yy_state_type;
334 extern int yylineno;
335 int yylineno = 1;
337 extern char *yytext;
338 #ifdef yytext_ptr
339 #undef yytext_ptr
340 #endif
341 #define yytext_ptr yytext
343 static yy_state_type yy_get_previous_state ( void );
344 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
345 static int yy_get_next_buffer ( void );
346 static void yynoreturn yy_fatal_error ( const char* msg );
348 /* Done after the current pattern has been matched and before the
349 * corresponding action - sets up yytext.
351 #define YY_DO_BEFORE_ACTION \
352 (yytext_ptr) = yy_bp; \
353 yyleng = (int) (yy_cp - yy_bp); \
354 (yy_hold_char) = *yy_cp; \
355 *yy_cp = '\0'; \
356 (yy_c_buf_p) = yy_cp;
357 #define YY_NUM_RULES 42
358 #define YY_END_OF_BUFFER 43
359 /* This struct is not used in this scanner,
360 but its presence is necessary. */
361 struct yy_trans_info
363 flex_int32_t yy_verify;
364 flex_int32_t yy_nxt;
366 static const flex_int16_t yy_accept[199] =
367 { 0,
368 0, 0, 43, 42, 34, 36, 35, 33, 42, 28,
369 42, 31, 41, 39, 27, 32, 38, 40, 28, 28,
370 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
371 28, 28, 28, 0, 29, 28, 0, 30, 31, 27,
372 32, 37, 28, 28, 28, 28, 28, 28, 28, 28,
373 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
374 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
375 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
376 28, 28, 28, 28, 28, 28, 28, 12, 6, 28,
377 7, 28, 28, 28, 28, 28, 28, 28, 28, 1,
379 28, 28, 28, 16, 28, 28, 28, 28, 28, 28,
380 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
381 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
382 28, 17, 28, 28, 28, 28, 28, 28, 28, 28,
383 28, 28, 14, 28, 28, 28, 19, 21, 28, 28,
384 28, 28, 28, 28, 18, 9, 28, 10, 28, 28,
385 2, 28, 28, 15, 28, 28, 28, 28, 11, 13,
386 28, 5, 28, 28, 22, 28, 8, 28, 28, 28,
387 28, 28, 28, 20, 4, 28, 28, 28, 24, 28,
388 26, 28, 3, 28, 28, 23, 25, 0
392 static const YY_CHAR yy_ec[256] =
393 { 0,
394 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
395 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 5, 1, 6, 1, 7, 1, 1, 8, 1,
398 1, 9, 10, 11, 7, 12, 10, 13, 13, 13,
399 13, 13, 13, 13, 13, 13, 13, 7, 14, 10,
400 15, 10, 7, 16, 17, 18, 19, 20, 21, 22,
401 23, 24, 25, 7, 26, 27, 28, 29, 30, 31,
402 7, 32, 33, 34, 35, 36, 37, 38, 39, 40,
403 1, 1, 1, 1, 7, 1, 22, 22, 22, 22,
405 22, 22, 7, 7, 7, 7, 7, 7, 7, 7,
406 7, 7, 7, 7, 7, 7, 7, 7, 7, 22,
407 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1
424 static const YY_CHAR yy_meta[41] =
425 { 0,
426 1, 1, 2, 1, 1, 1, 3, 1, 1, 4,
427 1, 1, 5, 1, 1, 4, 6, 6, 6, 6,
428 6, 6, 3, 3, 3, 3, 3, 3, 3, 3,
429 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
432 static const flex_int16_t yy_base[206] =
433 { 0,
434 0, 0, 230, 231, 231, 231, 231, 231, 223, 0,
435 220, 0, 231, 231, 0, 0, 212, 0, 209, 195,
436 24, 186, 202, 14, 197, 186, 27, 188, 198, 25,
437 197, 196, 184, 209, 231, 0, 206, 231, 0, 0,
438 0, 231, 0, 180, 27, 178, 178, 27, 193, 178,
439 183, 189, 179, 177, 175, 178, 185, 182, 183, 170,
440 181, 165, 164, 170, 173, 172, 159, 174, 171, 170,
441 158, 156, 156, 151, 152, 149, 161, 34, 145, 160,
442 145, 146, 154, 157, 147, 141, 139, 0, 0, 138,
443 0, 139, 135, 137, 135, 135, 29, 149, 140, 0,
445 136, 139, 145, 0, 136, 139, 132, 132, 30, 132,
446 135, 138, 129, 119, 118, 126, 116, 122, 119, 115,
447 115, 124, 127, 109, 112, 121, 119, 106, 111, 108,
448 106, 0, 106, 103, 112, 99, 91, 97, 99, 95,
449 88, 99, 0, 93, 103, 94, 0, 0, 97, 91,
450 87, 90, 84, 83, 0, 0, 95, 0, 97, 80,
451 0, 92, 91, 0, 78, 70, 91, 74, 0, 0,
452 82, 0, 89, 88, 0, 84, 0, 82, 85, 83,
453 69, 66, 56, 0, 0, 39, 36, 35, 0, 44,
454 0, 43, 0, 40, 39, 0, 0, 231, 67, 71,
456 77, 83, 85, 91, 95
459 static const flex_int16_t yy_def[206] =
460 { 0,
461 198, 1, 198, 198, 198, 198, 198, 198, 199, 200,
462 201, 202, 198, 198, 203, 204, 198, 205, 200, 200,
463 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
464 200, 200, 200, 199, 198, 200, 201, 198, 202, 203,
465 204, 198, 200, 200, 200, 200, 200, 200, 200, 200,
466 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
467 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
468 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
469 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
470 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
472 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
473 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
474 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
475 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
476 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
477 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
478 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
479 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
480 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
481 200, 200, 200, 200, 200, 200, 200, 0, 198, 198,
483 198, 198, 198, 198, 198
486 static const flex_int16_t yy_nxt[272] =
487 { 0,
488 4, 5, 6, 7, 8, 9, 10, 11, 12, 4,
489 13, 14, 15, 16, 17, 18, 10, 19, 20, 21,
490 22, 10, 10, 23, 24, 10, 25, 26, 27, 10,
491 28, 29, 30, 31, 10, 32, 33, 10, 10, 10,
492 46, 50, 51, 54, 47, 58, 66, 70, 59, 60,
493 101, 118, 129, 119, 130, 67, 55, 71, 61, 197,
494 196, 195, 194, 193, 192, 191, 102, 34, 34, 34,
495 34, 34, 34, 36, 36, 36, 36, 37, 37, 37,
496 37, 37, 37, 39, 190, 39, 39, 39, 39, 40,
497 40, 41, 189, 41, 41, 41, 41, 43, 188, 187,
499 43, 186, 185, 184, 183, 182, 181, 180, 179, 178,
500 177, 176, 175, 174, 173, 172, 171, 170, 169, 168,
501 167, 166, 165, 164, 163, 162, 161, 160, 159, 158,
502 157, 156, 155, 154, 153, 152, 151, 150, 149, 148,
503 147, 146, 145, 144, 143, 142, 141, 140, 139, 138,
504 137, 136, 135, 134, 133, 132, 131, 128, 127, 126,
505 125, 124, 123, 122, 121, 120, 117, 116, 115, 114,
506 113, 112, 111, 110, 109, 108, 107, 106, 105, 104,
507 103, 100, 99, 98, 97, 96, 95, 94, 93, 92,
508 91, 90, 89, 88, 87, 86, 85, 84, 83, 82,
510 81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
511 69, 68, 65, 38, 35, 64, 63, 62, 57, 56,
512 53, 52, 49, 48, 45, 44, 42, 38, 35, 198,
513 3, 198, 198, 198, 198, 198, 198, 198, 198, 198,
514 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
515 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
516 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
520 static const flex_int16_t yy_chk[272] =
521 { 0,
522 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
523 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
524 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
525 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526 21, 24, 24, 27, 21, 30, 45, 48, 30, 30,
527 78, 97, 109, 97, 109, 45, 27, 48, 30, 195,
528 194, 192, 190, 188, 187, 186, 78, 199, 199, 199,
529 199, 199, 199, 200, 200, 200, 200, 201, 201, 201,
530 201, 201, 201, 202, 183, 202, 202, 202, 202, 203,
531 203, 204, 182, 204, 204, 204, 204, 205, 181, 180,
533 205, 179, 178, 176, 174, 173, 171, 168, 167, 166,
534 165, 163, 162, 160, 159, 157, 154, 153, 152, 151,
535 150, 149, 146, 145, 144, 142, 141, 140, 139, 138,
536 137, 136, 135, 134, 133, 131, 130, 129, 128, 127,
537 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
538 116, 115, 114, 113, 112, 111, 110, 108, 107, 106,
539 105, 103, 102, 101, 99, 98, 96, 95, 94, 93,
540 92, 90, 87, 86, 85, 84, 83, 82, 81, 80,
541 79, 77, 76, 75, 74, 73, 72, 71, 70, 69,
542 68, 67, 66, 65, 64, 63, 62, 61, 60, 59,
544 58, 57, 56, 55, 54, 53, 52, 51, 50, 49,
545 47, 46, 44, 37, 34, 33, 32, 31, 29, 28,
546 26, 25, 23, 22, 20, 19, 17, 11, 9, 3,
547 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
548 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
549 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
550 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
554 static yy_state_type yy_last_accepting_state;
555 static char *yy_last_accepting_cpos;
557 extern int yy_flex_debug;
558 int yy_flex_debug = 0;
560 /* The intent behind this definition is that it'll catch
561 * any uses of REJECT which flex missed.
563 #define REJECT reject_used_but_not_detected
564 #define yymore() yymore_used_but_not_detected
565 #define YY_MORE_ADJ 0
566 #define YY_RESTORE_YY_MORE_OFFSET
567 char *yytext;
568 #line 1 "deflex.l"
569 #define YY_NO_INPUT 1
570 #line 4 "deflex.l"
572 /* Copyright (C) 1995-2022 Free Software Foundation, Inc.
574 This file is part of GNU Binutils.
576 This program is free software; you can redistribute it and/or modify
577 it under the terms of the GNU General Public License as published by
578 the Free Software Foundation; either version 3 of the License, or
579 (at your option) any later version.
581 This program is distributed in the hope that it will be useful,
582 but WITHOUT ANY WARRANTY; without even the implied warranty of
583 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
584 GNU General Public License for more details.
586 You should have received a copy of the GNU General Public License
587 along with this program; if not, write to the Free Software
588 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
589 MA 02110-1301, USA. */
592 /* Contributed by Steve Chamberlain: sac@cygnus.com */
594 #define DONTDECLARE_MALLOC
595 #include "libiberty.h"
596 #include "defparse.h"
597 #include "dlltool.h"
599 int linenumber;
601 #line 601 "deflex.c"
602 #line 602 "deflex.c"
604 #define INITIAL 0
606 #ifndef YY_NO_UNISTD_H
607 /* Special case for "unistd.h", since it is non-ANSI. We include it way
608 * down here because we want the user's section 1 to have been scanned first.
609 * The user has a chance to override it with an option.
611 #include <unistd.h>
612 #endif
614 #ifndef YY_EXTRA_TYPE
615 #define YY_EXTRA_TYPE void *
616 #endif
618 static int yy_init_globals ( void );
620 /* Accessor methods to globals.
621 These are made visible to non-reentrant scanners for convenience. */
623 int yylex_destroy ( void );
625 int yyget_debug ( void );
627 void yyset_debug ( int debug_flag );
629 YY_EXTRA_TYPE yyget_extra ( void );
631 void yyset_extra ( YY_EXTRA_TYPE user_defined );
633 FILE *yyget_in ( void );
635 void yyset_in ( FILE * _in_str );
637 FILE *yyget_out ( void );
639 void yyset_out ( FILE * _out_str );
641 int yyget_leng ( void );
643 char *yyget_text ( void );
645 int yyget_lineno ( void );
647 void yyset_lineno ( int _line_number );
649 /* Macros after this point can all be overridden by user definitions in
650 * section 1.
653 #ifndef YY_SKIP_YYWRAP
654 #ifdef __cplusplus
655 extern "C" int yywrap ( void );
656 #else
657 extern int yywrap ( void );
658 #endif
659 #endif
661 #ifndef YY_NO_UNPUT
663 #endif
665 #ifndef yytext_ptr
666 static void yy_flex_strncpy ( char *, const char *, int );
667 #endif
669 #ifdef YY_NEED_STRLEN
670 static int yy_flex_strlen ( const char * );
671 #endif
673 #ifndef YY_NO_INPUT
674 #ifdef __cplusplus
675 static int yyinput ( void );
676 #else
677 static int input ( void );
678 #endif
680 #endif
682 /* Amount of stuff to slurp up with each read. */
683 #ifndef YY_READ_BUF_SIZE
684 #ifdef __ia64__
685 /* On IA-64, the buffer size is 16k, not 8k */
686 #define YY_READ_BUF_SIZE 16384
687 #else
688 #define YY_READ_BUF_SIZE 8192
689 #endif /* __ia64__ */
690 #endif
692 /* Copy whatever the last rule matched to the standard output. */
693 #ifndef ECHO
694 /* This used to be an fputs(), but since the string might contain NUL's,
695 * we now use fwrite().
697 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
698 #endif
700 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
701 * is returned in "result".
703 #ifndef YY_INPUT
704 #define YY_INPUT(buf,result,max_size) \
705 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
707 int c = '*'; \
708 int n; \
709 for ( n = 0; n < max_size && \
710 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
711 buf[n] = (char) c; \
712 if ( c == '\n' ) \
713 buf[n++] = (char) c; \
714 if ( c == EOF && ferror( yyin ) ) \
715 YY_FATAL_ERROR( "input in flex scanner failed" ); \
716 result = n; \
718 else \
720 errno=0; \
721 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
723 if( errno != EINTR) \
725 YY_FATAL_ERROR( "input in flex scanner failed" ); \
726 break; \
728 errno=0; \
729 clearerr(yyin); \
734 #endif
736 /* No semi-colon after return; correct usage is to write "yyterminate();" -
737 * we don't want an extra ';' after the "return" because that will cause
738 * some compilers to complain about unreachable statements.
740 #ifndef yyterminate
741 #define yyterminate() return YY_NULL
742 #endif
744 /* Number of entries by which start-condition stack grows. */
745 #ifndef YY_START_STACK_INCR
746 #define YY_START_STACK_INCR 25
747 #endif
749 /* Report a fatal error. */
750 #ifndef YY_FATAL_ERROR
751 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
752 #endif
754 /* end tables serialization structures and prototypes */
756 /* Default declaration of generated scanner - a define so the user can
757 * easily add parameters.
759 #ifndef YY_DECL
760 #define YY_DECL_IS_OURS 1
762 extern int yylex (void);
764 #define YY_DECL int yylex (void)
765 #endif /* !YY_DECL */
767 /* Code executed at the beginning of each rule, after yytext and yyleng
768 * have been set up.
770 #ifndef YY_USER_ACTION
771 #define YY_USER_ACTION
772 #endif
774 /* Code executed at the end of each rule. */
775 #ifndef YY_BREAK
776 #define YY_BREAK /*LINTED*/break;
777 #endif
779 #define YY_RULE_SETUP \
780 YY_USER_ACTION
782 /** The main scanner function which does all the work.
784 YY_DECL
786 yy_state_type yy_current_state;
787 char *yy_cp, *yy_bp;
788 int yy_act;
790 if ( !(yy_init) )
792 (yy_init) = 1;
794 #ifdef YY_USER_INIT
795 YY_USER_INIT;
796 #endif
798 if ( ! (yy_start) )
799 (yy_start) = 1; /* first start state */
801 if ( ! yyin )
802 yyin = stdin;
804 if ( ! yyout )
805 yyout = stdout;
807 if ( ! YY_CURRENT_BUFFER ) {
808 yyensure_buffer_stack ();
809 YY_CURRENT_BUFFER_LVALUE =
810 yy_create_buffer( yyin, YY_BUF_SIZE );
813 yy_load_buffer_state( );
817 #line 35 "deflex.l"
819 #line 819 "deflex.c"
821 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
823 yy_cp = (yy_c_buf_p);
825 /* Support of yytext. */
826 *yy_cp = (yy_hold_char);
828 /* yy_bp points to the position in yy_ch_buf of the start of
829 * the current run.
831 yy_bp = yy_cp;
833 yy_current_state = (yy_start);
834 yy_match:
837 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
838 if ( yy_accept[yy_current_state] )
840 (yy_last_accepting_state) = yy_current_state;
841 (yy_last_accepting_cpos) = yy_cp;
843 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
845 yy_current_state = (int) yy_def[yy_current_state];
846 if ( yy_current_state >= 199 )
847 yy_c = yy_meta[yy_c];
849 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
850 ++yy_cp;
852 while ( yy_base[yy_current_state] != 231 );
854 yy_find_action:
855 yy_act = yy_accept[yy_current_state];
856 if ( yy_act == 0 )
857 { /* have to back up */
858 yy_cp = (yy_last_accepting_cpos);
859 yy_current_state = (yy_last_accepting_state);
860 yy_act = yy_accept[yy_current_state];
863 YY_DO_BEFORE_ACTION;
865 do_action: /* This label is used only to access EOF actions. */
867 switch ( yy_act )
868 { /* beginning of action switch */
869 case 0: /* must back up */
870 /* undo the effects of YY_DO_BEFORE_ACTION */
871 *yy_cp = (yy_hold_char);
872 yy_cp = (yy_last_accepting_cpos);
873 yy_current_state = (yy_last_accepting_state);
874 goto yy_find_action;
876 case 1:
877 YY_RULE_SETUP
878 #line 36 "deflex.l"
879 { return NAME;}
880 YY_BREAK
881 case 2:
882 YY_RULE_SETUP
883 #line 37 "deflex.l"
884 { return LIBRARY;}
885 YY_BREAK
886 case 3:
887 YY_RULE_SETUP
888 #line 38 "deflex.l"
889 { return DESCRIPTION;}
890 YY_BREAK
891 case 4:
892 YY_RULE_SETUP
893 #line 39 "deflex.l"
894 { return STACKSIZE;}
895 YY_BREAK
896 case 5:
897 YY_RULE_SETUP
898 #line 40 "deflex.l"
899 { return HEAPSIZE;}
900 YY_BREAK
901 case 6:
902 YY_RULE_SETUP
903 #line 41 "deflex.l"
904 { return CODE;}
905 YY_BREAK
906 case 7:
907 YY_RULE_SETUP
908 #line 42 "deflex.l"
909 { return DATA;}
910 YY_BREAK
911 case 8:
912 YY_RULE_SETUP
913 #line 43 "deflex.l"
914 { return SECTIONS;}
915 YY_BREAK
916 case 9:
917 YY_RULE_SETUP
918 #line 44 "deflex.l"
919 { return EXPORTS;}
920 YY_BREAK
921 case 10:
922 YY_RULE_SETUP
923 #line 45 "deflex.l"
924 { return IMPORTS;}
925 YY_BREAK
926 case 11:
927 YY_RULE_SETUP
928 #line 46 "deflex.l"
929 { return VERSIONK;}
930 YY_BREAK
931 case 12:
932 YY_RULE_SETUP
933 #line 47 "deflex.l"
934 { return BASE;}
935 YY_BREAK
936 case 13:
937 YY_RULE_SETUP
938 #line 48 "deflex.l"
939 { return CONSTANT; }
940 YY_BREAK
941 case 14:
942 YY_RULE_SETUP
943 #line 49 "deflex.l"
944 { return NONAME; }
945 YY_BREAK
946 case 15:
947 YY_RULE_SETUP
948 #line 50 "deflex.l"
949 { return PRIVATE; }
950 YY_BREAK
951 case 16:
952 YY_RULE_SETUP
953 #line 51 "deflex.l"
954 { return READ;}
955 YY_BREAK
956 case 17:
957 YY_RULE_SETUP
958 #line 52 "deflex.l"
959 { return WRITE;}
960 YY_BREAK
961 case 18:
962 YY_RULE_SETUP
963 #line 53 "deflex.l"
964 { return EXECUTE;}
965 YY_BREAK
966 case 19:
967 YY_RULE_SETUP
968 #line 54 "deflex.l"
969 { return SHARED;}
970 YY_BREAK
971 case 20:
972 YY_RULE_SETUP
973 #line 55 "deflex.l"
974 { return NONSHARED;}
975 YY_BREAK
976 case 21:
977 YY_RULE_SETUP
978 #line 56 "deflex.l"
979 { return SINGLE;}
980 YY_BREAK
981 case 22:
982 YY_RULE_SETUP
983 #line 57 "deflex.l"
984 { return MULTIPLE;}
985 YY_BREAK
986 case 23:
987 YY_RULE_SETUP
988 #line 58 "deflex.l"
989 { return INITINSTANCE;}
990 YY_BREAK
991 case 24:
992 YY_RULE_SETUP
993 #line 59 "deflex.l"
994 { return INITGLOBAL;}
995 YY_BREAK
996 case 25:
997 YY_RULE_SETUP
998 #line 60 "deflex.l"
999 { return TERMINSTANCE;}
1000 YY_BREAK
1001 case 26:
1002 YY_RULE_SETUP
1003 #line 61 "deflex.l"
1004 { return TERMGLOBAL;}
1005 YY_BREAK
1006 case 27:
1007 YY_RULE_SETUP
1008 #line 63 "deflex.l"
1009 { yylval.number = strtol (yytext,0,0);
1010 return NUMBER; }
1011 YY_BREAK
1012 case 28:
1013 YY_RULE_SETUP
1014 #line 66 "deflex.l"
1016 yylval.id = xstrdup (yytext);
1017 return ID;
1019 YY_BREAK
1020 case 29:
1021 /* rule 29 can match eol */
1022 YY_RULE_SETUP
1023 #line 71 "deflex.l"
1025 yylval.id = xmemdup (yytext + 1, yyleng - 2, yyleng - 1);
1026 return ID;
1028 YY_BREAK
1029 case 30:
1030 /* rule 30 can match eol */
1031 YY_RULE_SETUP
1032 #line 76 "deflex.l"
1034 yylval.id = xmemdup (yytext + 1, yyleng - 2, yyleng - 1);
1035 return ID;
1037 YY_BREAK
1038 case 31:
1039 YY_RULE_SETUP
1040 #line 80 "deflex.l"
1042 YY_BREAK
1043 case 32:
1044 YY_RULE_SETUP
1045 #line 81 "deflex.l"
1047 YY_BREAK
1048 case 33:
1049 YY_RULE_SETUP
1050 #line 82 "deflex.l"
1052 YY_BREAK
1053 case 34:
1054 YY_RULE_SETUP
1055 #line 83 "deflex.l"
1057 YY_BREAK
1058 case 35:
1059 YY_RULE_SETUP
1060 #line 84 "deflex.l"
1062 YY_BREAK
1063 case 36:
1064 /* rule 36 can match eol */
1065 YY_RULE_SETUP
1066 #line 85 "deflex.l"
1067 { linenumber ++ ;}
1068 YY_BREAK
1069 case 37:
1070 YY_RULE_SETUP
1071 #line 86 "deflex.l"
1072 { return EQUAL;}
1073 YY_BREAK
1074 case 38:
1075 YY_RULE_SETUP
1076 #line 87 "deflex.l"
1077 { return '=';}
1078 YY_BREAK
1079 case 39:
1080 YY_RULE_SETUP
1081 #line 88 "deflex.l"
1082 { return '.';}
1083 YY_BREAK
1084 case 40:
1085 YY_RULE_SETUP
1086 #line 89 "deflex.l"
1087 { return '@';}
1088 YY_BREAK
1089 case 41:
1090 YY_RULE_SETUP
1091 #line 90 "deflex.l"
1092 { return ',';}
1093 YY_BREAK
1094 case 42:
1095 YY_RULE_SETUP
1096 #line 91 "deflex.l"
1097 ECHO;
1098 YY_BREAK
1099 #line 1099 "deflex.c"
1100 case YY_STATE_EOF(INITIAL):
1101 yyterminate();
1103 case YY_END_OF_BUFFER:
1105 /* Amount of text matched not including the EOB char. */
1106 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1108 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1109 *yy_cp = (yy_hold_char);
1110 YY_RESTORE_YY_MORE_OFFSET
1112 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1114 /* We're scanning a new file or input source. It's
1115 * possible that this happened because the user
1116 * just pointed yyin at a new source and called
1117 * yylex(). If so, then we have to assure
1118 * consistency between YY_CURRENT_BUFFER and our
1119 * globals. Here is the right place to do so, because
1120 * this is the first action (other than possibly a
1121 * back-up) that will match for the new input source.
1123 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1124 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1125 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1128 /* Note that here we test for yy_c_buf_p "<=" to the position
1129 * of the first EOB in the buffer, since yy_c_buf_p will
1130 * already have been incremented past the NUL character
1131 * (since all states make transitions on EOB to the
1132 * end-of-buffer state). Contrast this with the test
1133 * in input().
1135 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1136 { /* This was really a NUL. */
1137 yy_state_type yy_next_state;
1139 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1141 yy_current_state = yy_get_previous_state( );
1143 /* Okay, we're now positioned to make the NUL
1144 * transition. We couldn't have
1145 * yy_get_previous_state() go ahead and do it
1146 * for us because it doesn't know how to deal
1147 * with the possibility of jamming (and we don't
1148 * want to build jamming into it because then it
1149 * will run more slowly).
1152 yy_next_state = yy_try_NUL_trans( yy_current_state );
1154 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1156 if ( yy_next_state )
1158 /* Consume the NUL. */
1159 yy_cp = ++(yy_c_buf_p);
1160 yy_current_state = yy_next_state;
1161 goto yy_match;
1164 else
1166 yy_cp = (yy_c_buf_p);
1167 goto yy_find_action;
1171 else switch ( yy_get_next_buffer( ) )
1173 case EOB_ACT_END_OF_FILE:
1175 (yy_did_buffer_switch_on_eof) = 0;
1177 if ( yywrap( ) )
1179 /* Note: because we've taken care in
1180 * yy_get_next_buffer() to have set up
1181 * yytext, we can now set up
1182 * yy_c_buf_p so that if some total
1183 * hoser (like flex itself) wants to
1184 * call the scanner after we return the
1185 * YY_NULL, it'll still work - another
1186 * YY_NULL will get returned.
1188 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1190 yy_act = YY_STATE_EOF(YY_START);
1191 goto do_action;
1194 else
1196 if ( ! (yy_did_buffer_switch_on_eof) )
1197 YY_NEW_FILE;
1199 break;
1202 case EOB_ACT_CONTINUE_SCAN:
1203 (yy_c_buf_p) =
1204 (yytext_ptr) + yy_amount_of_matched_text;
1206 yy_current_state = yy_get_previous_state( );
1208 yy_cp = (yy_c_buf_p);
1209 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1210 goto yy_match;
1212 case EOB_ACT_LAST_MATCH:
1213 (yy_c_buf_p) =
1214 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1216 yy_current_state = yy_get_previous_state( );
1218 yy_cp = (yy_c_buf_p);
1219 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1220 goto yy_find_action;
1222 break;
1225 default:
1226 YY_FATAL_ERROR(
1227 "fatal flex scanner internal error--no action found" );
1228 } /* end of action switch */
1229 } /* end of scanning one token */
1230 } /* end of user's declarations */
1231 } /* end of yylex */
1233 /* yy_get_next_buffer - try to read in a new buffer
1235 * Returns a code representing an action:
1236 * EOB_ACT_LAST_MATCH -
1237 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1238 * EOB_ACT_END_OF_FILE - end of file
1240 static int yy_get_next_buffer (void)
1242 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1243 char *source = (yytext_ptr);
1244 int number_to_move, i;
1245 int ret_val;
1247 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1248 YY_FATAL_ERROR(
1249 "fatal flex scanner internal error--end of buffer missed" );
1251 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1252 { /* Don't try to fill the buffer, so this is an EOF. */
1253 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1255 /* We matched a single character, the EOB, so
1256 * treat this as a final EOF.
1258 return EOB_ACT_END_OF_FILE;
1261 else
1263 /* We matched some text prior to the EOB, first
1264 * process it.
1266 return EOB_ACT_LAST_MATCH;
1270 /* Try to read more data. */
1272 /* First move last chars to start of buffer. */
1273 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1275 for ( i = 0; i < number_to_move; ++i )
1276 *(dest++) = *(source++);
1278 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1279 /* don't do the read, it's not guaranteed to return an EOF,
1280 * just force an EOF
1282 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1284 else
1286 int num_to_read =
1287 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1289 while ( num_to_read <= 0 )
1290 { /* Not enough room in the buffer - grow it. */
1292 /* just a shorter name for the current buffer */
1293 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1295 int yy_c_buf_p_offset =
1296 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1298 if ( b->yy_is_our_buffer )
1300 int new_size = b->yy_buf_size * 2;
1302 if ( new_size <= 0 )
1303 b->yy_buf_size += b->yy_buf_size / 8;
1304 else
1305 b->yy_buf_size *= 2;
1307 b->yy_ch_buf = (char *)
1308 /* Include room in for 2 EOB chars. */
1309 yyrealloc( (void *) b->yy_ch_buf,
1310 (yy_size_t) (b->yy_buf_size + 2) );
1312 else
1313 /* Can't grow it, we don't own it. */
1314 b->yy_ch_buf = NULL;
1316 if ( ! b->yy_ch_buf )
1317 YY_FATAL_ERROR(
1318 "fatal error - scanner input buffer overflow" );
1320 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1322 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1323 number_to_move - 1;
1327 if ( num_to_read > YY_READ_BUF_SIZE )
1328 num_to_read = YY_READ_BUF_SIZE;
1330 /* Read in more data. */
1331 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1332 (yy_n_chars), num_to_read );
1334 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1337 if ( (yy_n_chars) == 0 )
1339 if ( number_to_move == YY_MORE_ADJ )
1341 ret_val = EOB_ACT_END_OF_FILE;
1342 yyrestart( yyin );
1345 else
1347 ret_val = EOB_ACT_LAST_MATCH;
1348 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1349 YY_BUFFER_EOF_PENDING;
1353 else
1354 ret_val = EOB_ACT_CONTINUE_SCAN;
1356 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1357 /* Extend the array by 50%, plus the number we really need. */
1358 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1359 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1360 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1361 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1362 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1363 /* "- 2" to take care of EOB's */
1364 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1367 (yy_n_chars) += number_to_move;
1368 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1369 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1371 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1373 return ret_val;
1376 /* yy_get_previous_state - get the state just before the EOB char was reached */
1378 static yy_state_type yy_get_previous_state (void)
1380 yy_state_type yy_current_state;
1381 char *yy_cp;
1383 yy_current_state = (yy_start);
1385 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1387 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1388 if ( yy_accept[yy_current_state] )
1390 (yy_last_accepting_state) = yy_current_state;
1391 (yy_last_accepting_cpos) = yy_cp;
1393 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1395 yy_current_state = (int) yy_def[yy_current_state];
1396 if ( yy_current_state >= 199 )
1397 yy_c = yy_meta[yy_c];
1399 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1402 return yy_current_state;
1405 /* yy_try_NUL_trans - try to make a transition on the NUL character
1407 * synopsis
1408 * next_state = yy_try_NUL_trans( current_state );
1410 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1412 int yy_is_jam;
1413 char *yy_cp = (yy_c_buf_p);
1415 YY_CHAR yy_c = 1;
1416 if ( yy_accept[yy_current_state] )
1418 (yy_last_accepting_state) = yy_current_state;
1419 (yy_last_accepting_cpos) = yy_cp;
1421 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1423 yy_current_state = (int) yy_def[yy_current_state];
1424 if ( yy_current_state >= 199 )
1425 yy_c = yy_meta[yy_c];
1427 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1428 yy_is_jam = (yy_current_state == 198);
1430 return yy_is_jam ? 0 : yy_current_state;
1433 #ifndef YY_NO_UNPUT
1435 #endif
1437 #ifndef YY_NO_INPUT
1438 #ifdef __cplusplus
1439 static int yyinput (void)
1440 #else
1441 static int input (void)
1442 #endif
1445 int c;
1447 *(yy_c_buf_p) = (yy_hold_char);
1449 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1451 /* yy_c_buf_p now points to the character we want to return.
1452 * If this occurs *before* the EOB characters, then it's a
1453 * valid NUL; if not, then we've hit the end of the buffer.
1455 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1456 /* This was really a NUL. */
1457 *(yy_c_buf_p) = '\0';
1459 else
1460 { /* need more input */
1461 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1462 ++(yy_c_buf_p);
1464 switch ( yy_get_next_buffer( ) )
1466 case EOB_ACT_LAST_MATCH:
1467 /* This happens because yy_g_n_b()
1468 * sees that we've accumulated a
1469 * token and flags that we need to
1470 * try matching the token before
1471 * proceeding. But for input(),
1472 * there's no matching to consider.
1473 * So convert the EOB_ACT_LAST_MATCH
1474 * to EOB_ACT_END_OF_FILE.
1477 /* Reset buffer status. */
1478 yyrestart( yyin );
1480 /*FALLTHROUGH*/
1482 case EOB_ACT_END_OF_FILE:
1484 if ( yywrap( ) )
1485 return 0;
1487 if ( ! (yy_did_buffer_switch_on_eof) )
1488 YY_NEW_FILE;
1489 #ifdef __cplusplus
1490 return yyinput();
1491 #else
1492 return input();
1493 #endif
1496 case EOB_ACT_CONTINUE_SCAN:
1497 (yy_c_buf_p) = (yytext_ptr) + offset;
1498 break;
1503 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1504 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1505 (yy_hold_char) = *++(yy_c_buf_p);
1507 return c;
1509 #endif /* ifndef YY_NO_INPUT */
1511 /** Immediately switch to a different input stream.
1512 * @param input_file A readable stream.
1514 * @note This function does not reset the start condition to @c INITIAL .
1516 void yyrestart (FILE * input_file )
1519 if ( ! YY_CURRENT_BUFFER ){
1520 yyensure_buffer_stack ();
1521 YY_CURRENT_BUFFER_LVALUE =
1522 yy_create_buffer( yyin, YY_BUF_SIZE );
1525 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1526 yy_load_buffer_state( );
1529 /** Switch to a different input buffer.
1530 * @param new_buffer The new input buffer.
1533 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1536 /* TODO. We should be able to replace this entire function body
1537 * with
1538 * yypop_buffer_state();
1539 * yypush_buffer_state(new_buffer);
1541 yyensure_buffer_stack ();
1542 if ( YY_CURRENT_BUFFER == new_buffer )
1543 return;
1545 if ( YY_CURRENT_BUFFER )
1547 /* Flush out information for old buffer. */
1548 *(yy_c_buf_p) = (yy_hold_char);
1549 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1550 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1553 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1554 yy_load_buffer_state( );
1556 /* We don't actually know whether we did this switch during
1557 * EOF (yywrap()) processing, but the only time this flag
1558 * is looked at is after yywrap() is called, so it's safe
1559 * to go ahead and always set it.
1561 (yy_did_buffer_switch_on_eof) = 1;
1564 static void yy_load_buffer_state (void)
1566 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1567 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1568 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1569 (yy_hold_char) = *(yy_c_buf_p);
1572 /** Allocate and initialize an input buffer state.
1573 * @param file A readable stream.
1574 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1576 * @return the allocated buffer state.
1578 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1580 YY_BUFFER_STATE b;
1582 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1583 if ( ! b )
1584 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1586 b->yy_buf_size = size;
1588 /* yy_ch_buf has to be 2 characters longer than the size given because
1589 * we need to put in 2 end-of-buffer characters.
1591 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1592 if ( ! b->yy_ch_buf )
1593 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1595 b->yy_is_our_buffer = 1;
1597 yy_init_buffer( b, file );
1599 return b;
1602 /** Destroy the buffer.
1603 * @param b a buffer created with yy_create_buffer()
1606 void yy_delete_buffer (YY_BUFFER_STATE b )
1609 if ( ! b )
1610 return;
1612 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1613 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1615 if ( b->yy_is_our_buffer )
1616 yyfree( (void *) b->yy_ch_buf );
1618 yyfree( (void *) b );
1621 /* Initializes or reinitializes a buffer.
1622 * This function is sometimes called more than once on the same buffer,
1623 * such as during a yyrestart() or at EOF.
1625 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1628 int oerrno = errno;
1630 yy_flush_buffer( b );
1632 b->yy_input_file = file;
1633 b->yy_fill_buffer = 1;
1635 /* If b is the current buffer, then yy_init_buffer was _probably_
1636 * called from yyrestart() or through yy_get_next_buffer.
1637 * In that case, we don't want to reset the lineno or column.
1639 if (b != YY_CURRENT_BUFFER){
1640 b->yy_bs_lineno = 1;
1641 b->yy_bs_column = 0;
1644 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1646 errno = oerrno;
1649 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1650 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1653 void yy_flush_buffer (YY_BUFFER_STATE b )
1655 if ( ! b )
1656 return;
1658 b->yy_n_chars = 0;
1660 /* We always need two end-of-buffer characters. The first causes
1661 * a transition to the end-of-buffer state. The second causes
1662 * a jam in that state.
1664 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1665 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1667 b->yy_buf_pos = &b->yy_ch_buf[0];
1669 b->yy_at_bol = 1;
1670 b->yy_buffer_status = YY_BUFFER_NEW;
1672 if ( b == YY_CURRENT_BUFFER )
1673 yy_load_buffer_state( );
1676 /** Pushes the new state onto the stack. The new state becomes
1677 * the current state. This function will allocate the stack
1678 * if necessary.
1679 * @param new_buffer The new state.
1682 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1684 if (new_buffer == NULL)
1685 return;
1687 yyensure_buffer_stack();
1689 /* This block is copied from yy_switch_to_buffer. */
1690 if ( YY_CURRENT_BUFFER )
1692 /* Flush out information for old buffer. */
1693 *(yy_c_buf_p) = (yy_hold_char);
1694 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1695 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1698 /* Only push if top exists. Otherwise, replace top. */
1699 if (YY_CURRENT_BUFFER)
1700 (yy_buffer_stack_top)++;
1701 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1703 /* copied from yy_switch_to_buffer. */
1704 yy_load_buffer_state( );
1705 (yy_did_buffer_switch_on_eof) = 1;
1708 /** Removes and deletes the top of the stack, if present.
1709 * The next element becomes the new top.
1712 void yypop_buffer_state (void)
1714 if (!YY_CURRENT_BUFFER)
1715 return;
1717 yy_delete_buffer(YY_CURRENT_BUFFER );
1718 YY_CURRENT_BUFFER_LVALUE = NULL;
1719 if ((yy_buffer_stack_top) > 0)
1720 --(yy_buffer_stack_top);
1722 if (YY_CURRENT_BUFFER) {
1723 yy_load_buffer_state( );
1724 (yy_did_buffer_switch_on_eof) = 1;
1728 /* Allocates the stack if it does not exist.
1729 * Guarantees space for at least one push.
1731 static void yyensure_buffer_stack (void)
1733 yy_size_t num_to_alloc;
1735 if (!(yy_buffer_stack)) {
1737 /* First allocation is just for 2 elements, since we don't know if this
1738 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1739 * immediate realloc on the next call.
1741 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1742 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1743 (num_to_alloc * sizeof(struct yy_buffer_state*)
1745 if ( ! (yy_buffer_stack) )
1746 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1748 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1750 (yy_buffer_stack_max) = num_to_alloc;
1751 (yy_buffer_stack_top) = 0;
1752 return;
1755 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1757 /* Increase the buffer to prepare for a possible push. */
1758 yy_size_t grow_size = 8 /* arbitrary grow size */;
1760 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1761 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1762 ((yy_buffer_stack),
1763 num_to_alloc * sizeof(struct yy_buffer_state*)
1765 if ( ! (yy_buffer_stack) )
1766 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1768 /* zero only the new slots.*/
1769 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1770 (yy_buffer_stack_max) = num_to_alloc;
1774 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1775 * @param base the character buffer
1776 * @param size the size in bytes of the character buffer
1778 * @return the newly allocated buffer state object.
1780 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1782 YY_BUFFER_STATE b;
1784 if ( size < 2 ||
1785 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1786 base[size-1] != YY_END_OF_BUFFER_CHAR )
1787 /* They forgot to leave room for the EOB's. */
1788 return NULL;
1790 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1791 if ( ! b )
1792 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1794 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1795 b->yy_buf_pos = b->yy_ch_buf = base;
1796 b->yy_is_our_buffer = 0;
1797 b->yy_input_file = NULL;
1798 b->yy_n_chars = b->yy_buf_size;
1799 b->yy_is_interactive = 0;
1800 b->yy_at_bol = 1;
1801 b->yy_fill_buffer = 0;
1802 b->yy_buffer_status = YY_BUFFER_NEW;
1804 yy_switch_to_buffer( b );
1806 return b;
1809 /** Setup the input buffer state to scan a string. The next call to yylex() will
1810 * scan from a @e copy of @a str.
1811 * @param yystr a NUL-terminated string to scan
1813 * @return the newly allocated buffer state object.
1814 * @note If you want to scan bytes that may contain NUL values, then use
1815 * yy_scan_bytes() instead.
1817 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1820 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1823 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1824 * scan from a @e copy of @a bytes.
1825 * @param yybytes the byte buffer to scan
1826 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1828 * @return the newly allocated buffer state object.
1830 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1832 YY_BUFFER_STATE b;
1833 char *buf;
1834 yy_size_t n;
1835 int i;
1837 /* Get memory for full buffer, including space for trailing EOB's. */
1838 n = (yy_size_t) (_yybytes_len + 2);
1839 buf = (char *) yyalloc( n );
1840 if ( ! buf )
1841 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1843 for ( i = 0; i < _yybytes_len; ++i )
1844 buf[i] = yybytes[i];
1846 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1848 b = yy_scan_buffer( buf, n );
1849 if ( ! b )
1850 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1852 /* It's okay to grow etc. this buffer, and we should throw it
1853 * away when we're done.
1855 b->yy_is_our_buffer = 1;
1857 return b;
1860 #ifndef YY_EXIT_FAILURE
1861 #define YY_EXIT_FAILURE 2
1862 #endif
1864 static void yynoreturn yy_fatal_error (const char* msg )
1866 fprintf( stderr, "%s\n", msg );
1867 exit( YY_EXIT_FAILURE );
1870 /* Redefine yyless() so it works in section 3 code. */
1872 #undef yyless
1873 #define yyless(n) \
1874 do \
1876 /* Undo effects of setting up yytext. */ \
1877 int yyless_macro_arg = (n); \
1878 YY_LESS_LINENO(yyless_macro_arg);\
1879 yytext[yyleng] = (yy_hold_char); \
1880 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1881 (yy_hold_char) = *(yy_c_buf_p); \
1882 *(yy_c_buf_p) = '\0'; \
1883 yyleng = yyless_macro_arg; \
1885 while ( 0 )
1887 /* Accessor methods (get/set functions) to struct members. */
1889 /** Get the current line number.
1892 int yyget_lineno (void)
1895 return yylineno;
1898 /** Get the input stream.
1901 FILE *yyget_in (void)
1903 return yyin;
1906 /** Get the output stream.
1909 FILE *yyget_out (void)
1911 return yyout;
1914 /** Get the length of the current token.
1917 int yyget_leng (void)
1919 return yyleng;
1922 /** Get the current token.
1926 char *yyget_text (void)
1928 return yytext;
1931 /** Set the current line number.
1932 * @param _line_number line number
1935 void yyset_lineno (int _line_number )
1938 yylineno = _line_number;
1941 /** Set the input stream. This does not discard the current
1942 * input buffer.
1943 * @param _in_str A readable stream.
1945 * @see yy_switch_to_buffer
1947 void yyset_in (FILE * _in_str )
1949 yyin = _in_str ;
1952 void yyset_out (FILE * _out_str )
1954 yyout = _out_str ;
1957 int yyget_debug (void)
1959 return yy_flex_debug;
1962 void yyset_debug (int _bdebug )
1964 yy_flex_debug = _bdebug ;
1967 static int yy_init_globals (void)
1969 /* Initialization is the same as for the non-reentrant scanner.
1970 * This function is called from yylex_destroy(), so don't allocate here.
1973 (yy_buffer_stack) = NULL;
1974 (yy_buffer_stack_top) = 0;
1975 (yy_buffer_stack_max) = 0;
1976 (yy_c_buf_p) = NULL;
1977 (yy_init) = 0;
1978 (yy_start) = 0;
1980 /* Defined in main.c */
1981 #ifdef YY_STDINIT
1982 yyin = stdin;
1983 yyout = stdout;
1984 #else
1985 yyin = NULL;
1986 yyout = NULL;
1987 #endif
1989 /* For future reference: Set errno on error, since we are called by
1990 * yylex_init()
1992 return 0;
1995 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1996 int yylex_destroy (void)
1999 /* Pop the buffer stack, destroying each element. */
2000 while(YY_CURRENT_BUFFER){
2001 yy_delete_buffer( YY_CURRENT_BUFFER );
2002 YY_CURRENT_BUFFER_LVALUE = NULL;
2003 yypop_buffer_state();
2006 /* Destroy the stack itself. */
2007 yyfree((yy_buffer_stack) );
2008 (yy_buffer_stack) = NULL;
2010 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2011 * yylex() is called, initialization will occur. */
2012 yy_init_globals( );
2014 return 0;
2018 * Internal utility routines.
2021 #ifndef yytext_ptr
2022 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2025 int i;
2026 for ( i = 0; i < n; ++i )
2027 s1[i] = s2[i];
2029 #endif
2031 #ifdef YY_NEED_STRLEN
2032 static int yy_flex_strlen (const char * s )
2034 int n;
2035 for ( n = 0; s[n]; ++n )
2038 return n;
2040 #endif
2042 void *yyalloc (yy_size_t size )
2044 return malloc(size);
2047 void *yyrealloc (void * ptr, yy_size_t size )
2050 /* The cast to (char *) in the following accommodates both
2051 * implementations that use char* generic pointers, and those
2052 * that use void* generic pointers. It works with the latter
2053 * because both ANSI C and C++ allow castless assignment from
2054 * any pointer type to void*, and deal with argument conversions
2055 * as though doing an assignment.
2057 return realloc(ptr, size);
2060 void yyfree (void * ptr )
2062 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2065 #define YYTABLES_NAME "yytables"
2067 #line 91 "deflex.l"