1 /* A lexical scanner generated by flex*/
3 /* Scanner skeleton version:
4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
15 /* 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_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* Some routines like yy_flex_realloc() are emitted as static but are
138 not called by all lexers. This generates warnings in some compilers,
139 notably GCC. Arrange to suppress these. */
141 #define YY_MAY_BE_UNUSED __attribute__((unused))
143 #define YY_MAY_BE_UNUSED
146 /* The following is because we cannot portably get our hands on size_t
147 * (without autoconf's help, which isn't available because we want
148 * flex-generated scanners to compile on their own).
150 typedef unsigned int yy_size_t;
153 struct yy_buffer_state
157 char *yy_ch_buf; /* input buffer */
158 char *yy_buf_pos; /* current position in input buffer */
160 /* Size of input buffer in bytes, not including room for EOB
163 yy_size_t yy_buf_size;
165 /* Number of characters read into yy_ch_buf, not including EOB
170 /* Whether we "own" the buffer - i.e., we know we created it,
171 * and can realloc() it to grow it, and should free() it to
174 int yy_is_our_buffer;
176 /* Whether this is an "interactive" input source; if so, and
177 * if we're using stdio for input, then we want to use getc()
178 * instead of fread(), to make sure we stop fetching input after
181 int yy_is_interactive;
183 /* Whether we're considered to be at the beginning of a line.
184 * If so, '^' rules will be active on the next match, otherwise
189 /* Whether to try to fill the input buffer when we reach the
194 int yy_buffer_status;
195 #define YY_BUFFER_NEW 0
196 #define YY_BUFFER_NORMAL 1
197 /* When an EOF's been seen but there's still some text to process
198 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
199 * shouldn't try reading from the input source any more. We might
200 * still have a bunch of tokens to match, though, because of
201 * possible backing-up.
203 * When we actually see the EOF, we change the status to "new"
204 * (via yyrestart()), so that the user can continue scanning by
205 * just pointing yyin at a new input file.
207 #define YY_BUFFER_EOF_PENDING 2
210 static YY_BUFFER_STATE yy_current_buffer = 0;
212 /* We provide macros for accessing buffer states in case in the
213 * future we want to put the buffer states in a more general
216 #define YY_CURRENT_BUFFER yy_current_buffer
219 /* yy_hold_char holds the character lost when yytext is formed. */
220 static char yy_hold_char;
222 static int yy_n_chars; /* number of characters read into yy_ch_buf */
227 /* Points to current character in buffer. */
228 static char *yy_c_buf_p = (char *) 0;
229 static int yy_init = 1; /* whether we need to initialize */
230 static int yy_start = 0; /* start state number */
232 /* Flag which is used to allow yywrap()'s to do buffer switches
233 * instead of setting up a fresh yyin. A bit of a hack ...
235 static int yy_did_buffer_switch_on_eof;
237 void yyrestart YY_PROTO(( FILE *input_file ));
239 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
240 void yy_load_buffer_state YY_PROTO(( void ));
241 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
242 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
244 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
245 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
247 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
248 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
249 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
251 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
252 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
253 static void yy_flex_free YY_PROTO(( void * ));
255 #define yy_new_buffer yy_create_buffer
257 #define yy_set_interactive(is_interactive) \
259 if ( ! yy_current_buffer ) \
260 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
261 yy_current_buffer->yy_is_interactive = is_interactive; \
264 #define yy_set_bol(at_bol) \
266 if ( ! yy_current_buffer ) \
267 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
268 yy_current_buffer->yy_at_bol = at_bol; \
271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
273 typedef unsigned char YY_CHAR;
274 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
275 typedef int yy_state_type;
277 #define yytext_ptr yytext
279 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
280 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
281 static int yy_get_next_buffer YY_PROTO(( void ));
282 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
284 /* Done after the current pattern has been matched and before the
285 * corresponding action - sets up yytext.
287 #define YY_DO_BEFORE_ACTION \
288 yytext_ptr = yy_bp; \
289 yyleng = (int) (yy_cp - yy_bp); \
290 yy_hold_char = *yy_cp; \
294 #define YY_NUM_RULES 40
295 #define YY_END_OF_BUFFER 41
296 static yyconst short int yy_accept[131] =
298 0, 0, 0, 0, 41, 40, 39, 38, 34, 38,
299 38, 22, 38, 38, 38, 38, 38, 38, 38, 38,
300 38, 38, 38, 35, 37, 40, 39, 38, 38, 38,
301 38, 38, 8, 38, 38, 38, 38, 38, 38, 38,
302 38, 13, 38, 38, 38, 38, 38, 38, 35, 36,
303 38, 38, 38, 14, 9, 38, 38, 38, 38, 38,
304 38, 23, 38, 38, 38, 19, 38, 38, 26, 27,
305 29, 38, 38, 15, 38, 38, 11, 38, 21, 38,
306 16, 24, 28, 10, 38, 38, 38, 38, 30, 31,
307 20, 38, 38, 38, 38, 38, 38, 38, 38, 38,
309 38, 38, 17, 38, 38, 38, 38, 38, 38, 38,
310 38, 38, 38, 18, 25, 12, 38, 38, 5, 4,
311 3, 6, 7, 38, 2, 1, 33, 38, 32, 0
314 static yyconst int yy_ec[256] =
316 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
317 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 1, 2, 4, 5, 4, 4, 4, 4, 4, 4,
320 4, 4, 4, 4, 6, 4, 4, 7, 7, 7,
321 7, 7, 7, 7, 7, 7, 7, 4, 4, 4,
322 4, 4, 8, 4, 4, 4, 4, 4, 4, 4,
323 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
324 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
325 4, 9, 4, 4, 4, 4, 10, 11, 12, 13,
327 14, 4, 4, 15, 16, 4, 17, 18, 19, 4,
328 20, 21, 22, 23, 24, 25, 26, 4, 27, 28,
329 29, 4, 4, 4, 4, 4, 1, 4, 4, 4,
330 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
331 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
332 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
333 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
334 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
335 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
336 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
338 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
339 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
340 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
341 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
342 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
346 static yyconst int yy_meta[30] =
348 1, 1, 2, 3, 4, 3, 3, 3, 5, 3,
349 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
350 3, 3, 3, 3, 3, 3, 3, 3, 3
353 static yyconst short int yy_base[135] =
355 0, 0, 25, 26, 161, 162, 30, 0, 162, 154,
356 30, 0, 146, 25, 144, 129, 25, 28, 136, 128,
357 128, 28, 143, 0, 162, 0, 43, 0, 44, 145,
358 47, 138, 122, 135, 130, 32, 129, 122, 132, 120,
359 116, 0, 129, 128, 124, 114, 127, 114, 0, 162,
360 129, 49, 52, 107, 0, 124, 119, 107, 108, 109,
361 104, 0, 103, 114, 112, 0, 100, 47, 0, 0,
362 117, 116, 115, 0, 98, 95, 0, 109, 0, 98,
363 48, 0, 0, 0, 54, 97, 96, 105, 107, 61,
364 0, 99, 100, 88, 94, 89, 83, 83, 82, 92,
366 83, 96, 74, 76, 71, 75, 74, 83, 79, 70,
367 80, 79, 67, 0, 0, 0, 72, 58, 0, 0,
368 0, 0, 0, 64, 0, 0, 69, 62, 58, 162,
372 static yyconst short int yy_def[135] =
374 130, 1, 131, 131, 130, 130, 130, 132, 130, 132,
375 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
376 132, 132, 132, 133, 130, 134, 130, 132, 132, 132,
377 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
378 132, 132, 132, 132, 132, 132, 132, 132, 133, 130,
379 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
380 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
381 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
382 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
383 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
385 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
386 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
387 132, 132, 132, 132, 132, 132, 132, 132, 132, 0,
391 static yyconst short int yy_nxt[192] =
393 6, 7, 7, 8, 9, 10, 11, 12, 8, 13,
394 8, 14, 15, 16, 17, 8, 8, 18, 19, 8,
395 20, 21, 8, 22, 23, 8, 8, 8, 8, 25,
396 25, 27, 27, 26, 26, 30, 31, 33, 37, 39,
397 38, 46, 34, 40, 27, 27, 47, 58, 41, 51,
398 52, 42, 30, 31, 72, 52, 59, 73, 53, 85,
399 95, 86, 96, 97, 129, 87, 102, 90, 129, 98,
400 127, 88, 124, 113, 128, 127, 24, 24, 24, 24,
401 24, 28, 126, 28, 49, 49, 49, 50, 125, 50,
402 50, 50, 123, 122, 121, 120, 119, 118, 117, 116,
404 115, 114, 113, 112, 111, 110, 109, 108, 107, 106,
405 105, 104, 103, 89, 101, 100, 99, 94, 93, 92,
406 91, 90, 89, 71, 84, 83, 82, 81, 80, 79,
407 78, 77, 76, 75, 74, 71, 70, 69, 68, 67,
408 66, 65, 64, 63, 62, 61, 60, 57, 56, 55,
409 54, 53, 48, 45, 44, 43, 36, 35, 32, 29,
410 130, 5, 130, 130, 130, 130, 130, 130, 130, 130,
411 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
412 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
417 static yyconst short int yy_chk[192] =
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
422 4, 7, 7, 3, 4, 11, 11, 14, 17, 18,
423 17, 22, 14, 18, 27, 27, 22, 36, 18, 29,
424 29, 18, 31, 31, 52, 52, 36, 53, 53, 68,
425 81, 68, 81, 85, 129, 68, 90, 90, 128, 85,
426 124, 68, 113, 113, 127, 127, 131, 131, 131, 131,
427 131, 132, 118, 132, 133, 133, 133, 134, 117, 134,
428 134, 134, 112, 111, 110, 109, 108, 107, 106, 105,
430 104, 103, 102, 101, 100, 99, 98, 97, 96, 95,
431 94, 93, 92, 89, 88, 87, 86, 80, 78, 76,
432 75, 73, 72, 71, 67, 65, 64, 63, 61, 60,
433 59, 58, 57, 56, 54, 51, 48, 47, 46, 45,
434 44, 43, 41, 40, 39, 38, 37, 35, 34, 33,
435 32, 30, 23, 21, 20, 19, 16, 15, 13, 10,
436 5, 130, 130, 130, 130, 130, 130, 130, 130, 130,
437 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
438 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
443 static yy_state_type yy_last_accepting_state;
444 static char *yy_last_accepting_cpos;
446 /* The intent behind this definition is that it'll catch
447 * any uses of REJECT which flex missed.
449 #define REJECT reject_used_but_not_detected
450 #define yymore() yymore_used_but_not_detected
451 #define YY_MORE_ADJ 0
452 #define YY_RESTORE_YY_MORE_OFFSET
457 * amanda, the advanced maryland automatic network disk archiver
458 * Copyright (c) 1991-2000 University of Maryland at College Park
459 * All Rights Reserved.
461 * Permission to use, copy, modify, distribute, and sell this software and its
462 * documentation for any purpose is hereby granted without fee, provided that
463 * the above copyright notice appear in all copies and that both that
464 * copyright notice and this permission notice appear in supporting
465 * documentation, and that the name of U.M. not be used in advertising or
466 * publicity pertaining to distribution of the software without specific,
467 * written prior permission. U.M. makes no representations about the
468 * suitability of this software for any purpose. It is provided "as is"
469 * without express or implied warranty.
471 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
472 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
473 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
474 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
475 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
476 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
478 * Authors: the Amanda Development Team. Its members are listed in a
479 * file named AUTHORS, in the root directory of this distribution.
482 * $Id: uscan.l,v 1.3 2006/07/05 11:15:56 martinea Exp $
484 * lexer for amrecover interactive language
491 * We redefine this here to prevent compiler warning about ignoring fwrite
496 if (fwrite(yytext, (size_t)yyleng, 1, yyout) <= 0) { \
497 yyerror("ECHO failure"); \
503 #define DATE_ALLOC_SIZE sizeof("YYYY-MM-DD-HH-MM-SS") /* includes null */
505 #define YY_DECL int yylex()
506 extern int yylex(void);
508 extern void yyerror(char *s);
509 extern int yyparse(void);
510 static int ll_parse_date(int type, char *text);
511 int process_line(char *line);
515 static char *string_buf = NULL;
518 /* Macros after this point can all be overridden by user definitions in
522 #ifndef YY_SKIP_YYWRAP
524 extern "C" int yywrap YY_PROTO(( void ));
526 extern int yywrap YY_PROTO(( void ));
531 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
535 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
538 #ifdef YY_NEED_STRLEN
539 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
544 static int yyinput YY_PROTO(( void ));
546 static int input YY_PROTO(( void ));
551 static int yy_start_stack_ptr = 0;
552 static int yy_start_stack_depth = 0;
553 static int *yy_start_stack = 0;
554 #ifndef YY_NO_PUSH_STATE
555 static void yy_push_state YY_PROTO(( int new_state ));
557 #ifndef YY_NO_POP_STATE
558 static void yy_pop_state YY_PROTO(( void ));
560 #ifndef YY_NO_TOP_STATE
561 static int yy_top_state YY_PROTO(( void ));
565 #define YY_NO_PUSH_STATE 1
566 #define YY_NO_POP_STATE 1
567 #define YY_NO_TOP_STATE 1
570 #ifdef YY_MALLOC_DECL
578 /* Just try to get by without declaring the routines. This will fail
579 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
580 * or sizeof(void*) != sizeof(int).
585 /* Amount of stuff to slurp up with each read. */
586 #ifndef YY_READ_BUF_SIZE
587 #define YY_READ_BUF_SIZE 8192
590 /* Copy whatever the last rule matched to the standard output. */
593 /* This used to be an fputs(), but since the string might contain NUL's,
594 * we now use fwrite().
596 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
599 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
600 * is returned in "result".
603 #define YY_INPUT(buf,result,max_size) \
604 if ( yy_current_buffer->yy_is_interactive ) \
607 for ( n = 0; n < max_size && \
608 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
611 buf[n++] = (char) c; \
612 if ( c == EOF && ferror( yyin ) ) \
613 YY_FATAL_ERROR( "input in flex scanner failed" ); \
616 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
617 && ferror( yyin ) ) \
618 YY_FATAL_ERROR( "input in flex scanner failed" );
621 /* No semi-colon after return; correct usage is to write "yyterminate();" -
622 * we don't want an extra ';' after the "return" because that will cause
623 * some compilers to complain about unreachable statements.
626 #define yyterminate() return YY_NULL
629 /* Number of entries by which start-condition stack grows. */
630 #ifndef YY_START_STACK_INCR
631 #define YY_START_STACK_INCR 25
634 /* Report a fatal error. */
635 #ifndef YY_FATAL_ERROR
636 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
639 /* Default declaration of generated scanner - a define so the user can
640 * easily add parameters.
643 #define YY_DECL int yylex YY_PROTO(( void ))
646 /* Code executed at the beginning of each rule, after yytext and yyleng
649 #ifndef YY_USER_ACTION
650 #define YY_USER_ACTION
653 /* Code executed at the end of each rule. */
655 #define YY_BREAK break;
658 #define YY_RULE_SETUP \
663 register yy_state_type yy_current_state;
664 register char *yy_cp = NULL, *yy_bp = NULL;
671 /* literal keyword tokens */
685 yy_start = 1; /* first start state */
693 if ( ! yy_current_buffer )
695 yy_create_buffer( yyin, YY_BUF_SIZE );
697 yy_load_buffer_state();
700 while ( 1 ) /* loops until end-of-file is reached */
704 /* Support of yytext. */
705 *yy_cp = yy_hold_char;
707 /* yy_bp points to the position in yy_ch_buf of the start of
712 yy_current_state = yy_start;
716 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
717 if ( yy_accept[yy_current_state] )
719 yy_last_accepting_state = yy_current_state;
720 yy_last_accepting_cpos = yy_cp;
722 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
724 yy_current_state = (int) yy_def[yy_current_state];
725 if ( yy_current_state >= 131 )
726 yy_c = yy_meta[(unsigned int) yy_c];
728 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
731 while ( yy_base[yy_current_state] != 162 );
734 yy_act = yy_accept[yy_current_state];
736 { /* have to back up */
737 yy_cp = yy_last_accepting_cpos;
738 yy_current_state = yy_last_accepting_state;
739 yy_act = yy_accept[yy_current_state];
745 do_action: /* This label is used only to access EOF actions. */
749 { /* beginning of action switch */
750 case 0: /* must back up */
751 /* undo the effects of YY_DO_BEFORE_ACTION */
752 *yy_cp = yy_hold_char;
753 yy_cp = yy_last_accepting_cpos;
754 yy_current_state = yy_last_accepting_state;
903 { return ll_parse_date(1, yytext); }
908 { return ll_parse_date(2, yytext); }
913 { return ll_parse_date(3, yytext); }
918 { return ll_parse_date(4, yytext); }
923 { return ll_parse_date(5, yytext); }
926 /* quoted file names */
932 if(string_buf != NULL) {
933 printf("ERROR:string_buf != NULL: %s\n",string_buf);
936 strappend(string_buf, yytext);
943 strappend(string_buf, yytext);
950 /* escaped character (including quote) */
951 strappend(string_buf, yytext);
957 { /* saw closing quote - all done */
958 strappend(string_buf, yytext);
959 yylval.strval = string_buf;
972 yylval.strval = stralloc(yytext);
986 /* everything should have been handled by now, so this rule is disabled */
990 . { yyerror("invalid character"); }
999 case YY_STATE_EOF(INITIAL):
1000 case YY_STATE_EOF(quotedpath):
1003 case YY_END_OF_BUFFER:
1005 /* Amount of text matched not including the EOB char. */
1006 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1008 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1009 *yy_cp = yy_hold_char;
1010 YY_RESTORE_YY_MORE_OFFSET
1012 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1014 /* We're scanning a new file or input source. It's
1015 * possible that this happened because the user
1016 * just pointed yyin at a new source and called
1017 * yylex(). If so, then we have to assure
1018 * consistency between yy_current_buffer and our
1019 * globals. Here is the right place to do so, because
1020 * this is the first action (other than possibly a
1021 * back-up) that will match for the new input source.
1023 yy_n_chars = yy_current_buffer->yy_n_chars;
1024 yy_current_buffer->yy_input_file = yyin;
1025 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1028 /* Note that here we test for yy_c_buf_p "<=" to the position
1029 * of the first EOB in the buffer, since yy_c_buf_p will
1030 * already have been incremented past the NUL character
1031 * (since all states make transitions on EOB to the
1032 * end-of-buffer state). Contrast this with the test
1035 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1036 { /* This was really a NUL. */
1037 yy_state_type yy_next_state;
1039 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1041 yy_current_state = yy_get_previous_state();
1043 /* Okay, we're now positioned to make the NUL
1044 * transition. We couldn't have
1045 * yy_get_previous_state() go ahead and do it
1046 * for us because it doesn't know how to deal
1047 * with the possibility of jamming (and we don't
1048 * want to build jamming into it because then it
1049 * will run more slowly).
1052 yy_next_state = yy_try_NUL_trans( yy_current_state );
1054 yy_bp = yytext_ptr + YY_MORE_ADJ;
1056 if ( yy_next_state )
1058 /* Consume the NUL. */
1059 yy_cp = ++yy_c_buf_p;
1060 yy_current_state = yy_next_state;
1067 goto yy_find_action;
1071 else switch ( yy_get_next_buffer() )
1073 case EOB_ACT_END_OF_FILE:
1075 yy_did_buffer_switch_on_eof = 0;
1079 /* Note: because we've taken care in
1080 * yy_get_next_buffer() to have set up
1081 * yytext, we can now set up
1082 * yy_c_buf_p so that if some total
1083 * hoser (like flex itself) wants to
1084 * call the scanner after we return the
1085 * YY_NULL, it'll still work - another
1086 * YY_NULL will get returned.
1088 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1090 yy_act = YY_STATE_EOF(YY_START);
1096 if ( ! yy_did_buffer_switch_on_eof )
1102 case EOB_ACT_CONTINUE_SCAN:
1104 yytext_ptr + yy_amount_of_matched_text;
1106 yy_current_state = yy_get_previous_state();
1109 yy_bp = yytext_ptr + YY_MORE_ADJ;
1112 case EOB_ACT_LAST_MATCH:
1114 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1116 yy_current_state = yy_get_previous_state();
1119 yy_bp = yytext_ptr + YY_MORE_ADJ;
1120 goto yy_find_action;
1127 "fatal flex scanner internal error--no action found" );
1128 } /* end of action switch */
1129 } /* end of scanning one token */
1130 } /* end of yylex */
1133 /* yy_get_next_buffer - try to read in a new buffer
1135 * Returns a code representing an action:
1136 * EOB_ACT_LAST_MATCH -
1137 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1138 * EOB_ACT_END_OF_FILE - end of file
1141 static int yy_get_next_buffer()
1143 register char *dest = yy_current_buffer->yy_ch_buf;
1144 register char *source = yytext_ptr;
1145 register int number_to_move, i;
1148 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1150 "fatal flex scanner internal error--end of buffer missed" );
1152 if ( yy_current_buffer->yy_fill_buffer == 0 )
1153 { /* Don't try to fill the buffer, so this is an EOF. */
1154 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1156 /* We matched a single character, the EOB, so
1157 * treat this as a final EOF.
1159 return EOB_ACT_END_OF_FILE;
1164 /* We matched some text prior to the EOB, first
1167 return EOB_ACT_LAST_MATCH;
1171 /* Try to read more data. */
1173 /* First move last chars to start of buffer. */
1174 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1176 for ( i = 0; i < number_to_move; ++i )
1177 *(dest++) = *(source++);
1179 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1180 /* don't do the read, it's not guaranteed to return an EOF,
1183 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1188 yy_current_buffer->yy_buf_size - number_to_move - 1;
1190 while ( num_to_read <= 0 )
1191 { /* Not enough room in the buffer - grow it. */
1192 #ifdef YY_USES_REJECT
1194 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1197 /* just a shorter name for the current buffer */
1198 YY_BUFFER_STATE b = yy_current_buffer;
1200 int yy_c_buf_p_offset =
1201 (int) (yy_c_buf_p - b->yy_ch_buf);
1203 if ( b->yy_is_our_buffer )
1205 int new_size = b->yy_buf_size * 2;
1207 if ( new_size <= 0 )
1208 b->yy_buf_size += b->yy_buf_size / 8;
1210 b->yy_buf_size *= 2;
1212 b->yy_ch_buf = (char *)
1213 /* Include room in for 2 EOB chars. */
1214 yy_flex_realloc( (void *) b->yy_ch_buf,
1215 b->yy_buf_size + 2 );
1218 /* Can't grow it, we don't own it. */
1221 if ( ! b->yy_ch_buf )
1223 "fatal error - scanner input buffer overflow" );
1225 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1227 num_to_read = yy_current_buffer->yy_buf_size -
1232 if ( num_to_read > YY_READ_BUF_SIZE )
1233 num_to_read = YY_READ_BUF_SIZE;
1235 /* Read in more data. */
1236 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1237 yy_n_chars, num_to_read );
1239 yy_current_buffer->yy_n_chars = yy_n_chars;
1242 if ( yy_n_chars == 0 )
1244 if ( number_to_move == YY_MORE_ADJ )
1246 ret_val = EOB_ACT_END_OF_FILE;
1252 ret_val = EOB_ACT_LAST_MATCH;
1253 yy_current_buffer->yy_buffer_status =
1254 YY_BUFFER_EOF_PENDING;
1259 ret_val = EOB_ACT_CONTINUE_SCAN;
1261 yy_n_chars += number_to_move;
1262 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1263 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1265 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1271 /* yy_get_previous_state - get the state just before the EOB char was reached */
1273 static yy_state_type yy_get_previous_state()
1275 register yy_state_type yy_current_state;
1276 register char *yy_cp;
1278 yy_current_state = yy_start;
1280 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1282 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1283 if ( yy_accept[yy_current_state] )
1285 yy_last_accepting_state = yy_current_state;
1286 yy_last_accepting_cpos = yy_cp;
1288 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1290 yy_current_state = (int) yy_def[yy_current_state];
1291 if ( yy_current_state >= 131 )
1292 yy_c = yy_meta[(unsigned int) yy_c];
1294 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1297 return yy_current_state;
1301 /* yy_try_NUL_trans - try to make a transition on the NUL character
1304 * next_state = yy_try_NUL_trans( current_state );
1307 #ifdef YY_USE_PROTOS
1308 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1310 static yy_state_type yy_try_NUL_trans( yy_current_state )
1311 yy_state_type yy_current_state;
1314 register int yy_is_jam;
1315 register char *yy_cp = yy_c_buf_p;
1317 register YY_CHAR yy_c = 1;
1318 if ( yy_accept[yy_current_state] )
1320 yy_last_accepting_state = yy_current_state;
1321 yy_last_accepting_cpos = yy_cp;
1323 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1325 yy_current_state = (int) yy_def[yy_current_state];
1326 if ( yy_current_state >= 131 )
1327 yy_c = yy_meta[(unsigned int) yy_c];
1329 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1330 yy_is_jam = (yy_current_state == 130);
1332 return yy_is_jam ? 0 : yy_current_state;
1337 #ifdef YY_USE_PROTOS
1338 static void yyunput( int c, register char *yy_bp )
1340 static void yyunput( c, yy_bp )
1342 register char *yy_bp;
1345 register char *yy_cp = yy_c_buf_p;
1347 /* undo effects of setting up yytext */
1348 *yy_cp = yy_hold_char;
1350 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1351 { /* need to shift things up to make room */
1352 /* +2 for EOB chars. */
1353 register int number_to_move = yy_n_chars + 2;
1354 register char *dest = &yy_current_buffer->yy_ch_buf[
1355 yy_current_buffer->yy_buf_size + 2];
1356 register char *source =
1357 &yy_current_buffer->yy_ch_buf[number_to_move];
1359 while ( source > yy_current_buffer->yy_ch_buf )
1360 *--dest = *--source;
1362 yy_cp += (int) (dest - source);
1363 yy_bp += (int) (dest - source);
1364 yy_current_buffer->yy_n_chars =
1365 yy_n_chars = yy_current_buffer->yy_buf_size;
1367 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1368 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1371 *--yy_cp = (char) c;
1375 yy_hold_char = *yy_cp;
1378 #endif /* ifndef YY_NO_UNPUT */
1383 static int yyinput()
1390 *yy_c_buf_p = yy_hold_char;
1392 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1394 /* yy_c_buf_p now points to the character we want to return.
1395 * If this occurs *before* the EOB characters, then it's a
1396 * valid NUL; if not, then we've hit the end of the buffer.
1398 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1399 /* This was really a NUL. */
1403 { /* need more input */
1404 int offset = yy_c_buf_p - yytext_ptr;
1407 switch ( yy_get_next_buffer() )
1409 case EOB_ACT_LAST_MATCH:
1410 /* This happens because yy_g_n_b()
1411 * sees that we've accumulated a
1412 * token and flags that we need to
1413 * try matching the token before
1414 * proceeding. But for input(),
1415 * there's no matching to consider.
1416 * So convert the EOB_ACT_LAST_MATCH
1417 * to EOB_ACT_END_OF_FILE.
1420 /* Reset buffer status. */
1425 case EOB_ACT_END_OF_FILE:
1430 if ( ! yy_did_buffer_switch_on_eof )
1439 case EOB_ACT_CONTINUE_SCAN:
1440 yy_c_buf_p = yytext_ptr + offset;
1446 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1447 *yy_c_buf_p = '\0'; /* preserve yytext */
1448 yy_hold_char = *++yy_c_buf_p;
1453 #endif /* YY_NO_INPUT */
1455 #ifdef YY_USE_PROTOS
1456 void yyrestart( FILE *input_file )
1458 void yyrestart( input_file )
1462 if ( ! yy_current_buffer )
1463 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1465 yy_init_buffer( yy_current_buffer, input_file );
1466 yy_load_buffer_state();
1470 #ifdef YY_USE_PROTOS
1471 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1473 void yy_switch_to_buffer( new_buffer )
1474 YY_BUFFER_STATE new_buffer;
1477 if ( yy_current_buffer == new_buffer )
1480 if ( yy_current_buffer )
1482 /* Flush out information for old buffer. */
1483 *yy_c_buf_p = yy_hold_char;
1484 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1485 yy_current_buffer->yy_n_chars = yy_n_chars;
1488 yy_current_buffer = new_buffer;
1489 yy_load_buffer_state();
1491 /* We don't actually know whether we did this switch during
1492 * EOF (yywrap()) processing, but the only time this flag
1493 * is looked at is after yywrap() is called, so it's safe
1494 * to go ahead and always set it.
1496 yy_did_buffer_switch_on_eof = 1;
1500 #ifdef YY_USE_PROTOS
1501 void yy_load_buffer_state( void )
1503 void yy_load_buffer_state()
1506 yy_n_chars = yy_current_buffer->yy_n_chars;
1507 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1508 yyin = yy_current_buffer->yy_input_file;
1509 yy_hold_char = *yy_c_buf_p;
1513 #ifdef YY_USE_PROTOS
1514 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1516 YY_BUFFER_STATE yy_create_buffer( file, size )
1523 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1525 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1527 b->yy_buf_size = size;
1529 /* yy_ch_buf has to be 2 characters longer than the size given because
1530 * we need to put in 2 end-of-buffer characters.
1532 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1533 if ( ! b->yy_ch_buf )
1534 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1536 b->yy_is_our_buffer = 1;
1538 yy_init_buffer( b, file );
1544 #ifdef YY_USE_PROTOS
1545 void yy_delete_buffer( YY_BUFFER_STATE b )
1547 void yy_delete_buffer( b )
1554 if ( b == yy_current_buffer )
1555 yy_current_buffer = (YY_BUFFER_STATE) 0;
1557 if ( b->yy_is_our_buffer )
1558 yy_flex_free( (void *) b->yy_ch_buf );
1560 yy_flex_free( (void *) b );
1565 #ifdef YY_USE_PROTOS
1566 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1568 void yy_init_buffer( b, file )
1575 yy_flush_buffer( b );
1577 b->yy_input_file = file;
1578 b->yy_fill_buffer = 1;
1580 #if YY_ALWAYS_INTERACTIVE
1581 b->yy_is_interactive = 1;
1583 #if YY_NEVER_INTERACTIVE
1584 b->yy_is_interactive = 0;
1586 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1592 #ifdef YY_USE_PROTOS
1593 void yy_flush_buffer( YY_BUFFER_STATE b )
1595 void yy_flush_buffer( b )
1605 /* We always need two end-of-buffer characters. The first causes
1606 * a transition to the end-of-buffer state. The second causes
1607 * a jam in that state.
1609 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1610 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1612 b->yy_buf_pos = &b->yy_ch_buf[0];
1615 b->yy_buffer_status = YY_BUFFER_NEW;
1617 if ( b == yy_current_buffer )
1618 yy_load_buffer_state();
1622 #ifndef YY_NO_SCAN_BUFFER
1623 #ifdef YY_USE_PROTOS
1624 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1626 YY_BUFFER_STATE yy_scan_buffer( base, size )
1634 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1635 base[size-1] != YY_END_OF_BUFFER_CHAR )
1636 /* They forgot to leave room for the EOB's. */
1639 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1641 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1643 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1644 b->yy_buf_pos = b->yy_ch_buf = base;
1645 b->yy_is_our_buffer = 0;
1646 b->yy_input_file = 0;
1647 b->yy_n_chars = b->yy_buf_size;
1648 b->yy_is_interactive = 0;
1650 b->yy_fill_buffer = 0;
1651 b->yy_buffer_status = YY_BUFFER_NEW;
1653 yy_switch_to_buffer( b );
1660 #ifndef YY_NO_SCAN_STRING
1661 #ifdef YY_USE_PROTOS
1662 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1664 YY_BUFFER_STATE yy_scan_string( yy_str )
1665 yyconst char *yy_str;
1669 for ( len = 0; yy_str[len]; ++len )
1672 return yy_scan_bytes( yy_str, len );
1677 #ifndef YY_NO_SCAN_BYTES
1678 #ifdef YY_USE_PROTOS
1679 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1681 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1682 yyconst char *bytes;
1691 /* Get memory for full buffer, including space for trailing EOB's. */
1693 buf = (char *) yy_flex_alloc( n );
1695 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1697 for ( i = 0; i < len; ++i )
1700 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1702 b = yy_scan_buffer( buf, n );
1704 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1706 /* It's okay to grow etc. this buffer, and we should throw it
1707 * away when we're done.
1709 b->yy_is_our_buffer = 1;
1716 #ifndef YY_NO_PUSH_STATE
1717 #ifdef YY_USE_PROTOS
1718 static void yy_push_state( int new_state )
1720 static void yy_push_state( new_state )
1724 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1728 yy_start_stack_depth += YY_START_STACK_INCR;
1729 new_size = yy_start_stack_depth * sizeof( int );
1731 if ( ! yy_start_stack )
1732 yy_start_stack = (int *) yy_flex_alloc( new_size );
1735 yy_start_stack = (int *) yy_flex_realloc(
1736 (void *) yy_start_stack, new_size );
1738 if ( ! yy_start_stack )
1740 "out of memory expanding start-condition stack" );
1743 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1750 #ifndef YY_NO_POP_STATE
1751 static void yy_pop_state()
1753 if ( --yy_start_stack_ptr < 0 )
1754 YY_FATAL_ERROR( "start-condition stack underflow" );
1756 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1761 #ifndef YY_NO_TOP_STATE
1762 static int yy_top_state()
1764 return yy_start_stack[yy_start_stack_ptr - 1];
1768 #ifndef YY_EXIT_FAILURE
1769 #define YY_EXIT_FAILURE 2
1772 #ifdef YY_USE_PROTOS
1773 static void yy_fatal_error( yyconst char msg[] )
1775 static void yy_fatal_error( msg )
1779 (void) fprintf( stderr, "%s\n", msg );
1780 exit( YY_EXIT_FAILURE );
1785 /* Redefine yyless() so it works in section 3 code. */
1791 /* Undo effects of setting up yytext. */ \
1792 yytext[yyleng] = yy_hold_char; \
1793 yy_c_buf_p = yytext + n; \
1794 yy_hold_char = *yy_c_buf_p; \
1795 *yy_c_buf_p = '\0'; \
1801 /* Internal utility routines. */
1804 #ifdef YY_USE_PROTOS
1805 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1807 static void yy_flex_strncpy( s1, s2, n )
1814 for ( i = 0; i < n; ++i )
1819 #ifdef YY_NEED_STRLEN
1820 #ifdef YY_USE_PROTOS
1821 static int yy_flex_strlen( yyconst char *s )
1823 static int yy_flex_strlen( s )
1828 for ( n = 0; s[n]; ++n )
1836 #ifdef YY_USE_PROTOS
1837 static void *yy_flex_alloc( yy_size_t size )
1839 static void *yy_flex_alloc( size )
1843 return (void *) malloc( size );
1846 #ifdef YY_USE_PROTOS
1847 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1849 static void *yy_flex_realloc( ptr, size )
1854 /* The cast to (char *) in the following accommodates both
1855 * implementations that use char* generic pointers, and those
1856 * that use void* generic pointers. It works with the latter
1857 * because both ANSI C and C++ allow castless assignment from
1858 * any pointer type to void*, and deal with argument conversions
1859 * as though doing an assignment.
1861 return (void *) realloc( (char *) ptr, size );
1864 #ifdef YY_USE_PROTOS
1865 static void yy_flex_free( void *ptr )
1867 static void yy_flex_free( ptr )
1891 b = yy_scan_string(line); /* tell lex to scan lineread */
1892 result = yyparse(); /* parse lineread and act */
1893 yy_delete_buffer(b);
1904 int y=2000, m=0, d=1, h=0, mi=0, s=0;
1907 now = time((time_t *)NULL);
1908 t = localtime(&now);
1910 y = 1900+t->tm_year;
1916 if (sscanf(text, "---%d", &d) != 1) {
1917 yyerror("invalid date");
1921 if (sscanf(text, "--%d-%d", &m, &d) != 2) {
1922 yyerror("invalid date");
1926 if (sscanf(text, "%d-%d-%d", &y, &m, &d) != 3) {
1927 yyerror("invalid date");
1931 if (sscanf(text, "%d-%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi, &s) != 6) {
1932 yyerror("invalid date");
1936 if (sscanf(text, "%d-%d-%d-%d-%d", &y, &m, &d, &h, &mi) != 5) {
1937 yyerror("invalid date");
1942 ret = PATH; /* cause a parse error */
1945 } else if(y < 100) {
1948 if(y < 1000 || y > 9999) {
1949 yyerror("invalid year");
1950 } else if(m < 1 || m > 12) {
1951 yyerror("invalid month");
1952 } else if(d < 1 || d > 31) {
1953 yyerror("invalid day");
1954 } else if(h < 0 || h > 24) {
1955 yyerror("invalid hour");
1956 } else if(mi < 0 || mi > 59) {
1957 yyerror("invalid minute");
1958 } else if(s < 0 || s > 59) {
1959 yyerror("invalid second");
1960 } else if(type < 4) {
1961 yylval.strval = alloc(DATE_ALLOC_SIZE);
1962 snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
1965 yylval.strval = alloc(DATE_ALLOC_SIZE);
1966 snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);