root/htags/asm.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. yy_get_next_buffer
  2. yy_get_previous_state
  3. yy_try_NUL_trans
  4. yyunput
  5. yyinput
  6. asm_restart
  7. asm__switch_to_buffer
  8. asm__load_buffer_state
  9. asm__create_buffer
  10. asm__delete_buffer
  11. asm__init_buffer
  12. asm__flush_buffer
  13. asm_push_buffer_state
  14. asm_pop_buffer_state
  15. asm_ensure_buffer_stack
  16. asm__scan_buffer
  17. asm__scan_string
  18. asm__scan_bytes
  19. yy_push_state
  20. yy_pop_state
  21. yy_fatal_error
  22. asm_get_lineno
  23. asm_get_in
  24. asm_get_out
  25. asm_get_leng
  26. asm_get_text
  27. asm_set_lineno
  28. asm_set_in
  29. asm_set_out
  30. asm_get_debug
  31. asm_set_debug
  32. yy_init_globals
  33. asm_lex_destroy
  34. yy_flex_strncpy
  35. yy_flex_strlen
  36. asm_alloc
  37. asm_realloc
  38. asm_free
  39. asm_parser_init

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

/* [previous][next][first][last][top][bottom][index][help] */