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