1 /* A lexical scanner generated by flex */
3 /* scanner skeleton version:
4 * $Header: flex.skel,v 1.2 90/06/27 22:56:49 leres Exp $
13 #ifndef DONT_HAVE_STDLIB_H
16 void *malloc( unsigned );
25 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
41 /* use prototypes in function declarations */
44 /* the "const" storage-class-modifier is valid */
61 #define YY_PROTO(proto) proto
63 #define YY_PROTO(proto) ()
64 /* there's no standard place to get these definitions */
71 /* amount of stuff to slurp up with each read */
72 #ifndef YY_READ_BUF_SIZE
73 #define YY_READ_BUF_SIZE 8192
76 /* returned upon end-of-file */
79 /* copy whatever the last rule matched to the standard output */
81 /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
82 /* this used to be an fputs(), but since the string might contain NUL's,
85 #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
87 /* gets input and stuffs it into "buf". number of characters read, or YY_NULL,
88 * is returned in "result".
90 #define YY_INPUT(buf,result,max_size) \
91 if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
92 YY_FATAL_ERROR( "read() in flex scanner failed" );
95 /* no semi-colon after return; correct usage is to write "yyterminate();" -
96 * we don't want an extra ';' after the "return" because that will cause
97 * some compilers to complain about unreachable statements.
99 #define yyterminate() return ( YY_NULL )
101 /* report a fatal error */
103 /* The funky do-while is used to turn this macro definition into
104 * a single C statement (which needs a semi-colon terminator).
105 * This avoids problems with code like:
107 * if ( something_happens )
108 * YY_FATAL_ERROR( "oops, the something happened" );
112 * Prior to using the do-while the compiler would get upset at the
113 * "else" because it interpreted the "if" statement as being all
114 * done when it reached the ';' after the YY_FATAL_ERROR() call.
117 #define YY_FATAL_ERROR(msg) \
120 (void) fputs( msg, stderr ); \
121 (void) putc( '\n', stderr ); \
126 /* default yywrap function - always treat EOF as an EOF */
129 /* enter a start condition. This macro really ought to take a parameter,
130 * but we do it the disgusting crufty way forced on us by the ()-less
131 * definition of BEGIN
133 #define BEGIN yy_start = 1 + 2 *
135 /* action number for EOF rule of a given start state */
136 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
138 /* special action meaning "start processing a new file" */
139 #define YY_NEW_FILE \
142 yy_init_buffer( yy_current_buffer, yyin ); \
143 yy_load_buffer_state(); \
147 /* default declaration of generated scanner - a define so the user can
148 * easily add parameters
150 #define YY_DECL int yylex YY_PROTO(( void ))
152 /* code executed at the end of each rule */
153 #define YY_BREAK break;
155 #define YY_END_OF_BUFFER_CHAR 0
158 #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 static char rcsid[] =
168 "@(#) $Header: dtimep.lex,v 1.15 90/10/16 14:57:20 leres Locked $ (LBL) (flex generated scanner)";
170 "@(#) $Header: dtimep.lex,v 1.15 90/10/16 14:57:20 leres Locked $ (LBL) (lex generated scanner)";
184 * Patchable flag that says how to interpret NN/NN/NN dates. When
185 * true, we do it European style: DD/MM/YY. When false, we do it
186 * American style: MM/DD/YY.
188 int europeandate = 0;
191 * Table to convert month names to numeric month. We use the
192 * fact that the low order 5 bits of the sum of the 2nd & 3rd
193 * characters of the name is a hash with no collisions for the 12
194 * valid month names. (The mask to 5 bits maps any combination of
195 * upper and lower case into the same hash value).
197 static int month_map[] = {
229 * Same trick for day-of-week using the hash function
230 * (c1 & 7) + (c2 & 4)
232 static int day_map[] = {
246 #define SETDAY { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)];\
247 tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP;\
249 #define SETMONTH { tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; gotdate++;\
252 #define CVT2 (i=(*cp++ - '0'),isdigit(*cp)? i*10 + (*cp++ - '0') : i)
253 #define SKIPD { while ( !isdigit(*cp++) ) ; --cp; }
254 #define EXPZONE { tw.tw_flags &= ~TW_SZONE; tw.tw_flags |= TW_SZEXP; }
255 #define ZONE(x) { tw.tw_zone=(x); EXPZONE; }
256 #define ZONED(x) { ZONE(x); tw.tw_flags |= TW_DST; }
257 #define LC(c) (isupper(c) ? tolower(c) : (c))
260 /* We get passed a string and return a pointer to a static tws struct */
262 #define YY_DECL struct tws *dparsetime(str) char *str;
264 /* We assume that we're never passed more than max_size characters */
266 #define YY_INPUT(buf,result,max_size) \
270 while (isspace(*xp)) \
273 while (*xp != '\0') \
275 result = xp - gstr; \
276 bcopy(gstr, buf, result); \
281 /* Date strings aren't usually very long */
282 #undef YY_READ_BUF_SIZE
283 #define YY_READ_BUF_SIZE 128
285 /* Use mh error reporting routine */
286 #undef YY_FATAL_ERROR
287 #define YY_FATAL_ERROR(s) adios("dparsetime()", s);
289 /* We need a pointer to the matched text we can modify */
290 #undef YY_USER_ACTION
291 #define YY_USER_ACTION cp = yytext
293 /* Used to initialize */
294 static struct tws ztw = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
296 /* Global for use by YY_INPUT() macro */
301 /* done after the current pattern has been matched and before the
302 * corresponding action - sets up yytext
304 #define YY_DO_BEFORE_ACTION \
306 yyleng = yy_cp - yy_bp; \
307 yy_hold_char = *yy_cp; \
311 #define EOB_ACT_CONTINUE_SCAN 0
312 #define EOB_ACT_END_OF_FILE 1
313 #define EOB_ACT_LAST_MATCH 2
315 /* return all but the first 'n' matched characters back to the input stream */
319 /* undo effects of setting up yytext */ \
320 *yy_cp = yy_hold_char; \
321 yy_c_buf_p = yy_cp = yy_bp + n; \
322 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
326 #define unput(c) yyunput( c, yytext )
329 struct yy_buffer_state
333 YY_CHAR *yy_ch_buf; /* input buffer */
334 YY_CHAR *yy_buf_pos; /* current position in input buffer */
336 /* size of input buffer in bytes, not including room for EOB characters*/
339 /* number of characters read into yy_ch_buf, not including EOB characters */
342 int yy_eof_status; /* whether we've seen an EOF on this buffer */
343 #define EOF_NOT_SEEN 0
344 /* "pending" happens when the EOF has been seen but there's still
347 #define EOF_PENDING 1
351 static YY_BUFFER_STATE yy_current_buffer;
353 /* we provide macros for accessing buffer states in case in the
354 * future we want to put the buffer states in a more general
357 #define YY_CURRENT_BUFFER yy_current_buffer
360 /* yy_hold_char holds the character lost when yytext is formed */
361 static YY_CHAR yy_hold_char;
363 static int yy_n_chars; /* number of characters read into yy_ch_buf */
367 #ifndef YY_USER_ACTION
368 #define YY_USER_ACTION
375 extern YY_CHAR *yytext;
377 extern FILE *yyin, *yyout;
382 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
384 #define YY_END_OF_BUFFER 44
385 typedef int yy_state_type;
386 static const short int yy_accept[390] =
388 0, 0, 0, 0, 44, 42, 40, 39, 42, 42,
389 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
390 42, 42, 42, 42, 34, 34, 34, 34, 34, 34,
391 34, 34, 34, 42, 35, 35, 36, 36, 36, 36,
392 36, 36, 36, 36, 36, 40, 0, 0, 0, 0,
393 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
394 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
400 0, 0, 0, 0, 14, 0, 0, 0, 0, 0,
401 0, 0, 0, 0, 0, 0, 0, 8, 0, 0,
402 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
403 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,
404 0, 0, 1, 0, 1, 1, 1, 1, 0, 0,
405 28, 27, 33, 21, 20, 19, 18, 15, 32, 31,
406 17, 16, 23, 22, 26, 25, 24, 30, 29, 0,
407 0, 0, 0, 0, 0, 0, 0, 0, 13, 8,
408 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
410 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
411 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
413 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
414 13, 0, 7, 9, 10, 0, 0, 4, 4, 0,
415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
416 12, 6, 0, 0, 0, 0, 0, 0, 0, 0,
417 0, 0, 0, 0, 0, 0, 0, 0, 37, 38,
418 2, 0, 0, 0, 0, 0, 0, 0, 3, 3,
419 11, 7, 7, 9, 10, 0, 4, 4, 4, 0,
421 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
422 6, 0, 6, 0, 0, 0, 1, 0, 1, 0,
423 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
424 0, 0, 0, 0, 3, 11, 4, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
426 0, 0, 0, 1, 0, 0, 0, 0, 0, 4,
427 0, 0, 0, 0, 0, 5, 5, 0, 0, 0,
428 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
429 0, 5, 5, 5, 0, 1, 0, 0, 0
432 static const YY_CHAR yy_ec[128] =
434 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
438 5, 1, 6, 7, 8, 1, 9, 10, 11, 12,
439 13, 13, 13, 14, 14, 14, 15, 16, 1, 1,
440 1, 1, 1, 1, 17, 18, 19, 20, 21, 22,
441 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
442 33, 34, 35, 36, 37, 38, 39, 33, 40, 1,
443 1, 1, 1, 1, 1, 1, 17, 18, 19, 20,
445 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
446 31, 32, 33, 34, 35, 36, 37, 38, 39, 33,
450 static const YY_CHAR yy_meta[41] =
452 1, 2, 1, 1, 1, 1, 3, 1, 4, 5,
453 5, 5, 5, 5, 5, 6, 7, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 1, 6, 1, 1, 1, 1, 1, 1, 1, 1
458 static const short int yy_base[413] =
460 0, 0, 40, 0, 637, 638, 634, 638, 59, 97,
461 620, 72, 59, 613, 68, 83, 73, 602, 613, 101,
462 79, 610, 82, 129, 125, 595, 95, 608, 101, 103,
463 599, 109, 638, 114, 638, 147, 66, 608, 121, 638,
464 151, 139, 590, 604, 145, 622, 589, 591, 137, 146,
465 600, 187, 169, 0, 186, 0, 147, 599, 598, 156,
466 601, 586, 597, 594, 128, 176, 580, 590, 593, 593,
467 585, 579, 105, 141, 578, 569, 570, 569, 572, 573,
468 565, 580, 580, 0, 0, 167, 564, 170, 171, 569,
469 188, 190, 191, 562, 192, 560, 194, 559, 558, 557,
471 556, 555, 554, 553, 552, 551, 550, 549, 548, 547,
472 546, 545, 544, 543, 638, 542, 541, 551, 545, 538,
473 543, 535, 550, 550, 0, 560, 0, 217, 534, 544,
474 547, 547, 534, 200, 181, 525, 526, 529, 0, 218,
475 201, 229, 222, 233, 230, 234, 237, 235, 558, 239,
476 240, 242, 245, 243, 255, 253, 261, 262, 0, 0,
477 638, 638, 638, 638, 638, 638, 638, 638, 638, 638,
478 638, 638, 638, 638, 638, 638, 638, 638, 638, 246,
479 260, 265, 266, 243, 271, 267, 548, 549, 555, 276,
480 282, 0, 527, 526, 313, 258, 260, 266, 517, 264,
482 532, 269, 531, 530, 282, 273, 548, 547, 520, 512,
483 517, 508, 542, 541, 525, 524, 538, 537, 514, 520,
484 507, 517, 500, 512, 515, 496, 510, 508, 0, 0,
485 521, 510, 509, 491, 507, 488, 502, 500, 0, 505,
486 517, 0, 516, 515, 514, 494, 308, 305, 328, 486,
487 478, 483, 474, 493, 488, 487, 483, 477, 487, 483,
488 501, 329, 500, 465, 482, 482, 458, 463, 494, 455,
489 476, 472, 472, 462, 450, 469, 471, 452, 638, 638,
490 638, 446, 445, 464, 443, 462, 464, 445, 477, 476,
491 475, 474, 473, 472, 471, 0, 330, 470, 332, 435,
493 339, 449, 433, 450, 450, 432, 444, 446, 442, 433,
494 459, 458, 346, 457, 437, 423, 350, 416, 352, 434,
495 420, 436, 434, 353, 434, 410, 429, 443, 442, 429,
496 440, 427, 403, 422, 439, 438, 437, 436, 416, 415,
497 401, 394, 412, 398, 413, 309, 396, 389, 394, 425,
498 386, 404, 384, 356, 406, 382, 381, 415, 402, 416,
499 383, 376, 381, 393, 392, 410, 303, 409, 408, 407,
500 359, 374, 360, 366, 400, 397, 361, 377, 373, 371,
501 354, 385, 382, 381, 378, 362, 374, 353, 638, 368,
502 363, 360, 346, 366, 339, 370, 337, 335, 328, 314,
504 376, 312, 380, 284, 189, 181, 120, 384, 388, 394,
508 static const short int yy_def[413] =
510 389, 1, 389, 3, 389, 389, 389, 389, 389, 389,
511 10, 10, 389, 389, 389, 389, 389, 389, 389, 389,
512 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
513 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
514 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
515 389, 389, 52, 390, 10, 391, 389, 389, 389, 389,
516 389, 389, 389, 389, 55, 52, 389, 389, 389, 389,
517 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
518 389, 389, 389, 392, 393, 389, 389, 389, 389, 389,
519 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
521 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
522 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
523 389, 389, 389, 389, 53, 394, 395, 396, 389, 389,
524 389, 389, 389, 389, 389, 389, 389, 389, 397, 389,
525 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
526 389, 389, 389, 389, 389, 389, 389, 389, 398, 399,
527 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
528 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
529 389, 389, 389, 389, 389, 389, 400, 389, 401, 389,
530 389, 402, 389, 389, 389, 195, 195, 195, 196, 196,
532 197, 197, 197, 197, 197, 197, 401, 403, 389, 389,
533 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
534 389, 389, 389, 389, 389, 389, 389, 389, 404, 405,
535 389, 389, 389, 389, 389, 389, 389, 389, 406, 406,
536 389, 407, 408, 389, 389, 197, 197, 409, 409, 389,
537 389, 389, 389, 389, 197, 197, 389, 389, 389, 389,
538 389, 410, 389, 389, 389, 389, 389, 389, 389, 389,
539 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
540 389, 389, 389, 389, 389, 389, 389, 389, 389, 400,
541 389, 389, 389, 389, 389, 247, 389, 389, 389, 389,
543 247, 197, 389, 389, 389, 389, 197, 389, 389, 389,
544 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
545 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
546 389, 389, 389, 389, 389, 389, 389, 389, 197, 389,
547 389, 389, 389, 389, 389, 411, 389, 389, 389, 389,
548 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
549 389, 389, 389, 197, 389, 412, 412, 389, 389, 389,
550 389, 389, 389, 389, 389, 389, 389, 197, 197, 197,
551 389, 389, 389, 411, 389, 389, 389, 197, 0, 389,
552 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
554 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
558 static const short int yy_nxt[679] =
560 6, 7, 8, 9, 6, 6, 6, 6, 6, 10,
561 11, 10, 12, 12, 12, 6, 13, 6, 6, 14,
562 6, 15, 6, 6, 6, 16, 6, 6, 17, 18,
563 19, 6, 6, 6, 20, 21, 6, 6, 22, 6,
564 6, 7, 8, 9, 6, 23, 6, 24, 6, 10,
565 11, 10, 12, 12, 12, 6, 25, 26, 27, 28,
566 29, 30, 31, 32, 33, 34, 35, 35, 36, 37,
567 38, 39, 40, 40, 41, 42, 43, 40, 44, 45,
568 47, 66, 66, 66, 66, 66, 66, 48, 70, 74,
569 67, 84, 84, 49, 50, 68, 76, 51, 52, 72,
571 112, 71, 81, 75, 53, 54, 55, 55, 55, 55,
572 55, 55, 56, 57, 101, 82, 58, 78, 59, 73,
573 103, 79, 60, 70, 291, 61, 62, 63, 106, 102,
574 72, 64, 146, 108, 147, 104, 71, 80, 85, 85,
575 113, 139, 139, 107, 98, 86, 87, 88, 109, 89,
576 73, 90, 91, 120, 92, 114, 67, 93, 94, 99,
577 95, 68, 81, 74, 116, 96, 110, 78, 97, 122,
578 125, 79, 133, 121, 148, 82, 389, 75, 129, 117,
579 149, 111, 123, 130, 54, 289, 98, 80, 52, 101,
580 103, 56, 134, 280, 53, 127, 127, 127, 127, 127,
582 127, 99, 208, 57, 102, 104, 58, 106, 59, 108,
583 110, 113, 60, 116, 202, 61, 62, 63, 190, 208,
584 203, 64, 107, 208, 109, 111, 114, 200, 117, 201,
585 208, 208, 192, 193, 213, 208, 208, 210, 208, 214,
586 213, 208, 209, 208, 208, 214, 213, 231, 194, 211,
587 231, 214, 215, 219, 213, 212, 213, 218, 220, 214,
588 221, 214, 213, 213, 231, 232, 216, 214, 214, 231,
589 231, 231, 222, 217, 225, 231, 236, 190, 224, 233,
590 252, 223, 389, 190, 389, 235, 226, 257, 279, 389,
591 389, 228, 193, 389, 251, 227, 238, 192, 193, 253,
593 389, 234, 389, 255, 382, 237, 297, 194, 260, 296,
594 346, 298, 259, 194, 246, 389, 243, 384, 239, 367,
595 247, 300, 248, 249, 248, 248, 248, 248, 389, 297,
596 311, 297, 230, 297, 298, 312, 298, 250, 298, 229,
597 297, 207, 301, 189, 300, 298, 300, 311, 300, 248,
598 160, 213, 312, 213, 213, 300, 214, 213, 214, 214,
599 213, 213, 214, 213, 159, 214, 214, 128, 214, 188,
600 188, 191, 126, 389, 191, 191, 191, 242, 231, 208,
601 242, 262, 382, 382, 262, 293, 382, 388, 293, 299,
602 299, 389, 299, 389, 299, 313, 313, 389, 313, 366,
604 387, 231, 366, 383, 231, 386, 383, 385, 208, 208,
605 208, 382, 381, 389, 380, 379, 378, 360, 377, 231,
606 376, 375, 374, 373, 372, 371, 208, 370, 369, 368,
607 365, 364, 363, 203, 362, 361, 389, 360, 337, 336,
608 335, 359, 358, 357, 231, 356, 231, 231, 355, 354,
609 353, 352, 351, 350, 349, 149, 348, 347, 208, 346,
610 311, 345, 344, 343, 389, 342, 341, 340, 339, 389,
611 338, 337, 295, 294, 292, 292, 336, 335, 335, 334,
612 333, 332, 331, 330, 329, 328, 327, 326, 325, 324,
613 323, 322, 321, 320, 319, 208, 318, 317, 316, 315,
615 314, 208, 261, 310, 309, 308, 307, 389, 389, 306,
616 305, 304, 303, 302, 389, 295, 294, 292, 241, 290,
617 288, 287, 286, 285, 284, 283, 282, 281, 278, 277,
618 276, 275, 274, 273, 272, 271, 270, 269, 208, 208,
619 268, 267, 213, 213, 266, 265, 264, 263, 208, 261,
620 258, 389, 256, 254, 245, 244, 241, 187, 240, 208,
621 206, 205, 204, 199, 198, 197, 196, 195, 187, 186,
622 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
623 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
624 165, 164, 163, 162, 161, 115, 112, 105, 100, 158,
626 157, 156, 155, 154, 153, 152, 151, 150, 145, 144,
627 143, 142, 141, 140, 138, 137, 136, 135, 132, 131,
628 124, 119, 118, 46, 83, 115, 77, 105, 69, 100,
629 83, 77, 76, 69, 65, 46, 389, 5, 389, 389,
630 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
631 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
632 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
633 389, 389, 389, 389, 389, 389, 389, 389
636 static const short int yy_chk[679] =
638 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
639 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
640 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
641 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
642 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
643 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
644 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
645 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
646 9, 12, 12, 12, 12, 12, 12, 9, 15, 17,
647 13, 23, 23, 9, 9, 13, 37, 9, 10, 16,
649 37, 15, 21, 17, 10, 10, 10, 10, 10, 10,
650 10, 10, 10, 10, 27, 21, 10, 20, 10, 16,
651 29, 20, 10, 30, 407, 10, 10, 10, 32, 27,
652 34, 10, 73, 34, 73, 29, 30, 20, 24, 24,
653 39, 65, 65, 32, 25, 24, 24, 24, 34, 24,
654 34, 24, 24, 49, 24, 39, 25, 24, 24, 25,
655 24, 25, 42, 36, 45, 24, 36, 41, 24, 50,
656 53, 41, 60, 49, 74, 42, 53, 36, 57, 45,
657 74, 36, 50, 57, 66, 406, 86, 41, 52, 88,
658 89, 66, 60, 405, 52, 55, 55, 55, 55, 55,
660 55, 86, 141, 52, 88, 89, 52, 91, 52, 92,
661 93, 95, 52, 97, 135, 52, 52, 52, 128, 140,
662 135, 52, 91, 143, 92, 93, 95, 134, 97, 134,
663 142, 145, 128, 128, 144, 146, 148, 141, 147, 144,
664 150, 151, 140, 152, 154, 150, 153, 184, 128, 142,
665 180, 153, 144, 148, 156, 143, 155, 147, 150, 156,
666 151, 155, 157, 158, 181, 180, 145, 157, 158, 182,
667 183, 186, 152, 146, 155, 185, 184, 190, 154, 181,
668 197, 153, 196, 191, 197, 183, 156, 202, 404, 202,
669 198, 158, 190, 206, 196, 157, 186, 191, 191, 198,
671 200, 182, 205, 200, 367, 185, 248, 190, 206, 247,
672 346, 248, 205, 191, 195, 247, 402, 367, 400, 346,
673 195, 248, 195, 195, 195, 195, 195, 195, 247, 249,
674 262, 297, 399, 299, 249, 262, 297, 195, 299, 398,
675 301, 397, 249, 395, 249, 301, 297, 313, 299, 301,
676 393, 317, 313, 319, 324, 301, 317, 354, 319, 324,
677 371, 373, 354, 386, 392, 371, 373, 391, 386, 394,
678 394, 396, 390, 388, 396, 396, 396, 401, 387, 385,
679 401, 403, 384, 383, 403, 408, 382, 381, 408, 409,
680 409, 380, 409, 379, 409, 410, 410, 378, 410, 411,
682 377, 376, 411, 412, 375, 374, 412, 372, 370, 369,
683 368, 366, 365, 364, 363, 362, 361, 360, 359, 358,
684 357, 356, 355, 353, 352, 351, 350, 349, 348, 347,
685 345, 344, 343, 342, 341, 340, 339, 338, 337, 336,
686 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
687 325, 323, 322, 321, 320, 318, 316, 315, 314, 312,
688 311, 310, 309, 308, 307, 306, 305, 304, 303, 302,
689 300, 298, 295, 294, 293, 292, 291, 290, 289, 288,
690 287, 286, 285, 284, 283, 282, 278, 277, 276, 275,
691 274, 273, 272, 271, 270, 269, 268, 267, 266, 265,
693 264, 263, 261, 260, 259, 258, 257, 256, 255, 254,
694 253, 252, 251, 250, 246, 245, 244, 243, 241, 240,
695 238, 237, 236, 235, 234, 233, 232, 231, 228, 227,
696 226, 225, 224, 223, 222, 221, 220, 219, 218, 217,
697 216, 215, 214, 213, 212, 211, 210, 209, 208, 207,
698 204, 203, 201, 199, 194, 193, 189, 188, 187, 149,
699 138, 137, 136, 133, 132, 131, 130, 129, 126, 124,
700 123, 122, 121, 120, 119, 118, 117, 116, 114, 113,
701 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
702 102, 101, 100, 99, 98, 96, 94, 90, 87, 83,
704 82, 81, 80, 79, 78, 77, 76, 75, 72, 71,
705 70, 69, 68, 67, 64, 63, 62, 61, 59, 58,
706 51, 48, 47, 46, 44, 43, 38, 31, 28, 26,
707 22, 19, 18, 14, 11, 7, 5, 389, 389, 389,
708 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
709 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
710 389, 389, 389, 389, 389, 389, 389, 389, 389, 389,
711 389, 389, 389, 389, 389, 389, 389, 389
714 static yy_state_type yy_last_accepting_state;
715 static YY_CHAR *yy_last_accepting_cpos;
717 /* the intent behind this definition is that it'll catch
718 * any uses of REJECT which flex missed
720 #define REJECT reject_used_but_not_detected
721 #define yymore() yymore_used_but_not_detected
722 #define YY_MORE_ADJ 0
724 /* these variables are all declared out here so that section 3 code can
727 /* points to current character in buffer */
728 static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
729 static int yy_init = 1; /* whether we need to initialize */
730 static int yy_start = 0; /* start state number */
732 /* flag which is used to allow yywrap()'s to do buffer switches
733 * instead of setting up a fresh yyin. A bit of a hack ...
735 static int yy_did_buffer_switch_on_eof;
737 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
738 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
739 static int yy_get_next_buffer YY_PROTO(( void ));
740 static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
741 void yyrestart YY_PROTO(( FILE *input_file ));
742 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
743 void yy_load_buffer_state YY_PROTO(( void ));
744 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
745 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
746 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
748 #define yy_new_buffer yy_create_buffer
751 static int yyinput YY_PROTO(( void ));
753 static int input YY_PROTO(( void ));
758 register yy_state_type yy_current_state;
759 register YY_CHAR *yy_cp, *yy_bp;
763 register int i, gotdate;
765 static struct tws tw;
766 static void zonehack();
780 yy_start = 1; /* first start state */
788 if ( yy_current_buffer )
789 yy_init_buffer( yy_current_buffer, yyin );
791 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
793 yy_load_buffer_state();
798 while ( 1 ) /* loops until end-of-file is reached */
802 /* support of yytext */
803 *yy_cp = yy_hold_char;
805 /* yy_bp points to the position in yy_ch_buf of the start of the
810 yy_current_state = yy_start;
814 register YY_CHAR yy_c = yy_ec[*yy_cp];
815 if ( yy_accept[yy_current_state] )
817 yy_last_accepting_state = yy_current_state;
818 yy_last_accepting_cpos = yy_cp;
820 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
822 yy_current_state = yy_def[yy_current_state];
823 if ( yy_current_state >= 390 )
824 yy_c = yy_meta[yy_c];
826 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
829 while ( yy_current_state != 389 );
830 yy_cp = yy_last_accepting_cpos;
831 yy_current_state = yy_last_accepting_state;
834 yy_act = yy_accept[yy_current_state];
839 do_action: /* this label is used only to access EOF actions */
844 case 0: /* must backtrack */
845 /* undo the effects of YY_DO_BEFORE_ACTION */
846 *yy_cp = yy_hold_char;
847 yy_cp = yy_last_accepting_cpos;
848 yy_current_state = yy_last_accepting_state;
863 /* European: DD/MM/YY */
866 tw.tw_mon = CVT2 - 1;
868 /* American: MM/DD/YY */
869 tw.tw_mon = CVT2 - 1;
874 for (i = 0; isdigit(*cp); )
875 i = i*10 + (*cp++ - '0');
876 tw.tw_year = i % 100;
883 while (!isalpha(*cp++))
886 for (i = 0; isdigit(*cp); )
887 i = i*10 + (*cp++ - '0');
888 tw.tw_year = i % 100;
897 for (i = 0; isdigit(*cp); )
898 i = i*10 + (*cp++ - '0');
899 tw.tw_year = i % 100;
911 tw.tw_hour = CVT2; cp++;
912 tw.tw_min = CVT2; cp++;
919 tw.tw_hour = CVT2; cp++;
926 tw.tw_hour = CVT2; cp++;
927 if (tw.tw_hour == 12)
935 tw.tw_hour = CVT2; cp++;
936 if (tw.tw_hour != 12)
953 * Luckly, 4 digit times in the range
954 * 1960-1999 aren't legal as hour
955 * and minutes. This rule must come
956 * the 4 digit hour and minute rule.
1006 ZONE(-(3 * 60 + 30));
1031 tw.tw_zone = 60 * (('a'-1) - LC(*cp));
1037 tw.tw_zone = 60 * ('a' - LC(*cp));
1043 tw.tw_zone = 60 * (LC(*cp) - 'm');
1050 tw.tw_zone = ((cp[0] * 10 + cp[1])
1051 -('0' * 10 + '0'))*60
1052 +((cp[2] * 10 + cp[3])
1064 tw.tw_zone = (('0' * 10 + '0')
1065 -(cp[0] * 10 + cp[1]))*60
1067 -(cp[2] * 10 + cp[3]));
1079 case YY_STATE_EOF(INITIAL):
1080 case YY_STATE_EOF(Z):
1086 * We jammed; it's an error if we
1087 * didn't parse anything.
1089 if (!gotdate || tw.tw_year == 0)
1095 YY_FATAL_ERROR( "flex scanner jammed" );
1098 case YY_END_OF_BUFFER:
1100 /* amount of text matched not including the EOB char */
1101 int yy_amount_of_matched_text = yy_cp - yytext - 1;
1103 /* undo the effects of YY_DO_BEFORE_ACTION */
1104 *yy_cp = yy_hold_char;
1106 /* note that here we test for yy_c_buf_p "<=" to the position
1107 * of the first EOB in the buffer, since yy_c_buf_p will
1108 * already have been incremented past the NUL character
1109 * (since all states make transitions on EOB to the end-
1110 * of-buffer state). Contrast this with the test in yyinput().
1112 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1113 /* this was really a NUL */
1115 yy_state_type yy_next_state;
1117 yy_c_buf_p = yytext + yy_amount_of_matched_text;
1119 yy_current_state = yy_get_previous_state();
1121 /* okay, we're now positioned to make the
1122 * NUL transition. We couldn't have
1123 * yy_get_previous_state() go ahead and do it
1124 * for us because it doesn't know how to deal
1125 * with the possibility of jamming (and we
1126 * don't want to build jamming into it because
1127 * then it will run more slowly)
1130 yy_next_state = yy_try_NUL_trans( yy_current_state );
1132 yy_bp = yytext + YY_MORE_ADJ;
1134 if ( yy_next_state )
1136 /* consume the NUL */
1137 yy_cp = ++yy_c_buf_p;
1138 yy_current_state = yy_next_state;
1144 yy_cp = yy_last_accepting_cpos;
1145 yy_current_state = yy_last_accepting_state;
1146 goto yy_find_action;
1150 else switch ( yy_get_next_buffer() )
1152 case EOB_ACT_END_OF_FILE:
1154 yy_did_buffer_switch_on_eof = 0;
1158 /* note: because we've taken care in
1159 * yy_get_next_buffer() to have set up yytext,
1160 * we can now set up yy_c_buf_p so that if some
1161 * total hoser (like flex itself) wants
1162 * to call the scanner after we return the
1163 * YY_NULL, it'll still work - another YY_NULL
1164 * will get returned.
1166 yy_c_buf_p = yytext + YY_MORE_ADJ;
1168 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
1174 if ( ! yy_did_buffer_switch_on_eof )
1180 case EOB_ACT_CONTINUE_SCAN:
1181 yy_c_buf_p = yytext + yy_amount_of_matched_text;
1183 yy_current_state = yy_get_previous_state();
1186 yy_bp = yytext + YY_MORE_ADJ;
1189 case EOB_ACT_LAST_MATCH:
1191 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1193 yy_current_state = yy_get_previous_state();
1196 yy_bp = yytext + YY_MORE_ADJ;
1197 goto yy_find_action;
1204 printf( "action # %d\n", yy_act );
1207 "fatal flex scanner internal error--no action found" );
1213 /* yy_get_next_buffer - try to read in a new buffer
1216 * int yy_get_next_buffer();
1218 * returns a code representing an action
1219 * EOB_ACT_LAST_MATCH -
1220 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1221 * EOB_ACT_END_OF_FILE - end of file
1224 static int yy_get_next_buffer()
1227 register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
1228 register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
1229 register int number_to_move, i;
1232 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1234 "fatal flex scanner internal error--end of buffer missed" );
1236 /* try to read more data */
1238 /* first move last chars to start of buffer */
1239 number_to_move = yy_c_buf_p - yytext;
1241 for ( i = 0; i < number_to_move; ++i )
1242 *(dest++) = *(source++);
1244 if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
1245 /* don't do the read, it's not guaranteed to return an EOF,
1252 int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
1254 if ( num_to_read > YY_READ_BUF_SIZE )
1255 num_to_read = YY_READ_BUF_SIZE;
1257 else if ( num_to_read <= 0 )
1258 YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
1260 /* read in more data */
1261 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1262 yy_n_chars, num_to_read );
1265 if ( yy_n_chars == 0 )
1267 if ( number_to_move == 1 )
1269 ret_val = EOB_ACT_END_OF_FILE;
1270 yy_current_buffer->yy_eof_status = EOF_DONE;
1275 ret_val = EOB_ACT_LAST_MATCH;
1276 yy_current_buffer->yy_eof_status = EOF_PENDING;
1281 ret_val = EOB_ACT_CONTINUE_SCAN;
1283 yy_n_chars += number_to_move;
1284 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1285 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1287 /* yytext begins at the second character in yy_ch_buf; the first
1288 * character is the one which preceded it before reading in the latest
1289 * buffer; it needs to be kept around in case it's a newline, so
1290 * yy_get_previous_state() will have with '^' rules active
1293 yytext = &yy_current_buffer->yy_ch_buf[1];
1299 /* yy_get_previous_state - get the state just before the EOB char was reached
1302 * yy_state_type yy_get_previous_state();
1305 static yy_state_type yy_get_previous_state()
1308 register yy_state_type yy_current_state;
1309 register YY_CHAR *yy_cp;
1311 yy_current_state = yy_start;
1313 for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1315 register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
1316 if ( yy_accept[yy_current_state] )
1318 yy_last_accepting_state = yy_current_state;
1319 yy_last_accepting_cpos = yy_cp;
1321 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1323 yy_current_state = yy_def[yy_current_state];
1324 if ( yy_current_state >= 390 )
1325 yy_c = yy_meta[yy_c];
1327 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1330 return ( yy_current_state );
1334 /* yy_try_NUL_trans - try to make a transition on the NUL character
1337 * next_state = yy_try_NUL_trans( current_state );
1340 #ifdef YY_USE_PROTOS
1341 static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
1343 static yy_state_type yy_try_NUL_trans( yy_current_state )
1344 register yy_state_type yy_current_state;
1348 register int yy_is_jam;
1349 register YY_CHAR *yy_cp = yy_c_buf_p;
1351 register YY_CHAR yy_c = 1;
1352 if ( yy_accept[yy_current_state] )
1354 yy_last_accepting_state = yy_current_state;
1355 yy_last_accepting_cpos = yy_cp;
1357 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1359 yy_current_state = yy_def[yy_current_state];
1360 if ( yy_current_state >= 390 )
1361 yy_c = yy_meta[yy_c];
1363 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1364 yy_is_jam = (yy_current_state == 389);
1366 return ( yy_is_jam ? 0 : yy_current_state );
1370 #ifdef YY_USE_PROTOS
1371 static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
1373 static void yyunput( c, yy_bp )
1375 register YY_CHAR *yy_bp;
1379 register YY_CHAR *yy_cp = yy_c_buf_p;
1381 /* undo effects of setting up yytext */
1382 *yy_cp = yy_hold_char;
1384 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1385 { /* need to shift things up to make room */
1386 register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
1387 register YY_CHAR *dest =
1388 &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
1389 register YY_CHAR *source =
1390 &yy_current_buffer->yy_ch_buf[number_to_move];
1392 while ( source > yy_current_buffer->yy_ch_buf )
1393 *--dest = *--source;
1395 yy_cp += dest - source;
1396 yy_bp += dest - source;
1397 yy_n_chars = yy_current_buffer->yy_buf_size;
1399 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1400 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1403 if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
1408 /* note: the formal parameter *must* be called "yy_bp" for this
1409 * macro to now work correctly
1411 YY_DO_BEFORE_ACTION; /* set up yytext again */
1416 static int yyinput()
1423 YY_CHAR *yy_cp = yy_c_buf_p;
1425 *yy_cp = yy_hold_char;
1427 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1429 /* yy_c_buf_p now points to the character we want to return.
1430 * If this occurs *before* the EOB characters, then it's a
1431 * valid NUL; if not, then we've hit the end of the buffer.
1433 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1434 /* this was really a NUL */
1438 { /* need more input */
1439 yytext = yy_c_buf_p;
1442 switch ( yy_get_next_buffer() )
1444 case EOB_ACT_END_OF_FILE:
1448 yy_c_buf_p = yytext + YY_MORE_ADJ;
1455 return ( yyinput() );
1462 case EOB_ACT_CONTINUE_SCAN:
1463 yy_c_buf_p = yytext + YY_MORE_ADJ;
1466 case EOB_ACT_LAST_MATCH:
1468 YY_FATAL_ERROR( "unexpected last match in yyinput()" );
1470 YY_FATAL_ERROR( "unexpected last match in input()" );
1477 yy_hold_char = *++yy_c_buf_p;
1483 #ifdef YY_USE_PROTOS
1484 void yyrestart( FILE *input_file )
1486 void yyrestart( input_file )
1491 yy_init_buffer( yy_current_buffer, input_file );
1492 yy_load_buffer_state();
1496 #ifdef YY_USE_PROTOS
1497 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1499 void yy_switch_to_buffer( new_buffer )
1500 YY_BUFFER_STATE new_buffer;
1504 if ( yy_current_buffer == new_buffer )
1507 if ( yy_current_buffer )
1509 /* flush out information for old buffer */
1510 *yy_c_buf_p = yy_hold_char;
1511 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1512 yy_current_buffer->yy_n_chars = yy_n_chars;
1515 yy_current_buffer = new_buffer;
1516 yy_load_buffer_state();
1518 /* we don't actually know whether we did this switch during
1519 * EOF (yywrap()) processing, but the only time this flag
1520 * is looked at is after yywrap() is called, so it's safe
1521 * to go ahead and always set it.
1523 yy_did_buffer_switch_on_eof = 1;
1527 #ifdef YY_USE_PROTOS
1528 void yy_load_buffer_state( void )
1530 void yy_load_buffer_state()
1534 yy_n_chars = yy_current_buffer->yy_n_chars;
1535 yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1536 yyin = yy_current_buffer->yy_input_file;
1537 yy_hold_char = *yy_c_buf_p;
1541 #ifdef YY_USE_PROTOS
1542 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1544 YY_BUFFER_STATE yy_create_buffer( file, size )
1552 b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
1555 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1557 b->yy_buf_size = size;
1559 /* yy_ch_buf has to be 2 characters longer than the size given because
1560 * we need to put in 2 end-of-buffer characters.
1562 b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
1564 if ( ! b->yy_ch_buf )
1565 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1567 yy_init_buffer( b, file );
1573 #ifdef YY_USE_PROTOS
1574 void yy_delete_buffer( YY_BUFFER_STATE b )
1576 void yy_delete_buffer( b )
1581 if ( b == yy_current_buffer )
1582 yy_current_buffer = (YY_BUFFER_STATE) 0;
1584 free( (char *) b->yy_ch_buf );
1589 #ifdef YY_USE_PROTOS
1590 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1592 void yy_init_buffer( b, file )
1598 b->yy_input_file = file;
1600 /* we put in the '\n' and start reading from [1] so that an
1601 * initial match-at-newline will be true.
1604 b->yy_ch_buf[0] = '\n';
1607 /* we always need two end-of-buffer characters. The first causes
1608 * a transition to the end-of-buffer state. The second causes
1609 * a jam in that state.
1611 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1612 b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
1614 b->yy_buf_pos = &b->yy_ch_buf[1];
1616 b->yy_eof_status = EOF_NOT_SEEN;
1621 #include <sys/types.h>
1625 #include <sys/time.h>
1630 register struct tws *tw;
1632 register struct tm *tm;
1634 if (twclock (tw) == -1L)
1637 tm = localtime (&tw -> tw_clock);
1638 if (tm -> tm_isdst) {
1639 tw -> tw_flags |= TW_DST;
1640 tw -> tw_zone -= 60;