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