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