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 38
295 #define YY_END_OF_BUFFER 39
296 static yyconst short int yy_accept[121] =
298 0, 0, 0, 0, 39, 31, 37, 32, 31, 31,
299 21, 31, 31, 31, 31, 31, 31, 31, 31, 31,
300 31, 31, 36, 35, 33, 38, 31, 37, 31, 31,
301 31, 31, 7, 31, 31, 31, 31, 31, 31, 31,
302 31, 12, 31, 31, 31, 31, 31, 31, 36, 34,
303 31, 31, 31, 13, 8, 31, 31, 31, 31, 31,
304 31, 22, 31, 31, 31, 18, 31, 31, 25, 26,
305 28, 31, 31, 14, 31, 31, 10, 31, 20, 31,
306 15, 23, 27, 9, 31, 31, 31, 31, 29, 30,
307 19, 31, 31, 31, 31, 31, 31, 31, 31, 31,
309 16, 31, 31, 31, 31, 31, 31, 31, 31, 17,
310 24, 11, 31, 4, 3, 2, 5, 6, 1, 0
313 static yyconst int yy_ec[256] =
315 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
316 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 5, 1, 1, 6, 6, 6,
320 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
321 1, 1, 7, 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, 8, 1, 1, 1, 1, 9, 10, 11, 12,
326 13, 1, 1, 14, 15, 1, 16, 17, 18, 1,
327 19, 20, 21, 22, 23, 24, 25, 1, 26, 27,
328 28, 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,
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,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 static yyconst int yy_meta[29] =
347 1, 2, 3, 4, 1, 1, 1, 3, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1
352 static yyconst short int yy_base[124] =
354 0, 0, 26, 28, 142, 0, 139, 143, 135, 32,
355 0, 127, 23, 125, 110, 26, 31, 117, 109, 109,
356 30, 124, 0, 143, 143, 128, 0, 129, 39, 124,
357 44, 117, 101, 114, 109, 32, 108, 101, 111, 99,
358 95, 0, 108, 107, 103, 93, 106, 93, 0, 143,
359 108, 47, 52, 86, 0, 103, 98, 86, 87, 88,
360 83, 0, 82, 93, 91, 0, 79, 47, 0, 0,
361 96, 95, 94, 0, 77, 74, 0, 88, 0, 77,
362 83, 0, 0, 0, 51, 75, 74, 83, 85, 84,
363 0, 76, 77, 65, 71, 61, 61, 60, 70, 61,
365 50, 46, 41, 45, 54, 48, 39, 49, 42, 0,
366 0, 0, 17, 0, 0, 0, 0, 0, 0, 143,
370 static yyconst short int yy_def[124] =
372 120, 1, 121, 121, 120, 122, 120, 120, 122, 122,
373 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
374 122, 122, 123, 120, 120, 120, 122, 120, 122, 122,
375 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
376 122, 122, 122, 122, 122, 122, 122, 122, 123, 120,
377 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
378 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
379 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
380 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
381 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
383 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
384 122, 122, 122, 122, 122, 122, 122, 122, 122, 0,
388 static yyconst short int yy_nxt[172] =
390 6, 7, 6, 8, 9, 10, 11, 6, 12, 6,
391 13, 14, 15, 16, 6, 6, 17, 18, 6, 19,
392 20, 6, 21, 22, 6, 6, 6, 6, 24, 25,
393 24, 25, 119, 26, 33, 26, 30, 31, 37, 34,
394 38, 39, 46, 51, 52, 40, 58, 47, 30, 31,
395 41, 72, 52, 42, 118, 59, 73, 53, 85, 96,
396 86, 117, 116, 115, 87, 97, 114, 113, 112, 111,
397 88, 23, 23, 23, 23, 27, 110, 27, 49, 49,
398 109, 108, 107, 106, 105, 104, 103, 102, 101, 90,
399 89, 100, 99, 98, 95, 94, 93, 92, 91, 90,
401 89, 71, 84, 83, 82, 81, 80, 79, 78, 77,
402 76, 75, 74, 71, 70, 69, 68, 67, 66, 65,
403 64, 63, 62, 61, 60, 57, 56, 55, 54, 53,
404 28, 50, 48, 45, 44, 43, 36, 35, 32, 29,
405 28, 120, 5, 120, 120, 120, 120, 120, 120, 120,
406 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
407 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
411 static yyconst short int yy_chk[172] =
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
416 4, 4, 113, 3, 13, 4, 10, 10, 16, 13,
417 16, 17, 21, 29, 29, 17, 36, 21, 31, 31,
418 17, 52, 52, 17, 109, 36, 53, 53, 68, 85,
419 68, 108, 107, 106, 68, 85, 105, 104, 103, 102,
420 68, 121, 121, 121, 121, 122, 101, 122, 123, 123,
421 100, 99, 98, 97, 96, 95, 94, 93, 92, 90,
422 89, 88, 87, 86, 81, 80, 78, 76, 75, 73,
424 72, 71, 67, 65, 64, 63, 61, 60, 59, 58,
425 57, 56, 54, 51, 48, 47, 46, 45, 44, 43,
426 41, 40, 39, 38, 37, 35, 34, 33, 32, 30,
427 28, 26, 22, 20, 19, 18, 15, 14, 12, 9,
428 7, 5, 120, 120, 120, 120, 120, 120, 120, 120,
429 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
430 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
434 static yy_state_type yy_last_accepting_state;
435 static char *yy_last_accepting_cpos;
437 /* The intent behind this definition is that it'll catch
438 * any uses of REJECT which flex missed.
440 #define REJECT reject_used_but_not_detected
441 #define yymore() yymore_used_but_not_detected
442 #define YY_MORE_ADJ 0
443 #define YY_RESTORE_YY_MORE_OFFSET
448 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
449 * Copyright (c) 1991-2000 University of Maryland at College Park
450 * All Rights Reserved.
452 * Permission to use, copy, modify, distribute, and sell this software and its
453 * documentation for any purpose is hereby granted without fee, provided that
454 * the above copyright notice appear in all copies and that both that
455 * copyright notice and this permission notice appear in supporting
456 * documentation, and that the name of U.M. not be used in advertising or
457 * publicity pertaining to distribution of the software without specific,
458 * written prior permission. U.M. makes no representations about the
459 * suitability of this software for any purpose. It is provided "as is"
460 * without express or implied warranty.
462 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
463 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
464 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
465 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
466 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
467 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
469 * Authors: the Amanda Development Team. Its members are listed in a
470 * file named AUTHORS, in the root directory of this distribution.
473 * $Id: uscan.l,v 1.22 2004/02/11 13:03:29 martinea Exp $
475 * lexer for amrecover interactive language
484 #define DATE_ALLOC_SIZE sizeof("YYYY-MM-DD") /* includes null */
486 extern void yyerror P((char *s));
487 extern int yyparse P((void));
488 static int ll_parse_date P((int type, char *text));
489 #define quotedstring 1
492 static char *string_buf = NULL;
495 /* Macros after this point can all be overridden by user definitions in
499 #ifndef YY_SKIP_YYWRAP
501 extern "C" int yywrap YY_PROTO(( void ));
503 extern int yywrap YY_PROTO(( void ));
508 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
512 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
515 #ifdef YY_NEED_STRLEN
516 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
521 static int yyinput YY_PROTO(( void ));
523 static int input YY_PROTO(( void ));
528 static int yy_start_stack_ptr = 0;
529 static int yy_start_stack_depth = 0;
530 static int *yy_start_stack = 0;
531 #ifndef YY_NO_PUSH_STATE
532 static void yy_push_state YY_PROTO(( int new_state ));
534 #ifndef YY_NO_POP_STATE
535 static void yy_pop_state YY_PROTO(( void ));
537 #ifndef YY_NO_TOP_STATE
538 static int yy_top_state YY_PROTO(( void ));
542 #define YY_NO_PUSH_STATE 1
543 #define YY_NO_POP_STATE 1
544 #define YY_NO_TOP_STATE 1
547 #ifdef YY_MALLOC_DECL
555 /* Just try to get by without declaring the routines. This will fail
556 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
557 * or sizeof(void*) != sizeof(int).
562 /* Amount of stuff to slurp up with each read. */
563 #ifndef YY_READ_BUF_SIZE
564 #define YY_READ_BUF_SIZE 8192
567 /* Copy whatever the last rule matched to the standard output. */
570 /* This used to be an fputs(), but since the string might contain NUL's,
571 * we now use fwrite().
573 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
576 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
577 * is returned in "result".
580 #define YY_INPUT(buf,result,max_size) \
581 if ( yy_current_buffer->yy_is_interactive ) \
584 for ( n = 0; n < max_size && \
585 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
588 buf[n++] = (char) c; \
589 if ( c == EOF && ferror( yyin ) ) \
590 YY_FATAL_ERROR( "input in flex scanner failed" ); \
593 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
594 && ferror( yyin ) ) \
595 YY_FATAL_ERROR( "input in flex scanner failed" );
598 /* No semi-colon after return; correct usage is to write "yyterminate();" -
599 * we don't want an extra ';' after the "return" because that will cause
600 * some compilers to complain about unreachable statements.
603 #define yyterminate() return YY_NULL
606 /* Number of entries by which start-condition stack grows. */
607 #ifndef YY_START_STACK_INCR
608 #define YY_START_STACK_INCR 25
611 /* Report a fatal error. */
612 #ifndef YY_FATAL_ERROR
613 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
616 /* Default declaration of generated scanner - a define so the user can
617 * easily add parameters.
620 #define YY_DECL int yylex YY_PROTO(( void ))
623 /* Code executed at the beginning of each rule, after yytext and yyleng
626 #ifndef YY_USER_ACTION
627 #define YY_USER_ACTION
630 /* Code executed at the end of each rule. */
632 #define YY_BREAK break;
635 #define YY_RULE_SETUP \
640 register yy_state_type yy_current_state;
641 register char *yy_cp = NULL, *yy_bp = NULL;
648 /* literal keyword tokens */
662 yy_start = 1; /* first start state */
670 if ( ! yy_current_buffer )
672 yy_create_buffer( yyin, YY_BUF_SIZE );
674 yy_load_buffer_state();
677 while ( 1 ) /* loops until end-of-file is reached */
681 /* Support of yytext. */
682 *yy_cp = yy_hold_char;
684 /* yy_bp points to the position in yy_ch_buf of the start of
689 yy_current_state = yy_start;
693 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
694 if ( yy_accept[yy_current_state] )
696 yy_last_accepting_state = yy_current_state;
697 yy_last_accepting_cpos = yy_cp;
699 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
701 yy_current_state = (int) yy_def[yy_current_state];
702 if ( yy_current_state >= 121 )
703 yy_c = yy_meta[(unsigned int) yy_c];
705 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
708 while ( yy_base[yy_current_state] != 143 );
711 yy_act = yy_accept[yy_current_state];
713 { /* have to back up */
714 yy_cp = yy_last_accepting_cpos;
715 yy_current_state = yy_last_accepting_state;
716 yy_act = yy_accept[yy_current_state];
722 do_action: /* This label is used only to access EOF actions. */
726 { /* beginning of action switch */
727 case 0: /* must back up */
728 /* undo the effects of YY_DO_BEFORE_ACTION */
729 *yy_cp = yy_hold_char;
730 yy_cp = yy_last_accepting_cpos;
731 yy_current_state = yy_last_accepting_state;
875 { return ll_parse_date(1, yytext); }
880 { return ll_parse_date(2, yytext); }
885 { return ll_parse_date(3, yytext); }
894 yylval.strval = stralloc(yytext); return PATH;
898 /* quoted file names */
903 { if(string_buf != NULL) {printf("ERROR:string_buf != NULL: %s\n",string_buf);}; BEGIN(quotedstring); }
908 { /* saw closing quote - all done */
911 yylval.strval = string_buf;
924 strappend(string_buf, "\\\"");
931 /* error - unterminated string constant */
932 yyerror("unterminated string");
939 { strappend(string_buf, yytext); }
951 /* everything should have been handled by now, so this rule is disabled */
955 . { yyerror("invalid character"); }
964 case YY_STATE_EOF(INITIAL):
965 case YY_STATE_EOF(quotedstring):
968 case YY_END_OF_BUFFER:
970 /* Amount of text matched not including the EOB char. */
971 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
973 /* Undo the effects of YY_DO_BEFORE_ACTION. */
974 *yy_cp = yy_hold_char;
975 YY_RESTORE_YY_MORE_OFFSET
977 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
979 /* We're scanning a new file or input source. It's
980 * possible that this happened because the user
981 * just pointed yyin at a new source and called
982 * yylex(). If so, then we have to assure
983 * consistency between yy_current_buffer and our
984 * globals. Here is the right place to do so, because
985 * this is the first action (other than possibly a
986 * back-up) that will match for the new input source.
988 yy_n_chars = yy_current_buffer->yy_n_chars;
989 yy_current_buffer->yy_input_file = yyin;
990 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
993 /* Note that here we test for yy_c_buf_p "<=" to the position
994 * of the first EOB in the buffer, since yy_c_buf_p will
995 * already have been incremented past the NUL character
996 * (since all states make transitions on EOB to the
997 * end-of-buffer state). Contrast this with the test
1000 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1001 { /* This was really a NUL. */
1002 yy_state_type yy_next_state;
1004 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1006 yy_current_state = yy_get_previous_state();
1008 /* Okay, we're now positioned to make the NUL
1009 * transition. We couldn't have
1010 * yy_get_previous_state() go ahead and do it
1011 * for us because it doesn't know how to deal
1012 * with the possibility of jamming (and we don't
1013 * want to build jamming into it because then it
1014 * will run more slowly).
1017 yy_next_state = yy_try_NUL_trans( yy_current_state );
1019 yy_bp = yytext_ptr + YY_MORE_ADJ;
1021 if ( yy_next_state )
1023 /* Consume the NUL. */
1024 yy_cp = ++yy_c_buf_p;
1025 yy_current_state = yy_next_state;
1032 goto yy_find_action;
1036 else switch ( yy_get_next_buffer() )
1038 case EOB_ACT_END_OF_FILE:
1040 yy_did_buffer_switch_on_eof = 0;
1044 /* Note: because we've taken care in
1045 * yy_get_next_buffer() to have set up
1046 * yytext, we can now set up
1047 * yy_c_buf_p so that if some total
1048 * hoser (like flex itself) wants to
1049 * call the scanner after we return the
1050 * YY_NULL, it'll still work - another
1051 * YY_NULL will get returned.
1053 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1055 yy_act = YY_STATE_EOF(YY_START);
1061 if ( ! yy_did_buffer_switch_on_eof )
1067 case EOB_ACT_CONTINUE_SCAN:
1069 yytext_ptr + yy_amount_of_matched_text;
1071 yy_current_state = yy_get_previous_state();
1074 yy_bp = yytext_ptr + YY_MORE_ADJ;
1077 case EOB_ACT_LAST_MATCH:
1079 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1081 yy_current_state = yy_get_previous_state();
1084 yy_bp = yytext_ptr + YY_MORE_ADJ;
1085 goto yy_find_action;
1092 "fatal flex scanner internal error--no action found" );
1093 } /* end of action switch */
1094 } /* end of scanning one token */
1095 } /* end of yylex */
1098 /* yy_get_next_buffer - try to read in a new buffer
1100 * Returns a code representing an action:
1101 * EOB_ACT_LAST_MATCH -
1102 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1103 * EOB_ACT_END_OF_FILE - end of file
1106 static int yy_get_next_buffer()
1108 register char *dest = yy_current_buffer->yy_ch_buf;
1109 register char *source = yytext_ptr;
1110 register int number_to_move, i;
1113 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1115 "fatal flex scanner internal error--end of buffer missed" );
1117 if ( yy_current_buffer->yy_fill_buffer == 0 )
1118 { /* Don't try to fill the buffer, so this is an EOF. */
1119 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1121 /* We matched a single character, the EOB, so
1122 * treat this as a final EOF.
1124 return EOB_ACT_END_OF_FILE;
1129 /* We matched some text prior to the EOB, first
1132 return EOB_ACT_LAST_MATCH;
1136 /* Try to read more data. */
1138 /* First move last chars to start of buffer. */
1139 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1141 for ( i = 0; i < number_to_move; ++i )
1142 *(dest++) = *(source++);
1144 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1145 /* don't do the read, it's not guaranteed to return an EOF,
1148 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1153 yy_current_buffer->yy_buf_size - number_to_move - 1;
1155 while ( num_to_read <= 0 )
1156 { /* Not enough room in the buffer - grow it. */
1157 #ifdef YY_USES_REJECT
1159 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1162 /* just a shorter name for the current buffer */
1163 YY_BUFFER_STATE b = yy_current_buffer;
1165 int yy_c_buf_p_offset =
1166 (int) (yy_c_buf_p - b->yy_ch_buf);
1168 if ( b->yy_is_our_buffer )
1170 int new_size = b->yy_buf_size * 2;
1172 if ( new_size <= 0 )
1173 b->yy_buf_size += b->yy_buf_size / 8;
1175 b->yy_buf_size *= 2;
1177 b->yy_ch_buf = (char *)
1178 /* Include room in for 2 EOB chars. */
1179 yy_flex_realloc( (void *) b->yy_ch_buf,
1180 b->yy_buf_size + 2 );
1183 /* Can't grow it, we don't own it. */
1186 if ( ! b->yy_ch_buf )
1188 "fatal error - scanner input buffer overflow" );
1190 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1192 num_to_read = yy_current_buffer->yy_buf_size -
1197 if ( num_to_read > YY_READ_BUF_SIZE )
1198 num_to_read = YY_READ_BUF_SIZE;
1200 /* Read in more data. */
1201 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1202 yy_n_chars, num_to_read );
1204 yy_current_buffer->yy_n_chars = yy_n_chars;
1207 if ( yy_n_chars == 0 )
1209 if ( number_to_move == YY_MORE_ADJ )
1211 ret_val = EOB_ACT_END_OF_FILE;
1217 ret_val = EOB_ACT_LAST_MATCH;
1218 yy_current_buffer->yy_buffer_status =
1219 YY_BUFFER_EOF_PENDING;
1224 ret_val = EOB_ACT_CONTINUE_SCAN;
1226 yy_n_chars += number_to_move;
1227 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1228 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1230 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1236 /* yy_get_previous_state - get the state just before the EOB char was reached */
1238 static yy_state_type yy_get_previous_state()
1240 register yy_state_type yy_current_state;
1241 register char *yy_cp;
1243 yy_current_state = yy_start;
1245 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1247 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1248 if ( yy_accept[yy_current_state] )
1250 yy_last_accepting_state = yy_current_state;
1251 yy_last_accepting_cpos = yy_cp;
1253 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1255 yy_current_state = (int) yy_def[yy_current_state];
1256 if ( yy_current_state >= 121 )
1257 yy_c = yy_meta[(unsigned int) yy_c];
1259 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1262 return yy_current_state;
1266 /* yy_try_NUL_trans - try to make a transition on the NUL character
1269 * next_state = yy_try_NUL_trans( current_state );
1272 #ifdef YY_USE_PROTOS
1273 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1275 static yy_state_type yy_try_NUL_trans( yy_current_state )
1276 yy_state_type yy_current_state;
1279 register int yy_is_jam;
1280 register char *yy_cp = yy_c_buf_p;
1282 register YY_CHAR yy_c = 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 >= 121 )
1292 yy_c = yy_meta[(unsigned int) yy_c];
1294 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1295 yy_is_jam = (yy_current_state == 120);
1297 return yy_is_jam ? 0 : yy_current_state;
1302 #ifdef YY_USE_PROTOS
1303 static void yyunput( int c, register char *yy_bp )
1305 static void yyunput( c, yy_bp )
1307 register char *yy_bp;
1310 register char *yy_cp = yy_c_buf_p;
1312 /* undo effects of setting up yytext */
1313 *yy_cp = yy_hold_char;
1315 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1316 { /* need to shift things up to make room */
1317 /* +2 for EOB chars. */
1318 register int number_to_move = yy_n_chars + 2;
1319 register char *dest = &yy_current_buffer->yy_ch_buf[
1320 yy_current_buffer->yy_buf_size + 2];
1321 register char *source =
1322 &yy_current_buffer->yy_ch_buf[number_to_move];
1324 while ( source > yy_current_buffer->yy_ch_buf )
1325 *--dest = *--source;
1327 yy_cp += (int) (dest - source);
1328 yy_bp += (int) (dest - source);
1329 yy_current_buffer->yy_n_chars =
1330 yy_n_chars = yy_current_buffer->yy_buf_size;
1332 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1333 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1336 *--yy_cp = (char) c;
1340 yy_hold_char = *yy_cp;
1343 #endif /* ifndef YY_NO_UNPUT */
1348 static int yyinput()
1355 *yy_c_buf_p = yy_hold_char;
1357 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1359 /* yy_c_buf_p now points to the character we want to return.
1360 * If this occurs *before* the EOB characters, then it's a
1361 * valid NUL; if not, then we've hit the end of the buffer.
1363 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1364 /* This was really a NUL. */
1368 { /* need more input */
1369 int offset = yy_c_buf_p - yytext_ptr;
1372 switch ( yy_get_next_buffer() )
1374 case EOB_ACT_LAST_MATCH:
1375 /* This happens because yy_g_n_b()
1376 * sees that we've accumulated a
1377 * token and flags that we need to
1378 * try matching the token before
1379 * proceeding. But for input(),
1380 * there's no matching to consider.
1381 * So convert the EOB_ACT_LAST_MATCH
1382 * to EOB_ACT_END_OF_FILE.
1385 /* Reset buffer status. */
1390 case EOB_ACT_END_OF_FILE:
1395 if ( ! yy_did_buffer_switch_on_eof )
1404 case EOB_ACT_CONTINUE_SCAN:
1405 yy_c_buf_p = yytext_ptr + offset;
1411 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1412 *yy_c_buf_p = '\0'; /* preserve yytext */
1413 yy_hold_char = *++yy_c_buf_p;
1418 #endif /* YY_NO_INPUT */
1420 #ifdef YY_USE_PROTOS
1421 void yyrestart( FILE *input_file )
1423 void yyrestart( input_file )
1427 if ( ! yy_current_buffer )
1428 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1430 yy_init_buffer( yy_current_buffer, input_file );
1431 yy_load_buffer_state();
1435 #ifdef YY_USE_PROTOS
1436 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1438 void yy_switch_to_buffer( new_buffer )
1439 YY_BUFFER_STATE new_buffer;
1442 if ( yy_current_buffer == new_buffer )
1445 if ( yy_current_buffer )
1447 /* Flush out information for old buffer. */
1448 *yy_c_buf_p = yy_hold_char;
1449 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1450 yy_current_buffer->yy_n_chars = yy_n_chars;
1453 yy_current_buffer = new_buffer;
1454 yy_load_buffer_state();
1456 /* We don't actually know whether we did this switch during
1457 * EOF (yywrap()) processing, but the only time this flag
1458 * is looked at is after yywrap() is called, so it's safe
1459 * to go ahead and always set it.
1461 yy_did_buffer_switch_on_eof = 1;
1465 #ifdef YY_USE_PROTOS
1466 void yy_load_buffer_state( void )
1468 void yy_load_buffer_state()
1471 yy_n_chars = yy_current_buffer->yy_n_chars;
1472 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1473 yyin = yy_current_buffer->yy_input_file;
1474 yy_hold_char = *yy_c_buf_p;
1478 #ifdef YY_USE_PROTOS
1479 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1481 YY_BUFFER_STATE yy_create_buffer( file, size )
1488 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1490 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1492 b->yy_buf_size = size;
1494 /* yy_ch_buf has to be 2 characters longer than the size given because
1495 * we need to put in 2 end-of-buffer characters.
1497 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1498 if ( ! b->yy_ch_buf )
1499 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1501 b->yy_is_our_buffer = 1;
1503 yy_init_buffer( b, file );
1509 #ifdef YY_USE_PROTOS
1510 void yy_delete_buffer( YY_BUFFER_STATE b )
1512 void yy_delete_buffer( b )
1519 if ( b == yy_current_buffer )
1520 yy_current_buffer = (YY_BUFFER_STATE) 0;
1522 if ( b->yy_is_our_buffer )
1523 yy_flex_free( (void *) b->yy_ch_buf );
1525 yy_flex_free( (void *) b );
1530 #ifdef YY_USE_PROTOS
1531 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1533 void yy_init_buffer( b, file )
1540 yy_flush_buffer( b );
1542 b->yy_input_file = file;
1543 b->yy_fill_buffer = 1;
1545 #if YY_ALWAYS_INTERACTIVE
1546 b->yy_is_interactive = 1;
1548 #if YY_NEVER_INTERACTIVE
1549 b->yy_is_interactive = 0;
1551 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1557 #ifdef YY_USE_PROTOS
1558 void yy_flush_buffer( YY_BUFFER_STATE b )
1560 void yy_flush_buffer( b )
1570 /* We always need two end-of-buffer characters. The first causes
1571 * a transition to the end-of-buffer state. The second causes
1572 * a jam in that state.
1574 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1575 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1577 b->yy_buf_pos = &b->yy_ch_buf[0];
1580 b->yy_buffer_status = YY_BUFFER_NEW;
1582 if ( b == yy_current_buffer )
1583 yy_load_buffer_state();
1587 #ifndef YY_NO_SCAN_BUFFER
1588 #ifdef YY_USE_PROTOS
1589 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1591 YY_BUFFER_STATE yy_scan_buffer( base, size )
1599 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1600 base[size-1] != YY_END_OF_BUFFER_CHAR )
1601 /* They forgot to leave room for the EOB's. */
1604 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1606 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1608 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1609 b->yy_buf_pos = b->yy_ch_buf = base;
1610 b->yy_is_our_buffer = 0;
1611 b->yy_input_file = 0;
1612 b->yy_n_chars = b->yy_buf_size;
1613 b->yy_is_interactive = 0;
1615 b->yy_fill_buffer = 0;
1616 b->yy_buffer_status = YY_BUFFER_NEW;
1618 yy_switch_to_buffer( b );
1625 #ifndef YY_NO_SCAN_STRING
1626 #ifdef YY_USE_PROTOS
1627 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1629 YY_BUFFER_STATE yy_scan_string( yy_str )
1630 yyconst char *yy_str;
1634 for ( len = 0; yy_str[len]; ++len )
1637 return yy_scan_bytes( yy_str, len );
1642 #ifndef YY_NO_SCAN_BYTES
1643 #ifdef YY_USE_PROTOS
1644 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1646 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1647 yyconst char *bytes;
1656 /* Get memory for full buffer, including space for trailing EOB's. */
1658 buf = (char *) yy_flex_alloc( n );
1660 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1662 for ( i = 0; i < len; ++i )
1665 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1667 b = yy_scan_buffer( buf, n );
1669 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1671 /* It's okay to grow etc. this buffer, and we should throw it
1672 * away when we're done.
1674 b->yy_is_our_buffer = 1;
1681 #ifndef YY_NO_PUSH_STATE
1682 #ifdef YY_USE_PROTOS
1683 static void yy_push_state( int new_state )
1685 static void yy_push_state( new_state )
1689 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1693 yy_start_stack_depth += YY_START_STACK_INCR;
1694 new_size = yy_start_stack_depth * sizeof( int );
1696 if ( ! yy_start_stack )
1697 yy_start_stack = (int *) yy_flex_alloc( new_size );
1700 yy_start_stack = (int *) yy_flex_realloc(
1701 (void *) yy_start_stack, new_size );
1703 if ( ! yy_start_stack )
1705 "out of memory expanding start-condition stack" );
1708 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1715 #ifndef YY_NO_POP_STATE
1716 static void yy_pop_state()
1718 if ( --yy_start_stack_ptr < 0 )
1719 YY_FATAL_ERROR( "start-condition stack underflow" );
1721 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1726 #ifndef YY_NO_TOP_STATE
1727 static int yy_top_state()
1729 return yy_start_stack[yy_start_stack_ptr - 1];
1733 #ifndef YY_EXIT_FAILURE
1734 #define YY_EXIT_FAILURE 2
1737 #ifdef YY_USE_PROTOS
1738 static void yy_fatal_error( yyconst char msg[] )
1740 static void yy_fatal_error( msg )
1744 (void) fprintf( stderr, "%s\n", msg );
1745 exit( YY_EXIT_FAILURE );
1750 /* Redefine yyless() so it works in section 3 code. */
1756 /* Undo effects of setting up yytext. */ \
1757 yytext[yyleng] = yy_hold_char; \
1758 yy_c_buf_p = yytext + n; \
1759 yy_hold_char = *yy_c_buf_p; \
1760 *yy_c_buf_p = '\0'; \
1766 /* Internal utility routines. */
1769 #ifdef YY_USE_PROTOS
1770 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1772 static void yy_flex_strncpy( s1, s2, n )
1779 for ( i = 0; i < n; ++i )
1784 #ifdef YY_NEED_STRLEN
1785 #ifdef YY_USE_PROTOS
1786 static int yy_flex_strlen( yyconst char *s )
1788 static int yy_flex_strlen( s )
1793 for ( n = 0; s[n]; ++n )
1801 #ifdef YY_USE_PROTOS
1802 static void *yy_flex_alloc( yy_size_t size )
1804 static void *yy_flex_alloc( size )
1808 return (void *) malloc( size );
1811 #ifdef YY_USE_PROTOS
1812 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1814 static void *yy_flex_realloc( ptr, size )
1819 /* The cast to (char *) in the following accommodates both
1820 * implementations that use char* generic pointers, and those
1821 * that use void* generic pointers. It works with the latter
1822 * because both ANSI C and C++ allow castless assignment from
1823 * any pointer type to void*, and deal with argument conversions
1824 * as though doing an assignment.
1826 return (void *) realloc( (char *) ptr, size );
1829 #ifdef YY_USE_PROTOS
1830 static void yy_flex_free( void *ptr )
1832 static void yy_flex_free( ptr )
1849 int process_line(line)
1855 b = yy_scan_string(line); /* tell lex to scan lineread */
1856 result = yyparse(); /* parse lineread and act */
1857 yy_delete_buffer(b);
1861 static int ll_parse_date(type, text)
1870 now = time((time_t *)NULL);
1871 t = localtime(&now);
1872 y = 1900+t->tm_year;
1876 sscanf(text, "---%d", &d);
1877 } else if(type == 2) {
1878 sscanf(text, "--%d-%d", &m, &d);
1880 sscanf(text, "%d-%d-%d", &y, &m, &d);
1883 } else if(y < 100) {
1887 ret = PATH; /* cause a parse error */
1888 if(y < 1000 || y > 9999) {
1889 yyerror("invalid year");
1890 } else if(m < 1 || m > 12) {
1891 yyerror("invalid month");
1892 } else if(d < 1 || d > 31) {
1893 yyerror("invalid day");
1895 yylval.strval = alloc(DATE_ALLOC_SIZE);
1896 snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);