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 20 615#define YY_END_OF_BUFFER 21 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[29] = 624 { 0, 625 0, 0, 21, 19, 1, 1, 19, 6, 7, 5, 626 4, 11, 15, 12, 2, 8, 17, 13, 14, 16, 627 9, 3, 10, 0, 18, 2, 17, 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, 4, 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, 5, 6, 636 7, 8, 9, 10, 11, 12, 1, 13, 13, 13, 637 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, 638 1, 1, 14, 1, 15, 15, 15, 15, 15, 15, 639 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 640 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 641 16, 4, 17, 18, 19, 1, 15, 15, 15, 15, 642 643 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 644 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 645 15, 15, 20, 21, 22, 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[23] = 663 { 0, 664 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 665 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 666 1, 1 667 } ; 668 669static const flex_int16_t yy_base[30] = 670 { 0, 671 0, 0, 34, 35, 35, 35, 28, 35, 35, 35, 672 35, 35, 35, 35, 19, 35, 10, 35, 35, 35, 673 35, 35, 35, 26, 35, 15, 11, 35, 26 674 } ; 675 676static const flex_int16_t yy_def[30] = 677 { 0, 678 28, 1, 28, 28, 28, 28, 29, 28, 28, 28, 679 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 680 28, 28, 28, 29, 28, 28, 28, 0, 28 681 } ; 682 683static const flex_int16_t yy_nxt[58] = 684 { 0, 685 4, 5, 6, 4, 7, 8, 9, 10, 11, 12, 686 13, 14, 15, 16, 17, 18, 19, 20, 4, 21, 687 22, 23, 27, 27, 27, 27, 24, 26, 27, 27, 688 25, 26, 25, 28, 3, 28, 28, 28, 28, 28, 689 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 690 28, 28, 28, 28, 28, 28, 28 691 } ; 692 693static const flex_int16_t yy_chk[58] = 694 { 0, 695 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 696 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 697 1, 1, 17, 27, 17, 27, 29, 26, 17, 27, 698 24, 15, 7, 3, 28, 28, 28, 28, 28, 28, 699 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 700 28, 28, 28, 28, 28, 28, 28 701 } ; 702 703static yy_state_type yy_last_accepting_state; 704static char *yy_last_accepting_cpos; 705 706extern int yy_flex_debug; 707int yy_flex_debug = 0; 708 709/* The intent behind this definition is that it'll catch 710 * any uses of REJECT which flex missed. 711 */ 712#define REJECT reject_used_but_not_detected 713#define yymore() yymore_used_but_not_detected 714#define YY_MORE_ADJ 0 715#define YY_RESTORE_YY_MORE_OFFSET 716char *yytext; 717/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 718/* 719 * Main authors: 720 * Jip J. Dekker <jip.dekker@monash.edu> 721 */ 722/* This Source Code Form is subject to the terms of the Mozilla Public 723 * License, v. 2.0. If a copy of the MPL was not distributed with this 724 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 725#include <cstdlib> 726 727#define YY_DECL int yylex() 728 729#include <minizinc/support/regex.hh> 730 731#define INITIAL 0 732 733#ifndef YY_NO_UNISTD_H 734/* Special case for "unistd.h", since it is non-ANSI. We include it way 735 * down here because we want the user's section 1 to have been scanned first. 736 * The user has a chance to override it with an option. 737 */ 738#include <unistd.h> 739#endif 740 741#ifndef YY_EXTRA_TYPE 742#define YY_EXTRA_TYPE void * 743#endif 744 745static int yy_init_globals ( void ); 746 747/* Accessor methods to globals. 748 These are made visible to non-reentrant scanners for convenience. */ 749 750int yylex_destroy ( void ); 751 752int yyget_debug ( void ); 753 754void yyset_debug ( int debug_flag ); 755 756YY_EXTRA_TYPE yyget_extra ( void ); 757 758void yyset_extra ( YY_EXTRA_TYPE user_defined ); 759 760FILE *yyget_in ( void ); 761 762void yyset_in ( FILE * _in_str ); 763 764FILE *yyget_out ( void ); 765 766void yyset_out ( FILE * _out_str ); 767 768 int yyget_leng ( void ); 769 770char *yyget_text ( void ); 771 772int yyget_lineno ( void ); 773 774void yyset_lineno ( int _line_number ); 775 776/* Macros after this point can all be overridden by user definitions in 777 * section 1. 778 */ 779 780#ifndef YY_SKIP_YYWRAP 781#ifdef __cplusplus 782extern "C" int yywrap ( void ); 783#else 784extern int yywrap ( void ); 785#endif 786#endif 787 788#ifndef YY_NO_UNPUT 789 790 static void yyunput ( int c, char *buf_ptr ); 791 792#endif 793 794#ifndef yytext_ptr 795static void yy_flex_strncpy ( char *, const char *, int ); 796#endif 797 798#ifdef YY_NEED_STRLEN 799static int yy_flex_strlen ( const char * ); 800#endif 801 802#ifndef YY_NO_INPUT 803#ifdef __cplusplus 804static int yyinput ( void ); 805#else 806static int input ( void ); 807#endif 808 809#endif 810 811/* Amount of stuff to slurp up with each read. */ 812#ifndef YY_READ_BUF_SIZE 813#ifdef __ia64__ 814/* On IA-64, the buffer size is 16k, not 8k */ 815#define YY_READ_BUF_SIZE 16384 816#else 817#define YY_READ_BUF_SIZE 8192 818#endif /* __ia64__ */ 819#endif 820 821/* Copy whatever the last rule matched to the standard output. */ 822#ifndef ECHO 823/* This used to be an fputs(), but since the string might contain NUL's, 824 * we now use fwrite(). 825 */ 826#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 827#endif 828 829/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 830 * is returned in "result". 831 */ 832#ifndef YY_INPUT 833#define YY_INPUT(buf,result,max_size) \ 834 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 835 { \ 836 int c = '*'; \ 837 int n; \ 838 for ( n = 0; n < max_size && \ 839 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 840 buf[n] = (char) c; \ 841 if ( c == '\n' ) \ 842 buf[n++] = (char) c; \ 843 if ( c == EOF && ferror( yyin ) ) \ 844 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 845 result = n; \ 846 } \ 847 else \ 848 { \ 849 errno=0; \ 850 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ 851 { \ 852 if( errno != EINTR) \ 853 { \ 854 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 855 break; \ 856 } \ 857 errno=0; \ 858 clearerr(yyin); \ 859 } \ 860 }\ 861\ 862 863#endif 864 865/* No semi-colon after return; correct usage is to write "yyterminate();" - 866 * we don't want an extra ';' after the "return" because that will cause 867 * some compilers to complain about unreachable statements. 868 */ 869#ifndef yyterminate 870#define yyterminate() return YY_NULL 871#endif 872 873/* Number of entries by which start-condition stack grows. */ 874#ifndef YY_START_STACK_INCR 875#define YY_START_STACK_INCR 25 876#endif 877 878/* Report a fatal error. */ 879#ifndef YY_FATAL_ERROR 880#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 881#endif 882 883/* end tables serialization structures and prototypes */ 884 885/* Default declaration of generated scanner - a define so the user can 886 * easily add parameters. 887 */ 888#ifndef YY_DECL 889#define YY_DECL_IS_OURS 1 890 891extern int yylex (void); 892 893#define YY_DECL int yylex (void) 894#endif /* !YY_DECL */ 895 896/* Code executed at the beginning of each rule, after yytext and yyleng 897 * have been set up. 898 */ 899#ifndef YY_USER_ACTION 900#define YY_USER_ACTION 901#endif 902 903/* Code executed at the end of each rule. */ 904#ifndef YY_BREAK 905#define YY_BREAK /*LINTED*/break; 906#endif 907 908#define YY_RULE_SETUP \ 909 YY_USER_ACTION 910 911/** The main scanner function which does all the work. 912 */ 913YY_DECL 914{ 915 yy_state_type yy_current_state; 916 char *yy_cp, *yy_bp; 917 int yy_act; 918 919 if ( !(yy_init) ) 920 { 921 (yy_init) = 1; 922 923#ifdef YY_USER_INIT 924 YY_USER_INIT; 925#endif 926 927 if ( ! (yy_start) ) 928 (yy_start) = 1; /* first start state */ 929 930 if ( ! yyin ) 931 yyin = stdin; 932 933 if ( ! yyout ) 934 yyout = stdout; 935 936 if ( ! YY_CURRENT_BUFFER ) { 937 yyensure_buffer_stack (); 938 YY_CURRENT_BUFFER_LVALUE = 939 yy_create_buffer( yyin, YY_BUF_SIZE ); 940 } 941 942 yy_load_buffer_state( ); 943 } 944 945 { 946 947 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ 948 { 949 yy_cp = (yy_c_buf_p); 950 951 /* Support of yytext. */ 952 *yy_cp = (yy_hold_char); 953 954 /* yy_bp points to the position in yy_ch_buf of the start of 955 * the current run. 956 */ 957 yy_bp = yy_cp; 958 959 yy_current_state = (yy_start); 960yy_match: 961 do 962 { 963 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 964 if ( yy_accept[yy_current_state] ) 965 { 966 (yy_last_accepting_state) = yy_current_state; 967 (yy_last_accepting_cpos) = yy_cp; 968 } 969 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 970 { 971 yy_current_state = (int) yy_def[yy_current_state]; 972 if ( yy_current_state >= 29 ) 973 yy_c = yy_meta[yy_c]; 974 } 975 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 976 ++yy_cp; 977 } 978 while ( yy_base[yy_current_state] != 35 ); 979 980yy_find_action: 981 yy_act = yy_accept[yy_current_state]; 982 if ( yy_act == 0 ) 983 { /* have to back up */ 984 yy_cp = (yy_last_accepting_cpos); 985 yy_current_state = (yy_last_accepting_state); 986 yy_act = yy_accept[yy_current_state]; 987 } 988 989 YY_DO_BEFORE_ACTION; 990 991do_action: /* This label is used only to access EOF actions. */ 992 993 switch ( yy_act ) 994 { /* beginning of action switch */ 995 case 0: /* must back up */ 996 /* undo the effects of YY_DO_BEFORE_ACTION */ 997 *yy_cp = (yy_hold_char); 998 yy_cp = (yy_last_accepting_cpos); 999 yy_current_state = (yy_last_accepting_state); 1000 goto yy_find_action; 1001 1002case 1: 1003/* rule 1 can match eol */ 1004YY_RULE_SETUP 1005{ /* ignore white space */ } 1006 YY_BREAK 1007case 2: 1008YY_RULE_SETUP 1009{ regex_yylval.iValue = std::atoi(regex_yytext); return R_INTEGER; } 1010 YY_BREAK 1011case 3: 1012YY_RULE_SETUP 1013{ return R_UNION; } 1014 YY_BREAK 1015case 4: 1016YY_RULE_SETUP 1017{ return R_PLUS; } 1018 YY_BREAK 1019case 5: 1020YY_RULE_SETUP 1021{ return R_STAR; } 1022 YY_BREAK 1023case 6: 1024YY_RULE_SETUP 1025{ return R_GROUP_OPEN; } 1026 YY_BREAK 1027case 7: 1028YY_RULE_SETUP 1029{ return R_GROUP_CLOSE; } 1030 YY_BREAK 1031case 8: 1032YY_RULE_SETUP 1033{ return R_OPTIONAL; } 1034 YY_BREAK 1035case 9: 1036YY_RULE_SETUP 1037{ return R_QUANT_OPEN; } 1038 YY_BREAK 1039case 10: 1040YY_RULE_SETUP 1041{ return R_QUANT_CLOSE; } 1042 YY_BREAK 1043case 11: 1044YY_RULE_SETUP 1045{ return R_COMMA; } 1046 YY_BREAK 1047case 12: 1048YY_RULE_SETUP 1049{ return R_ANY; } 1050 YY_BREAK 1051case 13: 1052YY_RULE_SETUP 1053{ return R_CLASS_OPEN; } 1054 YY_BREAK 1055case 14: 1056YY_RULE_SETUP 1057{ return R_CLASS_CLOSE; } 1058 YY_BREAK 1059case 15: 1060YY_RULE_SETUP 1061{ return R_CLASS_RANGE; } 1062 YY_BREAK 1063case 16: 1064YY_RULE_SETUP 1065{ return R_CLASS_NEG; } 1066 YY_BREAK 1067case 17: 1068YY_RULE_SETUP 1069{ regex_yylval.sValue = strdup(yytext); return R_IDENTIFIER; } 1070 YY_BREAK 1071case 18: 1072YY_RULE_SETUP 1073{ regex_yylval.sValue = strdup(yytext); return R_IDENTIFIER; } 1074 YY_BREAK 1075case 19: 1076YY_RULE_SETUP 1077{ 1078 /* Catch all */ 1079 throw std::runtime_error("Illegal token in regular expression: '" + std::string(regex_yytext) + "'"); 1080} 1081 YY_BREAK 1082case 20: 1083YY_RULE_SETUP 1084ECHO; 1085 YY_BREAK 1086case YY_STATE_EOF(INITIAL): 1087 yyterminate(); 1088 1089 case YY_END_OF_BUFFER: 1090 { 1091 /* Amount of text matched not including the EOB char. */ 1092 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 1093 1094 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1095 *yy_cp = (yy_hold_char); 1096 YY_RESTORE_YY_MORE_OFFSET 1097 1098 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 1099 { 1100 /* We're scanning a new file or input source. It's 1101 * possible that this happened because the user 1102 * just pointed yyin at a new source and called 1103 * yylex(). If so, then we have to assure 1104 * consistency between YY_CURRENT_BUFFER and our 1105 * globals. Here is the right place to do so, because 1106 * this is the first action (other than possibly a 1107 * back-up) that will match for the new input source. 1108 */ 1109 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1110 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 1111 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 1112 } 1113 1114 /* Note that here we test for yy_c_buf_p "<=" to the position 1115 * of the first EOB in the buffer, since yy_c_buf_p will 1116 * already have been incremented past the NUL character 1117 * (since all states make transitions on EOB to the 1118 * end-of-buffer state). Contrast this with the test 1119 * in input(). 1120 */ 1121 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1122 { /* This was really a NUL. */ 1123 yy_state_type yy_next_state; 1124 1125 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 1126 1127 yy_current_state = yy_get_previous_state( ); 1128 1129 /* Okay, we're now positioned to make the NUL 1130 * transition. We couldn't have 1131 * yy_get_previous_state() go ahead and do it 1132 * for us because it doesn't know how to deal 1133 * with the possibility of jamming (and we don't 1134 * want to build jamming into it because then it 1135 * will run more slowly). 1136 */ 1137 1138 yy_next_state = yy_try_NUL_trans( yy_current_state ); 1139 1140 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1141 1142 if ( yy_next_state ) 1143 { 1144 /* Consume the NUL. */ 1145 yy_cp = ++(yy_c_buf_p); 1146 yy_current_state = yy_next_state; 1147 goto yy_match; 1148 } 1149 1150 else 1151 { 1152 yy_cp = (yy_c_buf_p); 1153 goto yy_find_action; 1154 } 1155 } 1156 1157 else switch ( yy_get_next_buffer( ) ) 1158 { 1159 case EOB_ACT_END_OF_FILE: 1160 { 1161 (yy_did_buffer_switch_on_eof) = 0; 1162 1163 if ( yywrap( ) ) 1164 { 1165 /* Note: because we've taken care in 1166 * yy_get_next_buffer() to have set up 1167 * yytext, we can now set up 1168 * yy_c_buf_p so that if some total 1169 * hoser (like flex itself) wants to 1170 * call the scanner after we return the 1171 * YY_NULL, it'll still work - another 1172 * YY_NULL will get returned. 1173 */ 1174 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 1175 1176 yy_act = YY_STATE_EOF(YY_START); 1177 goto do_action; 1178 } 1179 1180 else 1181 { 1182 if ( ! (yy_did_buffer_switch_on_eof) ) 1183 YY_NEW_FILE; 1184 } 1185 break; 1186 } 1187 1188 case EOB_ACT_CONTINUE_SCAN: 1189 (yy_c_buf_p) = 1190 (yytext_ptr) + yy_amount_of_matched_text; 1191 1192 yy_current_state = yy_get_previous_state( ); 1193 1194 yy_cp = (yy_c_buf_p); 1195 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1196 goto yy_match; 1197 1198 case EOB_ACT_LAST_MATCH: 1199 (yy_c_buf_p) = 1200 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 1201 1202 yy_current_state = yy_get_previous_state( ); 1203 1204 yy_cp = (yy_c_buf_p); 1205 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1206 goto yy_find_action; 1207 } 1208 break; 1209 } 1210 1211 default: 1212 YY_FATAL_ERROR( 1213 "fatal flex scanner internal error--no action found" ); 1214 } /* end of action switch */ 1215 } /* end of scanning one token */ 1216 } /* end of user's declarations */ 1217} /* end of yylex */ 1218 1219/* yy_get_next_buffer - try to read in a new buffer 1220 * 1221 * Returns a code representing an action: 1222 * EOB_ACT_LAST_MATCH - 1223 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1224 * EOB_ACT_END_OF_FILE - end of file 1225 */ 1226static int yy_get_next_buffer (void) 1227{ 1228 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1229 char *source = (yytext_ptr); 1230 int number_to_move, i; 1231 int ret_val; 1232 1233 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 1234 YY_FATAL_ERROR( 1235 "fatal flex scanner internal error--end of buffer missed" ); 1236 1237 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1238 { /* Don't try to fill the buffer, so this is an EOF. */ 1239 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 1240 { 1241 /* We matched a single character, the EOB, so 1242 * treat this as a final EOF. 1243 */ 1244 return EOB_ACT_END_OF_FILE; 1245 } 1246 1247 else 1248 { 1249 /* We matched some text prior to the EOB, first 1250 * process it. 1251 */ 1252 return EOB_ACT_LAST_MATCH; 1253 } 1254 } 1255 1256 /* Try to read more data. */ 1257 1258 /* First move last chars to start of buffer. */ 1259 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); 1260 1261 for ( i = 0; i < number_to_move; ++i ) 1262 *(dest++) = *(source++); 1263 1264 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1265 /* don't do the read, it's not guaranteed to return an EOF, 1266 * just force an EOF 1267 */ 1268 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1269 1270 else 1271 { 1272 int num_to_read = 1273 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1274 1275 while ( num_to_read <= 0 ) 1276 { /* Not enough room in the buffer - grow it. */ 1277 1278 /* just a shorter name for the current buffer */ 1279 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 1280 1281 int yy_c_buf_p_offset = 1282 (int) ((yy_c_buf_p) - b->yy_ch_buf); 1283 1284 if ( b->yy_is_our_buffer ) 1285 { 1286 int new_size = b->yy_buf_size * 2; 1287 1288 if ( new_size <= 0 ) 1289 b->yy_buf_size += b->yy_buf_size / 8; 1290 else 1291 b->yy_buf_size *= 2; 1292 1293 b->yy_ch_buf = (char *) 1294 /* Include room in for 2 EOB chars. */ 1295 yyrealloc( (void *) b->yy_ch_buf, 1296 (yy_size_t) (b->yy_buf_size + 2) ); 1297 } 1298 else 1299 /* Can't grow it, we don't own it. */ 1300 b->yy_ch_buf = NULL; 1301 1302 if ( ! b->yy_ch_buf ) 1303 YY_FATAL_ERROR( 1304 "fatal error - scanner input buffer overflow" ); 1305 1306 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1307 1308 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1309 number_to_move - 1; 1310 1311 } 1312 1313 if ( num_to_read > YY_READ_BUF_SIZE ) 1314 num_to_read = YY_READ_BUF_SIZE; 1315 1316 /* Read in more data. */ 1317 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1318 (yy_n_chars), num_to_read ); 1319 1320 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1321 } 1322 1323 if ( (yy_n_chars) == 0 ) 1324 { 1325 if ( number_to_move == YY_MORE_ADJ ) 1326 { 1327 ret_val = EOB_ACT_END_OF_FILE; 1328 yyrestart( yyin ); 1329 } 1330 1331 else 1332 { 1333 ret_val = EOB_ACT_LAST_MATCH; 1334 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1335 YY_BUFFER_EOF_PENDING; 1336 } 1337 } 1338 1339 else 1340 ret_val = EOB_ACT_CONTINUE_SCAN; 1341 1342 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1343 /* Extend the array by 50%, plus the number we really need. */ 1344 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1345 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( 1346 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); 1347 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1348 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1349 /* "- 2" to take care of EOB's */ 1350 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); 1351 } 1352 1353 (yy_n_chars) += number_to_move; 1354 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1355 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1356 1357 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1358 1359 return ret_val; 1360} 1361 1362/* yy_get_previous_state - get the state just before the EOB char was reached */ 1363 1364 static yy_state_type yy_get_previous_state (void) 1365{ 1366 yy_state_type yy_current_state; 1367 char *yy_cp; 1368 1369 yy_current_state = (yy_start); 1370 1371 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1372 { 1373 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 4); 1374 if ( yy_accept[yy_current_state] ) 1375 { 1376 (yy_last_accepting_state) = yy_current_state; 1377 (yy_last_accepting_cpos) = yy_cp; 1378 } 1379 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1380 { 1381 yy_current_state = (int) yy_def[yy_current_state]; 1382 if ( yy_current_state >= 29 ) 1383 yy_c = yy_meta[yy_c]; 1384 } 1385 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1386 } 1387 1388 return yy_current_state; 1389} 1390 1391/* yy_try_NUL_trans - try to make a transition on the NUL character 1392 * 1393 * synopsis 1394 * next_state = yy_try_NUL_trans( current_state ); 1395 */ 1396 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1397{ 1398 int yy_is_jam; 1399 char *yy_cp = (yy_c_buf_p); 1400 1401 YY_CHAR yy_c = 4; 1402 if ( yy_accept[yy_current_state] ) 1403 { 1404 (yy_last_accepting_state) = yy_current_state; 1405 (yy_last_accepting_cpos) = yy_cp; 1406 } 1407 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1408 { 1409 yy_current_state = (int) yy_def[yy_current_state]; 1410 if ( yy_current_state >= 29 ) 1411 yy_c = yy_meta[yy_c]; 1412 } 1413 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 1414 yy_is_jam = (yy_current_state == 28); 1415 1416 return yy_is_jam ? 0 : yy_current_state; 1417} 1418 1419#ifndef YY_NO_UNPUT 1420 1421 static void yyunput (int c, char * yy_bp ) 1422{ 1423 char *yy_cp; 1424 1425 yy_cp = (yy_c_buf_p); 1426 1427 /* undo effects of setting up yytext */ 1428 *yy_cp = (yy_hold_char); 1429 1430 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1431 { /* need to shift things up to make room */ 1432 /* +2 for EOB chars. */ 1433 int number_to_move = (yy_n_chars) + 2; 1434 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 1435 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 1436 char *source = 1437 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 1438 1439 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1440 *--dest = *--source; 1441 1442 yy_cp += (int) (dest - source); 1443 yy_bp += (int) (dest - source); 1444 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 1445 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 1446 1447 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1448 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1449 } 1450 1451 *--yy_cp = (char) c; 1452 1453 (yytext_ptr) = yy_bp; 1454 (yy_hold_char) = *yy_cp; 1455 (yy_c_buf_p) = yy_cp; 1456} 1457 1458#endif 1459 1460#ifndef YY_NO_INPUT 1461#ifdef __cplusplus 1462 static int yyinput (void) 1463#else 1464 static int input (void) 1465#endif 1466 1467{ 1468 int c; 1469 1470 *(yy_c_buf_p) = (yy_hold_char); 1471 1472 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1473 { 1474 /* yy_c_buf_p now points to the character we want to return. 1475 * If this occurs *before* the EOB characters, then it's a 1476 * valid NUL; if not, then we've hit the end of the buffer. 1477 */ 1478 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1479 /* This was really a NUL. */ 1480 *(yy_c_buf_p) = '\0'; 1481 1482 else 1483 { /* need more input */ 1484 int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); 1485 ++(yy_c_buf_p); 1486 1487 switch ( yy_get_next_buffer( ) ) 1488 { 1489 case EOB_ACT_LAST_MATCH: 1490 /* This happens because yy_g_n_b() 1491 * sees that we've accumulated a 1492 * token and flags that we need to 1493 * try matching the token before 1494 * proceeding. But for input(), 1495 * there's no matching to consider. 1496 * So convert the EOB_ACT_LAST_MATCH 1497 * to EOB_ACT_END_OF_FILE. 1498 */ 1499 1500 /* Reset buffer status. */ 1501 yyrestart( yyin ); 1502 1503 /*FALLTHROUGH*/ 1504 1505 case EOB_ACT_END_OF_FILE: 1506 { 1507 if ( yywrap( ) ) 1508 return 0; 1509 1510 if ( ! (yy_did_buffer_switch_on_eof) ) 1511 YY_NEW_FILE; 1512#ifdef __cplusplus 1513 return yyinput(); 1514#else 1515 return input(); 1516#endif 1517 } 1518 1519 case EOB_ACT_CONTINUE_SCAN: 1520 (yy_c_buf_p) = (yytext_ptr) + offset; 1521 break; 1522 } 1523 } 1524 } 1525 1526 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1527 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1528 (yy_hold_char) = *++(yy_c_buf_p); 1529 1530 return c; 1531} 1532#endif /* ifndef YY_NO_INPUT */ 1533 1534/** Immediately switch to a different input stream. 1535 * @param input_file A readable stream. 1536 * 1537 * @note This function does not reset the start condition to @c INITIAL . 1538 */ 1539 void yyrestart (FILE * input_file ) 1540{ 1541 1542 if ( ! YY_CURRENT_BUFFER ){ 1543 yyensure_buffer_stack (); 1544 YY_CURRENT_BUFFER_LVALUE = 1545 yy_create_buffer( yyin, YY_BUF_SIZE ); 1546 } 1547 1548 yy_init_buffer( YY_CURRENT_BUFFER, input_file ); 1549 yy_load_buffer_state( ); 1550} 1551 1552/** Switch to a different input buffer. 1553 * @param new_buffer The new input buffer. 1554 * 1555 */ 1556 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1557{ 1558 1559 /* TODO. We should be able to replace this entire function body 1560 * with 1561 * yypop_buffer_state(); 1562 * yypush_buffer_state(new_buffer); 1563 */ 1564 yyensure_buffer_stack (); 1565 if ( YY_CURRENT_BUFFER == new_buffer ) 1566 return; 1567 1568 if ( YY_CURRENT_BUFFER ) 1569 { 1570 /* Flush out information for old buffer. */ 1571 *(yy_c_buf_p) = (yy_hold_char); 1572 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1573 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1574 } 1575 1576 YY_CURRENT_BUFFER_LVALUE = new_buffer; 1577 yy_load_buffer_state( ); 1578 1579 /* We don't actually know whether we did this switch during 1580 * EOF (yywrap()) processing, but the only time this flag 1581 * is looked at is after yywrap() is called, so it's safe 1582 * to go ahead and always set it. 1583 */ 1584 (yy_did_buffer_switch_on_eof) = 1; 1585} 1586 1587static void yy_load_buffer_state (void) 1588{ 1589 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1590 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1591 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1592 (yy_hold_char) = *(yy_c_buf_p); 1593} 1594 1595/** Allocate and initialize an input buffer state. 1596 * @param file A readable stream. 1597 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1598 * 1599 * @return the allocated buffer state. 1600 */ 1601 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1602{ 1603 YY_BUFFER_STATE b; 1604 1605 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 1606 if ( ! b ) 1607 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1608 1609 b->yy_buf_size = size; 1610 1611 /* yy_ch_buf has to be 2 characters longer than the size given because 1612 * we need to put in 2 end-of-buffer characters. 1613 */ 1614 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); 1615 if ( ! b->yy_ch_buf ) 1616 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1617 1618 b->yy_is_our_buffer = 1; 1619 1620 yy_init_buffer( b, file ); 1621 1622 return b; 1623} 1624 1625/** Destroy the buffer. 1626 * @param b a buffer created with yy_create_buffer() 1627 * 1628 */ 1629 void yy_delete_buffer (YY_BUFFER_STATE b ) 1630{ 1631 1632 if ( ! b ) 1633 return; 1634 1635 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1636 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1637 1638 if ( b->yy_is_our_buffer ) 1639 yyfree( (void *) b->yy_ch_buf ); 1640 1641 yyfree( (void *) b ); 1642} 1643 1644/* Initializes or reinitializes a buffer. 1645 * This function is sometimes called more than once on the same buffer, 1646 * such as during a yyrestart() or at EOF. 1647 */ 1648 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1649 1650{ 1651 int oerrno = errno; 1652 1653 yy_flush_buffer( b ); 1654 1655 b->yy_input_file = file; 1656 b->yy_fill_buffer = 1; 1657 1658 /* If b is the current buffer, then yy_init_buffer was _probably_ 1659 * called from yyrestart() or through yy_get_next_buffer. 1660 * In that case, we don't want to reset the lineno or column. 1661 */ 1662 if (b != YY_CURRENT_BUFFER){ 1663 b->yy_bs_lineno = 1; 1664 b->yy_bs_column = 0; 1665 } 1666 1667 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1668 1669 errno = oerrno; 1670} 1671 1672/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1673 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1674 * 1675 */ 1676 void yy_flush_buffer (YY_BUFFER_STATE b ) 1677{ 1678 if ( ! b ) 1679 return; 1680 1681 b->yy_n_chars = 0; 1682 1683 /* We always need two end-of-buffer characters. The first causes 1684 * a transition to the end-of-buffer state. The second causes 1685 * a jam in that state. 1686 */ 1687 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1688 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1689 1690 b->yy_buf_pos = &b->yy_ch_buf[0]; 1691 1692 b->yy_at_bol = 1; 1693 b->yy_buffer_status = YY_BUFFER_NEW; 1694 1695 if ( b == YY_CURRENT_BUFFER ) 1696 yy_load_buffer_state( ); 1697} 1698 1699/** Pushes the new state onto the stack. The new state becomes 1700 * the current state. This function will allocate the stack 1701 * if necessary. 1702 * @param new_buffer The new state. 1703 * 1704 */ 1705void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1706{ 1707 if (new_buffer == NULL) 1708 return; 1709 1710 yyensure_buffer_stack(); 1711 1712 /* This block is copied from yy_switch_to_buffer. */ 1713 if ( YY_CURRENT_BUFFER ) 1714 { 1715 /* Flush out information for old buffer. */ 1716 *(yy_c_buf_p) = (yy_hold_char); 1717 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1718 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1719 } 1720 1721 /* Only push if top exists. Otherwise, replace top. */ 1722 if (YY_CURRENT_BUFFER) 1723 (yy_buffer_stack_top)++; 1724 YY_CURRENT_BUFFER_LVALUE = new_buffer; 1725 1726 /* copied from yy_switch_to_buffer. */ 1727 yy_load_buffer_state( ); 1728 (yy_did_buffer_switch_on_eof) = 1; 1729} 1730 1731/** Removes and deletes the top of the stack, if present. 1732 * The next element becomes the new top. 1733 * 1734 */ 1735void yypop_buffer_state (void) 1736{ 1737 if (!YY_CURRENT_BUFFER) 1738 return; 1739 1740 yy_delete_buffer(YY_CURRENT_BUFFER ); 1741 YY_CURRENT_BUFFER_LVALUE = NULL; 1742 if ((yy_buffer_stack_top) > 0) 1743 --(yy_buffer_stack_top); 1744 1745 if (YY_CURRENT_BUFFER) { 1746 yy_load_buffer_state( ); 1747 (yy_did_buffer_switch_on_eof) = 1; 1748 } 1749} 1750 1751/* Allocates the stack if it does not exist. 1752 * Guarantees space for at least one push. 1753 */ 1754static void yyensure_buffer_stack (void) 1755{ 1756 yy_size_t num_to_alloc; 1757 1758 if (!(yy_buffer_stack)) { 1759 1760 /* First allocation is just for 2 elements, since we don't know if this 1761 * scanner will even need a stack. We use 2 instead of 1 to avoid an 1762 * immediate realloc on the next call. 1763 */ 1764 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 1765 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1766 (num_to_alloc * sizeof(struct yy_buffer_state*) 1767 ); 1768 if ( ! (yy_buffer_stack) ) 1769 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1770 1771 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1772 1773 (yy_buffer_stack_max) = num_to_alloc; 1774 (yy_buffer_stack_top) = 0; 1775 return; 1776 } 1777 1778 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 1779 1780 /* Increase the buffer to prepare for a possible push. */ 1781 yy_size_t grow_size = 8 /* arbitrary grow size */; 1782 1783 num_to_alloc = (yy_buffer_stack_max) + grow_size; 1784 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1785 ((yy_buffer_stack), 1786 num_to_alloc * sizeof(struct yy_buffer_state*) 1787 ); 1788 if ( ! (yy_buffer_stack) ) 1789 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1790 1791 /* zero only the new slots.*/ 1792 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1793 (yy_buffer_stack_max) = num_to_alloc; 1794 } 1795} 1796 1797/** Setup the input buffer state to scan directly from a user-specified character buffer. 1798 * @param base the character buffer 1799 * @param size the size in bytes of the character buffer 1800 * 1801 * @return the newly allocated buffer state object. 1802 */ 1803YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 1804{ 1805 YY_BUFFER_STATE b; 1806 1807 if ( size < 2 || 1808 base[size-2] != YY_END_OF_BUFFER_CHAR || 1809 base[size-1] != YY_END_OF_BUFFER_CHAR ) 1810 /* They forgot to leave room for the EOB's. */ 1811 return NULL; 1812 1813 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 1814 if ( ! b ) 1815 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1816 1817 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 1818 b->yy_buf_pos = b->yy_ch_buf = base; 1819 b->yy_is_our_buffer = 0; 1820 b->yy_input_file = NULL; 1821 b->yy_n_chars = b->yy_buf_size; 1822 b->yy_is_interactive = 0; 1823 b->yy_at_bol = 1; 1824 b->yy_fill_buffer = 0; 1825 b->yy_buffer_status = YY_BUFFER_NEW; 1826 1827 yy_switch_to_buffer( b ); 1828 1829 return b; 1830} 1831 1832/** Setup the input buffer state to scan a string. The next call to yylex() will 1833 * scan from a @e copy of @a str. 1834 * @param yystr a NUL-terminated string to scan 1835 * 1836 * @return the newly allocated buffer state object. 1837 * @note If you want to scan bytes that may contain NUL values, then use 1838 * yy_scan_bytes() instead. 1839 */ 1840YY_BUFFER_STATE yy_scan_string (const char * yystr ) 1841{ 1842 1843 return yy_scan_bytes( yystr, (int) strlen(yystr) ); 1844} 1845 1846/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1847 * scan from a @e copy of @a bytes. 1848 * @param yybytes the byte buffer to scan 1849 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 1850 * 1851 * @return the newly allocated buffer state object. 1852 */ 1853YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) 1854{ 1855 YY_BUFFER_STATE b; 1856 char *buf; 1857 yy_size_t n; 1858 int i; 1859 1860 /* Get memory for full buffer, including space for trailing EOB's. */ 1861 n = (yy_size_t) (_yybytes_len + 2); 1862 buf = (char *) yyalloc( n ); 1863 if ( ! buf ) 1864 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1865 1866 for ( i = 0; i < _yybytes_len; ++i ) 1867 buf[i] = yybytes[i]; 1868 1869 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 1870 1871 b = yy_scan_buffer( buf, n ); 1872 if ( ! b ) 1873 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1874 1875 /* It's okay to grow etc. this buffer, and we should throw it 1876 * away when we're done. 1877 */ 1878 b->yy_is_our_buffer = 1; 1879 1880 return b; 1881} 1882 1883#ifndef YY_EXIT_FAILURE 1884#define YY_EXIT_FAILURE 2 1885#endif 1886 1887static void yynoreturn yy_fatal_error (const char* msg ) 1888{ 1889 fprintf( stderr, "%s\n", msg ); 1890 exit( YY_EXIT_FAILURE ); 1891} 1892 1893/* Redefine yyless() so it works in section 3 code. */ 1894 1895#undef yyless 1896#define yyless(n) \ 1897 do \ 1898 { \ 1899 /* Undo effects of setting up yytext. */ \ 1900 int yyless_macro_arg = (n); \ 1901 YY_LESS_LINENO(yyless_macro_arg);\ 1902 yytext[yyleng] = (yy_hold_char); \ 1903 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1904 (yy_hold_char) = *(yy_c_buf_p); \ 1905 *(yy_c_buf_p) = '\0'; \ 1906 yyleng = yyless_macro_arg; \ 1907 } \ 1908 while ( 0 ) 1909 1910/* Accessor methods (get/set functions) to struct members. */ 1911 1912/** Get the current line number. 1913 * 1914 */ 1915int yyget_lineno (void) 1916{ 1917 1918 return yylineno; 1919} 1920 1921/** Get the input stream. 1922 * 1923 */ 1924FILE *yyget_in (void) 1925{ 1926 return yyin; 1927} 1928 1929/** Get the output stream. 1930 * 1931 */ 1932FILE *yyget_out (void) 1933{ 1934 return yyout; 1935} 1936 1937/** Get the length of the current token. 1938 * 1939 */ 1940int yyget_leng (void) 1941{ 1942 return yyleng; 1943} 1944 1945/** Get the current token. 1946 * 1947 */ 1948 1949char *yyget_text (void) 1950{ 1951 return yytext; 1952} 1953 1954/** Set the current line number. 1955 * @param _line_number line number 1956 * 1957 */ 1958void yyset_lineno (int _line_number ) 1959{ 1960 1961 yylineno = _line_number; 1962} 1963 1964/** Set the input stream. This does not discard the current 1965 * input buffer. 1966 * @param _in_str A readable stream. 1967 * 1968 * @see yy_switch_to_buffer 1969 */ 1970void yyset_in (FILE * _in_str ) 1971{ 1972 yyin = _in_str ; 1973} 1974 1975void yyset_out (FILE * _out_str ) 1976{ 1977 yyout = _out_str ; 1978} 1979 1980int yyget_debug (void) 1981{ 1982 return yy_flex_debug; 1983} 1984 1985void yyset_debug (int _bdebug ) 1986{ 1987 yy_flex_debug = _bdebug ; 1988} 1989 1990static int yy_init_globals (void) 1991{ 1992 /* Initialization is the same as for the non-reentrant scanner. 1993 * This function is called from yylex_destroy(), so don't allocate here. 1994 */ 1995 1996 (yy_buffer_stack) = NULL; 1997 (yy_buffer_stack_top) = 0; 1998 (yy_buffer_stack_max) = 0; 1999 (yy_c_buf_p) = NULL; 2000 (yy_init) = 0; 2001 (yy_start) = 0; 2002 2003/* Defined in main.c */ 2004#ifdef YY_STDINIT 2005 yyin = stdin; 2006 yyout = stdout; 2007#else 2008 yyin = NULL; 2009 yyout = NULL; 2010#endif 2011 2012 /* For future reference: Set errno on error, since we are called by 2013 * yylex_init() 2014 */ 2015 return 0; 2016} 2017 2018/* yylex_destroy is for both reentrant and non-reentrant scanners. */ 2019int yylex_destroy (void) 2020{ 2021 2022 /* Pop the buffer stack, destroying each element. */ 2023 while(YY_CURRENT_BUFFER){ 2024 yy_delete_buffer( YY_CURRENT_BUFFER ); 2025 YY_CURRENT_BUFFER_LVALUE = NULL; 2026 yypop_buffer_state(); 2027 } 2028 2029 /* Destroy the stack itself. */ 2030 yyfree((yy_buffer_stack) ); 2031 (yy_buffer_stack) = NULL; 2032 2033 /* Reset the globals. This is important in a non-reentrant scanner so the next time 2034 * yylex() is called, initialization will occur. */ 2035 yy_init_globals( ); 2036 2037 return 0; 2038} 2039 2040/* 2041 * Internal utility routines. 2042 */ 2043 2044#ifndef yytext_ptr 2045static void yy_flex_strncpy (char* s1, const char * s2, int n ) 2046{ 2047 2048 int i; 2049 for ( i = 0; i < n; ++i ) 2050 s1[i] = s2[i]; 2051} 2052#endif 2053 2054#ifdef YY_NEED_STRLEN 2055static int yy_flex_strlen (const char * s ) 2056{ 2057 int n; 2058 for ( n = 0; s[n]; ++n ) 2059 ; 2060 2061 return n; 2062} 2063#endif 2064 2065void *yyalloc (yy_size_t size ) 2066{ 2067 return malloc(size); 2068} 2069 2070void *yyrealloc (void * ptr, yy_size_t size ) 2071{ 2072 2073 /* The cast to (char *) in the following accommodates both 2074 * implementations that use char* generic pointers, and those 2075 * that use void* generic pointers. It works with the latter 2076 * because both ANSI C and C++ allow castless assignment from 2077 * any pointer type to void*, and deal with argument conversions 2078 * as though doing an assignment. 2079 */ 2080 return realloc(ptr, size); 2081} 2082 2083void yyfree (void * ptr ) 2084{ 2085 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2086} 2087 2088#define YYTABLES_NAME "yytables" 2089