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