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