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 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
180 /* Whether to try to fill the input buffer when we reach the
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1; /* whether we need to initialize */
221 static int yy_start = 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR;
265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266 typedef int yy_state_type;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272 static int yy_get_next_buffer YY_PROTO(( void ));
273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
285 #define YY_NUM_RULES 38
286 #define YY_END_OF_BUFFER 39
287 static yyconst short int yy_accept[121] =
289 0, 0, 0, 0, 39, 31, 37, 32, 31, 31,
290 21, 31, 31, 31, 31, 31, 31, 31, 31, 31,
291 31, 31, 36, 35, 33, 38, 31, 37, 31, 31,
292 31, 31, 7, 31, 31, 31, 31, 31, 31, 31,
293 31, 12, 31, 31, 31, 31, 31, 31, 36, 34,
294 31, 31, 31, 13, 8, 31, 31, 31, 31, 31,
295 31, 22, 31, 31, 31, 18, 31, 31, 25, 26,
296 28, 31, 31, 14, 31, 31, 10, 31, 20, 31,
297 15, 23, 27, 9, 31, 31, 31, 31, 29, 30,
298 19, 31, 31, 31, 31, 31, 31, 31, 31, 31,
300 16, 31, 31, 31, 31, 31, 31, 31, 31, 17,
301 24, 11, 31, 4, 3, 2, 5, 6, 1, 0
304 static yyconst int yy_ec[256] =
306 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
307 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
308 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309 1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
310 1, 1, 1, 1, 5, 1, 1, 6, 6, 6,
311 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
312 1, 1, 7, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 8, 1, 1, 1, 1, 9, 10, 11, 12,
317 13, 1, 1, 14, 15, 1, 16, 17, 18, 1,
318 19, 20, 21, 22, 23, 24, 25, 1, 26, 27,
319 28, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 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,
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,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 static yyconst int yy_meta[29] =
338 1, 2, 3, 4, 1, 1, 1, 3, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1
343 static yyconst short int yy_base[124] =
345 0, 0, 26, 28, 142, 0, 139, 143, 135, 32,
346 0, 127, 23, 125, 110, 26, 31, 117, 109, 109,
347 30, 124, 0, 143, 143, 128, 0, 129, 39, 124,
348 44, 117, 101, 114, 109, 32, 108, 101, 111, 99,
349 95, 0, 108, 107, 103, 93, 106, 93, 0, 143,
350 108, 47, 52, 86, 0, 103, 98, 86, 87, 88,
351 83, 0, 82, 93, 91, 0, 79, 47, 0, 0,
352 96, 95, 94, 0, 77, 74, 0, 88, 0, 77,
353 83, 0, 0, 0, 51, 75, 74, 83, 85, 84,
354 0, 76, 77, 65, 71, 61, 61, 60, 70, 61,
356 50, 46, 41, 45, 54, 48, 39, 49, 42, 0,
357 0, 0, 17, 0, 0, 0, 0, 0, 0, 143,
361 static yyconst short int yy_def[124] =
363 120, 1, 121, 121, 120, 122, 120, 120, 122, 122,
364 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
365 122, 122, 123, 120, 120, 120, 122, 120, 122, 122,
366 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
367 122, 122, 122, 122, 122, 122, 122, 122, 123, 120,
368 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
369 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
370 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
371 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
372 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
374 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
375 122, 122, 122, 122, 122, 122, 122, 122, 122, 0,
379 static yyconst short int yy_nxt[172] =
381 6, 7, 6, 8, 9, 10, 11, 6, 12, 6,
382 13, 14, 15, 16, 6, 6, 17, 18, 6, 19,
383 20, 6, 21, 22, 6, 6, 6, 6, 24, 25,
384 24, 25, 119, 26, 33, 26, 30, 31, 37, 34,
385 38, 39, 46, 51, 52, 40, 58, 47, 30, 31,
386 41, 72, 52, 42, 118, 59, 73, 53, 85, 96,
387 86, 117, 116, 115, 87, 97, 114, 113, 112, 111,
388 88, 23, 23, 23, 23, 27, 110, 27, 49, 49,
389 109, 108, 107, 106, 105, 104, 103, 102, 101, 90,
390 89, 100, 99, 98, 95, 94, 93, 92, 91, 90,
392 89, 71, 84, 83, 82, 81, 80, 79, 78, 77,
393 76, 75, 74, 71, 70, 69, 68, 67, 66, 65,
394 64, 63, 62, 61, 60, 57, 56, 55, 54, 53,
395 28, 50, 48, 45, 44, 43, 36, 35, 32, 29,
396 28, 120, 5, 120, 120, 120, 120, 120, 120, 120,
397 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
398 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
402 static yyconst short int yy_chk[172] =
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
407 4, 4, 113, 3, 13, 4, 10, 10, 16, 13,
408 16, 17, 21, 29, 29, 17, 36, 21, 31, 31,
409 17, 52, 52, 17, 109, 36, 53, 53, 68, 85,
410 68, 108, 107, 106, 68, 85, 105, 104, 103, 102,
411 68, 121, 121, 121, 121, 122, 101, 122, 123, 123,
412 100, 99, 98, 97, 96, 95, 94, 93, 92, 90,
413 89, 88, 87, 86, 81, 80, 78, 76, 75, 73,
415 72, 71, 67, 65, 64, 63, 61, 60, 59, 58,
416 57, 56, 54, 51, 48, 47, 46, 45, 44, 43,
417 41, 40, 39, 38, 37, 35, 34, 33, 32, 30,
418 28, 26, 22, 20, 19, 18, 15, 14, 12, 9,
419 7, 5, 120, 120, 120, 120, 120, 120, 120, 120,
420 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
421 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
425 static yy_state_type yy_last_accepting_state;
426 static char *yy_last_accepting_cpos;
428 /* The intent behind this definition is that it'll catch
429 * any uses of REJECT which flex missed.
431 #define REJECT reject_used_but_not_detected
432 #define yymore() yymore_used_but_not_detected
433 #define YY_MORE_ADJ 0
434 #define YY_RESTORE_YY_MORE_OFFSET
439 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
440 * Copyright (c) 1991-2000 University of Maryland at College Park
441 * All Rights Reserved.
443 * Permission to use, copy, modify, distribute, and sell this software and its
444 * documentation for any purpose is hereby granted without fee, provided that
445 * the above copyright notice appear in all copies and that both that
446 * copyright notice and this permission notice appear in supporting
447 * documentation, and that the name of U.M. not be used in advertising or
448 * publicity pertaining to distribution of the software without specific,
449 * written prior permission. U.M. makes no representations about the
450 * suitability of this software for any purpose. It is provided "as is"
451 * without express or implied warranty.
453 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
454 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
455 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
456 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
457 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
458 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
460 * Authors: the Amanda Development Team. Its members are listed in a
461 * file named AUTHORS, in the root directory of this distribution.
464 * $Id: uscan.l,v 1.14.2.3.4.1.2.3 2004/02/11 13:03:52 martinea Exp $
466 * lexer for amrecover interactive language
475 #define DATE_ALLOC_SIZE sizeof("YYYY-MM-DD") /* includes null */
477 extern void yyerror P((char *s));
478 extern int yyparse P((void));
479 static int ll_parse_date P((int type, char *text));
480 #define quotedstring 1
483 static char *string_buf = NULL;
486 /* Macros after this point can all be overridden by user definitions in
490 #ifndef YY_SKIP_YYWRAP
492 extern "C" int yywrap YY_PROTO(( void ));
494 extern int yywrap YY_PROTO(( void ));
499 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
503 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
506 #ifdef YY_NEED_STRLEN
507 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
512 static int yyinput YY_PROTO(( void ));
514 static int input YY_PROTO(( void ));
519 static int yy_start_stack_ptr = 0;
520 static int yy_start_stack_depth = 0;
521 static int *yy_start_stack = 0;
522 #ifndef YY_NO_PUSH_STATE
523 static void yy_push_state YY_PROTO(( int new_state ));
525 #ifndef YY_NO_POP_STATE
526 static void yy_pop_state YY_PROTO(( void ));
528 #ifndef YY_NO_TOP_STATE
529 static int yy_top_state YY_PROTO(( void ));
533 #define YY_NO_PUSH_STATE 1
534 #define YY_NO_POP_STATE 1
535 #define YY_NO_TOP_STATE 1
538 #ifdef YY_MALLOC_DECL
546 /* Just try to get by without declaring the routines. This will fail
547 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
548 * or sizeof(void*) != sizeof(int).
553 /* Amount of stuff to slurp up with each read. */
554 #ifndef YY_READ_BUF_SIZE
555 #define YY_READ_BUF_SIZE 8192
558 /* Copy whatever the last rule matched to the standard output. */
561 /* This used to be an fputs(), but since the string might contain NUL's,
562 * we now use fwrite().
564 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
567 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
568 * is returned in "result".
571 #define YY_INPUT(buf,result,max_size) \
572 if ( yy_current_buffer->yy_is_interactive ) \
575 for ( n = 0; n < max_size && \
576 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
579 buf[n++] = (char) c; \
580 if ( c == EOF && ferror( yyin ) ) \
581 YY_FATAL_ERROR( "input in flex scanner failed" ); \
584 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
585 && ferror( yyin ) ) \
586 YY_FATAL_ERROR( "input in flex scanner failed" );
589 /* No semi-colon after return; correct usage is to write "yyterminate();" -
590 * we don't want an extra ';' after the "return" because that will cause
591 * some compilers to complain about unreachable statements.
594 #define yyterminate() return YY_NULL
597 /* Number of entries by which start-condition stack grows. */
598 #ifndef YY_START_STACK_INCR
599 #define YY_START_STACK_INCR 25
602 /* Report a fatal error. */
603 #ifndef YY_FATAL_ERROR
604 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
607 /* Default declaration of generated scanner - a define so the user can
608 * easily add parameters.
611 #define YY_DECL int yylex YY_PROTO(( void ))
614 /* Code executed at the beginning of each rule, after yytext and yyleng
617 #ifndef YY_USER_ACTION
618 #define YY_USER_ACTION
621 /* Code executed at the end of each rule. */
623 #define YY_BREAK break;
626 #define YY_RULE_SETUP \
631 register yy_state_type yy_current_state;
632 register char *yy_cp = NULL, *yy_bp = NULL;
639 /* literal keyword tokens */
653 yy_start = 1; /* first start state */
661 if ( ! yy_current_buffer )
663 yy_create_buffer( yyin, YY_BUF_SIZE );
665 yy_load_buffer_state();
668 while ( 1 ) /* loops until end-of-file is reached */
672 /* Support of yytext. */
673 *yy_cp = yy_hold_char;
675 /* yy_bp points to the position in yy_ch_buf of the start of
680 yy_current_state = yy_start;
684 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
685 if ( yy_accept[yy_current_state] )
687 yy_last_accepting_state = yy_current_state;
688 yy_last_accepting_cpos = yy_cp;
690 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
692 yy_current_state = (int) yy_def[yy_current_state];
693 if ( yy_current_state >= 121 )
694 yy_c = yy_meta[(unsigned int) yy_c];
696 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
699 while ( yy_base[yy_current_state] != 143 );
702 yy_act = yy_accept[yy_current_state];
704 { /* have to back up */
705 yy_cp = yy_last_accepting_cpos;
706 yy_current_state = yy_last_accepting_state;
707 yy_act = yy_accept[yy_current_state];
713 do_action: /* This label is used only to access EOF actions. */
717 { /* beginning of action switch */
718 case 0: /* must back up */
719 /* undo the effects of YY_DO_BEFORE_ACTION */
720 *yy_cp = yy_hold_char;
721 yy_cp = yy_last_accepting_cpos;
722 yy_current_state = yy_last_accepting_state;
866 { return ll_parse_date(1, yytext); }
871 { return ll_parse_date(2, yytext); }
876 { return ll_parse_date(3, yytext); }
885 yylval.strval = stralloc(yytext); return PATH;
889 /* quoted file names */
894 { if(string_buf != NULL) {printf("ERROR:string_buf != NULL: %s\n",string_buf);}; BEGIN(quotedstring); }
899 { /* saw closing quote - all done */
902 yylval.strval = string_buf;
915 strappend(string_buf, "\\\"");
922 /* error - unterminated string constant */
923 yyerror("unterminated string");
930 { strappend(string_buf, yytext); }
942 /* everything should have been handled by now, so this rule is disabled */
946 . { yyerror("invalid character"); }
955 case YY_STATE_EOF(INITIAL):
956 case YY_STATE_EOF(quotedstring):
959 case YY_END_OF_BUFFER:
961 /* Amount of text matched not including the EOB char. */
962 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
964 /* Undo the effects of YY_DO_BEFORE_ACTION. */
965 *yy_cp = yy_hold_char;
966 YY_RESTORE_YY_MORE_OFFSET
968 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
970 /* We're scanning a new file or input source. It's
971 * possible that this happened because the user
972 * just pointed yyin at a new source and called
973 * yylex(). If so, then we have to assure
974 * consistency between yy_current_buffer and our
975 * globals. Here is the right place to do so, because
976 * this is the first action (other than possibly a
977 * back-up) that will match for the new input source.
979 yy_n_chars = yy_current_buffer->yy_n_chars;
980 yy_current_buffer->yy_input_file = yyin;
981 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
984 /* Note that here we test for yy_c_buf_p "<=" to the position
985 * of the first EOB in the buffer, since yy_c_buf_p will
986 * already have been incremented past the NUL character
987 * (since all states make transitions on EOB to the
988 * end-of-buffer state). Contrast this with the test
991 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
992 { /* This was really a NUL. */
993 yy_state_type yy_next_state;
995 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
997 yy_current_state = yy_get_previous_state();
999 /* Okay, we're now positioned to make the NUL
1000 * transition. We couldn't have
1001 * yy_get_previous_state() go ahead and do it
1002 * for us because it doesn't know how to deal
1003 * with the possibility of jamming (and we don't
1004 * want to build jamming into it because then it
1005 * will run more slowly).
1008 yy_next_state = yy_try_NUL_trans( yy_current_state );
1010 yy_bp = yytext_ptr + YY_MORE_ADJ;
1012 if ( yy_next_state )
1014 /* Consume the NUL. */
1015 yy_cp = ++yy_c_buf_p;
1016 yy_current_state = yy_next_state;
1023 goto yy_find_action;
1027 else switch ( yy_get_next_buffer() )
1029 case EOB_ACT_END_OF_FILE:
1031 yy_did_buffer_switch_on_eof = 0;
1035 /* Note: because we've taken care in
1036 * yy_get_next_buffer() to have set up
1037 * yytext, we can now set up
1038 * yy_c_buf_p so that if some total
1039 * hoser (like flex itself) wants to
1040 * call the scanner after we return the
1041 * YY_NULL, it'll still work - another
1042 * YY_NULL will get returned.
1044 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1046 yy_act = YY_STATE_EOF(YY_START);
1052 if ( ! yy_did_buffer_switch_on_eof )
1058 case EOB_ACT_CONTINUE_SCAN:
1060 yytext_ptr + yy_amount_of_matched_text;
1062 yy_current_state = yy_get_previous_state();
1065 yy_bp = yytext_ptr + YY_MORE_ADJ;
1068 case EOB_ACT_LAST_MATCH:
1070 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1072 yy_current_state = yy_get_previous_state();
1075 yy_bp = yytext_ptr + YY_MORE_ADJ;
1076 goto yy_find_action;
1083 "fatal flex scanner internal error--no action found" );
1084 } /* end of action switch */
1085 } /* end of scanning one token */
1086 } /* end of yylex */
1089 /* yy_get_next_buffer - try to read in a new buffer
1091 * Returns a code representing an action:
1092 * EOB_ACT_LAST_MATCH -
1093 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1094 * EOB_ACT_END_OF_FILE - end of file
1097 static int yy_get_next_buffer()
1099 register char *dest = yy_current_buffer->yy_ch_buf;
1100 register char *source = yytext_ptr;
1101 register int number_to_move, i;
1104 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1106 "fatal flex scanner internal error--end of buffer missed" );
1108 if ( yy_current_buffer->yy_fill_buffer == 0 )
1109 { /* Don't try to fill the buffer, so this is an EOF. */
1110 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1112 /* We matched a single character, the EOB, so
1113 * treat this as a final EOF.
1115 return EOB_ACT_END_OF_FILE;
1120 /* We matched some text prior to the EOB, first
1123 return EOB_ACT_LAST_MATCH;
1127 /* Try to read more data. */
1129 /* First move last chars to start of buffer. */
1130 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1132 for ( i = 0; i < number_to_move; ++i )
1133 *(dest++) = *(source++);
1135 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1136 /* don't do the read, it's not guaranteed to return an EOF,
1139 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1144 yy_current_buffer->yy_buf_size - number_to_move - 1;
1146 while ( num_to_read <= 0 )
1147 { /* Not enough room in the buffer - grow it. */
1148 #ifdef YY_USES_REJECT
1150 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1153 /* just a shorter name for the current buffer */
1154 YY_BUFFER_STATE b = yy_current_buffer;
1156 int yy_c_buf_p_offset =
1157 (int) (yy_c_buf_p - b->yy_ch_buf);
1159 if ( b->yy_is_our_buffer )
1161 int new_size = b->yy_buf_size * 2;
1163 if ( new_size <= 0 )
1164 b->yy_buf_size += b->yy_buf_size / 8;
1166 b->yy_buf_size *= 2;
1168 b->yy_ch_buf = (char *)
1169 /* Include room in for 2 EOB chars. */
1170 yy_flex_realloc( (void *) b->yy_ch_buf,
1171 b->yy_buf_size + 2 );
1174 /* Can't grow it, we don't own it. */
1177 if ( ! b->yy_ch_buf )
1179 "fatal error - scanner input buffer overflow" );
1181 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1183 num_to_read = yy_current_buffer->yy_buf_size -
1188 if ( num_to_read > YY_READ_BUF_SIZE )
1189 num_to_read = YY_READ_BUF_SIZE;
1191 /* Read in more data. */
1192 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1193 yy_n_chars, num_to_read );
1195 yy_current_buffer->yy_n_chars = yy_n_chars;
1198 if ( yy_n_chars == 0 )
1200 if ( number_to_move == YY_MORE_ADJ )
1202 ret_val = EOB_ACT_END_OF_FILE;
1208 ret_val = EOB_ACT_LAST_MATCH;
1209 yy_current_buffer->yy_buffer_status =
1210 YY_BUFFER_EOF_PENDING;
1215 ret_val = EOB_ACT_CONTINUE_SCAN;
1217 yy_n_chars += number_to_move;
1218 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1219 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1221 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1227 /* yy_get_previous_state - get the state just before the EOB char was reached */
1229 static yy_state_type yy_get_previous_state()
1231 register yy_state_type yy_current_state;
1232 register char *yy_cp;
1234 yy_current_state = yy_start;
1236 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1238 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1239 if ( yy_accept[yy_current_state] )
1241 yy_last_accepting_state = yy_current_state;
1242 yy_last_accepting_cpos = yy_cp;
1244 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1246 yy_current_state = (int) yy_def[yy_current_state];
1247 if ( yy_current_state >= 121 )
1248 yy_c = yy_meta[(unsigned int) yy_c];
1250 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1253 return yy_current_state;
1257 /* yy_try_NUL_trans - try to make a transition on the NUL character
1260 * next_state = yy_try_NUL_trans( current_state );
1263 #ifdef YY_USE_PROTOS
1264 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1266 static yy_state_type yy_try_NUL_trans( yy_current_state )
1267 yy_state_type yy_current_state;
1270 register int yy_is_jam;
1271 register char *yy_cp = yy_c_buf_p;
1273 register YY_CHAR yy_c = 1;
1274 if ( yy_accept[yy_current_state] )
1276 yy_last_accepting_state = yy_current_state;
1277 yy_last_accepting_cpos = yy_cp;
1279 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1281 yy_current_state = (int) yy_def[yy_current_state];
1282 if ( yy_current_state >= 121 )
1283 yy_c = yy_meta[(unsigned int) yy_c];
1285 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1286 yy_is_jam = (yy_current_state == 120);
1288 return yy_is_jam ? 0 : yy_current_state;
1293 #ifdef YY_USE_PROTOS
1294 static void yyunput( int c, register char *yy_bp )
1296 static void yyunput( c, yy_bp )
1298 register char *yy_bp;
1301 register char *yy_cp = yy_c_buf_p;
1303 /* undo effects of setting up yytext */
1304 *yy_cp = yy_hold_char;
1306 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1307 { /* need to shift things up to make room */
1308 /* +2 for EOB chars. */
1309 register int number_to_move = yy_n_chars + 2;
1310 register char *dest = &yy_current_buffer->yy_ch_buf[
1311 yy_current_buffer->yy_buf_size + 2];
1312 register char *source =
1313 &yy_current_buffer->yy_ch_buf[number_to_move];
1315 while ( source > yy_current_buffer->yy_ch_buf )
1316 *--dest = *--source;
1318 yy_cp += (int) (dest - source);
1319 yy_bp += (int) (dest - source);
1320 yy_current_buffer->yy_n_chars =
1321 yy_n_chars = yy_current_buffer->yy_buf_size;
1323 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1324 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1327 *--yy_cp = (char) c;
1331 yy_hold_char = *yy_cp;
1334 #endif /* ifndef YY_NO_UNPUT */
1339 static int yyinput()
1346 *yy_c_buf_p = yy_hold_char;
1348 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1350 /* yy_c_buf_p now points to the character we want to return.
1351 * If this occurs *before* the EOB characters, then it's a
1352 * valid NUL; if not, then we've hit the end of the buffer.
1354 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1355 /* This was really a NUL. */
1359 { /* need more input */
1360 int offset = yy_c_buf_p - yytext_ptr;
1363 switch ( yy_get_next_buffer() )
1365 case EOB_ACT_LAST_MATCH:
1366 /* This happens because yy_g_n_b()
1367 * sees that we've accumulated a
1368 * token and flags that we need to
1369 * try matching the token before
1370 * proceeding. But for input(),
1371 * there's no matching to consider.
1372 * So convert the EOB_ACT_LAST_MATCH
1373 * to EOB_ACT_END_OF_FILE.
1376 /* Reset buffer status. */
1381 case EOB_ACT_END_OF_FILE:
1386 if ( ! yy_did_buffer_switch_on_eof )
1395 case EOB_ACT_CONTINUE_SCAN:
1396 yy_c_buf_p = yytext_ptr + offset;
1402 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1403 *yy_c_buf_p = '\0'; /* preserve yytext */
1404 yy_hold_char = *++yy_c_buf_p;
1409 #endif /* YY_NO_INPUT */
1411 #ifdef YY_USE_PROTOS
1412 void yyrestart( FILE *input_file )
1414 void yyrestart( input_file )
1418 if ( ! yy_current_buffer )
1419 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1421 yy_init_buffer( yy_current_buffer, input_file );
1422 yy_load_buffer_state();
1426 #ifdef YY_USE_PROTOS
1427 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1429 void yy_switch_to_buffer( new_buffer )
1430 YY_BUFFER_STATE new_buffer;
1433 if ( yy_current_buffer == new_buffer )
1436 if ( yy_current_buffer )
1438 /* Flush out information for old buffer. */
1439 *yy_c_buf_p = yy_hold_char;
1440 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1441 yy_current_buffer->yy_n_chars = yy_n_chars;
1444 yy_current_buffer = new_buffer;
1445 yy_load_buffer_state();
1447 /* We don't actually know whether we did this switch during
1448 * EOF (yywrap()) processing, but the only time this flag
1449 * is looked at is after yywrap() is called, so it's safe
1450 * to go ahead and always set it.
1452 yy_did_buffer_switch_on_eof = 1;
1456 #ifdef YY_USE_PROTOS
1457 void yy_load_buffer_state( void )
1459 void yy_load_buffer_state()
1462 yy_n_chars = yy_current_buffer->yy_n_chars;
1463 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1464 yyin = yy_current_buffer->yy_input_file;
1465 yy_hold_char = *yy_c_buf_p;
1469 #ifdef YY_USE_PROTOS
1470 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1472 YY_BUFFER_STATE yy_create_buffer( file, size )
1479 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1481 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1483 b->yy_buf_size = size;
1485 /* yy_ch_buf has to be 2 characters longer than the size given because
1486 * we need to put in 2 end-of-buffer characters.
1488 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1489 if ( ! b->yy_ch_buf )
1490 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1492 b->yy_is_our_buffer = 1;
1494 yy_init_buffer( b, file );
1500 #ifdef YY_USE_PROTOS
1501 void yy_delete_buffer( YY_BUFFER_STATE b )
1503 void yy_delete_buffer( b )
1510 if ( b == yy_current_buffer )
1511 yy_current_buffer = (YY_BUFFER_STATE) 0;
1513 if ( b->yy_is_our_buffer )
1514 yy_flex_free( (void *) b->yy_ch_buf );
1516 yy_flex_free( (void *) b );
1521 #ifdef YY_USE_PROTOS
1522 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1524 void yy_init_buffer( b, file )
1531 yy_flush_buffer( b );
1533 b->yy_input_file = file;
1534 b->yy_fill_buffer = 1;
1536 #if YY_ALWAYS_INTERACTIVE
1537 b->yy_is_interactive = 1;
1539 #if YY_NEVER_INTERACTIVE
1540 b->yy_is_interactive = 0;
1542 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1548 #ifdef YY_USE_PROTOS
1549 void yy_flush_buffer( YY_BUFFER_STATE b )
1551 void yy_flush_buffer( b )
1561 /* We always need two end-of-buffer characters. The first causes
1562 * a transition to the end-of-buffer state. The second causes
1563 * a jam in that state.
1565 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1566 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1568 b->yy_buf_pos = &b->yy_ch_buf[0];
1571 b->yy_buffer_status = YY_BUFFER_NEW;
1573 if ( b == yy_current_buffer )
1574 yy_load_buffer_state();
1578 #ifndef YY_NO_SCAN_BUFFER
1579 #ifdef YY_USE_PROTOS
1580 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1582 YY_BUFFER_STATE yy_scan_buffer( base, size )
1590 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1591 base[size-1] != YY_END_OF_BUFFER_CHAR )
1592 /* They forgot to leave room for the EOB's. */
1595 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1597 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1599 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1600 b->yy_buf_pos = b->yy_ch_buf = base;
1601 b->yy_is_our_buffer = 0;
1602 b->yy_input_file = 0;
1603 b->yy_n_chars = b->yy_buf_size;
1604 b->yy_is_interactive = 0;
1606 b->yy_fill_buffer = 0;
1607 b->yy_buffer_status = YY_BUFFER_NEW;
1609 yy_switch_to_buffer( b );
1616 #ifndef YY_NO_SCAN_STRING
1617 #ifdef YY_USE_PROTOS
1618 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1620 YY_BUFFER_STATE yy_scan_string( yy_str )
1621 yyconst char *yy_str;
1625 for ( len = 0; yy_str[len]; ++len )
1628 return yy_scan_bytes( yy_str, len );
1633 #ifndef YY_NO_SCAN_BYTES
1634 #ifdef YY_USE_PROTOS
1635 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1637 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1638 yyconst char *bytes;
1647 /* Get memory for full buffer, including space for trailing EOB's. */
1649 buf = (char *) yy_flex_alloc( n );
1651 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1653 for ( i = 0; i < len; ++i )
1656 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1658 b = yy_scan_buffer( buf, n );
1660 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1662 /* It's okay to grow etc. this buffer, and we should throw it
1663 * away when we're done.
1665 b->yy_is_our_buffer = 1;
1672 #ifndef YY_NO_PUSH_STATE
1673 #ifdef YY_USE_PROTOS
1674 static void yy_push_state( int new_state )
1676 static void yy_push_state( new_state )
1680 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1684 yy_start_stack_depth += YY_START_STACK_INCR;
1685 new_size = yy_start_stack_depth * sizeof( int );
1687 if ( ! yy_start_stack )
1688 yy_start_stack = (int *) yy_flex_alloc( new_size );
1691 yy_start_stack = (int *) yy_flex_realloc(
1692 (void *) yy_start_stack, new_size );
1694 if ( ! yy_start_stack )
1696 "out of memory expanding start-condition stack" );
1699 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1706 #ifndef YY_NO_POP_STATE
1707 static void yy_pop_state()
1709 if ( --yy_start_stack_ptr < 0 )
1710 YY_FATAL_ERROR( "start-condition stack underflow" );
1712 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1717 #ifndef YY_NO_TOP_STATE
1718 static int yy_top_state()
1720 return yy_start_stack[yy_start_stack_ptr - 1];
1724 #ifndef YY_EXIT_FAILURE
1725 #define YY_EXIT_FAILURE 2
1728 #ifdef YY_USE_PROTOS
1729 static void yy_fatal_error( yyconst char msg[] )
1731 static void yy_fatal_error( msg )
1735 (void) fprintf( stderr, "%s\n", msg );
1736 exit( YY_EXIT_FAILURE );
1741 /* Redefine yyless() so it works in section 3 code. */
1747 /* Undo effects of setting up yytext. */ \
1748 yytext[yyleng] = yy_hold_char; \
1749 yy_c_buf_p = yytext + n; \
1750 yy_hold_char = *yy_c_buf_p; \
1751 *yy_c_buf_p = '\0'; \
1757 /* Internal utility routines. */
1760 #ifdef YY_USE_PROTOS
1761 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1763 static void yy_flex_strncpy( s1, s2, n )
1770 for ( i = 0; i < n; ++i )
1775 #ifdef YY_NEED_STRLEN
1776 #ifdef YY_USE_PROTOS
1777 static int yy_flex_strlen( yyconst char *s )
1779 static int yy_flex_strlen( s )
1784 for ( n = 0; s[n]; ++n )
1792 #ifdef YY_USE_PROTOS
1793 static void *yy_flex_alloc( yy_size_t size )
1795 static void *yy_flex_alloc( size )
1799 return (void *) malloc( size );
1802 #ifdef YY_USE_PROTOS
1803 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1805 static void *yy_flex_realloc( ptr, size )
1810 /* The cast to (char *) in the following accommodates both
1811 * implementations that use char* generic pointers, and those
1812 * that use void* generic pointers. It works with the latter
1813 * because both ANSI C and C++ allow castless assignment from
1814 * any pointer type to void*, and deal with argument conversions
1815 * as though doing an assignment.
1817 return (void *) realloc( (char *) ptr, size );
1820 #ifdef YY_USE_PROTOS
1821 static void yy_flex_free( void *ptr )
1823 static void yy_flex_free( ptr )
1840 int process_line(line)
1846 b = yy_scan_string(line); /* tell lex to scan lineread */
1847 result = yyparse(); /* parse lineread and act */
1848 yy_delete_buffer(b);
1852 static int ll_parse_date(type, text)
1861 now = time((time_t *)NULL);
1862 t = localtime(&now);
1863 y = 1900+t->tm_year;
1867 sscanf(text, "---%d", &d);
1868 } else if(type == 2) {
1869 sscanf(text, "--%d-%d", &m, &d);
1871 sscanf(text, "%d-%d-%d", &y, &m, &d);
1874 } else if(y < 100) {
1878 ret = PATH; /* cause a parse error */
1879 if(y < 1000 || y > 9999) {
1880 yyerror("invalid year");
1881 } else if(m < 1 || m > 12) {
1882 yyerror("invalid month");
1883 } else if(d < 1 || d > 31) {
1884 yyerror("invalid day");
1886 yylval.strval = alloc(DATE_ALLOC_SIZE);
1887 ap_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);