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