4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer i386__create_buffer
9 #define yy_delete_buffer i386__delete_buffer
10 #define yy_flex_debug i386__flex_debug
11 #define yy_init_buffer i386__init_buffer
12 #define yy_flush_buffer i386__flush_buffer
13 #define yy_load_buffer_state i386__load_buffer_state
14 #define yy_switch_to_buffer i386__switch_to_buffer
16 #define yyleng i386_leng
17 #define yylex i386_lex
18 #define yylineno i386_lineno
19 #define yyout i386_out
20 #define yyrestart i386_restart
21 #define yytext i386_text
22 #define yywrap i386_wrap
23 #define yyalloc i386_alloc
24 #define yyrealloc i386_realloc
25 #define yyfree i386_free
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 39
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
76 /* Limits of integral types. */
78 #define INT8_MIN (-128)
81 #define INT16_MIN (-32767-1)
84 #define INT32_MIN (-2147483647-1)
87 #define INT8_MAX (127)
90 #define INT16_MAX (32767)
93 #define INT32_MAX (2147483647)
96 #define UINT8_MAX (255U)
99 #define UINT16_MAX (65535U)
102 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE i386_restart(i386_in )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
163 #define YY_BUF_SIZE 16384
166 /* The state buf must be large enough to hold one state per character in the main buffer.
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
180 extern yy_size_t i386_leng;
182 extern FILE *i386_in, *i386_out;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
189 * access to the local variable yy_act. Since yyless() is a macro, it would break
190 * existing scanners that call yyless() from OUTSIDE i386_lex.
191 * One obvious solution it to make yy_act a global. I tried that, and saw
192 * a 5% performance hit in a non-i386_lineno scanner, because yy_act is
193 * normally declared as a register variable-- so it is not worth it.
195 #define YY_LESS_LINENO(n) \
198 for ( yyl = n; yyl < i386_leng; ++yyl )\
199 if ( i386_text[yyl] == '\n' )\
202 #define YY_LINENO_REWIND_TO(dst) \
205 for ( p = yy_cp-1; p >= (dst); --p)\
210 /* Return all but the first "n" matched characters back to the input stream. */
214 /* Undo effects of setting up i386_text. */ \
215 int yyless_macro_arg = (n); \
216 YY_LESS_LINENO(yyless_macro_arg);\
217 *yy_cp = (yy_hold_char); \
218 YY_RESTORE_YY_MORE_OFFSET \
219 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
220 YY_DO_BEFORE_ACTION; /* set up i386_text again */ \
224 #define unput(c) yyunput( c, (yytext_ptr) )
226 #ifndef YY_STRUCT_YY_BUFFER_STATE
227 #define YY_STRUCT_YY_BUFFER_STATE
228 struct yy_buffer_state
232 char *yy_ch_buf; /* input buffer */
233 char *yy_buf_pos; /* current position in input buffer */
235 /* Size of input buffer in bytes, not including room for EOB
238 yy_size_t yy_buf_size;
240 /* Number of characters read into yy_ch_buf, not including EOB
243 yy_size_t yy_n_chars;
245 /* Whether we "own" the buffer - i.e., we know we created it,
246 * and can realloc() it to grow it, and should free() it to
249 int yy_is_our_buffer;
251 /* Whether this is an "interactive" input source; if so, and
252 * if we're using stdio for input, then we want to use getc()
253 * instead of fread(), to make sure we stop fetching input after
256 int yy_is_interactive;
258 /* Whether we're considered to be at the beginning of a line.
259 * If so, '^' rules will be active on the next match, otherwise
264 int yy_bs_lineno; /**< The line count. */
265 int yy_bs_column; /**< The column count. */
267 /* Whether to try to fill the input buffer when we reach the
272 int yy_buffer_status;
274 #define YY_BUFFER_NEW 0
275 #define YY_BUFFER_NORMAL 1
276 /* When an EOF's been seen but there's still some text to process
277 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
278 * shouldn't try reading from the input source any more. We might
279 * still have a bunch of tokens to match, though, because of
280 * possible backing-up.
282 * When we actually see the EOF, we change the status to "new"
283 * (via i386_restart()), so that the user can continue scanning by
284 * just pointing i386_in at a new input file.
286 #define YY_BUFFER_EOF_PENDING 2
289 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
291 /* Stack of input buffers. */
292 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
293 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
294 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
296 /* We provide macros for accessing buffer states in case in the
297 * future we want to put the buffer states in a more general
300 * Returns the top of the stack, or NULL.
302 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
303 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
306 /* Same as previous macro, but useful when we know that the buffer stack is not
307 * NULL or when we need an lvalue. For internal use only.
309 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
311 /* yy_hold_char holds the character lost when i386_text is formed. */
312 static char yy_hold_char;
313 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
316 /* Points to current character in buffer. */
317 static char *yy_c_buf_p = (char *) 0;
318 static int yy_init = 0; /* whether we need to initialize */
319 static int yy_start = 0; /* start state number */
321 /* Flag which is used to allow i386_wrap()'s to do buffer switches
322 * instead of setting up a fresh i386_in. A bit of a hack ...
324 static int yy_did_buffer_switch_on_eof;
326 void i386_restart (FILE *input_file );
327 void i386__switch_to_buffer (YY_BUFFER_STATE new_buffer );
328 YY_BUFFER_STATE i386__create_buffer (FILE *file,int size );
329 void i386__delete_buffer (YY_BUFFER_STATE b );
330 void i386__flush_buffer (YY_BUFFER_STATE b );
331 void i386_push_buffer_state (YY_BUFFER_STATE new_buffer );
332 void i386_pop_buffer_state (void );
334 static void i386_ensure_buffer_stack (void );
335 static void i386__load_buffer_state (void );
336 static void i386__init_buffer (YY_BUFFER_STATE b,FILE *file );
338 #define YY_FLUSH_BUFFER i386__flush_buffer(YY_CURRENT_BUFFER )
340 YY_BUFFER_STATE i386__scan_buffer (char *base,yy_size_t size );
341 YY_BUFFER_STATE i386__scan_string (yyconst char *yy_str );
342 YY_BUFFER_STATE i386__scan_bytes (yyconst char *bytes,yy_size_t len );
344 void *i386_alloc (yy_size_t );
345 void *i386_realloc (void *,yy_size_t );
346 void i386_free (void * );
348 #define yy_new_buffer i386__create_buffer
350 #define yy_set_interactive(is_interactive) \
352 if ( ! YY_CURRENT_BUFFER ){ \
353 i386_ensure_buffer_stack (); \
354 YY_CURRENT_BUFFER_LVALUE = \
355 i386__create_buffer(i386_in,YY_BUF_SIZE ); \
357 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
360 #define yy_set_bol(at_bol) \
362 if ( ! YY_CURRENT_BUFFER ){\
363 i386_ensure_buffer_stack (); \
364 YY_CURRENT_BUFFER_LVALUE = \
365 i386__create_buffer(i386_in,YY_BUF_SIZE ); \
367 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
370 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
372 /* Begin user sect3 */
374 #define i386_wrap() 1
375 #define YY_SKIP_YYWRAP
377 typedef unsigned char YY_CHAR;
379 FILE *i386_in = (FILE *) 0, *i386_out = (FILE *) 0;
381 typedef int yy_state_type;
383 extern int i386_lineno;
387 extern char *i386_text;
388 #define yytext_ptr i386_text
390 static yy_state_type yy_get_previous_state (void );
391 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
392 static int yy_get_next_buffer (void );
393 static void yy_fatal_error (yyconst char msg[] );
395 /* Done after the current pattern has been matched and before the
396 * corresponding action - sets up i386_text.
398 #define YY_DO_BEFORE_ACTION \
399 (yytext_ptr) = yy_bp; \
400 i386_leng = (size_t) (yy_cp - yy_bp); \
401 (yy_hold_char) = *yy_cp; \
403 (yy_c_buf_p) = yy_cp;
405 #define YY_NUM_RULES 21
406 #define YY_END_OF_BUFFER 22
407 /* This struct is not used in this scanner,
408 but its presence is necessary. */
411 flex_int32_t yy_verify;
414 static yyconst flex_int16_t yy_accept[62] =
416 0, 0, 0, 0, 22, 20, 17, 15, 20, 5,
417 20, 14, 16, 19, 18, 15, 12, 7, 8, 13,
418 11, 11, 19, 14, 16, 17, 6, 0, 0, 0,
419 5, 0, 9, 18, 11, 11, 0, 0, 0, 0,
420 11, 0, 0, 0, 0, 11, 1, 0, 0, 0,
421 11, 0, 0, 0, 11, 2, 3, 0, 10, 4,
425 static yyconst flex_int32_t yy_ec[256] =
427 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
428 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 2, 1, 1, 4, 1, 5, 1, 1, 1,
431 1, 1, 1, 6, 1, 1, 7, 8, 9, 10,
432 10, 10, 10, 10, 10, 10, 10, 11, 1, 1,
433 1, 1, 1, 1, 12, 13, 13, 14, 13, 13,
434 13, 13, 15, 13, 13, 16, 13, 17, 13, 13,
435 13, 13, 13, 13, 13, 18, 13, 13, 13, 13,
436 1, 1, 1, 1, 13, 1, 19, 13, 13, 13,
438 20, 21, 13, 13, 22, 13, 23, 13, 24, 25,
439 26, 27, 13, 28, 29, 13, 30, 13, 13, 31,
440 32, 13, 33, 1, 34, 1, 1, 1, 1, 1,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 static yyconst flex_int32_t yy_meta[35] =
459 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
460 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 static yyconst flex_int16_t yy_base[65] =
467 0, 32, 65, 3, 113, 114, 9, 11, 19, 7,
468 78, 16, 114, 114, 18, 20, 114, 114, 114, 114,
469 0, 94, 76, 23, 114, 25, 114, 90, 80, 0,
470 41, 73, 114, 36, 0, 88, 76, 44, 42, 37,
471 49, 37, 38, 37, 31, 40, 114, 33, 32, 28,
472 37, 16, 14, 12, 17, 114, 114, 5, 0, 114,
476 static yyconst flex_int16_t yy_def[65] =
478 62, 62, 61, 3, 61, 61, 61, 61, 61, 61,
479 63, 61, 61, 61, 61, 61, 61, 61, 61, 61,
480 64, 64, 63, 61, 61, 61, 61, 61, 61, 61,
481 61, 63, 61, 61, 64, 64, 61, 61, 61, 61,
482 64, 61, 61, 61, 61, 64, 61, 61, 61, 61,
483 64, 61, 61, 61, 64, 61, 61, 61, 64, 61,
487 static yyconst flex_int16_t yy_nxt[149] =
489 61, 7, 8, 35, 9, 24, 25, 10, 10, 10,
490 26, 26, 26, 26, 31, 31, 31, 26, 26, 34,
491 34, 34, 34, 27, 34, 34, 26, 26, 60, 39,
492 59, 40, 11, 7, 12, 13, 9, 34, 34, 10,
493 10, 10, 28, 58, 57, 29, 56, 30, 31, 31,
494 31, 55, 54, 53, 52, 51, 50, 49, 48, 47,
495 46, 45, 44, 43, 11, 14, 15, 16, 14, 14,
496 17, 14, 18, 19, 14, 20, 21, 21, 21, 22,
497 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
498 21, 21, 21, 21, 21, 21, 21, 23, 14, 6,
500 6, 6, 32, 32, 42, 41, 33, 38, 37, 33,
501 36, 33, 61, 5, 61, 61, 61, 61, 61, 61,
502 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
503 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
504 61, 61, 61, 61, 61, 61, 61, 61
507 static yyconst flex_int16_t yy_chk[149] =
509 0, 1, 1, 64, 1, 4, 4, 1, 1, 1,
510 7, 7, 8, 8, 10, 10, 10, 12, 12, 15,
511 15, 16, 16, 9, 24, 24, 26, 26, 58, 30,
512 55, 30, 1, 2, 2, 2, 2, 34, 34, 2,
513 2, 2, 9, 54, 53, 9, 52, 9, 31, 31,
514 31, 51, 50, 49, 48, 46, 45, 44, 43, 42,
515 41, 40, 39, 38, 2, 3, 3, 3, 3, 3,
516 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
517 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
518 3, 3, 3, 3, 3, 3, 3, 3, 3, 62,
520 62, 62, 63, 63, 37, 36, 32, 29, 28, 23,
521 22, 11, 5, 61, 61, 61, 61, 61, 61, 61,
522 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
523 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
524 61, 61, 61, 61, 61, 61, 61, 61
527 /* Table of booleans, true if rule could match eol. */
528 static yyconst flex_int32_t yy_rule_can_match_eol[22] =
530 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0,
533 static yy_state_type yy_last_accepting_state;
534 static char *yy_last_accepting_cpos;
536 extern int i386__flex_debug;
537 int i386__flex_debug = 0;
539 /* The intent behind this definition is that it'll catch
540 * any uses of REJECT which flex missed.
542 #define REJECT reject_used_but_not_detected
543 #define yymore() yymore_used_but_not_detected
544 #define YY_MORE_ADJ 0
545 #define YY_RESTORE_YY_MORE_OFFSET
547 #line 1 "/home/mark/src/elfutils/libcpu/i386_lex.l"
548 #line 2 "/home/mark/src/elfutils/libcpu/i386_lex.l"
549 /* Copyright (C) 2004, 2005, 2007, 2008 Red Hat, Inc.
550 Written by Ulrich Drepper <drepper@redhat.com>, 2004.
552 This file is free software; you can redistribute it and/or modify
553 it under the terms of either
555 * the GNU Lesser General Public License as published by the Free
556 Software Foundation; either version 3 of the License, or (at
557 your option) any later version
561 * the GNU General Public License as published by the Free
562 Software Foundation; either version 2 of the License, or (at
563 your option) any later version
565 or both in parallel, as here.
567 elfutils is distributed in the hope that it will be useful, but
568 WITHOUT ANY WARRANTY; without even the implied warranty of
569 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
570 General Public License for more details.
572 You should have received copies of the GNU General Public License and
573 the GNU Lesser General Public License along with this program. If
574 not, see <http://www.gnu.org/licenses/>. */
585 #include "i386_parse.h"
588 static void eat_to_eol (void);
589 static void invalid_char (int ch);
591 #line 592 "i386_lex.c"
596 #ifndef YY_NO_UNISTD_H
597 /* Special case for "unistd.h", since it is non-ANSI. We include it way
598 * down here because we want the user's section 1 to have been scanned first.
599 * The user has a chance to override it with an option.
604 #ifndef YY_EXTRA_TYPE
605 #define YY_EXTRA_TYPE void *
608 static int yy_init_globals (void );
610 /* Accessor methods to globals.
611 These are made visible to non-reentrant scanners for convenience. */
613 int i386_lex_destroy (void );
615 int i386_get_debug (void );
617 void i386_set_debug (int debug_flag );
619 YY_EXTRA_TYPE i386_get_extra (void );
621 void i386_set_extra (YY_EXTRA_TYPE user_defined );
623 FILE *i386_get_in (void );
625 void i386_set_in (FILE * in_str );
627 FILE *i386_get_out (void );
629 void i386_set_out (FILE * out_str );
631 yy_size_t i386_get_leng (void );
633 char *i386_get_text (void );
635 int i386_get_lineno (void );
637 void i386_set_lineno (int line_number );
639 /* Macros after this point can all be overridden by user definitions in
643 #ifndef YY_SKIP_YYWRAP
645 extern "C" int i386_wrap (void );
647 extern int i386_wrap (void );
651 static void yyunput (int c,char *buf_ptr );
654 static void yy_flex_strncpy (char *,yyconst char *,int );
657 #ifdef YY_NEED_STRLEN
658 static int yy_flex_strlen (yyconst char * );
664 static int yyinput (void );
666 static int input (void );
671 /* Amount of stuff to slurp up with each read. */
672 #ifndef YY_READ_BUF_SIZE
673 #define YY_READ_BUF_SIZE 8192
676 /* Copy whatever the last rule matched to the standard output. */
678 /* This used to be an fputs(), but since the string might contain NUL's,
679 * we now use fwrite().
681 #define ECHO do { if (fwrite( i386_text, i386_leng, 1, i386_out )) {} } while (0)
684 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
685 * is returned in "result".
688 #define YY_INPUT(buf,result,max_size) \
689 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
693 for ( n = 0; n < max_size && \
694 (c = getc( i386_in )) != EOF && c != '\n'; ++n ) \
697 buf[n++] = (char) c; \
698 if ( c == EOF && ferror( i386_in ) ) \
699 YY_FATAL_ERROR( "input in flex scanner failed" ); \
705 while ( (result = fread(buf, 1, max_size, i386_in))==0 && ferror(i386_in)) \
707 if( errno != EINTR) \
709 YY_FATAL_ERROR( "input in flex scanner failed" ); \
720 /* No semi-colon after return; correct usage is to write "yyterminate();" -
721 * we don't want an extra ';' after the "return" because that will cause
722 * some compilers to complain about unreachable statements.
725 #define yyterminate() return YY_NULL
728 /* Number of entries by which start-condition stack grows. */
729 #ifndef YY_START_STACK_INCR
730 #define YY_START_STACK_INCR 25
733 /* Report a fatal error. */
734 #ifndef YY_FATAL_ERROR
735 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
738 /* end tables serialization structures and prototypes */
740 /* Default declaration of generated scanner - a define so the user can
741 * easily add parameters.
744 #define YY_DECL_IS_OURS 1
746 extern int i386_lex (void);
748 #define YY_DECL int i386_lex (void)
749 #endif /* !YY_DECL */
751 /* Code executed at the beginning of each rule, after i386_text and i386_leng
754 #ifndef YY_USER_ACTION
755 #define YY_USER_ACTION
758 /* Code executed at the end of each rule. */
760 #define YY_BREAK break;
763 #define YY_RULE_SETUP \
764 if ( i386_leng > 0 ) \
765 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
766 (i386_text[i386_leng - 1] == '\n'); \
769 /** The main scanner function which does all the work.
773 register yy_state_type yy_current_state;
774 register char *yy_cp, *yy_bp;
786 (yy_start) = 1; /* first start state */
794 if ( ! YY_CURRENT_BUFFER ) {
795 i386_ensure_buffer_stack ();
796 YY_CURRENT_BUFFER_LVALUE =
797 i386__create_buffer(i386_in,YY_BUF_SIZE );
800 i386__load_buffer_state( );
804 #line 57 "/home/mark/src/elfutils/libcpu/i386_lex.l"
807 #line 808 "i386_lex.c"
809 while ( 1 ) /* loops until end-of-file is reached */
811 yy_cp = (yy_c_buf_p);
813 /* Support of i386_text. */
814 *yy_cp = (yy_hold_char);
816 /* yy_bp points to the position in yy_ch_buf of the start of
821 yy_current_state = (yy_start);
822 yy_current_state += YY_AT_BOL();
826 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
827 if ( yy_accept[yy_current_state] )
829 (yy_last_accepting_state) = yy_current_state;
830 (yy_last_accepting_cpos) = yy_cp;
832 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
834 yy_current_state = (int) yy_def[yy_current_state];
835 if ( yy_current_state >= 62 )
836 yy_c = yy_meta[(unsigned int) yy_c];
838 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
841 while ( yy_current_state != 61 );
842 yy_cp = (yy_last_accepting_cpos);
843 yy_current_state = (yy_last_accepting_state);
846 yy_act = yy_accept[yy_current_state];
850 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
853 for ( yyl = 0; yyl < i386_leng; ++yyl )
854 if ( i386_text[yyl] == '\n' )
860 do_action: /* This label is used only to access EOF actions. */
863 { /* beginning of action switch */
864 case 0: /* must back up */
865 /* undo the effects of YY_DO_BEFORE_ACTION */
866 *yy_cp = (yy_hold_char);
867 yy_cp = (yy_last_accepting_cpos);
868 yy_current_state = (yy_last_accepting_state);
873 #line 59 "/home/mark/src/elfutils/libcpu/i386_lex.l"
878 #line 61 "/home/mark/src/elfutils/libcpu/i386_lex.l"
883 #line 62 "/home/mark/src/elfutils/libcpu/i386_lex.l"
888 #line 64 "/home/mark/src/elfutils/libcpu/i386_lex.l"
893 #line 66 "/home/mark/src/elfutils/libcpu/i386_lex.l"
894 { i386_lval.num = strtoul (i386_text, NULL, 10);
899 #line 69 "/home/mark/src/elfutils/libcpu/i386_lex.l"
900 { BEGIN (MAIN); return kPERCPERC; }
904 #line 72 "/home/mark/src/elfutils/libcpu/i386_lex.l"
909 #line 73 "/home/mark/src/elfutils/libcpu/i386_lex.l"
914 #line 75 "/home/mark/src/elfutils/libcpu/i386_lex.l"
915 { i386_lval.str = xstrndup (i386_text + 1,
921 #line 79 "/home/mark/src/elfutils/libcpu/i386_lex.l"
922 { i386_lval.str = (void *) -1l;
927 #line 82 "/home/mark/src/elfutils/libcpu/i386_lex.l"
928 { i386_lval.str = xstrndup (i386_text, i386_leng);
933 #line 85 "/home/mark/src/elfutils/libcpu/i386_lex.l"
938 #line 87 "/home/mark/src/elfutils/libcpu/i386_lex.l"
942 /* rule 14 can match eol */
944 #line 89 "/home/mark/src/elfutils/libcpu/i386_lex.l"
948 /* rule 15 can match eol */
950 #line 91 "/home/mark/src/elfutils/libcpu/i386_lex.l"
955 #line 93 "/home/mark/src/elfutils/libcpu/i386_lex.l"
959 /* rule 17 can match eol */
961 #line 95 "/home/mark/src/elfutils/libcpu/i386_lex.l"
965 /* rule 18 can match eol */
967 #line 97 "/home/mark/src/elfutils/libcpu/i386_lex.l"
972 #line 99 "/home/mark/src/elfutils/libcpu/i386_lex.l"
973 { i386_lval.ch = *i386_text; return kCHAR; }
977 #line 101 "/home/mark/src/elfutils/libcpu/i386_lex.l"
978 { invalid_char (*i386_text); }
982 #line 104 "/home/mark/src/elfutils/libcpu/i386_lex.l"
985 #line 986 "i386_lex.c"
986 case YY_STATE_EOF(INITIAL):
987 case YY_STATE_EOF(MAIN):
990 case YY_END_OF_BUFFER:
992 /* Amount of text matched not including the EOB char. */
993 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
995 /* Undo the effects of YY_DO_BEFORE_ACTION. */
996 *yy_cp = (yy_hold_char);
997 YY_RESTORE_YY_MORE_OFFSET
999 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1001 /* We're scanning a new file or input source. It's
1002 * possible that this happened because the user
1003 * just pointed i386_in at a new source and called
1004 * i386_lex(). If so, then we have to assure
1005 * consistency between YY_CURRENT_BUFFER and our
1006 * globals. Here is the right place to do so, because
1007 * this is the first action (other than possibly a
1008 * back-up) that will match for the new input source.
1010 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1011 YY_CURRENT_BUFFER_LVALUE->yy_input_file = i386_in;
1012 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1015 /* Note that here we test for yy_c_buf_p "<=" to the position
1016 * of the first EOB in the buffer, since yy_c_buf_p will
1017 * already have been incremented past the NUL character
1018 * (since all states make transitions on EOB to the
1019 * end-of-buffer state). Contrast this with the test
1022 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1023 { /* This was really a NUL. */
1024 yy_state_type yy_next_state;
1026 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1028 yy_current_state = yy_get_previous_state( );
1030 /* Okay, we're now positioned to make the NUL
1031 * transition. We couldn't have
1032 * yy_get_previous_state() go ahead and do it
1033 * for us because it doesn't know how to deal
1034 * with the possibility of jamming (and we don't
1035 * want to build jamming into it because then it
1036 * will run more slowly).
1039 yy_next_state = yy_try_NUL_trans( yy_current_state );
1041 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1043 if ( yy_next_state )
1045 /* Consume the NUL. */
1046 yy_cp = ++(yy_c_buf_p);
1047 yy_current_state = yy_next_state;
1053 yy_cp = (yy_last_accepting_cpos);
1054 yy_current_state = (yy_last_accepting_state);
1055 goto yy_find_action;
1059 else switch ( yy_get_next_buffer( ) )
1061 case EOB_ACT_END_OF_FILE:
1063 (yy_did_buffer_switch_on_eof) = 0;
1067 /* Note: because we've taken care in
1068 * yy_get_next_buffer() to have set up
1069 * i386_text, we can now set up
1070 * yy_c_buf_p so that if some total
1071 * hoser (like flex itself) wants to
1072 * call the scanner after we return the
1073 * YY_NULL, it'll still work - another
1074 * YY_NULL will get returned.
1076 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1078 yy_act = YY_STATE_EOF(YY_START);
1084 if ( ! (yy_did_buffer_switch_on_eof) )
1090 case EOB_ACT_CONTINUE_SCAN:
1092 (yytext_ptr) + yy_amount_of_matched_text;
1094 yy_current_state = yy_get_previous_state( );
1096 yy_cp = (yy_c_buf_p);
1097 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1100 case EOB_ACT_LAST_MATCH:
1102 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1104 yy_current_state = yy_get_previous_state( );
1106 yy_cp = (yy_c_buf_p);
1107 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1108 goto yy_find_action;
1115 "fatal flex scanner internal error--no action found" );
1116 } /* end of action switch */
1117 } /* end of scanning one token */
1118 } /* end of user's declarations */
1119 } /* end of i386_lex */
1121 /* yy_get_next_buffer - try to read in a new buffer
1123 * Returns a code representing an action:
1124 * EOB_ACT_LAST_MATCH -
1125 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1126 * EOB_ACT_END_OF_FILE - end of file
1128 static int yy_get_next_buffer (void)
1130 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1131 register char *source = (yytext_ptr);
1132 register int number_to_move, i;
1135 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1137 "fatal flex scanner internal error--end of buffer missed" );
1139 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1140 { /* Don't try to fill the buffer, so this is an EOF. */
1141 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1143 /* We matched a single character, the EOB, so
1144 * treat this as a final EOF.
1146 return EOB_ACT_END_OF_FILE;
1151 /* We matched some text prior to the EOB, first
1154 return EOB_ACT_LAST_MATCH;
1158 /* Try to read more data. */
1160 /* First move last chars to start of buffer. */
1161 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1163 for ( i = 0; i < number_to_move; ++i )
1164 *(dest++) = *(source++);
1166 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1167 /* don't do the read, it's not guaranteed to return an EOF,
1170 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1174 yy_size_t num_to_read =
1175 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1177 while ( num_to_read <= 0 )
1178 { /* Not enough room in the buffer - grow it. */
1180 /* just a shorter name for the current buffer */
1181 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1183 int yy_c_buf_p_offset =
1184 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1186 if ( b->yy_is_our_buffer )
1188 yy_size_t new_size = b->yy_buf_size * 2;
1190 if ( new_size <= 0 )
1191 b->yy_buf_size += b->yy_buf_size / 8;
1193 b->yy_buf_size *= 2;
1195 b->yy_ch_buf = (char *)
1196 /* Include room in for 2 EOB chars. */
1197 i386_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1200 /* Can't grow it, we don't own it. */
1203 if ( ! b->yy_ch_buf )
1205 "fatal error - scanner input buffer overflow" );
1207 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1209 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1214 if ( num_to_read > YY_READ_BUF_SIZE )
1215 num_to_read = YY_READ_BUF_SIZE;
1217 /* Read in more data. */
1218 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1219 (yy_n_chars), num_to_read );
1221 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1224 if ( (yy_n_chars) == 0 )
1226 if ( number_to_move == YY_MORE_ADJ )
1228 ret_val = EOB_ACT_END_OF_FILE;
1229 i386_restart(i386_in );
1234 ret_val = EOB_ACT_LAST_MATCH;
1235 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1236 YY_BUFFER_EOF_PENDING;
1241 ret_val = EOB_ACT_CONTINUE_SCAN;
1243 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1244 /* Extend the array by 50%, plus the number we really need. */
1245 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1246 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) i386_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1247 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1248 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1251 (yy_n_chars) += number_to_move;
1252 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1253 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1255 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1260 /* yy_get_previous_state - get the state just before the EOB char was reached */
1262 static yy_state_type yy_get_previous_state (void)
1264 register yy_state_type yy_current_state;
1265 register char *yy_cp;
1267 yy_current_state = (yy_start);
1268 yy_current_state += YY_AT_BOL();
1270 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1272 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1273 if ( yy_accept[yy_current_state] )
1275 (yy_last_accepting_state) = yy_current_state;
1276 (yy_last_accepting_cpos) = yy_cp;
1278 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1280 yy_current_state = (int) yy_def[yy_current_state];
1281 if ( yy_current_state >= 62 )
1282 yy_c = yy_meta[(unsigned int) yy_c];
1284 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1287 return yy_current_state;
1290 /* yy_try_NUL_trans - try to make a transition on the NUL character
1293 * next_state = yy_try_NUL_trans( current_state );
1295 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1297 register int yy_is_jam;
1298 register char *yy_cp = (yy_c_buf_p);
1300 register YY_CHAR yy_c = 1;
1301 if ( yy_accept[yy_current_state] )
1303 (yy_last_accepting_state) = yy_current_state;
1304 (yy_last_accepting_cpos) = yy_cp;
1306 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1308 yy_current_state = (int) yy_def[yy_current_state];
1309 if ( yy_current_state >= 62 )
1310 yy_c = yy_meta[(unsigned int) yy_c];
1312 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1313 yy_is_jam = (yy_current_state == 61);
1315 return yy_is_jam ? 0 : yy_current_state;
1318 static void yyunput (int c, register char * yy_bp )
1320 register char *yy_cp;
1322 yy_cp = (yy_c_buf_p);
1324 /* undo effects of setting up i386_text */
1325 *yy_cp = (yy_hold_char);
1327 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1328 { /* need to shift things up to make room */
1329 /* +2 for EOB chars. */
1330 register yy_size_t number_to_move = (yy_n_chars) + 2;
1331 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1332 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1333 register char *source =
1334 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1336 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1337 *--dest = *--source;
1339 yy_cp += (int) (dest - source);
1340 yy_bp += (int) (dest - source);
1341 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1342 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1344 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1345 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1348 *--yy_cp = (char) c;
1354 (yytext_ptr) = yy_bp;
1355 (yy_hold_char) = *yy_cp;
1356 (yy_c_buf_p) = yy_cp;
1361 static int yyinput (void)
1363 static int input (void)
1369 *(yy_c_buf_p) = (yy_hold_char);
1371 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1373 /* yy_c_buf_p now points to the character we want to return.
1374 * If this occurs *before* the EOB characters, then it's a
1375 * valid NUL; if not, then we've hit the end of the buffer.
1377 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1378 /* This was really a NUL. */
1379 *(yy_c_buf_p) = '\0';
1382 { /* need more input */
1383 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1386 switch ( yy_get_next_buffer( ) )
1388 case EOB_ACT_LAST_MATCH:
1389 /* This happens because yy_g_n_b()
1390 * sees that we've accumulated a
1391 * token and flags that we need to
1392 * try matching the token before
1393 * proceeding. But for input(),
1394 * there's no matching to consider.
1395 * So convert the EOB_ACT_LAST_MATCH
1396 * to EOB_ACT_END_OF_FILE.
1399 /* Reset buffer status. */
1400 i386_restart(i386_in );
1404 case EOB_ACT_END_OF_FILE:
1409 if ( ! (yy_did_buffer_switch_on_eof) )
1418 case EOB_ACT_CONTINUE_SCAN:
1419 (yy_c_buf_p) = (yytext_ptr) + offset;
1425 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1426 *(yy_c_buf_p) = '\0'; /* preserve i386_text */
1427 (yy_hold_char) = *++(yy_c_buf_p);
1429 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1430 if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1437 #endif /* ifndef YY_NO_INPUT */
1439 /** Immediately switch to a different input stream.
1440 * @param input_file A readable stream.
1442 * @note This function does not reset the start condition to @c INITIAL .
1444 void i386_restart (FILE * input_file )
1447 if ( ! YY_CURRENT_BUFFER ){
1448 i386_ensure_buffer_stack ();
1449 YY_CURRENT_BUFFER_LVALUE =
1450 i386__create_buffer(i386_in,YY_BUF_SIZE );
1453 i386__init_buffer(YY_CURRENT_BUFFER,input_file );
1454 i386__load_buffer_state( );
1457 /** Switch to a different input buffer.
1458 * @param new_buffer The new input buffer.
1461 void i386__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1464 /* TODO. We should be able to replace this entire function body
1466 * i386_pop_buffer_state();
1467 * i386_push_buffer_state(new_buffer);
1469 i386_ensure_buffer_stack ();
1470 if ( YY_CURRENT_BUFFER == new_buffer )
1473 if ( YY_CURRENT_BUFFER )
1475 /* Flush out information for old buffer. */
1476 *(yy_c_buf_p) = (yy_hold_char);
1477 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1478 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1481 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1482 i386__load_buffer_state( );
1484 /* We don't actually know whether we did this switch during
1485 * EOF (i386_wrap()) processing, but the only time this flag
1486 * is looked at is after i386_wrap() is called, so it's safe
1487 * to go ahead and always set it.
1489 (yy_did_buffer_switch_on_eof) = 1;
1492 static void i386__load_buffer_state (void)
1494 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1495 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1496 i386_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1497 (yy_hold_char) = *(yy_c_buf_p);
1500 /** Allocate and initialize an input buffer state.
1501 * @param file A readable stream.
1502 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1504 * @return the allocated buffer state.
1506 YY_BUFFER_STATE i386__create_buffer (FILE * file, int size )
1510 b = (YY_BUFFER_STATE) i386_alloc(sizeof( struct yy_buffer_state ) );
1512 YY_FATAL_ERROR( "out of dynamic memory in i386__create_buffer()" );
1514 b->yy_buf_size = size;
1516 /* yy_ch_buf has to be 2 characters longer than the size given because
1517 * we need to put in 2 end-of-buffer characters.
1519 b->yy_ch_buf = (char *) i386_alloc(b->yy_buf_size + 2 );
1520 if ( ! b->yy_ch_buf )
1521 YY_FATAL_ERROR( "out of dynamic memory in i386__create_buffer()" );
1523 b->yy_is_our_buffer = 1;
1525 i386__init_buffer(b,file );
1530 /** Destroy the buffer.
1531 * @param b a buffer created with i386__create_buffer()
1534 void i386__delete_buffer (YY_BUFFER_STATE b )
1540 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1541 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1543 if ( b->yy_is_our_buffer )
1544 i386_free((void *) b->yy_ch_buf );
1546 i386_free((void *) b );
1549 /* Initializes or reinitializes a buffer.
1550 * This function is sometimes called more than once on the same buffer,
1551 * such as during a i386_restart() or at EOF.
1553 static void i386__init_buffer (YY_BUFFER_STATE b, FILE * file )
1558 i386__flush_buffer(b );
1560 b->yy_input_file = file;
1561 b->yy_fill_buffer = 1;
1563 /* If b is the current buffer, then i386__init_buffer was _probably_
1564 * called from i386_restart() or through yy_get_next_buffer.
1565 * In that case, we don't want to reset the lineno or column.
1567 if (b != YY_CURRENT_BUFFER){
1568 b->yy_bs_lineno = 1;
1569 b->yy_bs_column = 0;
1572 b->yy_is_interactive = 0;
1577 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1578 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1581 void i386__flush_buffer (YY_BUFFER_STATE b )
1588 /* We always need two end-of-buffer characters. The first causes
1589 * a transition to the end-of-buffer state. The second causes
1590 * a jam in that state.
1592 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1593 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1595 b->yy_buf_pos = &b->yy_ch_buf[0];
1598 b->yy_buffer_status = YY_BUFFER_NEW;
1600 if ( b == YY_CURRENT_BUFFER )
1601 i386__load_buffer_state( );
1604 /** Pushes the new state onto the stack. The new state becomes
1605 * the current state. This function will allocate the stack
1607 * @param new_buffer The new state.
1610 void i386_push_buffer_state (YY_BUFFER_STATE new_buffer )
1612 if (new_buffer == NULL)
1615 i386_ensure_buffer_stack();
1617 /* This block is copied from i386__switch_to_buffer. */
1618 if ( YY_CURRENT_BUFFER )
1620 /* Flush out information for old buffer. */
1621 *(yy_c_buf_p) = (yy_hold_char);
1622 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1623 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1626 /* Only push if top exists. Otherwise, replace top. */
1627 if (YY_CURRENT_BUFFER)
1628 (yy_buffer_stack_top)++;
1629 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1631 /* copied from i386__switch_to_buffer. */
1632 i386__load_buffer_state( );
1633 (yy_did_buffer_switch_on_eof) = 1;
1636 /** Removes and deletes the top of the stack, if present.
1637 * The next element becomes the new top.
1640 void i386_pop_buffer_state (void)
1642 if (!YY_CURRENT_BUFFER)
1645 i386__delete_buffer(YY_CURRENT_BUFFER );
1646 YY_CURRENT_BUFFER_LVALUE = NULL;
1647 if ((yy_buffer_stack_top) > 0)
1648 --(yy_buffer_stack_top);
1650 if (YY_CURRENT_BUFFER) {
1651 i386__load_buffer_state( );
1652 (yy_did_buffer_switch_on_eof) = 1;
1656 /* Allocates the stack if it does not exist.
1657 * Guarantees space for at least one push.
1659 static void i386_ensure_buffer_stack (void)
1661 yy_size_t num_to_alloc;
1663 if (!(yy_buffer_stack)) {
1665 /* First allocation is just for 2 elements, since we don't know if this
1666 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1667 * immediate realloc on the next call.
1670 (yy_buffer_stack) = (struct yy_buffer_state**)i386_alloc
1671 (num_to_alloc * sizeof(struct yy_buffer_state*)
1673 if ( ! (yy_buffer_stack) )
1674 YY_FATAL_ERROR( "out of dynamic memory in i386_ensure_buffer_stack()" );
1676 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1678 (yy_buffer_stack_max) = num_to_alloc;
1679 (yy_buffer_stack_top) = 0;
1683 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1685 /* Increase the buffer to prepare for a possible push. */
1686 int grow_size = 8 /* arbitrary grow size */;
1688 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1689 (yy_buffer_stack) = (struct yy_buffer_state**)i386_realloc
1691 num_to_alloc * sizeof(struct yy_buffer_state*)
1693 if ( ! (yy_buffer_stack) )
1694 YY_FATAL_ERROR( "out of dynamic memory in i386_ensure_buffer_stack()" );
1696 /* zero only the new slots.*/
1697 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1698 (yy_buffer_stack_max) = num_to_alloc;
1702 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1703 * @param base the character buffer
1704 * @param size the size in bytes of the character buffer
1706 * @return the newly allocated buffer state object.
1708 YY_BUFFER_STATE i386__scan_buffer (char * base, yy_size_t size )
1713 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1714 base[size-1] != YY_END_OF_BUFFER_CHAR )
1715 /* They forgot to leave room for the EOB's. */
1718 b = (YY_BUFFER_STATE) i386_alloc(sizeof( struct yy_buffer_state ) );
1720 YY_FATAL_ERROR( "out of dynamic memory in i386__scan_buffer()" );
1722 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1723 b->yy_buf_pos = b->yy_ch_buf = base;
1724 b->yy_is_our_buffer = 0;
1725 b->yy_input_file = 0;
1726 b->yy_n_chars = b->yy_buf_size;
1727 b->yy_is_interactive = 0;
1729 b->yy_fill_buffer = 0;
1730 b->yy_buffer_status = YY_BUFFER_NEW;
1732 i386__switch_to_buffer(b );
1737 /** Setup the input buffer state to scan a string. The next call to i386_lex() will
1738 * scan from a @e copy of @a str.
1739 * @param yystr a NUL-terminated string to scan
1741 * @return the newly allocated buffer state object.
1742 * @note If you want to scan bytes that may contain NUL values, then use
1743 * i386__scan_bytes() instead.
1745 YY_BUFFER_STATE i386__scan_string (yyconst char * yystr )
1748 return i386__scan_bytes(yystr,strlen(yystr) );
1751 /** Setup the input buffer state to scan the given bytes. The next call to i386_lex() will
1752 * scan from a @e copy of @a bytes.
1753 * @param yybytes the byte buffer to scan
1754 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1756 * @return the newly allocated buffer state object.
1758 YY_BUFFER_STATE i386__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1765 /* Get memory for full buffer, including space for trailing EOB's. */
1766 n = _yybytes_len + 2;
1767 buf = (char *) i386_alloc(n );
1769 YY_FATAL_ERROR( "out of dynamic memory in i386__scan_bytes()" );
1771 for ( i = 0; i < _yybytes_len; ++i )
1772 buf[i] = yybytes[i];
1774 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1776 b = i386__scan_buffer(buf,n );
1778 YY_FATAL_ERROR( "bad buffer in i386__scan_bytes()" );
1780 /* It's okay to grow etc. this buffer, and we should throw it
1781 * away when we're done.
1783 b->yy_is_our_buffer = 1;
1788 #ifndef YY_EXIT_FAILURE
1789 #define YY_EXIT_FAILURE 2
1792 static void yy_fatal_error (yyconst char* msg )
1794 (void) fprintf( stderr, "%s\n", msg );
1795 exit( YY_EXIT_FAILURE );
1798 /* Redefine yyless() so it works in section 3 code. */
1804 /* Undo effects of setting up i386_text. */ \
1805 int yyless_macro_arg = (n); \
1806 YY_LESS_LINENO(yyless_macro_arg);\
1807 i386_text[i386_leng] = (yy_hold_char); \
1808 (yy_c_buf_p) = i386_text + yyless_macro_arg; \
1809 (yy_hold_char) = *(yy_c_buf_p); \
1810 *(yy_c_buf_p) = '\0'; \
1811 i386_leng = yyless_macro_arg; \
1815 /* Accessor methods (get/set functions) to struct members. */
1817 /** Get the current line number.
1820 int i386_get_lineno (void)
1826 /** Get the input stream.
1829 FILE *i386_get_in (void)
1834 /** Get the output stream.
1837 FILE *i386_get_out (void)
1842 /** Get the length of the current token.
1845 yy_size_t i386_get_leng (void)
1850 /** Get the current token.
1854 char *i386_get_text (void)
1859 /** Set the current line number.
1860 * @param line_number
1863 void i386_set_lineno (int line_number )
1866 i386_lineno = line_number;
1869 /** Set the input stream. This does not discard the current
1871 * @param in_str A readable stream.
1873 * @see i386__switch_to_buffer
1875 void i386_set_in (FILE * in_str )
1880 void i386_set_out (FILE * out_str )
1882 i386_out = out_str ;
1885 int i386_get_debug (void)
1887 return i386__flex_debug;
1890 void i386_set_debug (int bdebug )
1892 i386__flex_debug = bdebug ;
1895 static int yy_init_globals (void)
1897 /* Initialization is the same as for the non-reentrant scanner.
1898 * This function is called from i386_lex_destroy(), so don't allocate here.
1901 /* We do not touch i386_lineno unless the option is enabled. */
1904 (yy_buffer_stack) = 0;
1905 (yy_buffer_stack_top) = 0;
1906 (yy_buffer_stack_max) = 0;
1907 (yy_c_buf_p) = (char *) 0;
1911 /* Defined in main.c */
1916 i386_in = (FILE *) 0;
1917 i386_out = (FILE *) 0;
1920 /* For future reference: Set errno on error, since we are called by
1926 /* i386_lex_destroy is for both reentrant and non-reentrant scanners. */
1927 int i386_lex_destroy (void)
1930 /* Pop the buffer stack, destroying each element. */
1931 while(YY_CURRENT_BUFFER){
1932 i386__delete_buffer(YY_CURRENT_BUFFER );
1933 YY_CURRENT_BUFFER_LVALUE = NULL;
1934 i386_pop_buffer_state();
1937 /* Destroy the stack itself. */
1938 i386_free((yy_buffer_stack) );
1939 (yy_buffer_stack) = NULL;
1941 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1942 * i386_lex() is called, initialization will occur. */
1949 * Internal utility routines.
1953 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1956 for ( i = 0; i < n; ++i )
1961 #ifdef YY_NEED_STRLEN
1962 static int yy_flex_strlen (yyconst char * s )
1965 for ( n = 0; s[n]; ++n )
1972 void *i386_alloc (yy_size_t size )
1974 return (void *) malloc( size );
1977 void *i386_realloc (void * ptr, yy_size_t size )
1979 /* The cast to (char *) in the following accommodates both
1980 * implementations that use char* generic pointers, and those
1981 * that use void* generic pointers. It works with the latter
1982 * because both ANSI C and C++ allow castless assignment from
1983 * any pointer type to void*, and deal with argument conversions
1984 * as though doing an assignment.
1986 return (void *) realloc( (char *) ptr, size );
1989 void i386_free (void * ptr )
1991 free( (char *) ptr ); /* see i386_realloc() for (char *) cast */
1994 #define YYTABLES_NAME "yytables"
1996 #line 104 "/home/mark/src/elfutils/libcpu/i386_lex.l"
2007 if (c == EOF || c == '\n')
2013 invalid_char (int ch)
2015 error (0, 0, (isascii (ch)
2016 ? gettext ("invalid character '%c' at line %d; ignored")
2017 : gettext ("invalid character '\\%o' at line %d; ignored")),