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 */ 6 7#define FLEX_SCANNER 8#define YY_FLEX_MAJOR_VERSION 2 9#define YY_FLEX_MINOR_VERSION 5 10 11#include <stdio.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 24#include <stdlib.h> 25#include <unistd.h> 26 27/* Use prototypes in function declarations. */ 28#define YY_USE_PROTOS 29 30/* The "const" storage-class-modifier is valid. */ 31#define YY_USE_CONST 32 33#else /* ! __cplusplus */ 34 35#if __STDC__ 36 37#define YY_USE_PROTOS 38#define YY_USE_CONST 39 40#endif /* __STDC__ */ 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 51 52#ifdef YY_USE_CONST 53#define yyconst const 54#else 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) () 63#endif 64 65/* Returned upon end-of-file. */ 66#define YY_NULL 0 67 68/* Promotes a possibly negative, possibly signed char to an unsigned 69 * integer for use as an array index. If the signed char is negative, 70 * we want to instead treat it as an 8-bit unsigned char, hence the 71 * double cast. 72 */ 73#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 74 75/* Enter a start condition. This macro really ought to take a parameter, 76 * but we do it the disgusting crufty way forced on us by the ()-less 77 * definition of BEGIN. 78 */ 79#define BEGIN yy_start = 1 + 2 * 80 81/* Translate the current start state into a value that can be later handed 82 * to BEGIN to return to the state. The YYSTATE alias is for lex 83 * compatibility. 84 */ 85#define YY_START ((yy_start - 1) / 2) 86#define YYSTATE YY_START 87 88/* Action number for EOF rule of a given start state. */ 89#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 90 91/* Special action meaning "start processing a new file". */ 92#define YY_NEW_FILE yyrestart( yyin ) 93 94#define YY_END_OF_BUFFER_CHAR 0 95 96/* Size of default input buffer. */ 97#define YY_BUF_SIZE 16384 98 99typedef struct yy_buffer_state *YY_BUFFER_STATE; 100 101extern int yyleng; 102extern FILE *yyin, *yyout; 103 104#define EOB_ACT_CONTINUE_SCAN 0 105#define EOB_ACT_END_OF_FILE 1 106#define EOB_ACT_LAST_MATCH 2 107 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 124#define yyless(n) \ 125 do \ 126 { \ 127 /* Undo effects of setting up yytext. */ \ 128 *yy_cp = yy_hold_char; \ 129 YY_RESTORE_YY_MORE_OFFSET \ 130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 132 } \ 133 while ( 0 ) 134 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 */ 141typedef unsigned int yy_size_t; 142 143 144struct yy_buffer_state 145 { 146 FILE *yy_input_file; 147 148 char *yy_ch_buf; /* input buffer */ 149 char *yy_buf_pos; /* current position in input buffer */ 150 151 /* Size of input buffer in bytes, not including room for EOB 152 * characters. 153 */ 154 yy_size_t yy_buf_size; 155 156 /* Number of characters read into yy_ch_buf, not including EOB 157 * characters. 158 */ 159 int yy_n_chars; 160 161 /* Whether we "own" the buffer - i.e., we know we created it, 162 * and can realloc() it to grow it, and should free() it to 163 * delete it. 164 */ 165 int yy_is_our_buffer; 166 167 /* Whether this is an "interactive" input source; if so, and 168 * if we're using stdio for input, then we want to use getc() 169 * instead of fread(), to make sure we stop fetching input after 170 * each newline. 171 */ 172 int yy_is_interactive; 173 174 /* Whether we're considered to be at the beginning of a line. 175 * If so, '^' rules will be active on the next match, otherwise 176 * not. 177 */ 178 int yy_at_bol; 179 180 /* Whether to try to fill the input buffer when we reach the 181 * end of it. 182 */ 183 int yy_fill_buffer; 184 185 int yy_buffer_status; 186#define YY_BUFFER_NEW 0 187#define YY_BUFFER_NORMAL 1 188 /* When an EOF's been seen but there's still some text to process 189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 190 * shouldn't try reading from the input source any more. We might 191 * still have a bunch of tokens to match, though, because of 192 * possible backing-up. 193 * 194 * When we actually see the EOF, we change the status to "new" 195 * (via yyrestart()), so that the user can continue scanning by 196 * just pointing yyin at a new input file. 197 */ 198#define YY_BUFFER_EOF_PENDING 2 199 }; 200 201static YY_BUFFER_STATE yy_current_buffer = 0; 202 203/* We provide macros for accessing buffer states in case in the 204 * future we want to put the buffer states in a more general 205 * "scanner state". 206 */ 207#define YY_CURRENT_BUFFER yy_current_buffer 208 209 210/* yy_hold_char holds the character lost when yytext is formed. */ 211static char yy_hold_char; 212 213static int yy_n_chars; /* number of characters read into yy_ch_buf */ 214 215 216int yyleng; 217 218/* Points to current character in buffer. */ 219static char *yy_c_buf_p = (char *) 0; 220static int yy_init = 1; /* whether we need to initialize */ 221static int yy_start = 0; /* start state number */ 222 223/* Flag which is used to allow yywrap()'s to do buffer switches 224 * instead of setting up a fresh yyin. A bit of a hack ... 225 */ 226static int yy_did_buffer_switch_on_eof; 227 228void yyrestart YY_PROTO(( FILE *input_file )); 229 230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 231void yy_load_buffer_state YY_PROTO(( void )); 232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 237 238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 241 242static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 244static void yy_flex_free YY_PROTO(( void * )); 245 246#define yy_new_buffer yy_create_buffer 247 248#define yy_set_interactive(is_interactive) \ 249 { \ 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; \ 253 } 254 255#define yy_set_bol(at_bol) \ 256 { \ 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) 263 264typedef unsigned char YY_CHAR; 265FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 266typedef int yy_state_type; 267extern char *yytext; 268#define yytext_ptr yytext 269 270static yy_state_type yy_get_previous_state YY_PROTO(( void )); 271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 272static int yy_get_next_buffer YY_PROTO(( void )); 273static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 274 275/* Done after the current pattern has been matched and before the 276 * corresponding action - sets up yytext. 277 */ 278#define YY_DO_BEFORE_ACTION \ 279 yytext_ptr = yy_bp; \ 280 yyleng = (int) (yy_cp - yy_bp); \ 281 yy_hold_char = *yy_cp; \ 282 *yy_cp = '\0'; \ 283 yy_c_buf_p = yy_cp; 284 285#define YY_NUM_RULES 44 286#define YY_END_OF_BUFFER 45 287static yyconst short int yy_accept[298] = 288 { 0, 289 0, 0, 2, 2, 45, 43, 38, 36, 30, 43, 290 1, 31, 43, 27, 31, 27, 27, 26, 31, 42, 291 34, 32, 34, 43, 27, 40, 40, 40, 40, 40, 292 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 293 40, 43, 2, 2, 3, 2, 2, 1, 2, 2, 294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 296 2, 2, 2, 2, 2, 2, 2, 2, 2, 38, 297 34, 0, 41, 32, 28, 35, 42, 0, 39, 42, 298 42, 0, 33, 37, 40, 40, 40, 40, 40, 40, 299 300 40, 40, 40, 40, 10, 40, 40, 40, 40, 40, 301 40, 40, 40, 40, 40, 40, 29, 2, 2, 2, 302 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 303 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 304 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 305 2, 2, 2, 2, 2, 42, 0, 0, 42, 0, 306 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, 307 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 308 40, 2, 2, 2, 2, 2, 2, 2, 2, 2, 309 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 310 311 2, 2, 2, 2, 2, 2, 16, 40, 40, 40, 312 17, 19, 40, 40, 20, 40, 40, 40, 40, 6, 313 18, 40, 40, 12, 40, 40, 2, 2, 2, 2, 314 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 315 2, 2, 2, 2, 2, 2, 5, 40, 40, 40, 316 14, 40, 40, 15, 24, 40, 13, 40, 11, 2, 317 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 318 2, 2, 40, 4, 40, 7, 25, 8, 40, 2, 319 2, 2, 2, 2, 2, 2, 40, 21, 40, 2, 320 2, 2, 23, 22, 2, 2, 0 321 322 } ; 323 324static yyconst int yy_ec[256] = 325 { 0, 326 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 329 1, 2, 4, 5, 6, 1, 7, 8, 1, 9, 330 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, 331 17, 17, 17, 17, 17, 17, 17, 1, 18, 19, 332 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, 333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 335 23, 24, 25, 26, 27, 1, 28, 29, 30, 31, 336 337 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 338 42, 43, 44, 45, 46, 47, 48, 37, 49, 37, 339 50, 37, 51, 52, 53, 1, 1, 1, 1, 1, 340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 347 348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 353 1, 1, 1, 1, 1 354 } ; 355 356static yyconst int yy_meta[54] = 357 { 0, 358 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 359 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 360 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 361 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 362 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 363 1, 1, 1 364 } ; 365 366static yyconst short int yy_base[302] = 367 { 0, 368 0, 0, 53, 0, 525, 526, 522, 526, 503, 517, 369 526, 501, 512, 526, 499, 95, 94, 94, 99, 105, 370 498, 114, 497, 513, 495, 466, 468, 470, 479, 471, 371 467, 0, 81, 102, 105, 479, 462, 458, 473, 94, 372 104, 452, 0, 501, 526, 482, 139, 0, 481, 492, 373 0, 479, 131, 132, 131, 125, 132, 478, 150, 477, 374 493, 475, 160, 115, 117, 126, 130, 125, 446, 183, 375 184, 186, 187, 123, 445, 180, 185, 192, 440, 489, 376 526, 485, 526, 526, 526, 526, 158, 486, 526, 162, 377 221, 485, 526, 526, 0, 440, 454, 444, 451, 437, 378 379 437, 442, 434, 451, 0, 432, 436, 436, 447, 438, 380 437, 195, 444, 426, 425, 433, 526, 0, 466, 0, 381 178, 0, 0, 0, 0, 222, 464, 0, 230, 233, 382 463, 0, 417, 65, 189, 208, 193, 205, 213, 220, 383 214, 235, 416, 218, 224, 227, 241, 234, 237, 243, 384 246, 231, 232, 245, 0, 275, 460, 278, 279, 459, 385 419, 432, 412, 422, 425, 0, 409, 408, 408, 406, 386 418, 415, 404, 408, 401, 416, 398, 406, 397, 398, 387 403, 287, 438, 288, 437, 182, 250, 239, 270, 275, 388 391, 266, 268, 271, 273, 274, 288, 279, 285, 281, 389 390 299, 390, 292, 287, 293, 298, 0, 399, 400, 394, 391 0, 0, 392, 401, 0, 385, 384, 398, 382, 0, 392 0, 383, 395, 0, 398, 393, 376, 294, 303, 302, 393 375, 374, 306, 312, 373, 305, 308, 313, 310, 372, 394 371, 314, 317, 370, 335, 332, 0, 376, 384, 370, 395 0, 379, 367, 0, 0, 371, 0, 370, 0, 362, 396 325, 336, 322, 361, 137, 323, 360, 359, 331, 358, 397 333, 357, 356, 0, 353, 0, 0, 0, 355, 349, 398 343, 327, 342, 340, 334, 338, 346, 0, 238, 344, 399 236, 339, 0, 0, 177, 102, 526, 392, 120, 395, 400 401 398 402 } ; 403 404static yyconst short int yy_def[302] = 405 { 0, 406 297, 1, 297, 3, 297, 297, 297, 297, 297, 298, 407 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 408 297, 297, 297, 297, 297, 299, 299, 299, 299, 299, 409 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 410 299, 297, 300, 300, 297, 300, 301, 300, 300, 300, 411 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 412 300, 300, 300, 63, 63, 63, 63, 63, 63, 63, 413 63, 63, 63, 63, 63, 63, 63, 63, 300, 297, 414 297, 298, 297, 297, 297, 297, 297, 297, 297, 297, 415 297, 297, 297, 297, 299, 299, 299, 299, 299, 299, 416 417 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 418 299, 299, 299, 299, 299, 299, 297, 300, 300, 300, 419 301, 300, 300, 300, 300, 300, 300, 300, 300, 300, 420 300, 300, 63, 63, 63, 63, 63, 63, 63, 63, 421 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 422 63, 63, 63, 63, 300, 297, 297, 297, 297, 297, 423 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 424 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 425 299, 300, 300, 300, 300, 63, 63, 63, 63, 63, 426 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 427 428 63, 63, 63, 63, 63, 63, 299, 299, 299, 299, 429 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 430 299, 299, 299, 299, 299, 299, 63, 63, 63, 63, 431 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 432 63, 63, 63, 63, 63, 63, 299, 299, 299, 299, 433 299, 299, 299, 299, 299, 299, 299, 299, 299, 63, 434 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 435 63, 63, 299, 299, 299, 299, 299, 299, 299, 63, 436 63, 63, 63, 63, 63, 63, 299, 299, 299, 63, 437 63, 63, 299, 299, 63, 63, 0, 297, 297, 297, 438 439 297 440 } ; 441 442static yyconst short int yy_nxt[580] = 443 { 0, 444 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 445 15, 16, 14, 17, 18, 19, 20, 14, 21, 22, 446 23, 20, 14, 24, 14, 25, 6, 26, 27, 28, 447 29, 30, 31, 32, 33, 34, 32, 32, 35, 32, 448 32, 36, 37, 38, 39, 40, 32, 32, 41, 32, 449 14, 42, 14, 43, 44, 45, 46, 47, 48, 49, 450 50, 51, 51, 52, 53, 51, 54, 55, 56, 57, 451 51, 58, 59, 60, 57, 51, 61, 51, 62, 43, 452 63, 64, 65, 66, 67, 68, 69, 70, 71, 69, 453 69, 72, 69, 69, 73, 74, 75, 76, 77, 69, 454 455 69, 78, 69, 51, 79, 51, 86, 86, 102, 89, 456 87, 186, 133, 84, 84, 87, 103, 88, 84, 90, 457 93, 91, 95, 113, 93, 93, 91, 93, 92, 93, 458 104, 115, 106, 81, 105, 128, 107, 114, 116, 93, 459 108, 82, 125, 122, 123, 125, 129, 126, 130, 133, 460 123, 123, 126, 130, 127, 131, 132, 137, 136, 135, 461 132, 132, 133, 132, 133, 132, 139, 148, 138, 120, 462 133, 283, 133, 133, 156, 132, 133, 133, 159, 156, 463 82, 157, 122, 159, 133, 160, 133, 133, 133, 133, 464 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 465 466 133, 133, 133, 133, 133, 133, 133, 134, 133, 133, 467 140, 150, 142, 144, 151, 147, 143, 145, 141, 153, 468 187, 146, 176, 227, 133, 189, 154, 133, 152, 133, 469 133, 133, 133, 133, 133, 90, 133, 91, 182, 133, 470 133, 177, 91, 182, 92, 183, 184, 129, 188, 130, 471 190, 184, 133, 185, 130, 133, 131, 191, 192, 193, 472 133, 133, 194, 195, 196, 133, 197, 133, 198, 199, 473 201, 133, 200, 203, 133, 204, 205, 228, 133, 133, 474 206, 133, 133, 133, 133, 229, 133, 294, 133, 202, 475 133, 156, 133, 133, 87, 159, 156, 133, 157, 87, 476 477 159, 88, 160, 182, 184, 230, 231, 236, 182, 184, 478 183, 185, 232, 133, 233, 133, 234, 133, 133, 235, 479 133, 133, 133, 237, 238, 239, 133, 240, 133, 241, 480 243, 260, 133, 244, 133, 133, 246, 245, 261, 133, 481 133, 133, 262, 264, 267, 133, 133, 263, 270, 133, 482 133, 265, 133, 133, 266, 133, 268, 133, 269, 133, 483 133, 133, 271, 272, 133, 280, 282, 281, 284, 133, 484 133, 285, 133, 286, 133, 295, 291, 293, 133, 133, 485 133, 133, 133, 133, 292, 133, 133, 133, 296, 133, 486 133, 133, 82, 82, 82, 118, 290, 118, 121, 121, 487 488 121, 289, 288, 287, 133, 133, 133, 133, 133, 133, 489 279, 278, 277, 276, 275, 274, 273, 133, 133, 133, 490 133, 133, 133, 133, 259, 258, 257, 256, 255, 254, 491 253, 252, 251, 250, 249, 248, 247, 242, 133, 159, 492 156, 226, 225, 224, 223, 222, 221, 220, 219, 218, 493 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 494 207, 159, 156, 133, 133, 91, 158, 119, 181, 180, 495 179, 178, 175, 174, 173, 172, 171, 170, 169, 168, 496 167, 166, 165, 164, 163, 162, 161, 91, 158, 83, 497 80, 155, 149, 133, 123, 94, 120, 120, 123, 124, 498 499 123, 120, 119, 117, 112, 111, 110, 109, 101, 100, 500 99, 98, 97, 96, 84, 94, 81, 81, 84, 85, 501 84, 83, 81, 80, 297, 5, 297, 297, 297, 297, 502 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 503 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 504 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 505 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 506 297, 297, 297, 297, 297, 297, 297, 297, 297 507 } ; 508 509static yyconst short int yy_chk[580] = 510 { 0, 511 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 512 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 515 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 516 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 517 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 518 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 519 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 520 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 521 522 3, 3, 3, 3, 3, 3, 16, 17, 33, 19, 523 18, 134, 134, 17, 16, 18, 33, 18, 19, 20, 524 22, 20, 299, 40, 22, 22, 20, 22, 20, 22, 525 34, 41, 35, 22, 34, 56, 35, 40, 41, 22, 526 35, 47, 53, 47, 56, 54, 57, 55, 57, 296, 527 53, 54, 55, 57, 55, 57, 59, 66, 65, 64, 528 59, 59, 64, 59, 65, 59, 68, 74, 67, 59, 529 74, 265, 68, 66, 87, 59, 63, 67, 90, 87, 530 121, 87, 121, 90, 265, 90, 63, 63, 63, 63, 531 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 532 533 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 534 70, 76, 71, 72, 77, 73, 71, 72, 70, 78, 535 135, 72, 112, 186, 295, 137, 78, 76, 77, 186, 536 70, 71, 77, 72, 73, 91, 135, 91, 126, 78, 537 137, 112, 91, 126, 91, 126, 129, 130, 136, 130, 538 138, 129, 138, 129, 130, 136, 130, 139, 140, 141, 539 139, 141, 142, 144, 145, 144, 146, 140, 147, 148, 540 150, 145, 149, 151, 146, 152, 153, 187, 152, 153, 541 154, 148, 142, 291, 149, 188, 188, 289, 147, 150, 542 150, 156, 154, 151, 158, 159, 156, 187, 156, 158, 543 544 159, 158, 159, 182, 184, 189, 190, 196, 182, 184, 545 182, 184, 192, 192, 193, 193, 194, 189, 194, 195, 546 195, 196, 190, 197, 198, 199, 198, 200, 200, 201, 547 203, 228, 199, 204, 204, 197, 206, 205, 229, 203, 548 205, 228, 230, 234, 238, 206, 201, 233, 243, 230, 549 229, 236, 236, 233, 237, 237, 239, 239, 242, 234, 550 238, 242, 245, 246, 243, 261, 263, 262, 266, 263, 551 266, 269, 261, 271, 282, 290, 282, 287, 269, 246, 552 271, 285, 245, 262, 286, 286, 292, 284, 292, 283, 553 281, 290, 298, 298, 298, 300, 280, 300, 301, 301, 554 555 301, 279, 275, 273, 272, 270, 268, 267, 264, 260, 556 258, 256, 253, 252, 250, 249, 248, 244, 241, 240, 557 235, 232, 231, 227, 226, 225, 223, 222, 219, 218, 558 217, 216, 214, 213, 210, 209, 208, 202, 191, 185, 559 183, 181, 180, 179, 178, 177, 176, 175, 174, 173, 560 172, 171, 170, 169, 168, 167, 165, 164, 163, 162, 561 161, 160, 157, 143, 133, 131, 127, 119, 116, 115, 562 114, 113, 111, 110, 109, 108, 107, 106, 104, 103, 563 102, 101, 100, 99, 98, 97, 96, 92, 88, 82, 564 80, 79, 75, 69, 62, 61, 60, 58, 52, 50, 565 566 49, 46, 44, 42, 39, 38, 37, 36, 31, 30, 567 29, 28, 27, 26, 25, 24, 23, 21, 15, 13, 568 12, 10, 9, 7, 5, 297, 297, 297, 297, 297, 569 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 570 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 571 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 572 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 573 297, 297, 297, 297, 297, 297, 297, 297, 297 574 } ; 575 576static yy_state_type yy_last_accepting_state; 577static char *yy_last_accepting_cpos; 578 579/* The intent behind this definition is that it'll catch 580 * any uses of REJECT which flex missed. 581 */ 582#define REJECT reject_used_but_not_detected 583#define yymore() yymore_used_but_not_detected 584#define YY_MORE_ADJ 0 585#define YY_RESTORE_YY_MORE_OFFSET 586char *yytext; 587#line 1 "scan.l" 588#define INITIAL 0 589#line 2 "scan.l" 590/* scan.l: the (f)lex description file for the scanner. */ 591 592/* This file is part of GNU bc. 593 Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. 594 595 This program is free software; you can redistribute it and/or modify 596 it under the terms of the GNU General Public License as published by 597 the Free Software Foundation; either version 2 of the License , or 598 (at your option) any later version. 599 600 This program is distributed in the hope that it will be useful, 601 but WITHOUT ANY WARRANTY; without even the implied warranty of 602 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 603 GNU General Public License for more details. 604 605 You should have received a copy of the GNU General Public License 606 along with this program; see the file COPYING. If not, write to 607 The Free Software Foundation, Inc. 608 59 Temple Place, Suite 330 609 Boston, MA 02111 USA 610 611 You may contact the author by: 612 e-mail: philnelson@acm.org 613 us-mail: Philip A. Nelson 614 Computer Science Department, 9062 615 Western Washington University 616 Bellingham, WA 98226-9062 617 618*************************************************************************/ 619 620#include "bcdefs.h" 621#include "bc.h" 622#include "global.h" 623#include "proto.h" 624#include <errno.h> 625 626/* Using flex, we can ask for a smaller input buffer. With lex, this 627 does nothing! */ 628 629#ifdef SMALL_BUF 630#undef YY_READ_BUF_SIZE 631#define YY_READ_BUF_SIZE 512 632#endif 633 634/* Force . as last for now. */ 635#define DOT_IS_LAST 636 637/* We want to define our own yywrap. */ 638#undef yywrap 639_PROTOTYPE(int yywrap, (void)); 640 641#if defined(LIBEDIT) 642/* Support for the BSD libedit with history for 643 nicer input on the interactive part of input. */ 644 645#include <histedit.h> 646 647/* Have input call the following function. */ 648#undef YY_INPUT 649#define YY_INPUT(buf,result,max_size) \ 650 bcel_input((char *)buf, &result, max_size) 651 652/* Variables to help interface editline with bc. */ 653static const char *bcel_line = (char *)NULL; 654static int bcel_len = 0; 655 656 657/* Required to get rid of that ugly ? default prompt! */ 658char * 659null_prompt (EditLine *el) 660{ 661 return ""; 662} 663 664 665/* bcel_input puts upto MAX characters into BUF with the number put in 666 BUF placed in *RESULT. If the yy input file is the same as 667 stdin, use editline. Otherwise, just read it. 668*/ 669 670static void 671bcel_input (buf, result, max) 672 char *buf; 673 int *result; 674 int max; 675{ 676 if (!edit || yyin != stdin) 677 { 678 while ( (*result = read( fileno(yyin), buf, max )) < 0 ) 679 if (errno != EINTR) 680 { 681 yyerror( "read() in flex scanner failed" ); 682 exit (1); 683 } 684 return; 685 } 686 687 /* Do we need a new string? */ 688 if (bcel_len == 0) 689 { 690 bcel_line = el_gets(edit, &bcel_len); 691 if (bcel_line == NULL) { 692 /* end of file */ 693 *result = 0; 694 bcel_len = 0; 695 return; 696 } 697 if (bcel_len != 0) 698 history (hist, &histev, H_ENTER, bcel_line); 699 fflush (stdout); 700 } 701 702 if (bcel_len <= max) 703 { 704 strncpy (buf, bcel_line, bcel_len); 705 *result = bcel_len; 706 bcel_len = 0; 707 } 708 else 709 { 710 strncpy (buf, bcel_line, max); 711 *result = max; 712 bcel_line += max; 713 bcel_len -= max; 714 } 715} 716#endif 717 718#ifdef READLINE 719/* Support for the readline and history libraries. This allows 720 nicer input on the interactive part of input. */ 721 722/* Have input call the following function. */ 723#undef YY_INPUT 724#define YY_INPUT(buf,result,max_size) \ 725 rl_input((char *)buf, &result, max_size) 726 727/* Variables to help interface readline with bc. */ 728static char *rl_line = (char *)NULL; 729static char *rl_start = (char *)NULL; 730static int rl_len = 0; 731 732/* Definitions for readline access. */ 733extern FILE *rl_instream; 734_PROTOTYPE(char *readline, (char *)); 735 736/* rl_input puts upto MAX characters into BUF with the number put in 737 BUF placed in *RESULT. If the yy input file is the same as 738 rl_instream (stdin), use readline. Otherwise, just read it. 739*/ 740 741static void 742rl_input (buf, result, max) 743 char *buf; 744 int *result; 745 int max; 746{ 747 if (yyin != rl_instream) 748 { 749 while ( (*result = read( fileno(yyin), buf, max )) < 0 ) 750 if (errno != EINTR) 751 { 752 yyerror( "read() in flex scanner failed" ); 753 exit (1); 754 } 755 return; 756 } 757 758 /* Do we need a new string? */ 759 if (rl_len == 0) 760 { 761 if (rl_start) 762 free(rl_start); 763 rl_start = readline (""); 764 if (rl_start == NULL) { 765 /* end of file */ 766 *result = 0; 767 rl_len = 0; 768 return; 769 } 770 rl_line = rl_start; 771 rl_len = strlen (rl_line)+1; 772 if (rl_len != 1) 773 add_history (rl_line); 774 rl_line[rl_len-1] = '\n'; 775 fflush (stdout); 776 } 777 778 if (rl_len <= max) 779 { 780 strncpy (buf, rl_line, rl_len); 781 *result = rl_len; 782 rl_len = 0; 783 } 784 else 785 { 786 strncpy (buf, rl_line, max); 787 *result = max; 788 rl_line += max; 789 rl_len -= max; 790 } 791} 792#endif 793 794#if !defined(READLINE) && !defined(LIBEDIT) 795 796/* MINIX returns from read with < 0 if SIGINT is encountered. 797 In flex, we can redefine YY_INPUT to the following. In lex, this 798 does nothing! */ 799#undef YY_INPUT 800#define YY_INPUT(buf,result,max_size) \ 801 while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ 802 if (errno != EINTR) \ 803 YY_FATAL_ERROR( "read() in flex scanner failed" ); 804#endif 805 806#define slcomment 1 807 808#line 809 "lex.yy.c" 809 810/* Macros after this point can all be overridden by user definitions in 811 * section 1. 812 */ 813 814#ifndef YY_SKIP_YYWRAP 815#ifdef __cplusplus 816extern "C" int yywrap YY_PROTO(( void )); 817#else 818extern int yywrap YY_PROTO(( void )); 819#endif 820#endif 821 822#ifndef YY_NO_UNPUT 823static void yyunput YY_PROTO(( int c, char *buf_ptr )); 824#endif 825 826#ifndef yytext_ptr 827static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 828#endif 829 830#ifdef YY_NEED_STRLEN 831static int yy_flex_strlen YY_PROTO(( yyconst char * )); 832#endif 833 834#ifndef YY_NO_INPUT 835#ifdef __cplusplus 836static int yyinput YY_PROTO(( void )); 837#else 838static int input YY_PROTO(( void )); 839#endif 840#endif 841 842#if YY_STACK_USED 843static int yy_start_stack_ptr = 0; 844static int yy_start_stack_depth = 0; 845static int *yy_start_stack = 0; 846#ifndef YY_NO_PUSH_STATE 847static void yy_push_state YY_PROTO(( int new_state )); 848#endif 849#ifndef YY_NO_POP_STATE 850static void yy_pop_state YY_PROTO(( void )); 851#endif 852#ifndef YY_NO_TOP_STATE 853static int yy_top_state YY_PROTO(( void )); 854#endif 855 856#else 857#define YY_NO_PUSH_STATE 1 858#define YY_NO_POP_STATE 1 859#define YY_NO_TOP_STATE 1 860#endif 861 862#ifdef YY_MALLOC_DECL 863YY_MALLOC_DECL 864#else 865#if __STDC__ 866#ifndef __cplusplus 867#include <stdlib.h> 868#endif 869#else 870/* Just try to get by without declaring the routines. This will fail 871 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 872 * or sizeof(void*) != sizeof(int). 873 */ 874#endif 875#endif 876 877/* Amount of stuff to slurp up with each read. */ 878#ifndef YY_READ_BUF_SIZE 879#define YY_READ_BUF_SIZE 8192 880#endif 881 882/* Copy whatever the last rule matched to the standard output. */ 883 884#ifndef ECHO 885/* This used to be an fputs(), but since the string might contain NUL's, 886 * we now use fwrite(). 887 */ 888#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 889#endif 890 891/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 892 * is returned in "result". 893 */ 894#ifndef YY_INPUT 895#define YY_INPUT(buf,result,max_size) \ 896 if ( yy_current_buffer->yy_is_interactive ) \ 897 { \ 898 int c = '*', n; \ 899 for ( n = 0; n < max_size && \ 900 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 901 buf[n] = (char) c; \ 902 if ( c == '\n' ) \ 903 buf[n++] = (char) c; \ 904 if ( c == EOF && ferror( yyin ) ) \ 905 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 906 result = n; \ 907 } \ 908 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 909 && ferror( yyin ) ) \ 910 YY_FATAL_ERROR( "input in flex scanner failed" ); 911#endif 912 913/* No semi-colon after return; correct usage is to write "yyterminate();" - 914 * we don't want an extra ';' after the "return" because that will cause 915 * some compilers to complain about unreachable statements. 916 */ 917#ifndef yyterminate 918#define yyterminate() return YY_NULL 919#endif 920 921/* Number of entries by which start-condition stack grows. */ 922#ifndef YY_START_STACK_INCR 923#define YY_START_STACK_INCR 25 924#endif 925 926/* Report a fatal error. */ 927#ifndef YY_FATAL_ERROR 928#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 929#endif 930 931/* Default declaration of generated scanner - a define so the user can 932 * easily add parameters. 933 */ 934#ifndef YY_DECL 935#define YY_DECL int yylex YY_PROTO(( void )) 936#endif 937 938/* Code executed at the beginning of each rule, after yytext and yyleng 939 * have been set up. 940 */ 941#ifndef YY_USER_ACTION 942#define YY_USER_ACTION 943#endif 944 945/* Code executed at the end of each rule. */ 946#ifndef YY_BREAK 947#define YY_BREAK break; 948#endif 949 950#define YY_RULE_SETUP \ 951 YY_USER_ACTION 952 953YY_DECL 954 { 955 register yy_state_type yy_current_state; 956 register char *yy_cp, *yy_bp; 957 register int yy_act; 958 959#line 222 "scan.l" 960 961#line 962 "lex.yy.c" 962 963 if ( yy_init ) 964 { 965 yy_init = 0; 966 967#ifdef YY_USER_INIT 968 YY_USER_INIT; 969#endif 970 971 if ( ! yy_start ) 972 yy_start = 1; /* first start state */ 973 974 if ( ! yyin ) 975 yyin = stdin; 976 977 if ( ! yyout ) 978 yyout = stdout; 979 980 if ( ! yy_current_buffer ) 981 yy_current_buffer = 982 yy_create_buffer( yyin, YY_BUF_SIZE ); 983 984 yy_load_buffer_state(); 985 } 986 987 while ( 1 ) /* loops until end-of-file is reached */ 988 { 989 yy_cp = yy_c_buf_p; 990 991 /* Support of yytext. */ 992 *yy_cp = yy_hold_char; 993 994 /* yy_bp points to the position in yy_ch_buf of the start of 995 * the current run. 996 */ 997 yy_bp = yy_cp; 998 999 yy_current_state = yy_start; 1000yy_match: 1001 do 1002 { 1003 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 1004 if ( yy_accept[yy_current_state] ) 1005 { 1006 yy_last_accepting_state = yy_current_state; 1007 yy_last_accepting_cpos = yy_cp; 1008 } 1009 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1010 { 1011 yy_current_state = (int) yy_def[yy_current_state]; 1012 if ( yy_current_state >= 298 ) 1013 yy_c = yy_meta[(unsigned int) yy_c]; 1014 } 1015 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1016 ++yy_cp; 1017 } 1018 while ( yy_base[yy_current_state] != 526 ); 1019 1020yy_find_action: 1021 yy_act = yy_accept[yy_current_state]; 1022 if ( yy_act == 0 ) 1023 { /* have to back up */ 1024 yy_cp = yy_last_accepting_cpos; 1025 yy_current_state = yy_last_accepting_state; 1026 yy_act = yy_accept[yy_current_state]; 1027 } 1028 1029 YY_DO_BEFORE_ACTION; 1030 1031 1032do_action: /* This label is used only to access EOF actions. */ 1033 1034 1035 switch ( yy_act ) 1036 { /* beginning of action switch */ 1037 case 0: /* must back up */ 1038 /* undo the effects of YY_DO_BEFORE_ACTION */ 1039 *yy_cp = yy_hold_char; 1040 yy_cp = yy_last_accepting_cpos; 1041 yy_current_state = yy_last_accepting_state; 1042 goto yy_find_action; 1043 1044case 1: 1045YY_RULE_SETUP 1046#line 223 "scan.l" 1047{ 1048 if (!std_only) 1049 BEGIN(slcomment); 1050 else 1051 yyerror ("illegal character: #"); 1052 } 1053 YY_BREAK 1054case 2: 1055YY_RULE_SETUP 1056#line 229 "scan.l" 1057{ BEGIN(INITIAL); } 1058 YY_BREAK 1059case 3: 1060YY_RULE_SETUP 1061#line 230 "scan.l" 1062{ line_no++; BEGIN(INITIAL); return(ENDOFLINE); } 1063 YY_BREAK 1064case 4: 1065YY_RULE_SETUP 1066#line 231 "scan.l" 1067return(Define); 1068 YY_BREAK 1069case 5: 1070YY_RULE_SETUP 1071#line 232 "scan.l" 1072return(Break); 1073 YY_BREAK 1074case 6: 1075YY_RULE_SETUP 1076#line 233 "scan.l" 1077return(Quit); 1078 YY_BREAK 1079case 7: 1080YY_RULE_SETUP 1081#line 234 "scan.l" 1082return(Length); 1083 YY_BREAK 1084case 8: 1085YY_RULE_SETUP 1086#line 235 "scan.l" 1087return(Return); 1088 YY_BREAK 1089case 9: 1090YY_RULE_SETUP 1091#line 236 "scan.l" 1092return(For); 1093 YY_BREAK 1094case 10: 1095YY_RULE_SETUP 1096#line 237 "scan.l" 1097return(If); 1098 YY_BREAK 1099case 11: 1100YY_RULE_SETUP 1101#line 238 "scan.l" 1102return(While); 1103 YY_BREAK 1104case 12: 1105YY_RULE_SETUP 1106#line 239 "scan.l" 1107return(Sqrt); 1108 YY_BREAK 1109case 13: 1110YY_RULE_SETUP 1111#line 240 "scan.l" 1112return(Scale); 1113 YY_BREAK 1114case 14: 1115YY_RULE_SETUP 1116#line 241 "scan.l" 1117return(Ibase); 1118 YY_BREAK 1119case 15: 1120YY_RULE_SETUP 1121#line 242 "scan.l" 1122return(Obase); 1123 YY_BREAK 1124case 16: 1125YY_RULE_SETUP 1126#line 243 "scan.l" 1127return(Auto); 1128 YY_BREAK 1129case 17: 1130YY_RULE_SETUP 1131#line 244 "scan.l" 1132return(Else); 1133 YY_BREAK 1134case 18: 1135YY_RULE_SETUP 1136#line 245 "scan.l" 1137return(Read); 1138 YY_BREAK 1139case 19: 1140YY_RULE_SETUP 1141#line 246 "scan.l" 1142return(Halt); 1143 YY_BREAK 1144case 20: 1145YY_RULE_SETUP 1146#line 247 "scan.l" 1147return(Last); 1148 YY_BREAK 1149case 21: 1150YY_RULE_SETUP 1151#line 248 "scan.l" 1152{ 1153#if defined(READLINE) || defined(LIBEDIT) 1154 return(HistoryVar); 1155#else 1156 yylval.s_value = strcopyof(yytext); return(NAME); 1157#endif 1158 } 1159 YY_BREAK 1160case 22: 1161YY_RULE_SETUP 1162#line 256 "scan.l" 1163return(Warranty); 1164 YY_BREAK 1165case 23: 1166YY_RULE_SETUP 1167#line 257 "scan.l" 1168return(Continue); 1169 YY_BREAK 1170case 24: 1171YY_RULE_SETUP 1172#line 258 "scan.l" 1173return(Print); 1174 YY_BREAK 1175case 25: 1176YY_RULE_SETUP 1177#line 259 "scan.l" 1178return(Limits); 1179 YY_BREAK 1180case 26: 1181YY_RULE_SETUP 1182#line 260 "scan.l" 1183{ 1184#ifdef DOT_IS_LAST 1185 return(Last); 1186#else 1187 yyerror ("illegal character: %s",yytext); 1188#endif 1189 } 1190 YY_BREAK 1191case 27: 1192YY_RULE_SETUP 1193#line 267 "scan.l" 1194{ yylval.c_value = yytext[0]; 1195 return((int)yytext[0]); } 1196 YY_BREAK 1197case 28: 1198YY_RULE_SETUP 1199#line 269 "scan.l" 1200{ return(AND); } 1201 YY_BREAK 1202case 29: 1203YY_RULE_SETUP 1204#line 270 "scan.l" 1205{ return(OR); } 1206 YY_BREAK 1207case 30: 1208YY_RULE_SETUP 1209#line 271 "scan.l" 1210{ return(NOT); } 1211 YY_BREAK 1212case 31: 1213YY_RULE_SETUP 1214#line 272 "scan.l" 1215{ yylval.c_value = yytext[0]; return((int)yytext[0]); } 1216 YY_BREAK 1217case 32: 1218YY_RULE_SETUP 1219#line 273 "scan.l" 1220{ yylval.c_value = yytext[0]; return(ASSIGN_OP); } 1221 YY_BREAK 1222case 33: 1223YY_RULE_SETUP 1224#line 274 "scan.l" 1225{ 1226#ifdef OLD_EQ_OP 1227 char warn_save; 1228 warn_save = warn_not_std; 1229 warn_not_std = TRUE; 1230 warn ("Old fashioned =<op>"); 1231 warn_not_std = warn_save; 1232 yylval.c_value = yytext[1]; 1233#else 1234 yylval.c_value = '='; 1235 yyless (1); 1236#endif 1237 return(ASSIGN_OP); 1238 } 1239 YY_BREAK 1240case 34: 1241YY_RULE_SETUP 1242#line 288 "scan.l" 1243{ yylval.s_value = strcopyof(yytext); return(REL_OP); } 1244 YY_BREAK 1245case 35: 1246YY_RULE_SETUP 1247#line 289 "scan.l" 1248{ yylval.c_value = yytext[0]; return(INCR_DECR); } 1249 YY_BREAK 1250case 36: 1251YY_RULE_SETUP 1252#line 290 "scan.l" 1253{ line_no++; return(ENDOFLINE); } 1254 YY_BREAK 1255case 37: 1256YY_RULE_SETUP 1257#line 291 "scan.l" 1258{ line_no++; /* ignore a "quoted" newline */ } 1259 YY_BREAK 1260case 38: 1261YY_RULE_SETUP 1262#line 292 "scan.l" 1263{ /* ignore spaces and tabs */ } 1264 YY_BREAK 1265case 39: 1266YY_RULE_SETUP 1267#line 293 "scan.l" 1268{ 1269 int c; 1270 1271 for (;;) 1272 { 1273 while ( ((c=input()) != '*') && (c != EOF)) 1274 /* eat it */ 1275 if (c == '\n') line_no++; 1276 if (c == '*') 1277 { 1278 while ( (c=input()) == '*') /* eat it*/; 1279 if (c == '/') break; /* at end of comment */ 1280 if (c == '\n') line_no++; 1281 } 1282 if (c == EOF) 1283 { 1284 fprintf (stderr,"EOF encountered in a comment.\n"); 1285 break; 1286 } 1287 } 1288 } 1289 YY_BREAK 1290case 40: 1291YY_RULE_SETUP 1292#line 314 "scan.l" 1293{ yylval.s_value = strcopyof(yytext); return(NAME); } 1294 YY_BREAK 1295case 41: 1296YY_RULE_SETUP 1297#line 315 "scan.l" 1298{ 1299 unsigned char *look; 1300 int count = 0; 1301 yylval.s_value = strcopyof(yytext); 1302 for (look = yytext; *look != 0; look++) 1303 { 1304 if (*look == '\n') line_no++; 1305 if (*look == '"') count++; 1306 } 1307 if (count != 2) yyerror ("NUL character in string."); 1308 return(STRING); 1309 } 1310 YY_BREAK 1311case 42: 1312YY_RULE_SETUP 1313#line 327 "scan.l" 1314{ 1315 unsigned char *src, *dst; 1316 int len; 1317 /* remove a trailing decimal point. */ 1318 len = strlen(yytext); 1319 if (yytext[len-1] == '.') 1320 yytext[len-1] = 0; 1321 /* remove leading zeros. */ 1322 src = yytext; 1323 dst = yytext; 1324 while (*src == '0') src++; 1325 if (*src == 0) src--; 1326 /* Copy strings removing the newlines. */ 1327 while (*src != 0) 1328 { 1329 if (*src == '\\') 1330 { 1331 src++; src++; 1332 line_no++; 1333 } 1334 else 1335 *dst++ = *src++; 1336 } 1337 *dst = 0; 1338 yylval.s_value = strcopyof(yytext); 1339 return(NUMBER); 1340 } 1341 YY_BREAK 1342case 43: 1343YY_RULE_SETUP 1344#line 354 "scan.l" 1345{ 1346 if (yytext[0] < ' ') 1347 yyerror ("illegal character: ^%c",yytext[0] + '@'); 1348 else 1349 if (yytext[0] > '~') 1350 yyerror ("illegal character: \\%03o", (int) yytext[0]); 1351 else 1352 yyerror ("illegal character: %s",yytext); 1353 } 1354 YY_BREAK 1355case 44: 1356YY_RULE_SETUP 1357#line 363 "scan.l" 1358ECHO; 1359 YY_BREAK 1360#line 1361 "lex.yy.c" 1361case YY_STATE_EOF(INITIAL): 1362case YY_STATE_EOF(slcomment): 1363 yyterminate(); 1364 1365 case YY_END_OF_BUFFER: 1366 { 1367 /* Amount of text matched not including the EOB char. */ 1368 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 1369 1370 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1371 *yy_cp = yy_hold_char; 1372 YY_RESTORE_YY_MORE_OFFSET 1373 1374 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 1375 { 1376 /* We're scanning a new file or input source. It's 1377 * possible that this happened because the user 1378 * just pointed yyin at a new source and called 1379 * yylex(). If so, then we have to assure 1380 * consistency between yy_current_buffer and our 1381 * globals. Here is the right place to do so, because 1382 * this is the first action (other than possibly a 1383 * back-up) that will match for the new input source. 1384 */ 1385 yy_n_chars = yy_current_buffer->yy_n_chars; 1386 yy_current_buffer->yy_input_file = yyin; 1387 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 1388 } 1389 1390 /* Note that here we test for yy_c_buf_p "<=" to the position 1391 * of the first EOB in the buffer, since yy_c_buf_p will 1392 * already have been incremented past the NUL character 1393 * (since all states make transitions on EOB to the 1394 * end-of-buffer state). Contrast this with the test 1395 * in input(). 1396 */ 1397 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1398 { /* This was really a NUL. */ 1399 yy_state_type yy_next_state; 1400 1401 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 1402 1403 yy_current_state = yy_get_previous_state(); 1404 1405 /* Okay, we're now positioned to make the NUL 1406 * transition. We couldn't have 1407 * yy_get_previous_state() go ahead and do it 1408 * for us because it doesn't know how to deal 1409 * with the possibility of jamming (and we don't 1410 * want to build jamming into it because then it 1411 * will run more slowly). 1412 */ 1413 1414 yy_next_state = yy_try_NUL_trans( yy_current_state ); 1415 1416 yy_bp = yytext_ptr + YY_MORE_ADJ; 1417 1418 if ( yy_next_state ) 1419 { 1420 /* Consume the NUL. */ 1421 yy_cp = ++yy_c_buf_p; 1422 yy_current_state = yy_next_state; 1423 goto yy_match; 1424 } 1425 1426 else 1427 { 1428 yy_cp = yy_c_buf_p; 1429 goto yy_find_action; 1430 } 1431 } 1432 1433 else switch ( yy_get_next_buffer() ) 1434 { 1435 case EOB_ACT_END_OF_FILE: 1436 { 1437 yy_did_buffer_switch_on_eof = 0; 1438 1439 if ( yywrap() ) 1440 { 1441 /* Note: because we've taken care in 1442 * yy_get_next_buffer() to have set up 1443 * yytext, we can now set up 1444 * yy_c_buf_p so that if some total 1445 * hoser (like flex itself) wants to 1446 * call the scanner after we return the 1447 * YY_NULL, it'll still work - another 1448 * YY_NULL will get returned. 1449 */ 1450 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 1451 1452 yy_act = YY_STATE_EOF(YY_START); 1453 goto do_action; 1454 } 1455 1456 else 1457 { 1458 if ( ! yy_did_buffer_switch_on_eof ) 1459 YY_NEW_FILE; 1460 } 1461 break; 1462 } 1463 1464 case EOB_ACT_CONTINUE_SCAN: 1465 yy_c_buf_p = 1466 yytext_ptr + yy_amount_of_matched_text; 1467 1468 yy_current_state = yy_get_previous_state(); 1469 1470 yy_cp = yy_c_buf_p; 1471 yy_bp = yytext_ptr + YY_MORE_ADJ; 1472 goto yy_match; 1473 1474 case EOB_ACT_LAST_MATCH: 1475 yy_c_buf_p = 1476 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 1477 1478 yy_current_state = yy_get_previous_state(); 1479 1480 yy_cp = yy_c_buf_p; 1481 yy_bp = yytext_ptr + YY_MORE_ADJ; 1482 goto yy_find_action; 1483 } 1484 break; 1485 } 1486 1487 default: 1488 YY_FATAL_ERROR( 1489 "fatal flex scanner internal error--no action found" ); 1490 } /* end of action switch */ 1491 } /* end of scanning one token */ 1492 } /* end of yylex */ 1493 1494 1495/* yy_get_next_buffer - try to read in a new buffer 1496 * 1497 * Returns a code representing an action: 1498 * EOB_ACT_LAST_MATCH - 1499 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1500 * EOB_ACT_END_OF_FILE - end of file 1501 */ 1502 1503static int yy_get_next_buffer() 1504 { 1505 register char *dest = yy_current_buffer->yy_ch_buf; 1506 register char *source = yytext_ptr; 1507 register int number_to_move, i; 1508 int ret_val; 1509 1510 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 1511 YY_FATAL_ERROR( 1512 "fatal flex scanner internal error--end of buffer missed" ); 1513 1514 if ( yy_current_buffer->yy_fill_buffer == 0 ) 1515 { /* Don't try to fill the buffer, so this is an EOF. */ 1516 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 1517 { 1518 /* We matched a single character, the EOB, so 1519 * treat this as a final EOF. 1520 */ 1521 return EOB_ACT_END_OF_FILE; 1522 } 1523 1524 else 1525 { 1526 /* We matched some text prior to the EOB, first 1527 * process it. 1528 */ 1529 return EOB_ACT_LAST_MATCH; 1530 } 1531 } 1532 1533 /* Try to read more data. */ 1534 1535 /* First move last chars to start of buffer. */ 1536 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 1537 1538 for ( i = 0; i < number_to_move; ++i ) 1539 *(dest++) = *(source++); 1540 1541 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1542 /* don't do the read, it's not guaranteed to return an EOF, 1543 * just force an EOF 1544 */ 1545 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 1546 1547 else 1548 { 1549 int num_to_read = 1550 yy_current_buffer->yy_buf_size - number_to_move - 1; 1551 1552 while ( num_to_read <= 0 ) 1553 { /* Not enough room in the buffer - grow it. */ 1554#ifdef YY_USES_REJECT 1555 YY_FATAL_ERROR( 1556"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 1557#else 1558 1559 /* just a shorter name for the current buffer */ 1560 YY_BUFFER_STATE b = yy_current_buffer; 1561 1562 int yy_c_buf_p_offset = 1563 (int) (yy_c_buf_p - b->yy_ch_buf); 1564 1565 if ( b->yy_is_our_buffer ) 1566 { 1567 int new_size = b->yy_buf_size * 2; 1568 1569 if ( new_size <= 0 ) 1570 b->yy_buf_size += b->yy_buf_size / 8; 1571 else 1572 b->yy_buf_size *= 2; 1573 1574 b->yy_ch_buf = (char *) 1575 /* Include room in for 2 EOB chars. */ 1576 yy_flex_realloc( (void *) b->yy_ch_buf, 1577 b->yy_buf_size + 2 ); 1578 } 1579 else 1580 /* Can't grow it, we don't own it. */ 1581 b->yy_ch_buf = 0; 1582 1583 if ( ! b->yy_ch_buf ) 1584 YY_FATAL_ERROR( 1585 "fatal error - scanner input buffer overflow" ); 1586 1587 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1588 1589 num_to_read = yy_current_buffer->yy_buf_size - 1590 number_to_move - 1; 1591#endif 1592 } 1593 1594 if ( num_to_read > YY_READ_BUF_SIZE ) 1595 num_to_read = YY_READ_BUF_SIZE; 1596 1597 /* Read in more data. */ 1598 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 1599 yy_n_chars, num_to_read ); 1600 1601 yy_current_buffer->yy_n_chars = yy_n_chars; 1602 } 1603 1604 if ( yy_n_chars == 0 ) 1605 { 1606 if ( number_to_move == YY_MORE_ADJ ) 1607 { 1608 ret_val = EOB_ACT_END_OF_FILE; 1609 yyrestart( yyin ); 1610 } 1611 1612 else 1613 { 1614 ret_val = EOB_ACT_LAST_MATCH; 1615 yy_current_buffer->yy_buffer_status = 1616 YY_BUFFER_EOF_PENDING; 1617 } 1618 } 1619 1620 else 1621 ret_val = EOB_ACT_CONTINUE_SCAN; 1622 1623 yy_n_chars += number_to_move; 1624 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1625 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1626 1627 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1628 1629 return ret_val; 1630 } 1631 1632 1633/* yy_get_previous_state - get the state just before the EOB char was reached */ 1634 1635static yy_state_type yy_get_previous_state() 1636 { 1637 register yy_state_type yy_current_state; 1638 register char *yy_cp; 1639 1640 yy_current_state = yy_start; 1641 1642 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1643 { 1644 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1645 if ( yy_accept[yy_current_state] ) 1646 { 1647 yy_last_accepting_state = yy_current_state; 1648 yy_last_accepting_cpos = yy_cp; 1649 } 1650 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1651 { 1652 yy_current_state = (int) yy_def[yy_current_state]; 1653 if ( yy_current_state >= 298 ) 1654 yy_c = yy_meta[(unsigned int) yy_c]; 1655 } 1656 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1657 } 1658 1659 return yy_current_state; 1660 } 1661 1662 1663/* yy_try_NUL_trans - try to make a transition on the NUL character 1664 * 1665 * synopsis 1666 * next_state = yy_try_NUL_trans( current_state ); 1667 */ 1668 1669#ifdef YY_USE_PROTOS 1670static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1671#else 1672static yy_state_type yy_try_NUL_trans( yy_current_state ) 1673yy_state_type yy_current_state; 1674#endif 1675 { 1676 register int yy_is_jam; 1677 register char *yy_cp = yy_c_buf_p; 1678 1679 register YY_CHAR yy_c = 1; 1680 if ( yy_accept[yy_current_state] ) 1681 { 1682 yy_last_accepting_state = yy_current_state; 1683 yy_last_accepting_cpos = yy_cp; 1684 } 1685 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1686 { 1687 yy_current_state = (int) yy_def[yy_current_state]; 1688 if ( yy_current_state >= 298 ) 1689 yy_c = yy_meta[(unsigned int) yy_c]; 1690 } 1691 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1692 yy_is_jam = (yy_current_state == 297); 1693 1694 return yy_is_jam ? 0 : yy_current_state; 1695 } 1696 1697 1698#ifndef YY_NO_UNPUT 1699#ifdef YY_USE_PROTOS 1700static void yyunput( int c, register char *yy_bp ) 1701#else 1702static void yyunput( c, yy_bp ) 1703int c; 1704register char *yy_bp; 1705#endif 1706 { 1707 register char *yy_cp = yy_c_buf_p; 1708 1709 /* undo effects of setting up yytext */ 1710 *yy_cp = yy_hold_char; 1711 1712 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1713 { /* need to shift things up to make room */ 1714 /* +2 for EOB chars. */ 1715 register int number_to_move = yy_n_chars + 2; 1716 register char *dest = &yy_current_buffer->yy_ch_buf[ 1717 yy_current_buffer->yy_buf_size + 2]; 1718 register char *source = 1719 &yy_current_buffer->yy_ch_buf[number_to_move]; 1720 1721 while ( source > yy_current_buffer->yy_ch_buf ) 1722 *--dest = *--source; 1723 1724 yy_cp += (int) (dest - source); 1725 yy_bp += (int) (dest - source); 1726 yy_current_buffer->yy_n_chars = 1727 yy_n_chars = yy_current_buffer->yy_buf_size; 1728 1729 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1730 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1731 } 1732 1733 *--yy_cp = (char) c; 1734 1735 1736 yytext_ptr = yy_bp; 1737 yy_hold_char = *yy_cp; 1738 yy_c_buf_p = yy_cp; 1739 } 1740#endif /* ifndef YY_NO_UNPUT */ 1741 1742 1743#ifdef __cplusplus 1744static int yyinput() 1745#else 1746static int input() 1747#endif 1748 { 1749 int c; 1750 1751 *yy_c_buf_p = yy_hold_char; 1752 1753 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1754 { 1755 /* yy_c_buf_p now points to the character we want to return. 1756 * If this occurs *before* the EOB characters, then it's a 1757 * valid NUL; if not, then we've hit the end of the buffer. 1758 */ 1759 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1760 /* This was really a NUL. */ 1761 *yy_c_buf_p = '\0'; 1762 1763 else 1764 { /* need more input */ 1765 int offset = yy_c_buf_p - yytext_ptr; 1766 ++yy_c_buf_p; 1767 1768 switch ( yy_get_next_buffer() ) 1769 { 1770 case EOB_ACT_LAST_MATCH: 1771 /* This happens because yy_g_n_b() 1772 * sees that we've accumulated a 1773 * token and flags that we need to 1774 * try matching the token before 1775 * proceeding. But for input(), 1776 * there's no matching to consider. 1777 * So convert the EOB_ACT_LAST_MATCH 1778 * to EOB_ACT_END_OF_FILE. 1779 */ 1780 1781 /* Reset buffer status. */ 1782 yyrestart( yyin ); 1783 1784 /* fall through */ 1785 1786 case EOB_ACT_END_OF_FILE: 1787 { 1788 if ( yywrap() ) 1789 return EOF; 1790 1791 if ( ! yy_did_buffer_switch_on_eof ) 1792 YY_NEW_FILE; 1793#ifdef __cplusplus 1794 return yyinput(); 1795#else 1796 return input(); 1797#endif 1798 } 1799 1800 case EOB_ACT_CONTINUE_SCAN: 1801 yy_c_buf_p = yytext_ptr + offset; 1802 break; 1803 } 1804 } 1805 } 1806 1807 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1808 *yy_c_buf_p = '\0'; /* preserve yytext */ 1809 yy_hold_char = *++yy_c_buf_p; 1810 1811 1812 return c; 1813 } 1814 1815 1816#ifdef YY_USE_PROTOS 1817void yyrestart( FILE *input_file ) 1818#else 1819void yyrestart( input_file ) 1820FILE *input_file; 1821#endif 1822 { 1823 if ( ! yy_current_buffer ) 1824 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1825 1826 yy_init_buffer( yy_current_buffer, input_file ); 1827 yy_load_buffer_state(); 1828 } 1829 1830 1831#ifdef YY_USE_PROTOS 1832void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1833#else 1834void yy_switch_to_buffer( new_buffer ) 1835YY_BUFFER_STATE new_buffer; 1836#endif 1837 { 1838 if ( yy_current_buffer == new_buffer ) 1839 return; 1840 1841 if ( yy_current_buffer ) 1842 { 1843 /* Flush out information for old buffer. */ 1844 *yy_c_buf_p = yy_hold_char; 1845 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1846 yy_current_buffer->yy_n_chars = yy_n_chars; 1847 } 1848 1849 yy_current_buffer = new_buffer; 1850 yy_load_buffer_state(); 1851 1852 /* We don't actually know whether we did this switch during 1853 * EOF (yywrap()) processing, but the only time this flag 1854 * is looked at is after yywrap() is called, so it's safe 1855 * to go ahead and always set it. 1856 */ 1857 yy_did_buffer_switch_on_eof = 1; 1858 } 1859 1860 1861#ifdef YY_USE_PROTOS 1862void yy_load_buffer_state( void ) 1863#else 1864void yy_load_buffer_state() 1865#endif 1866 { 1867 yy_n_chars = yy_current_buffer->yy_n_chars; 1868 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 1869 yyin = yy_current_buffer->yy_input_file; 1870 yy_hold_char = *yy_c_buf_p; 1871 } 1872 1873 1874#ifdef YY_USE_PROTOS 1875YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1876#else 1877YY_BUFFER_STATE yy_create_buffer( file, size ) 1878FILE *file; 1879int size; 1880#endif 1881 { 1882 YY_BUFFER_STATE b; 1883 1884 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1885 if ( ! b ) 1886 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1887 1888 b->yy_buf_size = size; 1889 1890 /* yy_ch_buf has to be 2 characters longer than the size given because 1891 * we need to put in 2 end-of-buffer characters. 1892 */ 1893 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 1894 if ( ! b->yy_ch_buf ) 1895 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1896 1897 b->yy_is_our_buffer = 1; 1898 1899 yy_init_buffer( b, file ); 1900 1901 return b; 1902 } 1903 1904 1905#ifdef YY_USE_PROTOS 1906void yy_delete_buffer( YY_BUFFER_STATE b ) 1907#else 1908void yy_delete_buffer( b ) 1909YY_BUFFER_STATE b; 1910#endif 1911 { 1912 if ( ! b ) 1913 return; 1914 1915 if ( b == yy_current_buffer ) 1916 yy_current_buffer = (YY_BUFFER_STATE) 0; 1917 1918 if ( b->yy_is_our_buffer ) 1919 yy_flex_free( (void *) b->yy_ch_buf ); 1920 1921 yy_flex_free( (void *) b ); 1922 } 1923 1924 1925#ifndef YY_ALWAYS_INTERACTIVE 1926#ifndef YY_NEVER_INTERACTIVE 1927extern int isatty YY_PROTO(( int )); 1928#endif 1929#endif 1930 1931#ifdef YY_USE_PROTOS 1932void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 1933#else 1934void yy_init_buffer( b, file ) 1935YY_BUFFER_STATE b; 1936FILE *file; 1937#endif 1938 1939 1940 { 1941 yy_flush_buffer( b ); 1942 1943 b->yy_input_file = file; 1944 b->yy_fill_buffer = 1; 1945 1946#if YY_ALWAYS_INTERACTIVE 1947 b->yy_is_interactive = 1; 1948#else 1949#if YY_NEVER_INTERACTIVE 1950 b->yy_is_interactive = 0; 1951#else 1952 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1953#endif 1954#endif 1955 } 1956 1957 1958#ifdef YY_USE_PROTOS 1959void yy_flush_buffer( YY_BUFFER_STATE b ) 1960#else 1961void yy_flush_buffer( b ) 1962YY_BUFFER_STATE b; 1963#endif 1964 1965 { 1966 if ( ! b ) 1967 return; 1968 1969 b->yy_n_chars = 0; 1970 1971 /* We always need two end-of-buffer characters. The first causes 1972 * a transition to the end-of-buffer state. The second causes 1973 * a jam in that state. 1974 */ 1975 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1976 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1977 1978 b->yy_buf_pos = &b->yy_ch_buf[0]; 1979 1980 b->yy_at_bol = 1; 1981 b->yy_buffer_status = YY_BUFFER_NEW; 1982 1983 if ( b == yy_current_buffer ) 1984 yy_load_buffer_state(); 1985 } 1986 1987 1988#ifndef YY_NO_SCAN_BUFFER 1989#ifdef YY_USE_PROTOS 1990YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 1991#else 1992YY_BUFFER_STATE yy_scan_buffer( base, size ) 1993char *base; 1994yy_size_t size; 1995#endif 1996 { 1997 YY_BUFFER_STATE b; 1998 1999 if ( size < 2 || 2000 base[size-2] != YY_END_OF_BUFFER_CHAR || 2001 base[size-1] != YY_END_OF_BUFFER_CHAR ) 2002 /* They forgot to leave room for the EOB's. */ 2003 return 0; 2004 2005 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 2006 if ( ! b ) 2007 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 2008 2009 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 2010 b->yy_buf_pos = b->yy_ch_buf = base; 2011 b->yy_is_our_buffer = 0; 2012 b->yy_input_file = 0; 2013 b->yy_n_chars = b->yy_buf_size; 2014 b->yy_is_interactive = 0; 2015 b->yy_at_bol = 1; 2016 b->yy_fill_buffer = 0; 2017 b->yy_buffer_status = YY_BUFFER_NEW; 2018 2019 yy_switch_to_buffer( b ); 2020 2021 return b; 2022 } 2023#endif 2024 2025 2026#ifndef YY_NO_SCAN_STRING 2027#ifdef YY_USE_PROTOS 2028YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 2029#else 2030YY_BUFFER_STATE yy_scan_string( yy_str ) 2031yyconst char *yy_str; 2032#endif 2033 { 2034 int len; 2035 for ( len = 0; yy_str[len]; ++len ) 2036 ; 2037 2038 return yy_scan_bytes( yy_str, len ); 2039 } 2040#endif 2041 2042 2043#ifndef YY_NO_SCAN_BYTES 2044#ifdef YY_USE_PROTOS 2045YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 2046#else 2047YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 2048yyconst char *bytes; 2049int len; 2050#endif 2051 { 2052 YY_BUFFER_STATE b; 2053 char *buf; 2054 yy_size_t n; 2055 int i; 2056 2057 /* Get memory for full buffer, including space for trailing EOB's. */ 2058 n = len + 2; 2059 buf = (char *) yy_flex_alloc( n ); 2060 if ( ! buf ) 2061 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 2062 2063 for ( i = 0; i < len; ++i ) 2064 buf[i] = bytes[i]; 2065 2066 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 2067 2068 b = yy_scan_buffer( buf, n ); 2069 if ( ! b ) 2070 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 2071 2072 /* It's okay to grow etc. this buffer, and we should throw it 2073 * away when we're done. 2074 */ 2075 b->yy_is_our_buffer = 1; 2076 2077 return b; 2078 } 2079#endif 2080 2081 2082#ifndef YY_NO_PUSH_STATE 2083#ifdef YY_USE_PROTOS 2084static void yy_push_state( int new_state ) 2085#else 2086static void yy_push_state( new_state ) 2087int new_state; 2088#endif 2089 { 2090 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 2091 { 2092 yy_size_t new_size; 2093 2094 yy_start_stack_depth += YY_START_STACK_INCR; 2095 new_size = yy_start_stack_depth * sizeof( int ); 2096 2097 if ( ! yy_start_stack ) 2098 yy_start_stack = (int *) yy_flex_alloc( new_size ); 2099 2100 else 2101 yy_start_stack = (int *) yy_flex_realloc( 2102 (void *) yy_start_stack, new_size ); 2103 2104 if ( ! yy_start_stack ) 2105 YY_FATAL_ERROR( 2106 "out of memory expanding start-condition stack" ); 2107 } 2108 2109 yy_start_stack[yy_start_stack_ptr++] = YY_START; 2110 2111 BEGIN(new_state); 2112 } 2113#endif 2114 2115 2116#ifndef YY_NO_POP_STATE 2117static void yy_pop_state() 2118 { 2119 if ( --yy_start_stack_ptr < 0 ) 2120 YY_FATAL_ERROR( "start-condition stack underflow" ); 2121 2122 BEGIN(yy_start_stack[yy_start_stack_ptr]); 2123 } 2124#endif 2125 2126 2127#ifndef YY_NO_TOP_STATE 2128static int yy_top_state() 2129 { 2130 return yy_start_stack[yy_start_stack_ptr - 1]; 2131 } 2132#endif 2133 2134#ifndef YY_EXIT_FAILURE 2135#define YY_EXIT_FAILURE 2 2136#endif 2137 2138#ifdef YY_USE_PROTOS 2139static void yy_fatal_error( yyconst char msg[] ) 2140#else 2141static void yy_fatal_error( msg ) 2142char msg[]; 2143#endif 2144 { 2145 (void) fprintf( stderr, "%s\n", msg ); 2146 exit( YY_EXIT_FAILURE ); 2147 } 2148 2149 2150 2151/* Redefine yyless() so it works in section 3 code. */ 2152 2153#undef yyless 2154#define yyless(n) \ 2155 do \ 2156 { \ 2157 /* Undo effects of setting up yytext. */ \ 2158 yytext[yyleng] = yy_hold_char; \ 2159 yy_c_buf_p = yytext + n; \ 2160 yy_hold_char = *yy_c_buf_p; \ 2161 *yy_c_buf_p = '\0'; \ 2162 yyleng = n; \ 2163 } \ 2164 while ( 0 ) 2165 2166 2167/* Internal utility routines. */ 2168 2169#ifndef yytext_ptr 2170#ifdef YY_USE_PROTOS 2171static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 2172#else 2173static void yy_flex_strncpy( s1, s2, n ) 2174char *s1; 2175yyconst char *s2; 2176int n; 2177#endif 2178 { 2179 register int i; 2180 for ( i = 0; i < n; ++i ) 2181 s1[i] = s2[i]; 2182 } 2183#endif 2184 2185#ifdef YY_NEED_STRLEN 2186#ifdef YY_USE_PROTOS 2187static int yy_flex_strlen( yyconst char *s ) 2188#else 2189static int yy_flex_strlen( s ) 2190yyconst char *s; 2191#endif 2192 { 2193 register int n; 2194 for ( n = 0; s[n]; ++n ) 2195 ; 2196 2197 return n; 2198 } 2199#endif 2200 2201 2202#ifdef YY_USE_PROTOS 2203static void *yy_flex_alloc( yy_size_t size ) 2204#else 2205static void *yy_flex_alloc( size ) 2206yy_size_t size; 2207#endif 2208 { 2209 return (void *) malloc( size ); 2210 } 2211 2212#ifdef YY_USE_PROTOS 2213static void *yy_flex_realloc( void *ptr, yy_size_t size ) 2214#else 2215static void *yy_flex_realloc( ptr, size ) 2216void *ptr; 2217yy_size_t size; 2218#endif 2219 { 2220 /* The cast to (char *) in the following accommodates both 2221 * implementations that use char* generic pointers, and those 2222 * that use void* generic pointers. It works with the latter 2223 * because both ANSI C and C++ allow castless assignment from 2224 * any pointer type to void*, and deal with argument conversions 2225 * as though doing an assignment. 2226 */ 2227 return (void *) realloc( (char *) ptr, size ); 2228 } 2229 2230#ifdef YY_USE_PROTOS 2231static void yy_flex_free( void *ptr ) 2232#else 2233static void yy_flex_free( ptr ) 2234void *ptr; 2235#endif 2236 { 2237 free( ptr ); 2238 } 2239 2240#if YY_MAIN 2241int main() 2242 { 2243 yylex(); 2244 return 0; 2245 } 2246#endif 2247#line 363 "scan.l" 2248 2249 2250 2251 2252/* This is the way to get multiple files input into lex. */ 2253 2254int 2255yywrap() 2256{ 2257 if (!open_new_file ()) return (1); /* EOF on standard in. */ 2258 return (0); /* We have more input. */ 2259} 2260