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