Changeset 4 for heimdal/trunk/lib/sl
- Timestamp:
- Jul 11, 2015, 9:56:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
heimdal/trunk/lib/sl/slc-lex.c
r1 r4 1 2 #line 3 "slc-lex.c"3 4 #define YY_INT_ALIGNED short int5 6 1 /* A lexical scanner generated by flex */ 2 3 /* Scanner skeleton version: 4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 5 */ 7 6 8 7 #define FLEX_SCANNER 9 8 #define YY_FLEX_MAJOR_VERSION 2 10 9 #define YY_FLEX_MINOR_VERSION 5 11 #define YY_FLEX_SUBMINOR_VERSION 35 12 #if YY_FLEX_SUBMINOR_VERSION > 0 13 #define FLEX_BETA 14 #endif 15 16 /* First, we deal with platform-specific or compiler-specific issues. */ 17 18 /* begin standard C headers. */ 10 19 11 #include <stdio.h> 20 #include <string.h> 21 #include <errno.h> 12 13 14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 15 #ifdef c_plusplus 16 #ifndef __cplusplus 17 #define __cplusplus 18 #endif 19 #endif 20 21 22 #ifdef __cplusplus 23 22 24 #include <stdlib.h> 23 24 /* end standard C headers. */ 25 26 /* flex integer type definitions */ 27 28 #ifndef FLEXINT_H 29 #define FLEXINT_H 30 31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 32 33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 34 35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 36 * if you want the limit (max/min) macros for int types. 37 */ 38 #ifndef __STDC_LIMIT_MACROS 39 #define __STDC_LIMIT_MACROS 1 40 #endif 41 42 #include <inttypes.h> 43 typedef int8_t flex_int8_t; 44 typedef uint8_t flex_uint8_t; 45 typedef int16_t flex_int16_t; 46 typedef uint16_t flex_uint16_t; 47 typedef int32_t flex_int32_t; 48 typedef uint32_t flex_uint32_t; 49 typedef uint64_t flex_uint64_t; 50 #else 51 typedef signed char flex_int8_t; 52 typedef short int flex_int16_t; 53 typedef int flex_int32_t; 54 typedef unsigned char flex_uint8_t; 55 typedef unsigned short int flex_uint16_t; 56 typedef unsigned int flex_uint32_t; 57 #endif /* ! C99 */ 58 59 /* Limits of integral types. */ 60 #ifndef INT8_MIN 61 #define INT8_MIN (-128) 62 #endif 63 #ifndef INT16_MIN 64 #define INT16_MIN (-32767-1) 65 #endif 66 #ifndef INT32_MIN 67 #define INT32_MIN (-2147483647-1) 68 #endif 69 #ifndef INT8_MAX 70 #define INT8_MAX (127) 71 #endif 72 #ifndef INT16_MAX 73 #define INT16_MAX (32767) 74 #endif 75 #ifndef INT32_MAX 76 #define INT32_MAX (2147483647) 77 #endif 78 #ifndef UINT8_MAX 79 #define UINT8_MAX (255U) 80 #endif 81 #ifndef UINT16_MAX 82 #define UINT16_MAX (65535U) 83 #endif 84 #ifndef UINT32_MAX 85 #define UINT32_MAX (4294967295U) 86 #endif 87 88 #endif /* ! FLEXINT_H */ 89 90 #ifdef __cplusplus 25 #include <unistd.h> 26 27 /* Use prototypes in function declarations. */ 28 #define YY_USE_PROTOS 91 29 92 30 /* The "const" storage-class-modifier is valid. */ … … 95 33 #else /* ! __cplusplus */ 96 34 97 /* C99 requires __STDC__ to be defined as 1. */ 98 #if defined (__STDC__) 99 35 #if __STDC__ 36 37 #define YY_USE_PROTOS 100 38 #define YY_USE_CONST 101 39 102 #endif /* defined (__STDC__)*/40 #endif /* __STDC__ */ 103 41 #endif /* ! __cplusplus */ 42 43 #ifdef __TURBOC__ 44 #pragma warn -rch 45 #pragma warn -use 46 #include <io.h> 47 #include <stdlib.h> 48 #define YY_USE_CONST 49 #define YY_USE_PROTOS 50 #endif 104 51 105 52 #ifdef YY_USE_CONST … … 107 54 #else 108 55 #define yyconst 56 #endif 57 58 59 #ifdef YY_USE_PROTOS 60 #define YY_PROTO(proto) proto 61 #else 62 #define YY_PROTO(proto) () 109 63 #endif 110 64 … … 123 77 * definition of BEGIN. 124 78 */ 125 #define BEGIN (yy_start)= 1 + 2 *79 #define BEGIN yy_start = 1 + 2 * 126 80 127 81 /* Translate the current start state into a value that can be later handed … … 129 83 * compatibility. 130 84 */ 131 #define YY_START (( (yy_start)- 1) / 2)85 #define YY_START ((yy_start - 1) / 2) 132 86 #define YYSTATE YY_START 133 87 … … 136 90 137 91 /* Special action meaning "start processing a new file". */ 138 #define YY_NEW_FILE yyrestart( yyin)92 #define YY_NEW_FILE yyrestart( yyin ) 139 93 140 94 #define YY_END_OF_BUFFER_CHAR 0 141 95 142 96 /* Size of default input buffer. */ 143 #ifndef YY_BUF_SIZE144 97 #define YY_BUF_SIZE 16384 145 #endif 146 147 /* The state buf must be large enough to hold one state per character in the main buffer. 148 */ 149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 150 151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 152 #define YY_TYPEDEF_YY_BUFFER_STATE 98 153 99 typedef struct yy_buffer_state *YY_BUFFER_STATE; 154 #endif 155 156 #ifndef YY_TYPEDEF_YY_SIZE_T 157 #define YY_TYPEDEF_YY_SIZE_T 158 typedef size_t yy_size_t; 159 #endif 160 161 extern yy_size_t yyleng; 162 100 101 extern int yyleng; 163 102 extern FILE *yyin, *yyout; 164 103 … … 167 106 #define EOB_ACT_LAST_MATCH 2 168 107 169 #define YY_LESS_LINENO(n) 170 171 /* Return all but the first "n" matched characters back to the input stream. */ 108 /* The funky do-while in the following #define is used to turn the definition 109 * int a single C statement (which needs a semi-colon terminator). This 110 * avoids problems with code like: 111 * 112 * if ( condition_holds ) 113 * yyless( 5 ); 114 * else 115 * do_something_else(); 116 * 117 * Prior to using the do-while the compiler would get upset at the 118 * "else" because it interpreted the "if" statement as being all 119 * done when it reached the ';' after the yyless() call. 120 */ 121 122 /* Return all but the first 'n' matched characters back to the input stream. */ 123 172 124 #define yyless(n) \ 173 125 do \ 174 126 { \ 175 127 /* Undo effects of setting up yytext. */ \ 176 int yyless_macro_arg = (n); \ 177 YY_LESS_LINENO(yyless_macro_arg);\ 178 *yy_cp = (yy_hold_char); \ 128 *yy_cp = yy_hold_char; \ 179 129 YY_RESTORE_YY_MORE_OFFSET \ 180 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg- YY_MORE_ADJ; \130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 181 131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 182 132 } \ 183 133 while ( 0 ) 184 134 185 #define unput(c) yyunput( c, (yytext_ptr) ) 186 187 #ifndef YY_STRUCT_YY_BUFFER_STATE 188 #define YY_STRUCT_YY_BUFFER_STATE 135 #define unput(c) yyunput( c, yytext_ptr ) 136 137 /* The following is because we cannot portably get our hands on size_t 138 * (without autoconf's help, which isn't available because we want 139 * flex-generated scanners to compile on their own). 140 */ 141 typedef unsigned int yy_size_t; 142 143 189 144 struct yy_buffer_state 190 145 { … … 202 157 * characters. 203 158 */ 204 yy_size_t yy_n_chars;159 int yy_n_chars; 205 160 206 161 /* Whether we "own" the buffer - i.e., we know we created it, … … 223 178 int yy_at_bol; 224 179 225 int yy_bs_lineno; /**< The line count. */226 int yy_bs_column; /**< The column count. */227 228 180 /* Whether to try to fill the input buffer when we reach the 229 181 * end of it. … … 232 184 233 185 int yy_buffer_status; 234 235 186 #define YY_BUFFER_NEW 0 236 187 #define YY_BUFFER_NORMAL 1 … … 246 197 */ 247 198 #define YY_BUFFER_EOF_PENDING 2 248 249 199 }; 250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 251 252 /* Stack of input buffers. */ 253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 255 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 200 201 static YY_BUFFER_STATE yy_current_buffer = 0; 256 202 257 203 /* We provide macros for accessing buffer states in case in the 258 204 * future we want to put the buffer states in a more general 259 205 * "scanner state". 260 * 261 * Returns the top of the stack, or NULL. 262 */ 263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 265 : NULL) 266 267 /* Same as previous macro, but useful when we know that the buffer stack is not 268 * NULL or when we need an lvalue. For internal use only. 269 */ 270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 206 */ 207 #define YY_CURRENT_BUFFER yy_current_buffer 208 271 209 272 210 /* yy_hold_char holds the character lost when yytext is formed. */ 273 211 static char yy_hold_char; 274 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ 275 yy_size_t yyleng; 212 213 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 214 215 216 int yyleng; 276 217 277 218 /* Points to current character in buffer. */ 278 219 static char *yy_c_buf_p = (char *) 0; 279 static int yy_init = 0; /* whether we need to initialize */220 static int yy_init = 1; /* whether we need to initialize */ 280 221 static int yy_start = 0; /* start state number */ 281 222 … … 285 226 static int yy_did_buffer_switch_on_eof; 286 227 287 void yyrestart (FILE *input_file ); 288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 290 void yy_delete_buffer (YY_BUFFER_STATE b ); 291 void yy_flush_buffer (YY_BUFFER_STATE b ); 292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 293 void yypop_buffer_state (void ); 294 295 static void yyensure_buffer_stack (void ); 296 static void yy_load_buffer_state (void ); 297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 298 299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 300 301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); 304 305 void *yyalloc (yy_size_t ); 306 void *yyrealloc (void *,yy_size_t ); 307 void yyfree (void * ); 228 void yyrestart YY_PROTO(( FILE *input_file )); 229 230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 231 void yy_load_buffer_state YY_PROTO(( void )); 232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 237 238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 241 242 static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 244 static void yy_flex_free YY_PROTO(( void * )); 308 245 309 246 #define yy_new_buffer yy_create_buffer … … 311 248 #define yy_set_interactive(is_interactive) \ 312 249 { \ 313 if ( ! YY_CURRENT_BUFFER ){ \ 314 yyensure_buffer_stack (); \ 315 YY_CURRENT_BUFFER_LVALUE = \ 316 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 317 } \ 318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 250 if ( ! yy_current_buffer ) \ 251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 252 yy_current_buffer->yy_is_interactive = is_interactive; \ 319 253 } 320 254 321 255 #define yy_set_bol(at_bol) \ 322 256 { \ 323 if ( ! YY_CURRENT_BUFFER ){\ 324 yyensure_buffer_stack (); \ 325 YY_CURRENT_BUFFER_LVALUE = \ 326 yy_create_buffer(yyin,YY_BUF_SIZE ); \ 327 } \ 328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 329 } 330 331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 332 333 /* Begin user sect3 */ 257 if ( ! yy_current_buffer ) \ 258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 259 yy_current_buffer->yy_at_bol = at_bol; \ 260 } 261 262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 334 263 335 264 typedef unsigned char YY_CHAR; 336 337 265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 338 339 266 typedef int yy_state_type; 340 341 extern int yylineno;342 343 int yylineno = 1;344 345 267 extern char *yytext; 346 268 #define yytext_ptr yytext 347 269 348 static yy_state_type yy_get_previous_state (void);349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state);350 static int yy_get_next_buffer (void);351 static void yy_fatal_error (yyconst char msg[]);270 static yy_state_type yy_get_previous_state YY_PROTO(( void )); 271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 272 static int yy_get_next_buffer YY_PROTO(( void )); 273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 352 274 353 275 /* Done after the current pattern has been matched and before the … … 355 277 */ 356 278 #define YY_DO_BEFORE_ACTION \ 357 (yytext_ptr)= yy_bp; \358 yyleng = ( yy_size_t) (yy_cp - yy_bp); \359 (yy_hold_char)= *yy_cp; \279 yytext_ptr = yy_bp; \ 280 yyleng = (int) (yy_cp - yy_bp); \ 281 yy_hold_char = *yy_cp; \ 360 282 *yy_cp = '\0'; \ 361 (yy_c_buf_p)= yy_cp;283 yy_c_buf_p = yy_cp; 362 284 363 285 #define YY_NUM_RULES 7 364 286 #define YY_END_OF_BUFFER 8 365 /* This struct is not used in this scanner, 366 but its presence is necessary. */ 367 struct yy_trans_info 368 { 369 flex_int32_t yy_verify; 370 flex_int32_t yy_nxt; 371 }; 372 static yyconst flex_int16_t yy_accept[14] = 287 static yyconst short int yy_accept[14] = 373 288 { 0, 374 289 0, 0, 8, 7, 6, 3, 2, 7, 5, 1, … … 376 291 } ; 377 292 378 static yyconst flex_int32_t yy_ec[256] =293 static yyconst int yy_ec[256] = 379 294 { 0, 380 295 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, … … 408 323 } ; 409 324 410 static yyconst flex_int32_t yy_meta[10] =325 static yyconst int yy_meta[10] = 411 326 { 0, 412 327 1, 1, 1, 1, 1, 2, 1, 1, 2 413 328 } ; 414 329 415 static yyconst flex_int16_t yy_base[15] =330 static yyconst short int yy_base[15] = 416 331 { 0, 417 332 0, 0, 12, 13, 13, 13, 13, 6, 13, 0, … … 419 334 } ; 420 335 421 static yyconst flex_int16_t yy_def[15] =336 static yyconst short int yy_def[15] = 422 337 { 0, 423 338 13, 1, 13, 13, 13, 13, 13, 13, 13, 14, … … 425 340 } ; 426 341 427 static yyconst flex_int16_t yy_nxt[23] =342 static yyconst short int yy_nxt[23] = 428 343 { 0, 429 344 4, 5, 6, 7, 4, 4, 8, 9, 10, 12, … … 432 347 } ; 433 348 434 static yyconst flex_int16_t yy_chk[23] =349 static yyconst short int yy_chk[23] = 435 350 { 0, 436 351 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, … … 441 356 static yy_state_type yy_last_accepting_state; 442 357 static char *yy_last_accepting_cpos; 443 444 extern int yy_flex_debug;445 int yy_flex_debug = 0;446 358 447 359 /* The intent behind this definition is that it'll catch … … 454 366 char *yytext; 455 367 #line 1 "slc-lex.l" 368 #define INITIAL 0 456 369 #line 2 "slc-lex.l" 457 370 /* … … 507 420 #undef ECHO 508 421 509 #line 510 "slc-lex.c" 510 511 #define INITIAL 0 512 513 #ifndef YY_NO_UNISTD_H 514 /* Special case for "unistd.h", since it is non-ANSI. We include it way 515 * down here because we want the user's section 1 to have been scanned first. 516 * The user has a chance to override it with an option. 517 */ 518 #include <unistd.h> 519 #endif 520 521 #ifndef YY_EXTRA_TYPE 522 #define YY_EXTRA_TYPE void * 523 #endif 524 525 static int yy_init_globals (void ); 526 527 /* Accessor methods to globals. 528 These are made visible to non-reentrant scanners for convenience. */ 529 530 int yylex_destroy (void ); 531 532 int yyget_debug (void ); 533 534 void yyset_debug (int debug_flag ); 535 536 YY_EXTRA_TYPE yyget_extra (void ); 537 538 void yyset_extra (YY_EXTRA_TYPE user_defined ); 539 540 FILE *yyget_in (void ); 541 542 void yyset_in (FILE * in_str ); 543 544 FILE *yyget_out (void ); 545 546 void yyset_out (FILE * out_str ); 547 548 yy_size_t yyget_leng (void ); 549 550 char *yyget_text (void ); 551 552 int yyget_lineno (void ); 553 554 void yyset_lineno (int line_number ); 422 #define YY_NO_UNPUT 1 423 #line 424 "slc-lex.c" 555 424 556 425 /* Macros after this point can all be overridden by user definitions in … … 560 429 #ifndef YY_SKIP_YYWRAP 561 430 #ifdef __cplusplus 562 extern "C" int yywrap (void ); 563 #else 564 extern int yywrap (void ); 565 #endif 431 extern "C" int yywrap YY_PROTO(( void )); 432 #else 433 extern int yywrap YY_PROTO(( void )); 434 #endif 435 #endif 436 437 #ifndef YY_NO_UNPUT 438 static void yyunput YY_PROTO(( int c, char *buf_ptr )); 566 439 #endif 567 440 568 441 #ifndef yytext_ptr 569 static void yy_flex_strncpy (char *,yyconst char *,int);442 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 570 443 #endif 571 444 572 445 #ifdef YY_NEED_STRLEN 573 static int yy_flex_strlen (yyconst char *);446 static int yy_flex_strlen YY_PROTO(( yyconst char * )); 574 447 #endif 575 448 576 449 #ifndef YY_NO_INPUT 577 578 450 #ifdef __cplusplus 579 static int yyinput (void ); 580 #else 581 static int input (void ); 582 #endif 583 451 static int yyinput YY_PROTO(( void )); 452 #else 453 static int input YY_PROTO(( void )); 454 #endif 455 #endif 456 457 #if YY_STACK_USED 458 static int yy_start_stack_ptr = 0; 459 static int yy_start_stack_depth = 0; 460 static int *yy_start_stack = 0; 461 #ifndef YY_NO_PUSH_STATE 462 static void yy_push_state YY_PROTO(( int new_state )); 463 #endif 464 #ifndef YY_NO_POP_STATE 465 static void yy_pop_state YY_PROTO(( void )); 466 #endif 467 #ifndef YY_NO_TOP_STATE 468 static int yy_top_state YY_PROTO(( void )); 469 #endif 470 471 #else 472 #define YY_NO_PUSH_STATE 1 473 #define YY_NO_POP_STATE 1 474 #define YY_NO_TOP_STATE 1 475 #endif 476 477 #ifdef YY_MALLOC_DECL 478 YY_MALLOC_DECL 479 #else 480 #if __STDC__ 481 #ifndef __cplusplus 482 #include <stdlib.h> 483 #endif 484 #else 485 /* Just try to get by without declaring the routines. This will fail 486 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 487 * or sizeof(void*) != sizeof(int). 488 */ 489 #endif 584 490 #endif 585 491 … … 590 496 591 497 /* Copy whatever the last rule matched to the standard output. */ 498 592 499 #ifndef ECHO 593 500 /* This used to be an fputs(), but since the string might contain NUL's, 594 501 * we now use fwrite(). 595 502 */ 596 #define ECHO fwrite( yytext, yyleng, 1, yyout )503 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 597 504 #endif 598 505 … … 602 509 #ifndef YY_INPUT 603 510 #define YY_INPUT(buf,result,max_size) \ 604 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \511 if ( yy_current_buffer->yy_is_interactive ) \ 605 512 { \ 606 int c = '*'; \ 607 yy_size_t n; \ 513 int c = '*', n; \ 608 514 for ( n = 0; n < max_size && \ 609 515 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ … … 615 521 result = n; \ 616 522 } \ 617 else \ 618 { \ 619 errno=0; \ 620 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 621 { \ 622 if( errno != EINTR) \ 623 { \ 624 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 625 break; \ 626 } \ 627 errno=0; \ 628 clearerr(yyin); \ 629 } \ 630 }\ 631 \ 632 523 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 524 && ferror( yyin ) ) \ 525 YY_FATAL_ERROR( "input in flex scanner failed" ); 633 526 #endif 634 527 … … 651 544 #endif 652 545 653 /* end tables serialization structures and prototypes */654 655 546 /* Default declaration of generated scanner - a define so the user can 656 547 * easily add parameters. 657 548 */ 658 549 #ifndef YY_DECL 659 #define YY_DECL_IS_OURS 1 660 661 extern int yylex (void); 662 663 #define YY_DECL int yylex (void) 664 #endif /* !YY_DECL */ 550 #define YY_DECL int yylex YY_PROTO(( void )) 551 #endif 665 552 666 553 /* Code executed at the beginning of each rule, after yytext and yyleng … … 679 566 YY_USER_ACTION 680 567 681 /** The main scanner function which does all the work.682 */683 568 YY_DECL 684 {569 { 685 570 register yy_state_type yy_current_state; 686 571 register char *yy_cp, *yy_bp; 687 572 register int yy_act; 688 573 689 574 #line 58 "slc-lex.l" 690 575 691 #line 692"slc-lex.c"692 693 if ( !(yy_init))576 #line 577 "slc-lex.c" 577 578 if ( yy_init ) 694 579 { 695 (yy_init) = 1;580 yy_init = 0; 696 581 697 582 #ifdef YY_USER_INIT … … 699 584 #endif 700 585 701 if ( ! (yy_start))702 (yy_start)= 1; /* first start state */586 if ( ! yy_start ) 587 yy_start = 1; /* first start state */ 703 588 704 589 if ( ! yyin ) … … 708 593 yyout = stdout; 709 594 710 if ( ! YY_CURRENT_BUFFER ) { 711 yyensure_buffer_stack (); 712 YY_CURRENT_BUFFER_LVALUE = 713 yy_create_buffer(yyin,YY_BUF_SIZE ); 714 } 715 716 yy_load_buffer_state( ); 595 if ( ! yy_current_buffer ) 596 yy_current_buffer = 597 yy_create_buffer( yyin, YY_BUF_SIZE ); 598 599 yy_load_buffer_state(); 717 600 } 718 601 719 602 while ( 1 ) /* loops until end-of-file is reached */ 720 603 { 721 yy_cp = (yy_c_buf_p);604 yy_cp = yy_c_buf_p; 722 605 723 606 /* Support of yytext. */ 724 *yy_cp = (yy_hold_char);607 *yy_cp = yy_hold_char; 725 608 726 609 /* yy_bp points to the position in yy_ch_buf of the start of … … 729 612 yy_bp = yy_cp; 730 613 731 yy_current_state = (yy_start);614 yy_current_state = yy_start; 732 615 yy_match: 733 616 do … … 736 619 if ( yy_accept[yy_current_state] ) 737 620 { 738 (yy_last_accepting_state)= yy_current_state;739 (yy_last_accepting_cpos)= yy_cp;621 yy_last_accepting_state = yy_current_state; 622 yy_last_accepting_cpos = yy_cp; 740 623 } 741 624 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 754 637 if ( yy_act == 0 ) 755 638 { /* have to back up */ 756 yy_cp = (yy_last_accepting_cpos);757 yy_current_state = (yy_last_accepting_state);639 yy_cp = yy_last_accepting_cpos; 640 yy_current_state = yy_last_accepting_state; 758 641 yy_act = yy_accept[yy_current_state]; 759 642 } … … 761 644 YY_DO_BEFORE_ACTION; 762 645 646 763 647 do_action: /* This label is used only to access EOF actions. */ 648 764 649 765 650 switch ( yy_act ) … … 767 652 case 0: /* must back up */ 768 653 /* undo the effects of YY_DO_BEFORE_ACTION */ 769 *yy_cp = (yy_hold_char);770 yy_cp = (yy_last_accepting_cpos);771 yy_current_state = (yy_last_accepting_state);654 *yy_cp = yy_hold_char; 655 yy_cp = yy_last_accepting_cpos; 656 yy_current_state = yy_last_accepting_state; 772 657 goto yy_find_action; 773 658 … … 786 671 YY_BREAK 787 672 case 3: 788 /* rule 3 can match eol */789 673 YY_RULE_SETUP 790 674 #line 64 "slc-lex.l" … … 811 695 ECHO; 812 696 YY_BREAK 813 #line 814"slc-lex.c"697 #line 698 "slc-lex.c" 814 698 case YY_STATE_EOF(INITIAL): 815 699 yyterminate(); … … 818 702 { 819 703 /* Amount of text matched not including the EOB char. */ 820 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;704 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 821 705 822 706 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 823 *yy_cp = (yy_hold_char);707 *yy_cp = yy_hold_char; 824 708 YY_RESTORE_YY_MORE_OFFSET 825 709 826 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )710 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 827 711 { 828 712 /* We're scanning a new file or input source. It's … … 830 714 * just pointed yyin at a new source and called 831 715 * yylex(). If so, then we have to assure 832 * consistency between YY_CURRENT_BUFFERand our716 * consistency between yy_current_buffer and our 833 717 * globals. Here is the right place to do so, because 834 718 * this is the first action (other than possibly a 835 719 * back-up) that will match for the new input source. 836 720 */ 837 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;838 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;839 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;721 yy_n_chars = yy_current_buffer->yy_n_chars; 722 yy_current_buffer->yy_input_file = yyin; 723 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 840 724 } 841 725 … … 847 731 * in input(). 848 732 */ 849 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )733 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 850 734 { /* This was really a NUL. */ 851 735 yy_state_type yy_next_state; 852 736 853 (yy_c_buf_p) = (yytext_ptr)+ yy_amount_of_matched_text;854 855 yy_current_state = yy_get_previous_state( 737 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 738 739 yy_current_state = yy_get_previous_state(); 856 740 857 741 /* Okay, we're now positioned to make the NUL … … 866 750 yy_next_state = yy_try_NUL_trans( yy_current_state ); 867 751 868 yy_bp = (yytext_ptr)+ YY_MORE_ADJ;752 yy_bp = yytext_ptr + YY_MORE_ADJ; 869 753 870 754 if ( yy_next_state ) 871 755 { 872 756 /* Consume the NUL. */ 873 yy_cp = ++ (yy_c_buf_p);757 yy_cp = ++yy_c_buf_p; 874 758 yy_current_state = yy_next_state; 875 759 goto yy_match; … … 878 762 else 879 763 { 880 yy_cp = (yy_c_buf_p);764 yy_cp = yy_c_buf_p; 881 765 goto yy_find_action; 882 766 } 883 767 } 884 768 885 else switch ( yy_get_next_buffer( 769 else switch ( yy_get_next_buffer() ) 886 770 { 887 771 case EOB_ACT_END_OF_FILE: 888 772 { 889 (yy_did_buffer_switch_on_eof)= 0;890 891 if ( yywrap( 773 yy_did_buffer_switch_on_eof = 0; 774 775 if ( yywrap() ) 892 776 { 893 777 /* Note: because we've taken care in … … 900 784 * YY_NULL will get returned. 901 785 */ 902 (yy_c_buf_p) = (yytext_ptr)+ YY_MORE_ADJ;786 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 903 787 904 788 yy_act = YY_STATE_EOF(YY_START); … … 908 792 else 909 793 { 910 if ( ! (yy_did_buffer_switch_on_eof))794 if ( ! yy_did_buffer_switch_on_eof ) 911 795 YY_NEW_FILE; 912 796 } … … 915 799 916 800 case EOB_ACT_CONTINUE_SCAN: 917 (yy_c_buf_p)=918 (yytext_ptr)+ yy_amount_of_matched_text;919 920 yy_current_state = yy_get_previous_state( 921 922 yy_cp = (yy_c_buf_p);923 yy_bp = (yytext_ptr)+ YY_MORE_ADJ;801 yy_c_buf_p = 802 yytext_ptr + yy_amount_of_matched_text; 803 804 yy_current_state = yy_get_previous_state(); 805 806 yy_cp = yy_c_buf_p; 807 yy_bp = yytext_ptr + YY_MORE_ADJ; 924 808 goto yy_match; 925 809 926 810 case EOB_ACT_LAST_MATCH: 927 (yy_c_buf_p)=928 & YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];929 930 yy_current_state = yy_get_previous_state( 931 932 yy_cp = (yy_c_buf_p);933 yy_bp = (yytext_ptr)+ YY_MORE_ADJ;811 yy_c_buf_p = 812 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 813 814 yy_current_state = yy_get_previous_state(); 815 816 yy_cp = yy_c_buf_p; 817 yy_bp = yytext_ptr + YY_MORE_ADJ; 934 818 goto yy_find_action; 935 819 } … … 942 826 } /* end of action switch */ 943 827 } /* end of scanning one token */ 944 } /* end of yylex */ 828 } /* end of yylex */ 829 945 830 946 831 /* yy_get_next_buffer - try to read in a new buffer … … 951 836 * EOB_ACT_END_OF_FILE - end of file 952 837 */ 953 static int yy_get_next_buffer (void) 954 { 955 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 956 register char *source = (yytext_ptr); 838 839 static int yy_get_next_buffer() 840 { 841 register char *dest = yy_current_buffer->yy_ch_buf; 842 register char *source = yytext_ptr; 957 843 register int number_to_move, i; 958 844 int ret_val; 959 845 960 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)+ 1] )846 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 961 847 YY_FATAL_ERROR( 962 848 "fatal flex scanner internal error--end of buffer missed" ); 963 849 964 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )850 if ( yy_current_buffer->yy_fill_buffer == 0 ) 965 851 { /* Don't try to fill the buffer, so this is an EOF. */ 966 if ( (yy_c_buf_p) - (yytext_ptr)- YY_MORE_ADJ == 1 )852 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 967 853 { 968 854 /* We matched a single character, the EOB, so … … 984 870 985 871 /* First move last chars to start of buffer. */ 986 number_to_move = (int) ( (yy_c_buf_p) - (yytext_ptr)) - 1;872 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 987 873 988 874 for ( i = 0; i < number_to_move; ++i ) 989 875 *(dest++) = *(source++); 990 876 991 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )877 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 992 878 /* don't do the read, it's not guaranteed to return an EOF, 993 879 * just force an EOF 994 880 */ 995 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars)= 0;881 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 996 882 997 883 else 998 884 { 999 yy_size_t num_to_read =1000 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;885 int num_to_read = 886 yy_current_buffer->yy_buf_size - number_to_move - 1; 1001 887 1002 888 while ( num_to_read <= 0 ) 1003 889 { /* Not enough room in the buffer - grow it. */ 890 #ifdef YY_USES_REJECT 891 YY_FATAL_ERROR( 892 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 893 #else 1004 894 1005 895 /* just a shorter name for the current buffer */ 1006 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;896 YY_BUFFER_STATE b = yy_current_buffer; 1007 897 1008 898 int yy_c_buf_p_offset = 1009 (int) ( (yy_c_buf_p)- b->yy_ch_buf);899 (int) (yy_c_buf_p - b->yy_ch_buf); 1010 900 1011 901 if ( b->yy_is_our_buffer ) 1012 902 { 1013 yy_size_t new_size = b->yy_buf_size * 2;903 int new_size = b->yy_buf_size * 2; 1014 904 1015 905 if ( new_size <= 0 ) … … 1020 910 b->yy_ch_buf = (char *) 1021 911 /* Include room in for 2 EOB chars. */ 1022 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 912 yy_flex_realloc( (void *) b->yy_ch_buf, 913 b->yy_buf_size + 2 ); 1023 914 } 1024 915 else … … 1030 921 "fatal error - scanner input buffer overflow" ); 1031 922 1032 (yy_c_buf_p)= &b->yy_ch_buf[yy_c_buf_p_offset];1033 1034 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -923 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 924 925 num_to_read = yy_current_buffer->yy_buf_size - 1035 926 number_to_move - 1; 1036 927 #endif 1037 928 } 1038 929 … … 1041 932 1042 933 /* Read in more data. */ 1043 YY_INPUT( (& YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),1044 (yy_n_chars), num_to_read );1045 1046 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);934 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 935 yy_n_chars, num_to_read ); 936 937 yy_current_buffer->yy_n_chars = yy_n_chars; 1047 938 } 1048 939 1049 if ( (yy_n_chars)== 0 )940 if ( yy_n_chars == 0 ) 1050 941 { 1051 942 if ( number_to_move == YY_MORE_ADJ ) 1052 943 { 1053 944 ret_val = EOB_ACT_END_OF_FILE; 1054 yyrestart( yyin);945 yyrestart( yyin ); 1055 946 } 1056 947 … … 1058 949 { 1059 950 ret_val = EOB_ACT_LAST_MATCH; 1060 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =951 yy_current_buffer->yy_buffer_status = 1061 952 YY_BUFFER_EOF_PENDING; 1062 953 } … … 1066 957 ret_val = EOB_ACT_CONTINUE_SCAN; 1067 958 1068 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1069 /* Extend the array by 50%, plus the number we really need. */ 1070 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1071 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 1072 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1073 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1074 } 1075 1076 (yy_n_chars) += number_to_move; 1077 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1078 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1079 1080 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 959 yy_n_chars += number_to_move; 960 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 961 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 962 963 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1081 964 1082 965 return ret_val; 1083 } 966 } 967 1084 968 1085 969 /* yy_get_previous_state - get the state just before the EOB char was reached */ 1086 970 1087 static yy_state_type yy_get_previous_state (void)1088 {971 static yy_state_type yy_get_previous_state() 972 { 1089 973 register yy_state_type yy_current_state; 1090 974 register char *yy_cp; 1091 1092 yy_current_state = (yy_start);1093 1094 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )975 976 yy_current_state = yy_start; 977 978 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1095 979 { 1096 980 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1097 981 if ( yy_accept[yy_current_state] ) 1098 982 { 1099 (yy_last_accepting_state)= yy_current_state;1100 (yy_last_accepting_cpos)= yy_cp;983 yy_last_accepting_state = yy_current_state; 984 yy_last_accepting_cpos = yy_cp; 1101 985 } 1102 986 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 1110 994 1111 995 return yy_current_state; 1112 } 996 } 997 1113 998 1114 999 /* yy_try_NUL_trans - try to make a transition on the NUL character … … 1117 1002 * next_state = yy_try_NUL_trans( current_state ); 1118 1003 */ 1119 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1120 { 1004 1005 #ifdef YY_USE_PROTOS 1006 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1007 #else 1008 static yy_state_type yy_try_NUL_trans( yy_current_state ) 1009 yy_state_type yy_current_state; 1010 #endif 1011 { 1121 1012 register int yy_is_jam; 1122 register char *yy_cp = (yy_c_buf_p);1013 register char *yy_cp = yy_c_buf_p; 1123 1014 1124 1015 register YY_CHAR yy_c = 1; 1125 1016 if ( yy_accept[yy_current_state] ) 1126 1017 { 1127 (yy_last_accepting_state)= yy_current_state;1128 (yy_last_accepting_cpos)= yy_cp;1018 yy_last_accepting_state = yy_current_state; 1019 yy_last_accepting_cpos = yy_cp; 1129 1020 } 1130 1021 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) … … 1138 1029 1139 1030 return yy_is_jam ? 0 : yy_current_state; 1140 } 1141 1142 #ifndef YY_NO_INPUT 1031 } 1032 1033 1034 #ifndef YY_NO_UNPUT 1035 #ifdef YY_USE_PROTOS 1036 static void yyunput( int c, register char *yy_bp ) 1037 #else 1038 static void yyunput( c, yy_bp ) 1039 int c; 1040 register char *yy_bp; 1041 #endif 1042 { 1043 register char *yy_cp = yy_c_buf_p; 1044 1045 /* undo effects of setting up yytext */ 1046 *yy_cp = yy_hold_char; 1047 1048 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1049 { /* need to shift things up to make room */ 1050 /* +2 for EOB chars. */ 1051 register int number_to_move = yy_n_chars + 2; 1052 register char *dest = &yy_current_buffer->yy_ch_buf[ 1053 yy_current_buffer->yy_buf_size + 2]; 1054 register char *source = 1055 &yy_current_buffer->yy_ch_buf[number_to_move]; 1056 1057 while ( source > yy_current_buffer->yy_ch_buf ) 1058 *--dest = *--source; 1059 1060 yy_cp += (int) (dest - source); 1061 yy_bp += (int) (dest - source); 1062 yy_current_buffer->yy_n_chars = 1063 yy_n_chars = yy_current_buffer->yy_buf_size; 1064 1065 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1066 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1067 } 1068 1069 *--yy_cp = (char) c; 1070 1071 1072 yytext_ptr = yy_bp; 1073 yy_hold_char = *yy_cp; 1074 yy_c_buf_p = yy_cp; 1075 } 1076 #endif /* ifndef YY_NO_UNPUT */ 1077 1078 1143 1079 #ifdef __cplusplus 1144 static int yyinput (void) 1145 #else 1146 static int input (void) 1147 #endif 1148 1149 { 1080 static int yyinput() 1081 #else 1082 static int input() 1083 #endif 1084 { 1150 1085 int c; 1151 1152 * (yy_c_buf_p) = (yy_hold_char);1153 1154 if ( * (yy_c_buf_p)== YY_END_OF_BUFFER_CHAR )1086 1087 *yy_c_buf_p = yy_hold_char; 1088 1089 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1155 1090 { 1156 1091 /* yy_c_buf_p now points to the character we want to return. … … 1158 1093 * valid NUL; if not, then we've hit the end of the buffer. 1159 1094 */ 1160 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )1095 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1161 1096 /* This was really a NUL. */ 1162 * (yy_c_buf_p)= '\0';1097 *yy_c_buf_p = '\0'; 1163 1098 1164 1099 else 1165 1100 { /* need more input */ 1166 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);1167 ++ (yy_c_buf_p);1168 1169 switch ( yy_get_next_buffer( 1101 int offset = yy_c_buf_p - yytext_ptr; 1102 ++yy_c_buf_p; 1103 1104 switch ( yy_get_next_buffer() ) 1170 1105 { 1171 1106 case EOB_ACT_LAST_MATCH: … … 1181 1116 1182 1117 /* Reset buffer status. */ 1183 yyrestart( yyin );1184 1185 /* FALLTHROUGH*/1118 yyrestart( yyin ); 1119 1120 /* fall through */ 1186 1121 1187 1122 case EOB_ACT_END_OF_FILE: 1188 1123 { 1189 if ( yywrap( 1190 return 0;1191 1192 if ( ! (yy_did_buffer_switch_on_eof))1124 if ( yywrap() ) 1125 return EOF; 1126 1127 if ( ! yy_did_buffer_switch_on_eof ) 1193 1128 YY_NEW_FILE; 1194 1129 #ifdef __cplusplus … … 1200 1135 1201 1136 case EOB_ACT_CONTINUE_SCAN: 1202 (yy_c_buf_p) = (yytext_ptr)+ offset;1137 yy_c_buf_p = yytext_ptr + offset; 1203 1138 break; 1204 1139 } … … 1206 1141 } 1207 1142 1208 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1209 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1210 (yy_hold_char) = *++(yy_c_buf_p); 1143 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1144 *yy_c_buf_p = '\0'; /* preserve yytext */ 1145 yy_hold_char = *++yy_c_buf_p; 1146 1211 1147 1212 1148 return c; 1213 } 1214 #endif /* ifndef YY_NO_INPUT */ 1215 1216 /** Immediately switch to a different input stream. 1217 * @param input_file A readable stream. 1218 * 1219 * @note This function does not reset the start condition to @c INITIAL . 1220 */ 1221 void yyrestart (FILE * input_file ) 1222 { 1223 1224 if ( ! YY_CURRENT_BUFFER ){ 1225 yyensure_buffer_stack (); 1226 YY_CURRENT_BUFFER_LVALUE = 1227 yy_create_buffer(yyin,YY_BUF_SIZE ); 1228 } 1229 1230 yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 1231 yy_load_buffer_state( ); 1232 } 1233 1234 /** Switch to a different input buffer. 1235 * @param new_buffer The new input buffer. 1236 * 1237 */ 1238 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1239 { 1240 1241 /* TODO. We should be able to replace this entire function body 1242 * with 1243 * yypop_buffer_state(); 1244 * yypush_buffer_state(new_buffer); 1245 */ 1246 yyensure_buffer_stack (); 1247 if ( YY_CURRENT_BUFFER == new_buffer ) 1149 } 1150 1151 1152 #ifdef YY_USE_PROTOS 1153 void yyrestart( FILE *input_file ) 1154 #else 1155 void yyrestart( input_file ) 1156 FILE *input_file; 1157 #endif 1158 { 1159 if ( ! yy_current_buffer ) 1160 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1161 1162 yy_init_buffer( yy_current_buffer, input_file ); 1163 yy_load_buffer_state(); 1164 } 1165 1166 1167 #ifdef YY_USE_PROTOS 1168 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1169 #else 1170 void yy_switch_to_buffer( new_buffer ) 1171 YY_BUFFER_STATE new_buffer; 1172 #endif 1173 { 1174 if ( yy_current_buffer == new_buffer ) 1248 1175 return; 1249 1176 1250 if ( YY_CURRENT_BUFFER)1177 if ( yy_current_buffer ) 1251 1178 { 1252 1179 /* Flush out information for old buffer. */ 1253 * (yy_c_buf_p) = (yy_hold_char);1254 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);1255 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);1180 *yy_c_buf_p = yy_hold_char; 1181 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1182 yy_current_buffer->yy_n_chars = yy_n_chars; 1256 1183 } 1257 1184 1258 YY_CURRENT_BUFFER_LVALUE= new_buffer;1259 yy_load_buffer_state( 1185 yy_current_buffer = new_buffer; 1186 yy_load_buffer_state(); 1260 1187 1261 1188 /* We don't actually know whether we did this switch during … … 1264 1191 * to go ahead and always set it. 1265 1192 */ 1266 (yy_did_buffer_switch_on_eof) = 1; 1267 } 1268 1269 static void yy_load_buffer_state (void) 1270 { 1271 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1272 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1273 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1274 (yy_hold_char) = *(yy_c_buf_p); 1275 } 1276 1277 /** Allocate and initialize an input buffer state. 1278 * @param file A readable stream. 1279 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1280 * 1281 * @return the allocated buffer state. 1282 */ 1283 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1284 { 1193 yy_did_buffer_switch_on_eof = 1; 1194 } 1195 1196 1197 #ifdef YY_USE_PROTOS 1198 void yy_load_buffer_state( void ) 1199 #else 1200 void yy_load_buffer_state() 1201 #endif 1202 { 1203 yy_n_chars = yy_current_buffer->yy_n_chars; 1204 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 1205 yyin = yy_current_buffer->yy_input_file; 1206 yy_hold_char = *yy_c_buf_p; 1207 } 1208 1209 1210 #ifdef YY_USE_PROTOS 1211 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1212 #else 1213 YY_BUFFER_STATE yy_create_buffer( file, size ) 1214 FILE *file; 1215 int size; 1216 #endif 1217 { 1285 1218 YY_BUFFER_STATE b; 1286 1287 b = (YY_BUFFER_STATE) yy alloc(sizeof( struct yy_buffer_state ));1219 1220 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1288 1221 if ( ! b ) 1289 1222 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); … … 1294 1227 * we need to put in 2 end-of-buffer characters. 1295 1228 */ 1296 b->yy_ch_buf = (char *) yy alloc(b->yy_buf_size + 2);1229 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 1297 1230 if ( ! b->yy_ch_buf ) 1298 1231 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); … … 1300 1233 b->yy_is_our_buffer = 1; 1301 1234 1302 yy_init_buffer( b,file );1235 yy_init_buffer( b, file ); 1303 1236 1304 1237 return b; 1305 } 1306 1307 /** Destroy the buffer. 1308 * @param b a buffer created with yy_create_buffer() 1309 * 1310 */ 1311 void yy_delete_buffer (YY_BUFFER_STATE b ) 1312 { 1313 1238 } 1239 1240 1241 #ifdef YY_USE_PROTOS 1242 void yy_delete_buffer( YY_BUFFER_STATE b ) 1243 #else 1244 void yy_delete_buffer( b ) 1245 YY_BUFFER_STATE b; 1246 #endif 1247 { 1314 1248 if ( ! b ) 1315 1249 return; 1316 1250 1317 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */1318 YY_CURRENT_BUFFER_LVALUE= (YY_BUFFER_STATE) 0;1251 if ( b == yy_current_buffer ) 1252 yy_current_buffer = (YY_BUFFER_STATE) 0; 1319 1253 1320 1254 if ( b->yy_is_our_buffer ) 1321 yyfree((void *) b->yy_ch_buf ); 1322 1323 yyfree((void *) b ); 1324 } 1325 1326 #ifndef __cplusplus 1327 extern int isatty (int ); 1328 #endif /* __cplusplus */ 1329 1330 /* Initializes or reinitializes a buffer. 1331 * This function is sometimes called more than once on the same buffer, 1332 * such as during a yyrestart() or at EOF. 1333 */ 1334 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1335 1336 { 1337 int oerrno = errno; 1338 1339 yy_flush_buffer(b ); 1255 yy_flex_free( (void *) b->yy_ch_buf ); 1256 1257 yy_flex_free( (void *) b ); 1258 } 1259 1260 1261 #ifndef YY_ALWAYS_INTERACTIVE 1262 #ifndef YY_NEVER_INTERACTIVE 1263 extern int isatty YY_PROTO(( int )); 1264 #endif 1265 #endif 1266 1267 #ifdef YY_USE_PROTOS 1268 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 1269 #else 1270 void yy_init_buffer( b, file ) 1271 YY_BUFFER_STATE b; 1272 FILE *file; 1273 #endif 1274 1275 1276 { 1277 yy_flush_buffer( b ); 1340 1278 1341 1279 b->yy_input_file = file; 1342 1280 b->yy_fill_buffer = 1; 1343 1281 1344 /* If b is the current buffer, then yy_init_buffer was _probably_ 1345 * called from yyrestart() or through yy_get_next_buffer. 1346 * In that case, we don't want to reset the lineno or column. 1347 */ 1348 if (b != YY_CURRENT_BUFFER){ 1349 b->yy_bs_lineno = 1; 1350 b->yy_bs_column =0;1351 } 1352 1353 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1354 1355 errno = oerrno; 1356 } 1357 1358 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1359 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1360 * 1361 */ 1362 void yy_flush_buffer (YY_BUFFER_STATE b ) 1363 {1364 1282 #if YY_ALWAYS_INTERACTIVE 1283 b->yy_is_interactive = 1; 1284 #else 1285 #if YY_NEVER_INTERACTIVE 1286 b->yy_is_interactive = 0; 1287 #else 1288 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1289 #endif 1290 #endif 1291 } 1292 1293 1294 #ifdef YY_USE_PROTOS 1295 void yy_flush_buffer( YY_BUFFER_STATE b ) 1296 #else 1297 void yy_flush_buffer( b ) 1298 YY_BUFFER_STATE b; 1299 #endif 1300 1301 { 1302 if ( ! b ) 1365 1303 return; 1366 1304 … … 1379 1317 b->yy_buffer_status = YY_BUFFER_NEW; 1380 1318 1381 if ( b == YY_CURRENT_BUFFER ) 1382 yy_load_buffer_state( ); 1383 } 1384 1385 /** Pushes the new state onto the stack. The new state becomes 1386 * the current state. This function will allocate the stack 1387 * if necessary. 1388 * @param new_buffer The new state. 1389 * 1390 */ 1391 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1392 { 1393 if (new_buffer == NULL) 1394 return; 1395 1396 yyensure_buffer_stack(); 1397 1398 /* This block is copied from yy_switch_to_buffer. */ 1399 if ( YY_CURRENT_BUFFER ) 1400 { 1401 /* Flush out information for old buffer. */ 1402 *(yy_c_buf_p) = (yy_hold_char); 1403 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1404 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1405 } 1406 1407 /* Only push if top exists. Otherwise, replace top. */ 1408 if (YY_CURRENT_BUFFER) 1409 (yy_buffer_stack_top)++; 1410 YY_CURRENT_BUFFER_LVALUE = new_buffer; 1411 1412 /* copied from yy_switch_to_buffer. */ 1413 yy_load_buffer_state( ); 1414 (yy_did_buffer_switch_on_eof) = 1; 1415 } 1416 1417 /** Removes and deletes the top of the stack, if present. 1418 * The next element becomes the new top. 1419 * 1420 */ 1421 void yypop_buffer_state (void) 1422 { 1423 if (!YY_CURRENT_BUFFER) 1424 return; 1425 1426 yy_delete_buffer(YY_CURRENT_BUFFER ); 1427 YY_CURRENT_BUFFER_LVALUE = NULL; 1428 if ((yy_buffer_stack_top) > 0) 1429 --(yy_buffer_stack_top); 1430 1431 if (YY_CURRENT_BUFFER) { 1432 yy_load_buffer_state( ); 1433 (yy_did_buffer_switch_on_eof) = 1; 1434 } 1435 } 1436 1437 /* Allocates the stack if it does not exist. 1438 * Guarantees space for at least one push. 1439 */ 1440 static void yyensure_buffer_stack (void) 1441 { 1442 yy_size_t num_to_alloc; 1443 1444 if (!(yy_buffer_stack)) { 1445 1446 /* First allocation is just for 2 elements, since we don't know if this 1447 * scanner will even need a stack. We use 2 instead of 1 to avoid an 1448 * immediate realloc on the next call. 1449 */ 1450 num_to_alloc = 1; 1451 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1452 (num_to_alloc * sizeof(struct yy_buffer_state*) 1453 ); 1454 if ( ! (yy_buffer_stack) ) 1455 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1456 1457 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1458 1459 (yy_buffer_stack_max) = num_to_alloc; 1460 (yy_buffer_stack_top) = 0; 1461 return; 1462 } 1463 1464 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 1465 1466 /* Increase the buffer to prepare for a possible push. */ 1467 int grow_size = 8 /* arbitrary grow size */; 1468 1469 num_to_alloc = (yy_buffer_stack_max) + grow_size; 1470 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1471 ((yy_buffer_stack), 1472 num_to_alloc * sizeof(struct yy_buffer_state*) 1473 ); 1474 if ( ! (yy_buffer_stack) ) 1475 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1476 1477 /* zero only the new slots.*/ 1478 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1479 (yy_buffer_stack_max) = num_to_alloc; 1480 } 1481 } 1482 1483 /** Setup the input buffer state to scan directly from a user-specified character buffer. 1484 * @param base the character buffer 1485 * @param size the size in bytes of the character buffer 1486 * 1487 * @return the newly allocated buffer state object. 1488 */ 1489 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 1490 { 1319 if ( b == yy_current_buffer ) 1320 yy_load_buffer_state(); 1321 } 1322 1323 1324 #ifndef YY_NO_SCAN_BUFFER 1325 #ifdef YY_USE_PROTOS 1326 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 1327 #else 1328 YY_BUFFER_STATE yy_scan_buffer( base, size ) 1329 char *base; 1330 yy_size_t size; 1331 #endif 1332 { 1491 1333 YY_BUFFER_STATE b; 1492 1334 1493 1335 if ( size < 2 || 1494 1336 base[size-2] != YY_END_OF_BUFFER_CHAR || … … 1497 1339 return 0; 1498 1340 1499 b = (YY_BUFFER_STATE) yy alloc(sizeof( struct yy_buffer_state ));1341 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1500 1342 if ( ! b ) 1501 1343 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); … … 1511 1353 b->yy_buffer_status = YY_BUFFER_NEW; 1512 1354 1513 yy_switch_to_buffer( b);1355 yy_switch_to_buffer( b ); 1514 1356 1515 1357 return b; 1516 } 1517 1518 /** Setup the input buffer state to scan a string. The next call to yylex() will 1519 * scan from a @e copy of @a str. 1520 * @param yystr a NUL-terminated string to scan 1521 * 1522 * @return the newly allocated buffer state object. 1523 * @note If you want to scan bytes that may contain NUL values, then use 1524 * yy_scan_bytes() instead. 1525 */ 1526 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 1527 { 1528 1529 return yy_scan_bytes(yystr,strlen(yystr) ); 1530 } 1531 1532 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1533 * scan from a @e copy of @a bytes. 1534 * @param bytes the byte buffer to scan 1535 * @param len the number of bytes in the buffer pointed to by @a bytes. 1536 * 1537 * @return the newly allocated buffer state object. 1538 */ 1539 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) 1540 { 1358 } 1359 #endif 1360 1361 1362 #ifndef YY_NO_SCAN_STRING 1363 #ifdef YY_USE_PROTOS 1364 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 1365 #else 1366 YY_BUFFER_STATE yy_scan_string( yy_str ) 1367 yyconst char *yy_str; 1368 #endif 1369 { 1370 int len; 1371 for ( len = 0; yy_str[len]; ++len ) 1372 ; 1373 1374 return yy_scan_bytes( yy_str, len ); 1375 } 1376 #endif 1377 1378 1379 #ifndef YY_NO_SCAN_BYTES 1380 #ifdef YY_USE_PROTOS 1381 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 1382 #else 1383 YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 1384 yyconst char *bytes; 1385 int len; 1386 #endif 1387 { 1541 1388 YY_BUFFER_STATE b; 1542 1389 char *buf; 1543 yy_size_t n, i; 1544 1390 yy_size_t n; 1391 int i; 1392 1545 1393 /* Get memory for full buffer, including space for trailing EOB's. */ 1546 n = _yybytes_len + 2;1547 buf = (char *) yy alloc(n);1394 n = len + 2; 1395 buf = (char *) yy_flex_alloc( n ); 1548 1396 if ( ! buf ) 1549 1397 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1550 1398 1551 for ( i = 0; i < _yybytes_len; ++i )1552 buf[i] = yybytes[i];1553 1554 buf[ _yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;1555 1556 b = yy_scan_buffer( buf,n );1399 for ( i = 0; i < len; ++i ) 1400 buf[i] = bytes[i]; 1401 1402 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 1403 1404 b = yy_scan_buffer( buf, n ); 1557 1405 if ( ! b ) 1558 1406 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); … … 1564 1412 1565 1413 return b; 1566 } 1414 } 1415 #endif 1416 1417 1418 #ifndef YY_NO_PUSH_STATE 1419 #ifdef YY_USE_PROTOS 1420 static void yy_push_state( int new_state ) 1421 #else 1422 static void yy_push_state( new_state ) 1423 int new_state; 1424 #endif 1425 { 1426 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 1427 { 1428 yy_size_t new_size; 1429 1430 yy_start_stack_depth += YY_START_STACK_INCR; 1431 new_size = yy_start_stack_depth * sizeof( int ); 1432 1433 if ( ! yy_start_stack ) 1434 yy_start_stack = (int *) yy_flex_alloc( new_size ); 1435 1436 else 1437 yy_start_stack = (int *) yy_flex_realloc( 1438 (void *) yy_start_stack, new_size ); 1439 1440 if ( ! yy_start_stack ) 1441 YY_FATAL_ERROR( 1442 "out of memory expanding start-condition stack" ); 1443 } 1444 1445 yy_start_stack[yy_start_stack_ptr++] = YY_START; 1446 1447 BEGIN(new_state); 1448 } 1449 #endif 1450 1451 1452 #ifndef YY_NO_POP_STATE 1453 static void yy_pop_state() 1454 { 1455 if ( --yy_start_stack_ptr < 0 ) 1456 YY_FATAL_ERROR( "start-condition stack underflow" ); 1457 1458 BEGIN(yy_start_stack[yy_start_stack_ptr]); 1459 } 1460 #endif 1461 1462 1463 #ifndef YY_NO_TOP_STATE 1464 static int yy_top_state() 1465 { 1466 return yy_start_stack[yy_start_stack_ptr - 1]; 1467 } 1468 #endif 1567 1469 1568 1470 #ifndef YY_EXIT_FAILURE … … 1570 1472 #endif 1571 1473 1572 static void yy_fatal_error (yyconst char* msg ) 1573 { 1574 (void) fprintf( stderr, "%s\n", msg ); 1474 #ifdef YY_USE_PROTOS 1475 static void yy_fatal_error( yyconst char msg[] ) 1476 #else 1477 static void yy_fatal_error( msg ) 1478 char msg[]; 1479 #endif 1480 { 1481 (void) fprintf( stderr, "%s\n", msg ); 1575 1482 exit( YY_EXIT_FAILURE ); 1576 } 1483 } 1484 1485 1577 1486 1578 1487 /* Redefine yyless() so it works in section 3 code. */ … … 1583 1492 { \ 1584 1493 /* Undo effects of setting up yytext. */ \ 1585 int yyless_macro_arg = (n); \ 1586 YY_LESS_LINENO(yyless_macro_arg);\ 1587 yytext[yyleng] = (yy_hold_char); \ 1588 (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1589 (yy_hold_char) = *(yy_c_buf_p); \ 1590 *(yy_c_buf_p) = '\0'; \ 1591 yyleng = yyless_macro_arg; \ 1494 yytext[yyleng] = yy_hold_char; \ 1495 yy_c_buf_p = yytext + n; \ 1496 yy_hold_char = *yy_c_buf_p; \ 1497 *yy_c_buf_p = '\0'; \ 1498 yyleng = n; \ 1592 1499 } \ 1593 1500 while ( 0 ) 1594 1501 1595 /* Accessor methods (get/set functions) to struct members. */ 1596 1597 /** Get the current line number. 1598 * 1599 */ 1600 int yyget_lineno (void) 1601 { 1602 1603 return yylineno; 1604 } 1605 1606 /** Get the input stream. 1607 * 1608 */ 1609 FILE *yyget_in (void) 1610 { 1611 return yyin; 1612 } 1613 1614 /** Get the output stream. 1615 * 1616 */ 1617 FILE *yyget_out (void) 1618 { 1619 return yyout; 1620 } 1621 1622 /** Get the length of the current token. 1623 * 1624 */ 1625 yy_size_t yyget_leng (void) 1626 { 1627 return yyleng; 1628 } 1629 1630 /** Get the current token. 1631 * 1632 */ 1633 1634 char *yyget_text (void) 1635 { 1636 return yytext; 1637 } 1638 1639 /** Set the current line number. 1640 * @param line_number 1641 * 1642 */ 1643 void yyset_lineno (int line_number ) 1644 { 1645 1646 yylineno = line_number; 1647 } 1648 1649 /** Set the input stream. This does not discard the current 1650 * input buffer. 1651 * @param in_str A readable stream. 1652 * 1653 * @see yy_switch_to_buffer 1654 */ 1655 void yyset_in (FILE * in_str ) 1656 { 1657 yyin = in_str ; 1658 } 1659 1660 void yyset_out (FILE * out_str ) 1661 { 1662 yyout = out_str ; 1663 } 1664 1665 int yyget_debug (void) 1666 { 1667 return yy_flex_debug; 1668 } 1669 1670 void yyset_debug (int bdebug ) 1671 { 1672 yy_flex_debug = bdebug ; 1673 } 1674 1675 static int yy_init_globals (void) 1676 { 1677 /* Initialization is the same as for the non-reentrant scanner. 1678 * This function is called from yylex_destroy(), so don't allocate here. 1679 */ 1680 1681 (yy_buffer_stack) = 0; 1682 (yy_buffer_stack_top) = 0; 1683 (yy_buffer_stack_max) = 0; 1684 (yy_c_buf_p) = (char *) 0; 1685 (yy_init) = 0; 1686 (yy_start) = 0; 1687 1688 /* Defined in main.c */ 1689 #ifdef YY_STDINIT 1690 yyin = stdin; 1691 yyout = stdout; 1692 #else 1693 yyin = (FILE *) 0; 1694 yyout = (FILE *) 0; 1695 #endif 1696 1697 /* For future reference: Set errno on error, since we are called by 1698 * yylex_init() 1699 */ 1700 return 0; 1701 } 1702 1703 /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 1704 int yylex_destroy (void) 1705 { 1706 1707 /* Pop the buffer stack, destroying each element. */ 1708 while(YY_CURRENT_BUFFER){ 1709 yy_delete_buffer(YY_CURRENT_BUFFER ); 1710 YY_CURRENT_BUFFER_LVALUE = NULL; 1711 yypop_buffer_state(); 1712 } 1713 1714 /* Destroy the stack itself. */ 1715 yyfree((yy_buffer_stack) ); 1716 (yy_buffer_stack) = NULL; 1717 1718 /* Reset the globals. This is important in a non-reentrant scanner so the next time 1719 * yylex() is called, initialization will occur. */ 1720 yy_init_globals( ); 1721 1722 return 0; 1723 } 1724 1725 /* 1726 * Internal utility routines. 1727 */ 1502 1503 /* Internal utility routines. */ 1728 1504 1729 1505 #ifndef yytext_ptr 1730 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 1731 { 1506 #ifdef YY_USE_PROTOS 1507 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 1508 #else 1509 static void yy_flex_strncpy( s1, s2, n ) 1510 char *s1; 1511 yyconst char *s2; 1512 int n; 1513 #endif 1514 { 1732 1515 register int i; 1733 1516 for ( i = 0; i < n; ++i ) 1734 1517 s1[i] = s2[i]; 1735 }1518 } 1736 1519 #endif 1737 1520 1738 1521 #ifdef YY_NEED_STRLEN 1739 static int yy_flex_strlen (yyconst char * s ) 1740 { 1522 #ifdef YY_USE_PROTOS 1523 static int yy_flex_strlen( yyconst char *s ) 1524 #else 1525 static int yy_flex_strlen( s ) 1526 yyconst char *s; 1527 #endif 1528 { 1741 1529 register int n; 1742 1530 for ( n = 0; s[n]; ++n ) … … 1744 1532 1745 1533 return n; 1746 } 1747 #endif 1748 1749 void *yyalloc (yy_size_t size ) 1750 { 1534 } 1535 #endif 1536 1537 1538 #ifdef YY_USE_PROTOS 1539 static void *yy_flex_alloc( yy_size_t size ) 1540 #else 1541 static void *yy_flex_alloc( size ) 1542 yy_size_t size; 1543 #endif 1544 { 1751 1545 return (void *) malloc( size ); 1752 } 1753 1754 void *yyrealloc (void * ptr, yy_size_t size ) 1755 { 1546 } 1547 1548 #ifdef YY_USE_PROTOS 1549 static void *yy_flex_realloc( void *ptr, yy_size_t size ) 1550 #else 1551 static void *yy_flex_realloc( ptr, size ) 1552 void *ptr; 1553 yy_size_t size; 1554 #endif 1555 { 1756 1556 /* The cast to (char *) in the following accommodates both 1757 1557 * implementations that use char* generic pointers, and those … … 1762 1562 */ 1763 1563 return (void *) realloc( (char *) ptr, size ); 1764 } 1765 1766 void yyfree (void * ptr ) 1767 { 1768 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 1769 } 1770 1771 #define YYTABLES_NAME "yytables" 1772 1564 } 1565 1566 #ifdef YY_USE_PROTOS 1567 static void yy_flex_free( void *ptr ) 1568 #else 1569 static void yy_flex_free( ptr ) 1570 void *ptr; 1571 #endif 1572 { 1573 free( ptr ); 1574 } 1575 1576 #if YY_MAIN 1577 int main() 1578 { 1579 yylex(); 1580 return 0; 1581 } 1582 #endif 1773 1583 #line 68 "slc-lex.l" 1774 1775 1584 1776 1585 … … 1866 1675 return 1; 1867 1676 } 1868
Note:
See TracChangeset
for help on using the changeset viewer.