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