1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /home/ig25/at-3.1.7/RCS/lex.yy.c,v 1.3 1997/05/26 08:31:37 ig25 Exp ig25 $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
130 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
134 #define unput(c) yyunput( c, yytext_ptr )
136 /* The following is because we cannot portably get our hands on size_t
137 * (without autoconf's help, which isn't available because we want
138 * flex-generated scanners to compile on their own).
140 typedef unsigned int yy_size_t;
143 struct yy_buffer_state
147 char *yy_ch_buf; /* input buffer */
148 char *yy_buf_pos; /* current position in input buffer */
150 /* Size of input buffer in bytes, not including room for EOB
153 yy_size_t yy_buf_size;
155 /* Number of characters read into yy_ch_buf, not including EOB
160 /* Whether we "own" the buffer - i.e., we know we created it,
161 * and can realloc() it to grow it, and should free() it to
164 int yy_is_our_buffer;
166 /* Whether this is an "interactive" input source; if so, and
167 * if we're using stdio for input, then we want to use getc()
168 * instead of fread(), to make sure we stop fetching input after
171 int yy_is_interactive;
173 /* Whether we're considered to be at the beginning of a line.
174 * If so, '^' rules will be active on the next match, otherwise
179 /* Whether to try to fill the input buffer when we reach the
184 int yy_buffer_status;
185 #define YY_BUFFER_NEW 0
186 #define YY_BUFFER_NORMAL 1
187 /* When an EOF's been seen but there's still some text to process
188 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
189 * shouldn't try reading from the input source any more. We might
190 * still have a bunch of tokens to match, though, because of
191 * possible backing-up.
193 * When we actually see the EOF, we change the status to "new"
194 * (via yyrestart()), so that the user can continue scanning by
195 * just pointing yyin at a new input file.
197 #define YY_BUFFER_EOF_PENDING 2
200 static YY_BUFFER_STATE yy_current_buffer = 0;
202 /* We provide macros for accessing buffer states in case in the
203 * future we want to put the buffer states in a more general
206 #define YY_CURRENT_BUFFER yy_current_buffer
209 /* yy_hold_char holds the character lost when yytext is formed. */
210 static char yy_hold_char;
212 static int yy_n_chars; /* number of characters read into yy_ch_buf */
217 /* Points to current character in buffer. */
218 static char *yy_c_buf_p = (char *) 0;
219 static int yy_init = 1; /* whether we need to initialize */
220 static int yy_start = 0; /* start state number */
222 /* Flag which is used to allow yywrap()'s to do buffer switches
223 * instead of setting up a fresh yyin. A bit of a hack ...
225 static int yy_did_buffer_switch_on_eof;
227 void yyrestart YY_PROTO(( FILE *input_file ));
229 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
230 void yy_load_buffer_state YY_PROTO(( void ));
231 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
232 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
233 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
234 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
238 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
239 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
242 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
243 static void yy_flex_free YY_PROTO(( void * ));
245 #define yy_new_buffer yy_create_buffer
247 #define yy_set_interactive(is_interactive) \
249 if ( ! yy_current_buffer ) \
250 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
251 yy_current_buffer->yy_is_interactive = is_interactive; \
254 #define yy_set_bol(at_bol) \
256 if ( ! yy_current_buffer ) \
257 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
258 yy_current_buffer->yy_at_bol = at_bol; \
261 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263 typedef unsigned char YY_CHAR;
264 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
265 typedef int yy_state_type;
267 #define yytext_ptr yytext
269 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
270 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
271 static int yy_get_next_buffer YY_PROTO(( void ));
272 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
274 /* Done after the current pattern has been matched and before the
275 * corresponding action - sets up yytext.
277 #define YY_DO_BEFORE_ACTION \
278 yytext_ptr = yy_bp; \
279 yyleng = (int) (yy_cp - yy_bp); \
280 yy_hold_char = *yy_cp; \
284 #define YY_NUM_RULES 39
285 #define YY_END_OF_BUFFER 40
286 static yyconst short int yy_accept[175] =
288 0, 0, 40, 38, 36, 36, 35, 38, 38, 38,
289 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
290 35, 37, 2, 37, 37, 37, 37, 37, 37, 37,
291 37, 37, 37, 37, 37, 37, 37, 37, 3, 37,
292 37, 37, 37, 37, 37, 37, 37, 26, 30, 20,
293 34, 24, 12, 37, 23, 29, 28, 25, 27, 37,
294 17, 8, 37, 37, 33, 1, 32, 13, 31, 7,
295 37, 11, 37, 37, 9, 10, 37, 37, 37, 20,
296 37, 37, 37, 19, 37, 29, 28, 37, 37, 37,
297 37, 37, 16, 4, 37, 37, 37, 37, 37, 37,
299 37, 37, 37, 37, 37, 21, 26, 37, 37, 37,
300 37, 19, 37, 25, 37, 37, 37, 22, 37, 37,
301 37, 37, 37, 37, 37, 14, 37, 37, 37, 21,
302 30, 37, 37, 12, 37, 37, 18, 8, 22, 37,
303 37, 37, 37, 7, 37, 37, 37, 37, 37, 37,
304 24, 23, 37, 18, 37, 32, 37, 37, 6, 37,
305 37, 9, 37, 34, 5, 33, 13, 37, 11, 15,
309 static yyconst int yy_ec[256] =
311 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 4, 4, 4,
316 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
317 1, 1, 1, 1, 5, 6, 7, 8, 9, 10,
318 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
319 21, 22, 23, 24, 25, 26, 27, 28, 29, 21,
320 1, 1, 1, 1, 1, 1, 5, 6, 7, 8,
322 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
323 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
324 29, 21, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 static yyconst int yy_meta[30] =
343 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
344 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
345 2, 2, 2, 2, 2, 2, 2, 2, 2
348 static yyconst short int yy_base[176] =
350 0, 0, 184, 185, 185, 185, 179, 13, 0, 26,
351 23, 163, 29, 31, 28, 174, 163, 34, 37, 170,
352 174, 0, 0, 155, 165, 146, 167, 167, 159, 146,
353 152, 24, 19, 43, 151, 140, 38, 143, 0, 142,
354 145, 146, 158, 137, 50, 152, 44, 147, 134, 135,
355 148, 131, 147, 132, 128, 123, 142, 143, 0, 131,
356 123, 47, 123, 128, 136, 0, 125, 118, 118, 133,
357 116, 117, 133, 118, 113, 117, 119, 117, 109, 0,
358 114, 125, 124, 105, 122, 0, 0, 114, 112, 100,
359 118, 110, 0, 0, 104, 114, 97, 109, 112, 103,
361 92, 85, 91, 104, 102, 87, 0, 85, 102, 85,
362 77, 0, 83, 0, 93, 94, 73, 78, 94, 90,
363 90, 80, 67, 78, 86, 0, 71, 87, 68, 0,
364 0, 81, 60, 0, 59, 75, 63, 0, 0, 76,
365 62, 78, 76, 0, 72, 75, 60, 49, 69, 54,
366 0, 0, 51, 0, 52, 0, 44, 63, 0, 41,
367 42, 0, 63, 0, 0, 0, 0, 44, 0, 0,
371 static yyconst short int yy_def[176] =
373 174, 1, 174, 174, 174, 174, 174, 175, 175, 175,
374 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
375 174, 175, 175, 175, 175, 175, 175, 175, 175, 175,
376 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
377 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
378 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
379 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
380 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
381 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
382 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
384 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
385 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
386 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
387 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
388 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
389 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
390 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
391 175, 175, 175, 0, 174
394 static yyconst short int yy_nxt[215] =
396 4, 5, 6, 7, 8, 9, 9, 10, 9, 11,
397 9, 12, 9, 13, 9, 9, 14, 15, 16, 17,
398 9, 9, 18, 19, 9, 9, 20, 9, 9, 23,
399 26, 28, 24, 31, 27, 33, 36, 25, 40, 56,
400 58, 57, 41, 34, 29, 43, 37, 59, 44, 35,
401 60, 76, 77, 32, 91, 45, 64, 73, 42, 22,
402 61, 46, 173, 65, 66, 172, 74, 171, 170, 169,
403 92, 168, 167, 166, 165, 164, 163, 162, 161, 160,
404 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
405 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
407 139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
408 129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
409 119, 118, 117, 116, 115, 114, 113, 112, 111, 110,
410 109, 108, 107, 106, 105, 104, 103, 102, 101, 100,
411 99, 98, 97, 96, 95, 94, 93, 90, 89, 88,
412 87, 86, 85, 84, 83, 82, 81, 80, 79, 78,
413 75, 72, 71, 70, 69, 68, 67, 63, 62, 55,
414 54, 53, 52, 51, 50, 49, 48, 21, 47, 39,
415 38, 30, 21, 174, 3, 174, 174, 174, 174, 174,
416 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
418 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
422 static yyconst short int yy_chk[215] =
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 8,
427 10, 11, 8, 13, 10, 14, 15, 8, 18, 32,
428 33, 32, 18, 14, 11, 19, 15, 33, 19, 14,
429 34, 47, 47, 13, 62, 19, 37, 45, 18, 175,
430 34, 19, 171, 37, 37, 168, 45, 163, 161, 160,
431 62, 158, 157, 155, 153, 150, 149, 148, 147, 146,
432 145, 143, 142, 141, 140, 137, 136, 135, 133, 132,
433 129, 128, 127, 125, 124, 123, 122, 121, 120, 119,
435 118, 117, 116, 115, 113, 111, 110, 109, 108, 106,
436 105, 104, 103, 102, 101, 100, 99, 98, 97, 96,
437 95, 92, 91, 90, 89, 88, 85, 84, 83, 82,
438 81, 79, 78, 77, 76, 75, 74, 73, 72, 71,
439 70, 69, 68, 67, 65, 64, 63, 61, 60, 58,
440 57, 56, 55, 54, 53, 52, 51, 50, 49, 48,
441 46, 44, 43, 42, 41, 40, 38, 36, 35, 31,
442 30, 29, 28, 27, 26, 25, 24, 21, 20, 17,
443 16, 12, 7, 3, 174, 174, 174, 174, 174, 174,
444 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
446 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
450 static yy_state_type yy_last_accepting_state;
451 static char *yy_last_accepting_cpos;
453 /* The intent behind this definition is that it'll catch
454 * any uses of REJECT which flex missed.
456 #define REJECT reject_used_but_not_detected
457 #define yymore() yymore_used_but_not_detected
458 #define YY_MORE_ADJ 0
460 #line 1 "parsetime.l"
462 #line 2 "parsetime.l"
467 #include "parsetime.h"
469 char *last_token = NULL;
472 #define COPY_TOK do { last_token = strdup(yytext); } while(0)
474 #define COPY_VAL do { yylval.charval = strdup(yytext); } while(0)
476 #define YY_INPUT(buf,result,max_size) \
478 if (*my_argv == NULL) { \
483 if (**my_argv == '\0') { \
488 buf[0] = **my_argv; \
496 /* Macros after this point can all be overridden by user definitions in
500 #ifndef YY_SKIP_YYWRAP
502 extern "C" int yywrap YY_PROTO(( void ));
504 extern int yywrap YY_PROTO(( void ));
509 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
513 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
518 static int yyinput YY_PROTO(( void ));
520 static int input YY_PROTO(( void ));
525 static int yy_start_stack_ptr = 0;
526 static int yy_start_stack_depth = 0;
527 static int *yy_start_stack = 0;
528 #ifndef YY_NO_PUSH_STATE
529 static void yy_push_state YY_PROTO(( int new_state ));
531 #ifndef YY_NO_POP_STATE
532 static void yy_pop_state YY_PROTO(( void ));
534 #ifndef YY_NO_TOP_STATE
535 static int yy_top_state YY_PROTO(( void ));
539 #define YY_NO_PUSH_STATE 1
540 #define YY_NO_POP_STATE 1
541 #define YY_NO_TOP_STATE 1
544 #ifdef YY_MALLOC_DECL
552 /* Just try to get by without declaring the routines. This will fail
553 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
554 * or sizeof(void*) != sizeof(int).
559 /* Amount of stuff to slurp up with each read. */
560 #ifndef YY_READ_BUF_SIZE
561 #define YY_READ_BUF_SIZE 8192
564 /* Copy whatever the last rule matched to the standard output. */
567 /* This used to be an fputs(), but since the string might contain NUL's,
568 * we now use fwrite().
570 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
573 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
574 * is returned in "result".
577 #define YY_INPUT(buf,result,max_size) \
578 if ( yy_current_buffer->yy_is_interactive ) \
581 for ( n = 0; n < max_size && \
582 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
585 buf[n++] = (char) c; \
586 if ( c == EOF && ferror( yyin ) ) \
587 YY_FATAL_ERROR( "input in flex scanner failed" ); \
590 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
591 && ferror( yyin ) ) \
592 YY_FATAL_ERROR( "input in flex scanner failed" );
595 /* No semi-colon after return; correct usage is to write "yyterminate();" -
596 * we don't want an extra ';' after the "return" because that will cause
597 * some compilers to complain about unreachable statements.
600 #define yyterminate() return YY_NULL
603 /* Number of entries by which start-condition stack grows. */
604 #ifndef YY_START_STACK_INCR
605 #define YY_START_STACK_INCR 25
608 /* Report a fatal error. */
609 #ifndef YY_FATAL_ERROR
610 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
613 /* Default declaration of generated scanner - a define so the user can
614 * easily add parameters.
617 #define YY_DECL int yylex YY_PROTO(( void ))
620 /* Code executed at the beginning of each rule, after yytext and yyleng
623 #ifndef YY_USER_ACTION
624 #define YY_USER_ACTION
627 /* Code executed at the end of each rule. */
629 #define YY_BREAK break;
632 #define YY_RULE_SETUP \
637 register yy_state_type yy_current_state;
638 register char *yy_cp, *yy_bp;
641 #line 36 "parsetime.l"
655 yy_start = 1; /* first start state */
663 if ( ! yy_current_buffer )
665 yy_create_buffer( yyin, YY_BUF_SIZE );
667 yy_load_buffer_state();
670 while ( 1 ) /* loops until end-of-file is reached */
674 /* Support of yytext. */
675 *yy_cp = yy_hold_char;
677 /* yy_bp points to the position in yy_ch_buf of the start of
682 yy_current_state = yy_start;
686 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
687 if ( yy_accept[yy_current_state] )
689 yy_last_accepting_state = yy_current_state;
690 yy_last_accepting_cpos = yy_cp;
692 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
694 yy_current_state = (int) yy_def[yy_current_state];
695 if ( yy_current_state >= 175 )
696 yy_c = yy_meta[(unsigned int) yy_c];
698 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
701 while ( yy_base[yy_current_state] != 185 );
704 yy_act = yy_accept[yy_current_state];
706 { /* have to back up */
707 yy_cp = yy_last_accepting_cpos;
708 yy_current_state = yy_last_accepting_state;
709 yy_act = yy_accept[yy_current_state];
715 do_action: /* This label is used only to access EOF actions. */
719 { /* beginning of action switch */
720 case 0: /* must back up */
721 /* undo the effects of YY_DO_BEFORE_ACTION */
722 *yy_cp = yy_hold_char;
723 yy_cp = yy_last_accepting_cpos;
724 yy_current_state = yy_last_accepting_state;
729 #line 38 "parsetime.l"
730 { COPY_TOK ; return NOW; }
734 #line 39 "parsetime.l"
735 { COPY_TOK ; return AM; }
739 #line 40 "parsetime.l"
740 { COPY_TOK ; return PM; }
744 #line 41 "parsetime.l"
745 { COPY_TOK ; return NOON; }
749 #line 42 "parsetime.l"
750 { COPY_TOK ; return MIDNIGHT; }
754 #line 43 "parsetime.l"
755 { COPY_TOK ; return TEATIME; }
759 #line 44 "parsetime.l"
760 { COPY_TOK ; return SUN; }
764 #line 45 "parsetime.l"
765 { COPY_TOK ; return MON; }
769 #line 46 "parsetime.l"
770 { COPY_TOK ; return TUE; }
774 #line 47 "parsetime.l"
775 { COPY_TOK ; return WED; }
779 #line 48 "parsetime.l"
780 { COPY_TOK ; return THU; }
784 #line 49 "parsetime.l"
785 { COPY_TOK ; return FRI; }
789 #line 50 "parsetime.l"
790 { COPY_TOK ; return SAT; }
794 #line 51 "parsetime.l"
795 { COPY_TOK ; return TODAY; }
799 #line 52 "parsetime.l"
800 { COPY_TOK ; return TOMORROW; }
804 #line 53 "parsetime.l"
805 { COPY_TOK ; return NEXT; }
809 #line 54 "parsetime.l"
810 { COPY_TOK ; return MINUTE; }
814 #line 55 "parsetime.l"
815 { COPY_TOK ; return MINUTE; }
819 #line 56 "parsetime.l"
820 { COPY_TOK ; return HOUR; }
824 #line 57 "parsetime.l"
825 { COPY_TOK ; return DAY; }
829 #line 58 "parsetime.l"
830 { COPY_TOK ; return WEEK; }
834 #line 59 "parsetime.l"
835 { COPY_TOK ; return MONTH; }
839 #line 60 "parsetime.l"
840 { COPY_TOK ; return JAN; }
844 #line 61 "parsetime.l"
845 { COPY_TOK ; return FEB; }
849 #line 62 "parsetime.l"
850 { COPY_TOK ; return MAR; }
854 #line 63 "parsetime.l"
855 { COPY_TOK ; return APR; }
859 #line 64 "parsetime.l"
860 { COPY_TOK ; return MAY; }
864 #line 65 "parsetime.l"
865 { COPY_TOK ; return JUN; }
869 #line 66 "parsetime.l"
870 { COPY_TOK ; return JUL; }
874 #line 67 "parsetime.l"
875 { COPY_TOK ; return AUG; }
879 #line 68 "parsetime.l"
880 { COPY_TOK ; return SEP; }
884 #line 69 "parsetime.l"
885 { COPY_TOK ; return OCT; }
889 #line 70 "parsetime.l"
890 { COPY_TOK ; return NOV; }
894 #line 71 "parsetime.l"
895 { COPY_TOK ; return DEC; }
899 #line 72 "parsetime.l"
900 { COPY_TOK ; COPY_VAL; return INT; }
904 #line 73 "parsetime.l"
909 #line 74 "parsetime.l"
910 { COPY_TOK ; COPY_VAL; return WORD; }
914 #line 75 "parsetime.l"
915 { COPY_TOK ; return yytext[0]; }
919 #line 77 "parsetime.l"
923 case YY_STATE_EOF(INITIAL):
926 case YY_END_OF_BUFFER:
928 /* Amount of text matched not including the EOB char. */
929 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
931 /* Undo the effects of YY_DO_BEFORE_ACTION. */
932 *yy_cp = yy_hold_char;
934 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
936 /* We're scanning a new file or input source. It's
937 * possible that this happened because the user
938 * just pointed yyin at a new source and called
939 * yylex(). If so, then we have to assure
940 * consistency between yy_current_buffer and our
941 * globals. Here is the right place to do so, because
942 * this is the first action (other than possibly a
943 * back-up) that will match for the new input source.
945 yy_n_chars = yy_current_buffer->yy_n_chars;
946 yy_current_buffer->yy_input_file = yyin;
947 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
950 /* Note that here we test for yy_c_buf_p "<=" to the position
951 * of the first EOB in the buffer, since yy_c_buf_p will
952 * already have been incremented past the NUL character
953 * (since all states make transitions on EOB to the
954 * end-of-buffer state). Contrast this with the test
957 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
958 { /* This was really a NUL. */
959 yy_state_type yy_next_state;
961 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
963 yy_current_state = yy_get_previous_state();
965 /* Okay, we're now positioned to make the NUL
966 * transition. We couldn't have
967 * yy_get_previous_state() go ahead and do it
968 * for us because it doesn't know how to deal
969 * with the possibility of jamming (and we don't
970 * want to build jamming into it because then it
971 * will run more slowly).
974 yy_next_state = yy_try_NUL_trans( yy_current_state );
976 yy_bp = yytext_ptr + YY_MORE_ADJ;
980 /* Consume the NUL. */
981 yy_cp = ++yy_c_buf_p;
982 yy_current_state = yy_next_state;
993 else switch ( yy_get_next_buffer() )
995 case EOB_ACT_END_OF_FILE:
997 yy_did_buffer_switch_on_eof = 0;
1001 /* Note: because we've taken care in
1002 * yy_get_next_buffer() to have set up
1003 * yytext, we can now set up
1004 * yy_c_buf_p so that if some total
1005 * hoser (like flex itself) wants to
1006 * call the scanner after we return the
1007 * YY_NULL, it'll still work - another
1008 * YY_NULL will get returned.
1010 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1012 yy_act = YY_STATE_EOF(YY_START);
1018 if ( ! yy_did_buffer_switch_on_eof )
1024 case EOB_ACT_CONTINUE_SCAN:
1026 yytext_ptr + yy_amount_of_matched_text;
1028 yy_current_state = yy_get_previous_state();
1031 yy_bp = yytext_ptr + YY_MORE_ADJ;
1034 case EOB_ACT_LAST_MATCH:
1036 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1038 yy_current_state = yy_get_previous_state();
1041 yy_bp = yytext_ptr + YY_MORE_ADJ;
1042 goto yy_find_action;
1049 "fatal flex scanner internal error--no action found" );
1050 } /* end of action switch */
1051 } /* end of scanning one token */
1052 } /* end of yylex */
1055 /* yy_get_next_buffer - try to read in a new buffer
1057 * Returns a code representing an action:
1058 * EOB_ACT_LAST_MATCH -
1059 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1060 * EOB_ACT_END_OF_FILE - end of file
1063 static int yy_get_next_buffer()
1065 register char *dest = yy_current_buffer->yy_ch_buf;
1066 register char *source = yytext_ptr;
1067 register int number_to_move, i;
1070 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1072 "fatal flex scanner internal error--end of buffer missed" );
1074 if ( yy_current_buffer->yy_fill_buffer == 0 )
1075 { /* Don't try to fill the buffer, so this is an EOF. */
1076 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1078 /* We matched a singled characater, the EOB, so
1079 * treat this as a final EOF.
1081 return EOB_ACT_END_OF_FILE;
1086 /* We matched some text prior to the EOB, first
1089 return EOB_ACT_LAST_MATCH;
1093 /* Try to read more data. */
1095 /* First move last chars to start of buffer. */
1096 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1098 for ( i = 0; i < number_to_move; ++i )
1099 *(dest++) = *(source++);
1101 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1102 /* don't do the read, it's not guaranteed to return an EOF,
1110 yy_current_buffer->yy_buf_size - number_to_move - 1;
1112 while ( num_to_read <= 0 )
1113 { /* Not enough room in the buffer - grow it. */
1114 #ifdef YY_USES_REJECT
1116 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1119 /* just a shorter name for the current buffer */
1120 YY_BUFFER_STATE b = yy_current_buffer;
1122 int yy_c_buf_p_offset =
1123 (int) (yy_c_buf_p - b->yy_ch_buf);
1125 if ( b->yy_is_our_buffer )
1127 int new_size = b->yy_buf_size * 2;
1129 if ( new_size <= 0 )
1130 b->yy_buf_size += b->yy_buf_size / 8;
1132 b->yy_buf_size *= 2;
1134 b->yy_ch_buf = (char *)
1135 /* Include room in for 2 EOB chars. */
1136 yy_flex_realloc( (void *) b->yy_ch_buf,
1137 b->yy_buf_size + 2 );
1140 /* Can't grow it, we don't own it. */
1143 if ( ! b->yy_ch_buf )
1145 "fatal error - scanner input buffer overflow" );
1147 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1149 num_to_read = yy_current_buffer->yy_buf_size -
1154 if ( num_to_read > YY_READ_BUF_SIZE )
1155 num_to_read = YY_READ_BUF_SIZE;
1157 /* Read in more data. */
1158 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1159 yy_n_chars, num_to_read );
1162 if ( yy_n_chars == 0 )
1164 if ( number_to_move == YY_MORE_ADJ )
1166 ret_val = EOB_ACT_END_OF_FILE;
1172 ret_val = EOB_ACT_LAST_MATCH;
1173 yy_current_buffer->yy_buffer_status =
1174 YY_BUFFER_EOF_PENDING;
1179 ret_val = EOB_ACT_CONTINUE_SCAN;
1181 yy_n_chars += number_to_move;
1182 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1183 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1185 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1191 /* yy_get_previous_state - get the state just before the EOB char was reached */
1193 static yy_state_type yy_get_previous_state()
1195 register yy_state_type yy_current_state;
1196 register char *yy_cp;
1198 yy_current_state = yy_start;
1200 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1202 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1203 if ( yy_accept[yy_current_state] )
1205 yy_last_accepting_state = yy_current_state;
1206 yy_last_accepting_cpos = yy_cp;
1208 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1210 yy_current_state = (int) yy_def[yy_current_state];
1211 if ( yy_current_state >= 175 )
1212 yy_c = yy_meta[(unsigned int) yy_c];
1214 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1217 return yy_current_state;
1221 /* yy_try_NUL_trans - try to make a transition on the NUL character
1224 * next_state = yy_try_NUL_trans( current_state );
1227 #ifdef YY_USE_PROTOS
1228 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1230 static yy_state_type yy_try_NUL_trans( yy_current_state )
1231 yy_state_type yy_current_state;
1234 register int yy_is_jam;
1235 register char *yy_cp = yy_c_buf_p;
1237 register YY_CHAR yy_c = 1;
1238 if ( yy_accept[yy_current_state] )
1240 yy_last_accepting_state = yy_current_state;
1241 yy_last_accepting_cpos = yy_cp;
1243 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1245 yy_current_state = (int) yy_def[yy_current_state];
1246 if ( yy_current_state >= 175 )
1247 yy_c = yy_meta[(unsigned int) yy_c];
1249 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1250 yy_is_jam = (yy_current_state == 174);
1252 return yy_is_jam ? 0 : yy_current_state;
1257 #ifdef YY_USE_PROTOS
1258 static void yyunput( int c, register char *yy_bp )
1260 static void yyunput( c, yy_bp )
1262 register char *yy_bp;
1265 register char *yy_cp = yy_c_buf_p;
1267 /* undo effects of setting up yytext */
1268 *yy_cp = yy_hold_char;
1270 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1271 { /* need to shift things up to make room */
1272 /* +2 for EOB chars. */
1273 register int number_to_move = yy_n_chars + 2;
1274 register char *dest = &yy_current_buffer->yy_ch_buf[
1275 yy_current_buffer->yy_buf_size + 2];
1276 register char *source =
1277 &yy_current_buffer->yy_ch_buf[number_to_move];
1279 while ( source > yy_current_buffer->yy_ch_buf )
1280 *--dest = *--source;
1282 yy_cp += (int) (dest - source);
1283 yy_bp += (int) (dest - source);
1284 yy_n_chars = yy_current_buffer->yy_buf_size;
1286 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1287 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1290 *--yy_cp = (char) c;
1294 yy_hold_char = *yy_cp;
1297 #endif /* ifndef YY_NO_UNPUT */
1301 static int yyinput()
1308 *yy_c_buf_p = yy_hold_char;
1310 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1312 /* yy_c_buf_p now points to the character we want to return.
1313 * If this occurs *before* the EOB characters, then it's a
1314 * valid NUL; if not, then we've hit the end of the buffer.
1316 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1317 /* This was really a NUL. */
1321 { /* need more input */
1322 yytext_ptr = yy_c_buf_p;
1325 switch ( yy_get_next_buffer() )
1327 case EOB_ACT_END_OF_FILE:
1332 yytext_ptr + YY_MORE_ADJ;
1336 if ( ! yy_did_buffer_switch_on_eof )
1345 case EOB_ACT_CONTINUE_SCAN:
1346 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1349 case EOB_ACT_LAST_MATCH:
1352 "unexpected last match in yyinput()" );
1355 "unexpected last match in input()" );
1361 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1362 *yy_c_buf_p = '\0'; /* preserve yytext */
1363 yy_hold_char = *++yy_c_buf_p;
1370 #ifdef YY_USE_PROTOS
1371 void yyrestart( FILE *input_file )
1373 void yyrestart( input_file )
1377 if ( ! yy_current_buffer )
1378 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1380 yy_init_buffer( yy_current_buffer, input_file );
1381 yy_load_buffer_state();
1385 #ifdef YY_USE_PROTOS
1386 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1388 void yy_switch_to_buffer( new_buffer )
1389 YY_BUFFER_STATE new_buffer;
1392 if ( yy_current_buffer == new_buffer )
1395 if ( yy_current_buffer )
1397 /* Flush out information for old buffer. */
1398 *yy_c_buf_p = yy_hold_char;
1399 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1400 yy_current_buffer->yy_n_chars = yy_n_chars;
1403 yy_current_buffer = new_buffer;
1404 yy_load_buffer_state();
1406 /* We don't actually know whether we did this switch during
1407 * EOF (yywrap()) processing, but the only time this flag
1408 * is looked at is after yywrap() is called, so it's safe
1409 * to go ahead and always set it.
1411 yy_did_buffer_switch_on_eof = 1;
1415 #ifdef YY_USE_PROTOS
1416 void yy_load_buffer_state( void )
1418 void yy_load_buffer_state()
1421 yy_n_chars = yy_current_buffer->yy_n_chars;
1422 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1423 yyin = yy_current_buffer->yy_input_file;
1424 yy_hold_char = *yy_c_buf_p;
1428 #ifdef YY_USE_PROTOS
1429 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1431 YY_BUFFER_STATE yy_create_buffer( file, size )
1438 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1440 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1442 b->yy_buf_size = size;
1444 /* yy_ch_buf has to be 2 characters longer than the size given because
1445 * we need to put in 2 end-of-buffer characters.
1447 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1448 if ( ! b->yy_ch_buf )
1449 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1451 b->yy_is_our_buffer = 1;
1453 yy_init_buffer( b, file );
1459 #ifdef YY_USE_PROTOS
1460 void yy_delete_buffer( YY_BUFFER_STATE b )
1462 void yy_delete_buffer( b )
1469 if ( b == yy_current_buffer )
1470 yy_current_buffer = (YY_BUFFER_STATE) 0;
1472 if ( b->yy_is_our_buffer )
1473 yy_flex_free( (void *) b->yy_ch_buf );
1475 yy_flex_free( (void *) b );
1479 #ifndef YY_ALWAYS_INTERACTIVE
1480 #ifndef YY_NEVER_INTERACTIVE
1481 extern int isatty YY_PROTO(( int ));
1485 #ifdef YY_USE_PROTOS
1486 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1488 void yy_init_buffer( b, file )
1495 yy_flush_buffer( b );
1497 b->yy_input_file = file;
1498 b->yy_fill_buffer = 1;
1500 #if YY_ALWAYS_INTERACTIVE
1501 b->yy_is_interactive = 1;
1503 #if YY_NEVER_INTERACTIVE
1504 b->yy_is_interactive = 0;
1506 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1512 #ifdef YY_USE_PROTOS
1513 void yy_flush_buffer( YY_BUFFER_STATE b )
1515 void yy_flush_buffer( b )
1522 /* We always need two end-of-buffer characters. The first causes
1523 * a transition to the end-of-buffer state. The second causes
1524 * a jam in that state.
1526 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1527 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1529 b->yy_buf_pos = &b->yy_ch_buf[0];
1532 b->yy_buffer_status = YY_BUFFER_NEW;
1534 if ( b == yy_current_buffer )
1535 yy_load_buffer_state();
1539 #ifndef YY_NO_SCAN_BUFFER
1540 #ifdef YY_USE_PROTOS
1541 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1543 YY_BUFFER_STATE yy_scan_buffer( base, size )
1551 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1552 base[size-1] != YY_END_OF_BUFFER_CHAR )
1553 /* They forgot to leave room for the EOB's. */
1556 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1558 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1560 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1561 b->yy_buf_pos = b->yy_ch_buf = base;
1562 b->yy_is_our_buffer = 0;
1563 b->yy_input_file = 0;
1564 b->yy_n_chars = b->yy_buf_size;
1565 b->yy_is_interactive = 0;
1567 b->yy_fill_buffer = 0;
1568 b->yy_buffer_status = YY_BUFFER_NEW;
1570 yy_switch_to_buffer( b );
1577 #ifndef YY_NO_SCAN_STRING
1578 #ifdef YY_USE_PROTOS
1579 YY_BUFFER_STATE yy_scan_string( yyconst char *str )
1581 YY_BUFFER_STATE yy_scan_string( str )
1586 for ( len = 0; str[len]; ++len )
1589 return yy_scan_bytes( str, len );
1594 #ifndef YY_NO_SCAN_BYTES
1595 #ifdef YY_USE_PROTOS
1596 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1598 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1599 yyconst char *bytes;
1608 /* Get memory for full buffer, including space for trailing EOB's. */
1610 buf = (char *) yy_flex_alloc( n );
1612 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1614 for ( i = 0; i < len; ++i )
1617 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1619 b = yy_scan_buffer( buf, n );
1621 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1623 /* It's okay to grow etc. this buffer, and we should throw it
1624 * away when we're done.
1626 b->yy_is_our_buffer = 1;
1633 #ifndef YY_NO_PUSH_STATE
1634 #ifdef YY_USE_PROTOS
1635 static void yy_push_state( int new_state )
1637 static void yy_push_state( new_state )
1641 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1645 yy_start_stack_depth += YY_START_STACK_INCR;
1646 new_size = yy_start_stack_depth * sizeof( int );
1648 if ( ! yy_start_stack )
1649 yy_start_stack = (int *) yy_flex_alloc( new_size );
1652 yy_start_stack = (int *) yy_flex_realloc(
1653 (void *) yy_start_stack, new_size );
1655 if ( ! yy_start_stack )
1657 "out of memory expanding start-condition stack" );
1660 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1667 #ifndef YY_NO_POP_STATE
1668 static void yy_pop_state()
1670 if ( --yy_start_stack_ptr < 0 )
1671 YY_FATAL_ERROR( "start-condition stack underflow" );
1673 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1678 #ifndef YY_NO_TOP_STATE
1679 static int yy_top_state()
1681 return yy_start_stack[yy_start_stack_ptr - 1];
1685 #ifndef YY_EXIT_FAILURE
1686 #define YY_EXIT_FAILURE 2
1689 #ifdef YY_USE_PROTOS
1690 static void yy_fatal_error( yyconst char msg[] )
1692 static void yy_fatal_error( msg )
1696 (void) fprintf( stderr, "%s\n", msg );
1697 exit( YY_EXIT_FAILURE );
1702 /* Redefine yyless() so it works in section 3 code. */
1708 /* Undo effects of setting up yytext. */ \
1709 yytext[yyleng] = yy_hold_char; \
1710 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
1711 yy_hold_char = *yy_c_buf_p; \
1712 *yy_c_buf_p = '\0'; \
1718 /* Internal utility routines. */
1721 #ifdef YY_USE_PROTOS
1722 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1724 static void yy_flex_strncpy( s1, s2, n )
1731 for ( i = 0; i < n; ++i )
1737 #ifdef YY_USE_PROTOS
1738 static void *yy_flex_alloc( yy_size_t size )
1740 static void *yy_flex_alloc( size )
1744 return (void *) malloc( size );
1747 #ifdef YY_USE_PROTOS
1748 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1750 static void *yy_flex_realloc( ptr, size )
1755 /* The cast to (char *) in the following accommodates both
1756 * implementations that use char* generic pointers, and those
1757 * that use void* generic pointers. It works with the latter
1758 * because both ANSI C and C++ allow castless assignment from
1759 * any pointer type to void*, and deal with argument conversions
1760 * as though doing an assignment.
1762 return (void *) realloc( (char *) ptr, size );
1765 #ifdef YY_USE_PROTOS
1766 static void yy_flex_free( void *ptr )
1768 static void yy_flex_free( ptr )
1782 #line 77 "parsetime.l"