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