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