4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 33
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
100 #endif /* __STDC__ */
101 #endif /* ! __cplusplus */
104 #define yyconst const
109 /* Returned upon end-of-file. */
112 /* Promotes a possibly negative, possibly signed char to an unsigned
113 * integer for use as an array index. If the signed char is negative,
114 * we want to instead treat it as an 8-bit unsigned char, hence the
117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119 /* Enter a start condition. This macro really ought to take a parameter,
120 * but we do it the disgusting crufty way forced on us by the ()-less
121 * definition of BEGIN.
123 #define BEGIN (yy_start) = 1 + 2 *
125 /* Translate the current start state into a value that can be later handed
126 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 #define YY_START (((yy_start) - 1) / 2)
130 #define YYSTATE YY_START
132 /* Action number for EOF rule of a given start state. */
133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135 /* Special action meaning "start processing a new file". */
136 #define YY_NEW_FILE yyrestart(yyin )
138 #define YY_END_OF_BUFFER_CHAR 0
140 /* Size of default input buffer. */
142 #define YY_BUF_SIZE 16384
145 /* The state buf must be large enough to hold one state per character in the main buffer.
147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
156 extern FILE *yyin, *yyout;
158 #define EOB_ACT_CONTINUE_SCAN 0
159 #define EOB_ACT_END_OF_FILE 1
160 #define EOB_ACT_LAST_MATCH 2
162 #define YY_LESS_LINENO(n)
164 /* Return all but the first "n" matched characters back to the input stream. */
168 /* Undo effects of setting up yytext. */ \
169 int yyless_macro_arg = (n); \
170 YY_LESS_LINENO(yyless_macro_arg);\
171 *yy_cp = (yy_hold_char); \
172 YY_RESTORE_YY_MORE_OFFSET \
173 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
174 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
178 #define unput(c) yyunput( c, (yytext_ptr) )
180 /* The following is because we cannot portably get our hands on size_t
181 * (without autoconf's help, which isn't available because we want
182 * flex-generated scanners to compile on their own).
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef unsigned int yy_size_t;
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
196 char *yy_ch_buf; /* input buffer */
197 char *yy_buf_pos; /* current position in input buffer */
199 /* Size of input buffer in bytes, not including room for EOB
202 yy_size_t yy_buf_size;
204 /* Number of characters read into yy_ch_buf, not including EOB
209 /* Whether we "own" the buffer - i.e., we know we created it,
210 * and can realloc() it to grow it, and should free() it to
213 int yy_is_our_buffer;
215 /* Whether this is an "interactive" input source; if so, and
216 * if we're using stdio for input, then we want to use getc()
217 * instead of fread(), to make sure we stop fetching input after
220 int yy_is_interactive;
222 /* Whether we're considered to be at the beginning of a line.
223 * If so, '^' rules will be active on the next match, otherwise
228 int yy_bs_lineno; /**< The line count. */
229 int yy_bs_column; /**< The column count. */
231 /* Whether to try to fill the input buffer when we reach the
236 int yy_buffer_status;
238 #define YY_BUFFER_NEW 0
239 #define YY_BUFFER_NORMAL 1
240 /* When an EOF's been seen but there's still some text to process
241 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
242 * shouldn't try reading from the input source any more. We might
243 * still have a bunch of tokens to match, though, because of
244 * possible backing-up.
246 * When we actually see the EOF, we change the status to "new"
247 * (via yyrestart()), so that the user can continue scanning by
248 * just pointing yyin at a new input file.
250 #define YY_BUFFER_EOF_PENDING 2
253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
255 /* Stack of input buffers. */
256 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
257 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
258 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
260 /* We provide macros for accessing buffer states in case in the
261 * future we want to put the buffer states in a more general
264 * Returns the top of the stack, or NULL.
266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
270 /* Same as previous macro, but useful when we know that the buffer stack is not
271 * NULL or when we need an lvalue. For internal use only.
273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 /* yy_hold_char holds the character lost when yytext is formed. */
276 static char yy_hold_char;
277 static int yy_n_chars; /* number of characters read into yy_ch_buf */
280 /* Points to current character in buffer. */
281 static char *yy_c_buf_p = (char *) 0;
282 static int yy_init = 0; /* whether we need to initialize */
283 static int yy_start = 0; /* start state number */
285 /* Flag which is used to allow yywrap()'s to do buffer switches
286 * instead of setting up a fresh yyin. A bit of a hack ...
288 static int yy_did_buffer_switch_on_eof;
290 void yyrestart (FILE *input_file );
291 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
292 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
293 void yy_delete_buffer (YY_BUFFER_STATE b );
294 void yy_flush_buffer (YY_BUFFER_STATE b );
295 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
296 void yypop_buffer_state (void );
298 static void yyensure_buffer_stack (void );
299 static void yy_load_buffer_state (void );
300 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
302 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
304 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
305 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
306 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
308 void *yyalloc (yy_size_t );
309 void *yyrealloc (void *,yy_size_t );
310 void yyfree (void * );
312 #define yy_new_buffer yy_create_buffer
314 #define yy_set_interactive(is_interactive) \
316 if ( ! YY_CURRENT_BUFFER ){ \
317 yyensure_buffer_stack (); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 yy_create_buffer(yyin,YY_BUF_SIZE ); \
321 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
324 #define yy_set_bol(at_bol) \
326 if ( ! YY_CURRENT_BUFFER ){\
327 yyensure_buffer_stack (); \
328 YY_CURRENT_BUFFER_LVALUE = \
329 yy_create_buffer(yyin,YY_BUF_SIZE ); \
331 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 /* Begin user sect3 */
338 typedef unsigned char YY_CHAR;
340 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
342 typedef int yy_state_type;
349 #define yytext_ptr yytext
351 static yy_state_type yy_get_previous_state (void );
352 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
353 static int yy_get_next_buffer (void );
354 static void yy_fatal_error (yyconst char msg[] );
356 /* Done after the current pattern has been matched and before the
357 * corresponding action - sets up yytext.
359 #define YY_DO_BEFORE_ACTION \
360 (yytext_ptr) = yy_bp; \
361 yyleng = (size_t) (yy_cp - yy_bp); \
362 (yy_hold_char) = *yy_cp; \
364 (yy_c_buf_p) = yy_cp;
366 #define YY_NUM_RULES 46
367 #define YY_END_OF_BUFFER 47
368 /* This struct is not used in this scanner,
369 but its presence is necessary. */
372 flex_int32_t yy_verify;
375 static yyconst flex_int16_t yy_accept[316] =
377 0, 0, 2, 2, 47, 45, 40, 38, 32, 45,
378 1, 33, 33, 29, 33, 29, 29, 28, 33, 44,
379 36, 34, 36, 45, 29, 42, 42, 42, 42, 42,
380 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
381 42, 42, 45, 2, 2, 3, 2, 2, 1, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 40, 36, 0, 43, 34, 30, 37, 44, 0,
386 41, 44, 44, 0, 35, 39, 42, 42, 42, 42,
388 42, 42, 42, 42, 42, 42, 10, 42, 42, 42,
389 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
390 31, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 44, 0, 0, 44, 0, 42, 42, 42, 42,
395 42, 9, 42, 42, 42, 42, 42, 42, 42, 42,
396 42, 42, 42, 42, 42, 42, 42, 42, 42, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 16, 42, 42, 42,
401 17, 20, 42, 42, 21, 42, 42, 42, 42, 6,
402 42, 18, 42, 42, 12, 22, 42, 42, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405 5, 42, 42, 42, 14, 42, 42, 15, 26, 42,
406 42, 13, 42, 11, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 42, 4,
408 42, 7, 27, 19, 8, 42, 2, 2, 2, 2,
410 2, 2, 2, 2, 42, 23, 42, 2, 2, 2,
414 static yyconst flex_int32_t yy_ec[256] =
416 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 2, 4, 5, 6, 1, 7, 8, 1, 9,
420 10, 11, 12, 13, 14, 15, 16, 17, 17, 17,
421 17, 17, 17, 17, 17, 17, 17, 1, 18, 19,
422 20, 21, 1, 1, 22, 22, 22, 22, 22, 22,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 23, 24, 25, 26, 27, 1, 28, 29, 30, 31,
427 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
428 42, 43, 44, 45, 46, 47, 48, 49, 50, 37,
429 51, 37, 52, 53, 54, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 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,
446 static yyconst flex_int32_t yy_meta[55] =
448 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 3, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
451 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
452 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
456 static yyconst flex_int16_t yy_base[320] =
458 0, 0, 54, 0, 553, 554, 550, 554, 531, 545,
459 554, 529, 540, 554, 527, 97, 96, 96, 101, 107,
460 526, 116, 525, 541, 523, 494, 496, 498, 507, 499,
461 495, 0, 83, 104, 107, 507, 490, 486, 106, 96,
462 491, 113, 479, 0, 529, 554, 510, 141, 0, 509,
463 520, 0, 507, 133, 135, 130, 139, 141, 506, 150,
464 505, 521, 503, 160, 123, 125, 137, 112, 130, 474,
465 184, 185, 187, 188, 134, 473, 193, 183, 132, 194,
466 467, 517, 554, 513, 554, 554, 554, 554, 221, 514,
467 554, 222, 232, 513, 554, 554, 0, 468, 482, 472,
469 479, 465, 465, 470, 462, 479, 0, 460, 464, 464,
470 475, 466, 465, 459, 206, 471, 453, 461, 451, 459,
471 554, 0, 492, 0, 178, 0, 0, 0, 0, 233,
472 490, 0, 241, 244, 489, 0, 443, 67, 192, 189,
473 219, 138, 203, 221, 180, 234, 442, 224, 223, 233,
474 246, 239, 240, 236, 250, 251, 235, 253, 245, 255,
475 0, 278, 486, 287, 288, 485, 445, 458, 438, 448,
476 451, 0, 435, 434, 434, 432, 444, 441, 430, 434,
477 427, 442, 441, 423, 431, 422, 437, 422, 427, 291,
478 462, 297, 461, 244, 268, 259, 281, 286, 415, 275,
480 277, 280, 283, 293, 284, 287, 295, 290, 308, 309,
481 414, 303, 297, 315, 302, 310, 0, 423, 424, 418,
482 0, 0, 416, 425, 0, 409, 408, 422, 406, 0,
483 410, 0, 406, 418, 0, 0, 421, 416, 399, 314,
484 312, 313, 398, 397, 311, 323, 396, 317, 319, 336,
485 322, 395, 330, 394, 328, 342, 393, 392, 347, 345,
486 0, 398, 406, 392, 0, 401, 389, 0, 0, 394,
487 392, 0, 391, 0, 383, 338, 348, 337, 382, 346,
488 341, 381, 380, 343, 351, 379, 356, 378, 373, 0,
489 364, 0, 0, 0, 0, 367, 365, 364, 350, 363,
491 362, 361, 359, 355, 374, 0, 337, 368, 237, 357,
492 0, 0, 168, 127, 554, 416, 122, 419, 422
495 static yyconst flex_int16_t yy_def[320] =
497 315, 1, 315, 3, 315, 315, 315, 315, 315, 316,
498 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
499 315, 315, 315, 315, 315, 317, 317, 317, 317, 317,
500 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
501 317, 317, 315, 318, 318, 315, 318, 319, 318, 318,
502 318, 318, 318, 318, 318, 318, 318, 318, 318, 318,
503 318, 318, 318, 318, 64, 64, 64, 64, 64, 64,
504 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
505 318, 315, 315, 316, 315, 315, 315, 315, 315, 315,
506 315, 315, 315, 315, 315, 315, 317, 317, 317, 317,
508 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
509 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
510 315, 318, 318, 318, 319, 318, 318, 318, 318, 318,
511 318, 318, 318, 318, 318, 318, 64, 64, 64, 64,
512 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
513 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
514 318, 315, 315, 315, 315, 315, 317, 317, 317, 317,
515 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
516 317, 317, 317, 317, 317, 317, 317, 317, 317, 318,
517 318, 318, 318, 64, 64, 64, 64, 64, 64, 64,
519 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
520 64, 64, 64, 64, 64, 64, 317, 317, 317, 317,
521 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
522 317, 317, 317, 317, 317, 317, 317, 317, 64, 64,
523 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
524 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
525 317, 317, 317, 317, 317, 317, 317, 317, 317, 317,
526 317, 317, 317, 317, 64, 64, 64, 64, 64, 64,
527 64, 64, 64, 64, 64, 64, 64, 64, 317, 317,
528 317, 317, 317, 317, 317, 317, 64, 64, 64, 64,
530 64, 64, 64, 64, 317, 317, 317, 64, 64, 64,
531 317, 317, 64, 64, 0, 315, 315, 315, 315
534 static yyconst flex_int16_t yy_nxt[609] =
536 6, 7, 8, 9, 10, 11, 12, 13, 14, 14,
537 15, 16, 14, 17, 18, 19, 20, 14, 21, 22,
538 23, 20, 14, 24, 14, 25, 6, 26, 27, 28,
539 29, 30, 31, 32, 33, 34, 32, 32, 35, 32,
540 32, 36, 37, 38, 39, 40, 32, 32, 41, 42,
541 32, 14, 43, 14, 44, 45, 46, 47, 48, 49,
542 50, 51, 52, 52, 53, 54, 52, 55, 56, 57,
543 58, 52, 59, 60, 61, 58, 52, 62, 52, 63,
544 44, 64, 65, 66, 67, 68, 69, 70, 71, 72,
545 70, 70, 73, 70, 70, 74, 75, 76, 77, 78,
547 70, 70, 79, 80, 70, 52, 81, 52, 88, 88,
548 104, 91, 89, 194, 137, 86, 86, 89, 105, 90,
549 86, 92, 95, 93, 97, 116, 95, 95, 93, 95,
550 94, 95, 106, 114, 108, 83, 107, 115, 109, 117,
551 119, 95, 110, 84, 129, 126, 130, 120, 129, 132,
552 142, 130, 127, 131, 127, 133, 136, 134, 127, 137,
553 136, 136, 134, 136, 135, 136, 140, 139, 141, 124,
554 137, 143, 137, 158, 137, 136, 137, 137, 152, 137,
555 84, 137, 126, 198, 137, 137, 137, 137, 137, 137,
556 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
558 137, 137, 137, 137, 137, 137, 137, 138, 137, 137,
559 137, 144, 156, 146, 148, 137, 151, 147, 149, 145,
560 154, 159, 150, 195, 155, 201, 157, 137, 160, 196,
561 137, 137, 137, 183, 137, 137, 137, 162, 165, 137,
562 137, 137, 162, 165, 163, 166, 92, 199, 93, 190,
563 137, 197, 184, 93, 190, 94, 191, 192, 133, 200,
564 134, 202, 192, 204, 193, 134, 137, 135, 137, 203,
565 137, 137, 205, 206, 207, 208, 209, 210, 212, 213,
566 137, 137, 137, 137, 137, 239, 137, 137, 214, 215,
567 216, 137, 137, 137, 162, 240, 211, 137, 137, 162,
569 137, 163, 137, 89, 165, 241, 137, 190, 89, 165,
570 90, 166, 190, 192, 191, 137, 242, 243, 192, 249,
571 193, 244, 137, 245, 137, 246, 248, 137, 137, 247,
572 137, 137, 250, 137, 137, 251, 252, 137, 253, 254,
573 137, 256, 137, 257, 137, 258, 259, 276, 260, 137,
574 137, 275, 278, 277, 279, 137, 137, 137, 137, 137,
575 137, 137, 137, 280, 137, 281, 137, 282, 283, 137,
576 137, 284, 285, 286, 287, 137, 288, 137, 297, 298,
577 300, 299, 302, 137, 137, 137, 301, 312, 137, 137,
578 137, 303, 137, 137, 137, 137, 304, 137, 137, 313,
580 309, 310, 137, 137, 137, 311, 137, 314, 137, 137,
581 137, 137, 308, 307, 306, 137, 84, 84, 84, 122,
582 305, 122, 125, 125, 125, 137, 137, 137, 137, 137,
583 137, 296, 295, 294, 293, 292, 291, 290, 289, 137,
584 137, 137, 137, 137, 137, 137, 137, 274, 273, 272,
585 271, 270, 269, 268, 267, 266, 265, 264, 263, 262,
586 261, 255, 137, 165, 162, 238, 237, 236, 235, 234,
587 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
588 223, 222, 221, 220, 219, 218, 217, 165, 162, 137,
589 137, 93, 164, 123, 189, 188, 187, 186, 185, 182,
591 181, 180, 179, 178, 177, 176, 175, 174, 173, 172,
592 171, 170, 169, 168, 167, 93, 164, 85, 82, 161,
593 153, 137, 127, 96, 124, 124, 127, 128, 127, 124,
594 123, 121, 118, 113, 112, 111, 103, 102, 101, 100,
595 99, 98, 86, 96, 83, 83, 86, 87, 86, 85,
596 83, 82, 315, 5, 315, 315, 315, 315, 315, 315,
597 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
598 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
599 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
600 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
602 315, 315, 315, 315, 315, 315, 315, 315
605 static yyconst flex_int16_t yy_chk[609] =
607 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
613 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
614 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
615 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
616 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
618 3, 3, 3, 3, 3, 3, 3, 3, 16, 17,
619 33, 19, 18, 138, 138, 17, 16, 18, 33, 18,
620 19, 20, 22, 20, 317, 40, 22, 22, 20, 22,
621 20, 22, 34, 39, 35, 22, 34, 39, 35, 40,
622 42, 22, 35, 48, 54, 48, 56, 42, 55, 57,
623 68, 56, 54, 56, 55, 58, 60, 58, 57, 68,
624 60, 60, 58, 60, 58, 60, 66, 65, 67, 60,
625 65, 69, 66, 79, 314, 60, 64, 69, 75, 79,
626 125, 75, 125, 142, 67, 142, 64, 64, 64, 64,
627 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
629 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
630 64, 71, 78, 72, 73, 313, 74, 72, 73, 71,
631 77, 80, 73, 139, 77, 145, 78, 145, 80, 140,
632 78, 71, 72, 115, 73, 74, 140, 89, 92, 139,
633 77, 80, 89, 92, 89, 92, 93, 143, 93, 130,
634 143, 141, 115, 93, 130, 93, 130, 133, 134, 144,
635 134, 146, 133, 149, 133, 134, 141, 134, 144, 148,
636 149, 148, 150, 151, 152, 153, 154, 155, 156, 157,
637 150, 146, 157, 154, 309, 194, 152, 153, 158, 159,
638 160, 194, 159, 151, 162, 195, 155, 155, 156, 162,
640 158, 162, 160, 164, 165, 196, 196, 190, 164, 165,
641 164, 165, 190, 192, 190, 195, 197, 198, 192, 205,
642 192, 200, 200, 201, 201, 202, 204, 202, 197, 203,
643 203, 205, 206, 198, 206, 207, 208, 208, 209, 210,
644 204, 212, 207, 213, 213, 214, 215, 241, 216, 215,
645 212, 240, 245, 242, 246, 209, 210, 216, 245, 241,
646 242, 240, 214, 248, 248, 249, 249, 250, 251, 251,
647 246, 253, 255, 256, 259, 255, 260, 253, 276, 277,
648 280, 278, 284, 250, 278, 276, 281, 307, 281, 256,
649 284, 285, 260, 280, 259, 277, 287, 299, 285, 308,
651 299, 304, 304, 287, 310, 305, 303, 310, 302, 301,
652 300, 298, 297, 296, 291, 308, 316, 316, 316, 318,
653 289, 318, 319, 319, 319, 288, 286, 283, 282, 279,
654 275, 273, 271, 270, 267, 266, 264, 263, 262, 258,
655 257, 254, 252, 247, 244, 243, 239, 238, 237, 234,
656 233, 231, 229, 228, 227, 226, 224, 223, 220, 219,
657 218, 211, 199, 193, 191, 189, 188, 187, 186, 185,
658 184, 183, 182, 181, 180, 179, 178, 177, 176, 175,
659 174, 173, 171, 170, 169, 168, 167, 166, 163, 147,
660 137, 135, 131, 123, 120, 119, 118, 117, 116, 114,
662 113, 112, 111, 110, 109, 108, 106, 105, 104, 103,
663 102, 101, 100, 99, 98, 94, 90, 84, 82, 81,
664 76, 70, 63, 62, 61, 59, 53, 51, 50, 47,
665 45, 43, 41, 38, 37, 36, 31, 30, 29, 28,
666 27, 26, 25, 24, 23, 21, 15, 13, 12, 10,
667 9, 7, 5, 315, 315, 315, 315, 315, 315, 315,
668 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
669 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
670 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
671 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
673 315, 315, 315, 315, 315, 315, 315, 315
676 static yy_state_type yy_last_accepting_state;
677 static char *yy_last_accepting_cpos;
679 extern int yy_flex_debug;
680 int yy_flex_debug = 0;
682 /* The intent behind this definition is that it'll catch
683 * any uses of REJECT which flex missed.
685 #define REJECT reject_used_but_not_detected
686 #define yymore() yymore_used_but_not_detected
687 #define YY_MORE_ADJ 0
688 #define YY_RESTORE_YY_MORE_OFFSET
691 /* This file is part of GNU bc.
693 Copyright (C) 1991-1994, 1997, 2006 Free Software Foundation, Inc.
695 This program is free software; you can redistribute it and/or modify
696 it under the terms of the GNU General Public License as published by
697 the Free Software Foundation; either version 2 of the License , or
698 (at your option) any later version.
700 This program is distributed in the hope that it will be useful,
701 but WITHOUT ANY WARRANTY; without even the implied warranty of
702 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
703 GNU General Public License for more details.
705 You should have received a copy of the GNU General Public License
706 along with this program; see the file COPYING. If not, write to:
707 The Free Software Foundation, Inc.
708 Foundation, Inc. 51 Franklin Street, Fifth Floor,
709 Boston, MA 02110-1301 USA
711 You may contact the author by:
712 e-mail: philnelson@acm.org
713 us-mail: Philip A. Nelson
714 Computer Science Department, 9062
715 Western Washington University
716 Bellingham, WA 98226-9062
718 *************************************************************************/
719 /* scan.l: the (f)lex description file for the scanner. */
728 /* Using flex, we can ask for a smaller input buffer. With lex, this
732 #undef YY_READ_BUF_SIZE
733 #define YY_READ_BUF_SIZE 512
736 /* Force . as last for now. */
739 /* We want to define our own yywrap. */
741 _PROTOTYPE(int yywrap, (void));
744 /* Support for the BSD libedit with history for
745 nicer input on the interactive part of input. */
747 #include <histedit.h>
749 /* Have input call the following function. */
751 #define YY_INPUT(buf,result,max_size) \
752 bcel_input((char *)buf, &result, max_size)
754 /* Variables to help interface editline with bc. */
755 static const char *bcel_line = (char *)NULL;
756 static int bcel_len = 0;
759 /* Required to get rid of that ugly ? default prompt! */
761 null_prompt (EditLine *el)
767 /* bcel_input puts upto MAX characters into BUF with the number put in
768 BUF placed in *RESULT. If the yy input file is the same as
769 stdin, use editline. Otherwise, just read it.
773 bcel_input (buf, result, max)
778 if (!edit || yyin != stdin)
780 while ( (*result = read( fileno(yyin), buf, max )) < 0 )
783 yyerror( "read() in flex scanner failed" );
789 /* Do we need a new string? */
792 bcel_line = el_gets(edit, &bcel_len);
793 if (bcel_line == NULL) {
800 history (hist, &histev, H_ENTER, bcel_line);
806 strncpy (buf, bcel_line, bcel_len);
812 strncpy (buf, bcel_line, max);
821 /* Support for the readline and history libraries. This allows
822 nicer input on the interactive part of input. */
824 /* Have input call the following function. */
826 #define YY_INPUT(buf,result,max_size) \
827 rl_input((char *)buf, &result, max_size)
829 /* Variables to help interface readline with bc. */
830 static char *rl_line = (char *)NULL;
831 static char *rl_start = (char *)NULL;
832 static int rl_len = 0;
834 /* Definitions for readline access. */
835 extern FILE *rl_instream;
837 /* rl_input puts upto MAX characters into BUF with the number put in
838 BUF placed in *RESULT. If the yy input file is the same as
839 rl_instream (stdin), use readline. Otherwise, just read it.
843 rl_input (buf, result, max)
848 if (yyin != rl_instream)
850 while ( (*result = read( fileno(yyin), buf, max )) < 0 )
853 yyerror( "read() in flex scanner failed" );
859 /* Do we need a new string? */
864 rl_start = readline ("");
865 if (rl_start == NULL) {
872 rl_len = strlen (rl_line)+1;
874 add_history (rl_line);
875 rl_line[rl_len-1] = '\n';
881 strncpy (buf, rl_line, rl_len);
887 strncpy (buf, rl_line, max);
895 #if !defined(READLINE) && !defined(LIBEDIT)
897 /* MINIX returns from read with < 0 if SIGINT is encountered.
898 In flex, we can redefine YY_INPUT to the following. In lex, this
901 #define YY_INPUT(buf,result,max_size) \
902 while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
903 if (errno != EINTR) \
904 YY_FATAL_ERROR( "read() in flex scanner failed" );
913 #ifndef YY_NO_UNISTD_H
914 /* Special case for "unistd.h", since it is non-ANSI. We include it way
915 * down here because we want the user's section 1 to have been scanned first.
916 * The user has a chance to override it with an option.
921 #ifndef YY_EXTRA_TYPE
922 #define YY_EXTRA_TYPE void *
925 static int yy_init_globals (void );
927 /* Macros after this point can all be overridden by user definitions in
931 #ifndef YY_SKIP_YYWRAP
933 extern "C" int yywrap (void );
935 extern int yywrap (void );
939 static void yyunput (int c,char *buf_ptr );
942 static void yy_flex_strncpy (char *,yyconst char *,int );
945 #ifdef YY_NEED_STRLEN
946 static int yy_flex_strlen (yyconst char * );
952 static int yyinput (void );
954 static int input (void );
959 /* Amount of stuff to slurp up with each read. */
960 #ifndef YY_READ_BUF_SIZE
961 #define YY_READ_BUF_SIZE 8192
964 /* Copy whatever the last rule matched to the standard output. */
966 /* This used to be an fputs(), but since the string might contain NUL's,
967 * we now use fwrite().
969 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
972 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
973 * is returned in "result".
976 #define YY_INPUT(buf,result,max_size) \
977 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
981 for ( n = 0; n < max_size && \
982 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
985 buf[n++] = (char) c; \
986 if ( c == EOF && ferror( yyin ) ) \
987 YY_FATAL_ERROR( "input in flex scanner failed" ); \
993 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
995 if( errno != EINTR) \
997 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1008 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1009 * we don't want an extra ';' after the "return" because that will cause
1010 * some compilers to complain about unreachable statements.
1013 #define yyterminate() return YY_NULL
1016 /* Number of entries by which start-condition stack grows. */
1017 #ifndef YY_START_STACK_INCR
1018 #define YY_START_STACK_INCR 25
1021 /* Report a fatal error. */
1022 #ifndef YY_FATAL_ERROR
1023 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1026 /* end tables serialization structures and prototypes */
1028 /* Default declaration of generated scanner - a define so the user can
1029 * easily add parameters.
1032 #define YY_DECL_IS_OURS 1
1034 extern int yylex (void);
1036 #define YY_DECL int yylex (void)
1037 #endif /* !YY_DECL */
1039 /* Code executed at the beginning of each rule, after yytext and yyleng
1042 #ifndef YY_USER_ACTION
1043 #define YY_USER_ACTION
1046 /* Code executed at the end of each rule. */
1048 #define YY_BREAK break;
1051 #define YY_RULE_SETUP \
1054 /** The main scanner function which does all the work.
1058 register yy_state_type yy_current_state;
1059 register char *yy_cp, *yy_bp;
1060 register int yy_act;
1075 (yy_start) = 1; /* first start state */
1083 if ( ! YY_CURRENT_BUFFER ) {
1084 yyensure_buffer_stack ();
1085 YY_CURRENT_BUFFER_LVALUE =
1086 yy_create_buffer(yyin,YY_BUF_SIZE );
1089 yy_load_buffer_state( );
1092 while ( 1 ) /* loops until end-of-file is reached */
1094 yy_cp = (yy_c_buf_p);
1096 /* Support of yytext. */
1097 *yy_cp = (yy_hold_char);
1099 /* yy_bp points to the position in yy_ch_buf of the start of
1104 yy_current_state = (yy_start);
1108 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1109 if ( yy_accept[yy_current_state] )
1111 (yy_last_accepting_state) = yy_current_state;
1112 (yy_last_accepting_cpos) = yy_cp;
1114 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1116 yy_current_state = (int) yy_def[yy_current_state];
1117 if ( yy_current_state >= 316 )
1118 yy_c = yy_meta[(unsigned int) yy_c];
1120 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1123 while ( yy_base[yy_current_state] != 554 );
1126 yy_act = yy_accept[yy_current_state];
1128 { /* have to back up */
1129 yy_cp = (yy_last_accepting_cpos);
1130 yy_current_state = (yy_last_accepting_state);
1131 yy_act = yy_accept[yy_current_state];
1134 YY_DO_BEFORE_ACTION;
1136 do_action: /* This label is used only to access EOF actions. */
1139 { /* beginning of action switch */
1140 case 0: /* must back up */
1141 /* undo the effects of YY_DO_BEFORE_ACTION */
1142 *yy_cp = (yy_hold_char);
1143 yy_cp = (yy_last_accepting_cpos);
1144 yy_current_state = (yy_last_accepting_state);
1145 goto yy_find_action;
1154 yyerror ("illegal character: #");
1163 /* rule 3 can match eol */
1166 { line_no++; BEGIN(INITIAL); return(ENDOFLINE); }
1267 #if defined(READLINE) || defined(LIBEDIT)
1270 yylval.s_value = strcopyof(yytext); return(NAME);
1301 yyerror ("illegal character: %s",yytext);
1308 { yylval.c_value = yytext[0];
1309 return((int)yytext[0]); }
1329 { yylval.c_value = yytext[0]; return((int)yytext[0]); }
1334 { yylval.c_value = yytext[0]; return(ASSIGN_OP); }
1342 warn_save = warn_not_std;
1343 warn_not_std = TRUE;
1344 warn ("Old fashioned =<op>");
1345 warn_not_std = warn_save;
1346 yylval.c_value = yytext[1];
1348 yylval.c_value = '=';
1357 { yylval.s_value = strcopyof(yytext); return(REL_OP); }
1362 { yylval.c_value = yytext[0]; return(INCR_DECR); }
1365 /* rule 38 can match eol */
1368 { line_no++; return(ENDOFLINE); }
1371 /* rule 39 can match eol */
1374 { line_no++; /* ignore a "quoted" newline */ }
1379 { /* ignore spaces and tabs */ }
1389 while ( ((c=input()) != '*') && (c != EOF))
1391 if (c == '\n') line_no++;
1394 while ( (c=input()) == '*') /* eat it*/;
1395 if (c == '/') break; /* at end of comment */
1396 if (c == '\n') line_no++;
1400 fprintf (stderr,"EOF encountered in a comment.\n");
1409 { yylval.s_value = strcopyof(yytext); return(NAME); }
1412 /* rule 43 can match eol */
1418 yylval.s_value = strcopyof(yytext);
1419 for (look = yytext; *look != 0; look++)
1421 if (*look == '\n') line_no++;
1422 if (*look == '"') count++;
1424 if (count != 2) yyerror ("NUL character in string.");
1429 /* rule 44 can match eol */
1435 /* remove a trailing decimal point. */
1436 len = strlen(yytext);
1437 if (yytext[len-1] == '.')
1439 /* remove leading zeros. */
1442 while (*src == '0') src++;
1443 if (*src == 0) src--;
1444 /* Copy strings removing the newlines. */
1456 yylval.s_value = strcopyof(yytext);
1464 if (yytext[0] < ' ')
1465 yyerror ("illegal character: ^%c",yytext[0] + '@');
1467 if (yytext[0] > '~')
1468 yyerror ("illegal character: \\%03o", (int) yytext[0]);
1470 yyerror ("illegal character: %s",yytext);
1479 case YY_STATE_EOF(INITIAL):
1480 case YY_STATE_EOF(slcomment):
1483 case YY_END_OF_BUFFER:
1485 /* Amount of text matched not including the EOB char. */
1486 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1488 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1489 *yy_cp = (yy_hold_char);
1490 YY_RESTORE_YY_MORE_OFFSET
1492 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1494 /* We're scanning a new file or input source. It's
1495 * possible that this happened because the user
1496 * just pointed yyin at a new source and called
1497 * yylex(). If so, then we have to assure
1498 * consistency between YY_CURRENT_BUFFER and our
1499 * globals. Here is the right place to do so, because
1500 * this is the first action (other than possibly a
1501 * back-up) that will match for the new input source.
1503 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1504 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1505 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1508 /* Note that here we test for yy_c_buf_p "<=" to the position
1509 * of the first EOB in the buffer, since yy_c_buf_p will
1510 * already have been incremented past the NUL character
1511 * (since all states make transitions on EOB to the
1512 * end-of-buffer state). Contrast this with the test
1515 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1516 { /* This was really a NUL. */
1517 yy_state_type yy_next_state;
1519 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1521 yy_current_state = yy_get_previous_state( );
1523 /* Okay, we're now positioned to make the NUL
1524 * transition. We couldn't have
1525 * yy_get_previous_state() go ahead and do it
1526 * for us because it doesn't know how to deal
1527 * with the possibility of jamming (and we don't
1528 * want to build jamming into it because then it
1529 * will run more slowly).
1532 yy_next_state = yy_try_NUL_trans( yy_current_state );
1534 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1536 if ( yy_next_state )
1538 /* Consume the NUL. */
1539 yy_cp = ++(yy_c_buf_p);
1540 yy_current_state = yy_next_state;
1546 yy_cp = (yy_c_buf_p);
1547 goto yy_find_action;
1551 else switch ( yy_get_next_buffer( ) )
1553 case EOB_ACT_END_OF_FILE:
1555 (yy_did_buffer_switch_on_eof) = 0;
1559 /* Note: because we've taken care in
1560 * yy_get_next_buffer() to have set up
1561 * yytext, we can now set up
1562 * yy_c_buf_p so that if some total
1563 * hoser (like flex itself) wants to
1564 * call the scanner after we return the
1565 * YY_NULL, it'll still work - another
1566 * YY_NULL will get returned.
1568 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1570 yy_act = YY_STATE_EOF(YY_START);
1576 if ( ! (yy_did_buffer_switch_on_eof) )
1582 case EOB_ACT_CONTINUE_SCAN:
1584 (yytext_ptr) + yy_amount_of_matched_text;
1586 yy_current_state = yy_get_previous_state( );
1588 yy_cp = (yy_c_buf_p);
1589 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1592 case EOB_ACT_LAST_MATCH:
1594 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1596 yy_current_state = yy_get_previous_state( );
1598 yy_cp = (yy_c_buf_p);
1599 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1600 goto yy_find_action;
1607 "fatal flex scanner internal error--no action found" );
1608 } /* end of action switch */
1609 } /* end of scanning one token */
1610 } /* end of yylex */
1612 /* yy_get_next_buffer - try to read in a new buffer
1614 * Returns a code representing an action:
1615 * EOB_ACT_LAST_MATCH -
1616 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1617 * EOB_ACT_END_OF_FILE - end of file
1619 static int yy_get_next_buffer (void)
1621 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1622 register char *source = (yytext_ptr);
1623 register int number_to_move, i;
1626 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1628 "fatal flex scanner internal error--end of buffer missed" );
1630 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1631 { /* Don't try to fill the buffer, so this is an EOF. */
1632 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1634 /* We matched a single character, the EOB, so
1635 * treat this as a final EOF.
1637 return EOB_ACT_END_OF_FILE;
1642 /* We matched some text prior to the EOB, first
1645 return EOB_ACT_LAST_MATCH;
1649 /* Try to read more data. */
1651 /* First move last chars to start of buffer. */
1652 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1654 for ( i = 0; i < number_to_move; ++i )
1655 *(dest++) = *(source++);
1657 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1658 /* don't do the read, it's not guaranteed to return an EOF,
1661 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1666 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1668 while ( num_to_read <= 0 )
1669 { /* Not enough room in the buffer - grow it. */
1671 /* just a shorter name for the current buffer */
1672 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1674 int yy_c_buf_p_offset =
1675 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1677 if ( b->yy_is_our_buffer )
1679 int new_size = b->yy_buf_size * 2;
1681 if ( new_size <= 0 )
1682 b->yy_buf_size += b->yy_buf_size / 8;
1684 b->yy_buf_size *= 2;
1686 b->yy_ch_buf = (char *)
1687 /* Include room in for 2 EOB chars. */
1688 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1691 /* Can't grow it, we don't own it. */
1694 if ( ! b->yy_ch_buf )
1696 "fatal error - scanner input buffer overflow" );
1698 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1700 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1705 if ( num_to_read > YY_READ_BUF_SIZE )
1706 num_to_read = YY_READ_BUF_SIZE;
1708 /* Read in more data. */
1709 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1710 (yy_n_chars), num_to_read );
1712 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1715 if ( (yy_n_chars) == 0 )
1717 if ( number_to_move == YY_MORE_ADJ )
1719 ret_val = EOB_ACT_END_OF_FILE;
1725 ret_val = EOB_ACT_LAST_MATCH;
1726 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1727 YY_BUFFER_EOF_PENDING;
1732 ret_val = EOB_ACT_CONTINUE_SCAN;
1734 (yy_n_chars) += number_to_move;
1735 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1736 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1738 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1743 /* yy_get_previous_state - get the state just before the EOB char was reached */
1745 static yy_state_type yy_get_previous_state (void)
1747 register yy_state_type yy_current_state;
1748 register char *yy_cp;
1750 yy_current_state = (yy_start);
1752 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1754 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1755 if ( yy_accept[yy_current_state] )
1757 (yy_last_accepting_state) = yy_current_state;
1758 (yy_last_accepting_cpos) = yy_cp;
1760 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1762 yy_current_state = (int) yy_def[yy_current_state];
1763 if ( yy_current_state >= 316 )
1764 yy_c = yy_meta[(unsigned int) yy_c];
1766 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1769 return yy_current_state;
1772 /* yy_try_NUL_trans - try to make a transition on the NUL character
1775 * next_state = yy_try_NUL_trans( current_state );
1777 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1779 register int yy_is_jam;
1780 register char *yy_cp = (yy_c_buf_p);
1782 register YY_CHAR yy_c = 1;
1783 if ( yy_accept[yy_current_state] )
1785 (yy_last_accepting_state) = yy_current_state;
1786 (yy_last_accepting_cpos) = yy_cp;
1788 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1790 yy_current_state = (int) yy_def[yy_current_state];
1791 if ( yy_current_state >= 316 )
1792 yy_c = yy_meta[(unsigned int) yy_c];
1794 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1795 yy_is_jam = (yy_current_state == 315);
1797 return yy_is_jam ? 0 : yy_current_state;
1800 static void yyunput (int c, register char * yy_bp )
1802 register char *yy_cp;
1804 yy_cp = (yy_c_buf_p);
1806 /* undo effects of setting up yytext */
1807 *yy_cp = (yy_hold_char);
1809 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1810 { /* need to shift things up to make room */
1811 /* +2 for EOB chars. */
1812 register int number_to_move = (yy_n_chars) + 2;
1813 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1814 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1815 register char *source =
1816 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1818 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1819 *--dest = *--source;
1821 yy_cp += (int) (dest - source);
1822 yy_bp += (int) (dest - source);
1823 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1824 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1826 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1827 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1830 *--yy_cp = (char) c;
1832 (yytext_ptr) = yy_bp;
1833 (yy_hold_char) = *yy_cp;
1834 (yy_c_buf_p) = yy_cp;
1839 static int yyinput (void)
1841 static int input (void)
1847 *(yy_c_buf_p) = (yy_hold_char);
1849 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1851 /* yy_c_buf_p now points to the character we want to return.
1852 * If this occurs *before* the EOB characters, then it's a
1853 * valid NUL; if not, then we've hit the end of the buffer.
1855 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1856 /* This was really a NUL. */
1857 *(yy_c_buf_p) = '\0';
1860 { /* need more input */
1861 int offset = (yy_c_buf_p) - (yytext_ptr);
1864 switch ( yy_get_next_buffer( ) )
1866 case EOB_ACT_LAST_MATCH:
1867 /* This happens because yy_g_n_b()
1868 * sees that we've accumulated a
1869 * token and flags that we need to
1870 * try matching the token before
1871 * proceeding. But for input(),
1872 * there's no matching to consider.
1873 * So convert the EOB_ACT_LAST_MATCH
1874 * to EOB_ACT_END_OF_FILE.
1877 /* Reset buffer status. */
1882 case EOB_ACT_END_OF_FILE:
1887 if ( ! (yy_did_buffer_switch_on_eof) )
1896 case EOB_ACT_CONTINUE_SCAN:
1897 (yy_c_buf_p) = (yytext_ptr) + offset;
1903 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1904 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1905 (yy_hold_char) = *++(yy_c_buf_p);
1909 #endif /* ifndef YY_NO_INPUT */
1911 /** Immediately switch to a different input stream.
1912 * @param input_file A readable stream.
1914 * @note This function does not reset the start condition to @c INITIAL .
1916 void yyrestart (FILE * input_file )
1919 if ( ! YY_CURRENT_BUFFER ){
1920 yyensure_buffer_stack ();
1921 YY_CURRENT_BUFFER_LVALUE =
1922 yy_create_buffer(yyin,YY_BUF_SIZE );
1925 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1926 yy_load_buffer_state( );
1929 /** Switch to a different input buffer.
1930 * @param new_buffer The new input buffer.
1933 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1936 /* TODO. We should be able to replace this entire function body
1938 * yypop_buffer_state();
1939 * yypush_buffer_state(new_buffer);
1941 yyensure_buffer_stack ();
1942 if ( YY_CURRENT_BUFFER == new_buffer )
1945 if ( YY_CURRENT_BUFFER )
1947 /* Flush out information for old buffer. */
1948 *(yy_c_buf_p) = (yy_hold_char);
1949 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1950 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1953 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1954 yy_load_buffer_state( );
1956 /* We don't actually know whether we did this switch during
1957 * EOF (yywrap()) processing, but the only time this flag
1958 * is looked at is after yywrap() is called, so it's safe
1959 * to go ahead and always set it.
1961 (yy_did_buffer_switch_on_eof) = 1;
1964 static void yy_load_buffer_state (void)
1966 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1967 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1968 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1969 (yy_hold_char) = *(yy_c_buf_p);
1972 /** Allocate and initialize an input buffer state.
1973 * @param file A readable stream.
1974 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1976 * @return the allocated buffer state.
1978 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1982 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1984 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1986 b->yy_buf_size = size;
1988 /* yy_ch_buf has to be 2 characters longer than the size given because
1989 * we need to put in 2 end-of-buffer characters.
1991 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1992 if ( ! b->yy_ch_buf )
1993 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1995 b->yy_is_our_buffer = 1;
1997 yy_init_buffer(b,file );
2002 /** Destroy the buffer.
2003 * @param b a buffer created with yy_create_buffer()
2006 void yy_delete_buffer (YY_BUFFER_STATE b )
2012 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2013 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2015 if ( b->yy_is_our_buffer )
2016 yyfree((void *) b->yy_ch_buf );
2018 yyfree((void *) b );
2021 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
2025 #ifdef __THROW /* this is a gnuism */
2026 extern int isatty (int ) __THROW;
2028 extern int isatty (int );
2035 /* Initializes or reinitializes a buffer.
2036 * This function is sometimes called more than once on the same buffer,
2037 * such as during a yyrestart() or at EOF.
2039 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2044 yy_flush_buffer(b );
2046 b->yy_input_file = file;
2047 b->yy_fill_buffer = 1;
2049 /* If b is the current buffer, then yy_init_buffer was _probably_
2050 * called from yyrestart() or through yy_get_next_buffer.
2051 * In that case, we don't want to reset the lineno or column.
2053 if (b != YY_CURRENT_BUFFER){
2054 b->yy_bs_lineno = 1;
2055 b->yy_bs_column = 0;
2058 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2063 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2064 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2067 void yy_flush_buffer (YY_BUFFER_STATE b )
2074 /* We always need two end-of-buffer characters. The first causes
2075 * a transition to the end-of-buffer state. The second causes
2076 * a jam in that state.
2078 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2079 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2081 b->yy_buf_pos = &b->yy_ch_buf[0];
2084 b->yy_buffer_status = YY_BUFFER_NEW;
2086 if ( b == YY_CURRENT_BUFFER )
2087 yy_load_buffer_state( );
2090 /** Pushes the new state onto the stack. The new state becomes
2091 * the current state. This function will allocate the stack
2093 * @param new_buffer The new state.
2096 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2098 if (new_buffer == NULL)
2101 yyensure_buffer_stack();
2103 /* This block is copied from yy_switch_to_buffer. */
2104 if ( YY_CURRENT_BUFFER )
2106 /* Flush out information for old buffer. */
2107 *(yy_c_buf_p) = (yy_hold_char);
2108 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2109 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2112 /* Only push if top exists. Otherwise, replace top. */
2113 if (YY_CURRENT_BUFFER)
2114 (yy_buffer_stack_top)++;
2115 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2117 /* copied from yy_switch_to_buffer. */
2118 yy_load_buffer_state( );
2119 (yy_did_buffer_switch_on_eof) = 1;
2122 /** Removes and deletes the top of the stack, if present.
2123 * The next element becomes the new top.
2126 void yypop_buffer_state (void)
2128 if (!YY_CURRENT_BUFFER)
2131 yy_delete_buffer(YY_CURRENT_BUFFER );
2132 YY_CURRENT_BUFFER_LVALUE = NULL;
2133 if ((yy_buffer_stack_top) > 0)
2134 --(yy_buffer_stack_top);
2136 if (YY_CURRENT_BUFFER) {
2137 yy_load_buffer_state( );
2138 (yy_did_buffer_switch_on_eof) = 1;
2142 /* Allocates the stack if it does not exist.
2143 * Guarantees space for at least one push.
2145 static void yyensure_buffer_stack (void)
2149 if (!(yy_buffer_stack)) {
2151 /* First allocation is just for 2 elements, since we don't know if this
2152 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2153 * immediate realloc on the next call.
2156 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2157 (num_to_alloc * sizeof(struct yy_buffer_state*)
2160 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2162 (yy_buffer_stack_max) = num_to_alloc;
2163 (yy_buffer_stack_top) = 0;
2167 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2169 /* Increase the buffer to prepare for a possible push. */
2170 int grow_size = 8 /* arbitrary grow size */;
2172 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2173 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2175 num_to_alloc * sizeof(struct yy_buffer_state*)
2178 /* zero only the new slots.*/
2179 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2180 (yy_buffer_stack_max) = num_to_alloc;
2184 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2185 * @param base the character buffer
2186 * @param size the size in bytes of the character buffer
2188 * @return the newly allocated buffer state object.
2190 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2195 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2196 base[size-1] != YY_END_OF_BUFFER_CHAR )
2197 /* They forgot to leave room for the EOB's. */
2200 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2202 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2204 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2205 b->yy_buf_pos = b->yy_ch_buf = base;
2206 b->yy_is_our_buffer = 0;
2207 b->yy_input_file = 0;
2208 b->yy_n_chars = b->yy_buf_size;
2209 b->yy_is_interactive = 0;
2211 b->yy_fill_buffer = 0;
2212 b->yy_buffer_status = YY_BUFFER_NEW;
2214 yy_switch_to_buffer(b );
2219 /** Setup the input buffer state to scan a string. The next call to yylex() will
2220 * scan from a @e copy of @a str.
2221 * @param str a NUL-terminated string to scan
2223 * @return the newly allocated buffer state object.
2224 * @note If you want to scan bytes that may contain NUL values, then use
2225 * yy_scan_bytes() instead.
2227 YY_BUFFER_STATE yy_scan_string (yyconst char * __yystr )
2230 return yy_scan_bytes(__yystr,strlen(__yystr) );
2233 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2234 * scan from a @e copy of @a bytes.
2235 * @param bytes the byte buffer to scan
2236 * @param len the number of bytes in the buffer pointed to by @a bytes.
2238 * @return the newly allocated buffer state object.
2240 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2247 /* Get memory for full buffer, including space for trailing EOB's. */
2248 n = _yybytes_len + 2;
2249 buf = (char *) yyalloc(n );
2251 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2253 for ( i = 0; i < _yybytes_len; ++i )
2254 buf[i] = yybytes[i];
2256 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2258 b = yy_scan_buffer(buf,n );
2260 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2262 /* It's okay to grow etc. this buffer, and we should throw it
2263 * away when we're done.
2265 b->yy_is_our_buffer = 1;
2270 #ifndef YY_EXIT_FAILURE
2271 #define YY_EXIT_FAILURE 2
2274 static void yy_fatal_error (yyconst char* msg )
2276 (void) fprintf( stderr, "%s\n", msg );
2277 exit( YY_EXIT_FAILURE );
2280 /* Redefine yyless() so it works in section 3 code. */
2286 /* Undo effects of setting up yytext. */ \
2287 int yyless_macro_arg = (n); \
2288 YY_LESS_LINENO(yyless_macro_arg);\
2289 yytext[yyleng] = (yy_hold_char); \
2290 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2291 (yy_hold_char) = *(yy_c_buf_p); \
2292 *(yy_c_buf_p) = '\0'; \
2293 yyleng = yyless_macro_arg; \
2297 /* Accessor methods (get/set functions) to struct members. */
2299 /** Get the current line number.
2302 int yyget_lineno (void)
2308 /** Get the input stream.
2311 FILE *yyget_in (void)
2316 /** Get the output stream.
2319 FILE *yyget_out (void)
2324 /** Get the length of the current token.
2327 int yyget_leng (void)
2332 /** Get the current token.
2336 char *yyget_text (void)
2341 /** Set the current line number.
2342 * @param line_number
2345 void yyset_lineno (int line_number )
2348 yylineno = line_number;
2351 /** Set the input stream. This does not discard the current
2353 * @param in_str A readable stream.
2355 * @see yy_switch_to_buffer
2357 void yyset_in (FILE * in_str )
2362 void yyset_out (FILE * out_str )
2367 int yyget_debug (void)
2369 return yy_flex_debug;
2372 void yyset_debug (int bdebug )
2374 yy_flex_debug = bdebug ;
2377 static int yy_init_globals (void)
2379 /* Initialization is the same as for the non-reentrant scanner.
2380 * This function is called from yylex_destroy(), so don't allocate here.
2383 (yy_buffer_stack) = 0;
2384 (yy_buffer_stack_top) = 0;
2385 (yy_buffer_stack_max) = 0;
2386 (yy_c_buf_p) = (char *) 0;
2390 /* Defined in main.c */
2399 /* For future reference: Set errno on error, since we are called by
2405 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2406 int yylex_destroy (void)
2409 /* Pop the buffer stack, destroying each element. */
2410 while(YY_CURRENT_BUFFER){
2411 yy_delete_buffer(YY_CURRENT_BUFFER );
2412 YY_CURRENT_BUFFER_LVALUE = NULL;
2413 yypop_buffer_state();
2416 /* Destroy the stack itself. */
2417 yyfree((yy_buffer_stack) );
2418 (yy_buffer_stack) = NULL;
2420 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2421 * yylex() is called, initialization will occur. */
2428 * Internal utility routines.
2432 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2435 for ( i = 0; i < n; ++i )
2440 #ifdef YY_NEED_STRLEN
2441 static int yy_flex_strlen (yyconst char * s )
2444 for ( n = 0; s[n]; ++n )
2451 void *yyalloc (yy_size_t size )
2453 return (void *) malloc( size );
2456 void *yyrealloc (void * ptr, yy_size_t size )
2458 /* The cast to (char *) in the following accommodates both
2459 * implementations that use char* generic pointers, and those
2460 * that use void* generic pointers. It works with the latter
2461 * because both ANSI C and C++ allow castless assignment from
2462 * any pointer type to void*, and deal with argument conversions
2463 * as though doing an assignment.
2465 return (void *) realloc( (char *) ptr, size );
2468 void yyfree (void * ptr )
2470 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2473 #define YYTABLES_NAME "yytables"
2481 /* This is the way to get multiple files input into lex. */
2486 if (!open_new_file ()) return (1); /* EOF on standard in. */
2487 return (0); /* We have more input. */