1 #define yy_create_buffer quote_fmt_create_buffer
2 #define yy_delete_buffer quote_fmt_delete_buffer
3 #define yy_scan_buffer quote_fmt_scan_buffer
4 #define yy_scan_string quote_fmt_scan_string
5 #define yy_scan_bytes quote_fmt_scan_bytes
6 #define yy_flex_debug quote_fmt_flex_debug
7 #define yy_init_buffer quote_fmt_init_buffer
8 #define yy_flush_buffer quote_fmt_flush_buffer
9 #define yy_load_buffer_state quote_fmt_load_buffer_state
10 #define yy_switch_to_buffer quote_fmt_switch_to_buffer
11 #define yyin quote_fmtin
12 #define yyleng quote_fmtleng
13 #define yylex quote_fmtlex
14 #define yyout quote_fmtout
15 #define yyrestart quote_fmtrestart
16 #define yytext quote_fmttext
17 #define yywrap quote_fmtwrap
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
45 /* Use prototypes in function declarations. */
48 /* The "const" storage-class-modifier is valid. */
51 #else /* ! __cplusplus */
59 #endif /* ! __cplusplus */
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
83 /* Returned upon end-of-file. */
86 /* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index. If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93 /* Enter a start condition. This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
97 #define BEGIN yy_start = 1 + 2 *
99 /* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state. The YYSTATE alias is for lex
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
106 /* Action number for EOF rule of a given start state. */
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109 /* Special action meaning "start processing a new file". */
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
114 /* Size of default input buffer. */
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state *YY_BUFFER_STATE;
120 extern FILE *yyin, *yyout;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
126 /* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator). This
128 * avoids problems with code like:
130 * if ( condition_holds )
133 * do_something_else();
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
140 /* Return all but the first 'n' matched characters back to the input stream. */
145 /* Undo effects of setting up yytext. */ \
146 *yy_cp = yy_hold_char; \
147 YY_RESTORE_YY_MORE_OFFSET \
148 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
153 #define unput(c) yyunput( c, yytext_ptr )
155 /* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
159 typedef unsigned int yy_size_t;
162 struct yy_buffer_state
166 char *yy_ch_buf; /* input buffer */
167 char *yy_buf_pos; /* current position in input buffer */
169 /* Size of input buffer in bytes, not including room for EOB
172 yy_size_t yy_buf_size;
174 /* Number of characters read into yy_ch_buf, not including EOB
179 /* Whether we "own" the buffer - i.e., we know we created it,
180 * and can realloc() it to grow it, and should free() it to
183 int yy_is_our_buffer;
185 /* Whether this is an "interactive" input source; if so, and
186 * if we're using stdio for input, then we want to use getc()
187 * instead of fread(), to make sure we stop fetching input after
190 int yy_is_interactive;
192 /* Whether we're considered to be at the beginning of a line.
193 * If so, '^' rules will be active on the next match, otherwise
198 /* Whether to try to fill the input buffer when we reach the
203 int yy_buffer_status;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
206 /* When an EOF's been seen but there's still some text to process
207 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208 * shouldn't try reading from the input source any more. We might
209 * still have a bunch of tokens to match, though, because of
210 * possible backing-up.
212 * When we actually see the EOF, we change the status to "new"
213 * (via yyrestart()), so that the user can continue scanning by
214 * just pointing yyin at a new input file.
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer = 0;
221 /* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
225 #define YY_CURRENT_BUFFER yy_current_buffer
228 /* yy_hold_char holds the character lost when yytext is formed. */
229 static char yy_hold_char;
231 static int yy_n_chars; /* number of characters read into yy_ch_buf */
236 /* Points to current character in buffer. */
237 static char *yy_c_buf_p = (char *) 0;
238 static int yy_init = 1; /* whether we need to initialize */
239 static int yy_start = 0; /* start state number */
241 /* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin. A bit of a hack ...
244 static int yy_did_buffer_switch_on_eof;
246 void yyrestart YY_PROTO(( FILE *input_file ));
248 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249 void yy_load_buffer_state YY_PROTO(( void ));
250 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
260 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262 static void yy_flex_free YY_PROTO(( void * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
268 if ( ! yy_current_buffer ) \
269 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270 yy_current_buffer->yy_is_interactive = is_interactive; \
273 #define yy_set_bol(at_bol) \
275 if ( ! yy_current_buffer ) \
276 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277 yy_current_buffer->yy_at_bol = at_bol; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
282 typedef unsigned char YY_CHAR;
283 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
284 typedef int yy_state_type;
286 #define yytext_ptr yytext
288 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
289 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
290 static int yy_get_next_buffer YY_PROTO(( void ));
291 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
293 /* Done after the current pattern has been matched and before the
294 * corresponding action - sets up yytext.
296 #define YY_DO_BEFORE_ACTION \
297 yytext_ptr = yy_bp; \
298 yyleng = (int) (yy_cp - yy_bp); \
299 yy_hold_char = *yy_cp; \
303 #define YY_NUM_RULES 33
304 #define YY_END_OF_BUFFER 34
305 static yyconst short int yy_accept[41] =
307 0, 0, 34, 32, 33, 32, 30, 31, 32, 32,
308 14, 4, 5, 12, 3, 13, 8, 1, 2, 10,
309 9, 11, 6, 7, 23, 26, 21, 22, 28, 27,
310 29, 24, 25, 19, 20, 18, 15, 17, 16, 0
313 static yyconst int yy_ec[256] =
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 1, 1, 1, 1, 1, 3, 1, 1, 4,
319 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 6, 1, 1, 1, 1, 1, 1, 7,
322 1, 1, 8, 1, 1, 1, 9, 10, 1, 1,
323 11, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 12, 1, 1, 1, 1, 1, 1, 13, 14,
326 1, 15, 1, 1, 16, 1, 1, 1, 1, 17,
327 1, 1, 1, 18, 19, 20, 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,
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[21] =
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
351 static yyconst short int yy_base[42] =
353 0, 11, 7, 73, 73, 21, 73, 73, 35, 52,
354 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
355 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
356 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
360 static yyconst short int yy_def[42] =
362 41, 41, 40, 40, 40, 40, 40, 40, 40, 40,
363 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
364 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
365 40, 40, 40, 40, 40, 40, 40, 40, 40, 0,
369 static yyconst short int yy_nxt[94] =
371 4, 5, 6, 7, 8, 9, 40, 40, 40, 40,
372 40, 10, 5, 6, 7, 8, 9, 40, 40, 40,
373 40, 40, 10, 11, 40, 40, 40, 12, 13, 14,
374 15, 16, 40, 17, 18, 19, 20, 21, 22, 23,
375 24, 25, 25, 40, 25, 40, 40, 26, 27, 28,
376 29, 30, 31, 32, 33, 34, 35, 36, 40, 40,
377 40, 40, 40, 37, 40, 40, 40, 40, 38, 40,
378 40, 39, 3, 40, 40, 40, 40, 40, 40, 40,
379 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
384 static yyconst short int yy_chk[94] =
386 41, 1, 1, 1, 1, 1, 3, 0, 0, 0,
387 0, 1, 2, 2, 2, 2, 2, 0, 0, 0,
388 0, 0, 2, 6, 0, 0, 0, 6, 6, 6,
389 6, 6, 0, 6, 6, 6, 6, 6, 6, 6,
390 6, 9, 9, 0, 9, 0, 0, 9, 9, 9,
391 9, 9, 9, 9, 9, 10, 10, 10, 0, 0,
392 0, 0, 0, 10, 0, 0, 0, 0, 10, 0,
393 0, 10, 40, 40, 40, 40, 40, 40, 40, 40,
394 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
399 static yy_state_type yy_last_accepting_state;
400 static char *yy_last_accepting_cpos;
402 /* The intent behind this definition is that it'll catch
403 * any uses of REJECT which flex missed.
405 #define REJECT reject_used_but_not_detected
406 #define yymore() yymore_used_but_not_detected
407 #define YY_MORE_ADJ 0
408 #define YY_RESTORE_YY_MORE_OFFSET
410 #line 1 "quote_fmt.l"
412 #line 2 "quote_fmt.l"
413 #line 414 "lex.quote_fmt.c"
415 /* Macros after this point can all be overridden by user definitions in
419 #ifndef YY_SKIP_YYWRAP
421 extern "C" int yywrap YY_PROTO(( void ));
423 extern int yywrap YY_PROTO(( void ));
428 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
432 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
435 #ifdef YY_NEED_STRLEN
436 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
441 static int yyinput YY_PROTO(( void ));
443 static int input YY_PROTO(( void ));
448 static int yy_start_stack_ptr = 0;
449 static int yy_start_stack_depth = 0;
450 static int *yy_start_stack = 0;
451 #ifndef YY_NO_PUSH_STATE
452 static void yy_push_state YY_PROTO(( int new_state ));
454 #ifndef YY_NO_POP_STATE
455 static void yy_pop_state YY_PROTO(( void ));
457 #ifndef YY_NO_TOP_STATE
458 static int yy_top_state YY_PROTO(( void ));
462 #define YY_NO_PUSH_STATE 1
463 #define YY_NO_POP_STATE 1
464 #define YY_NO_TOP_STATE 1
467 #ifdef YY_MALLOC_DECL
475 /* Just try to get by without declaring the routines. This will fail
476 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
477 * or sizeof(void*) != sizeof(int).
482 /* Amount of stuff to slurp up with each read. */
483 #ifndef YY_READ_BUF_SIZE
484 #define YY_READ_BUF_SIZE 8192
487 /* Copy whatever the last rule matched to the standard output. */
490 /* This used to be an fputs(), but since the string might contain NUL's,
491 * we now use fwrite().
493 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
496 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
497 * is returned in "result".
500 #define YY_INPUT(buf,result,max_size) \
501 if ( yy_current_buffer->yy_is_interactive ) \
504 for ( n = 0; n < max_size && \
505 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
508 buf[n++] = (char) c; \
509 if ( c == EOF && ferror( yyin ) ) \
510 YY_FATAL_ERROR( "input in flex scanner failed" ); \
513 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
514 && ferror( yyin ) ) \
515 YY_FATAL_ERROR( "input in flex scanner failed" );
518 /* No semi-colon after return; correct usage is to write "yyterminate();" -
519 * we don't want an extra ';' after the "return" because that will cause
520 * some compilers to complain about unreachable statements.
523 #define yyterminate() return YY_NULL
526 /* Number of entries by which start-condition stack grows. */
527 #ifndef YY_START_STACK_INCR
528 #define YY_START_STACK_INCR 25
531 /* Report a fatal error. */
532 #ifndef YY_FATAL_ERROR
533 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
536 /* Default declaration of generated scanner - a define so the user can
537 * easily add parameters.
540 #define YY_DECL int yylex YY_PROTO(( void ))
543 /* Code executed at the beginning of each rule, after yytext and yyleng
546 #ifndef YY_USER_ACTION
547 #define YY_USER_ACTION
550 /* Code executed at the end of each rule. */
552 #define YY_BREAK break;
555 #define YY_RULE_SETUP \
560 register yy_state_type yy_current_state;
561 register char *yy_cp, *yy_bp;
564 #line 6 "quote_fmt.l"
567 #line 568 "lex.quote_fmt.c"
578 yy_start = 1; /* first start state */
586 if ( ! yy_current_buffer )
588 yy_create_buffer( yyin, YY_BUF_SIZE );
590 yy_load_buffer_state();
593 while ( 1 ) /* loops until end-of-file is reached */
597 /* Support of yytext. */
598 *yy_cp = yy_hold_char;
600 /* yy_bp points to the position in yy_ch_buf of the start of
605 yy_current_state = yy_start;
609 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
610 if ( yy_accept[yy_current_state] )
612 yy_last_accepting_state = yy_current_state;
613 yy_last_accepting_cpos = yy_cp;
615 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
617 yy_current_state = (int) yy_def[yy_current_state];
618 if ( yy_current_state >= 41 )
619 yy_c = yy_meta[(unsigned int) yy_c];
621 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
624 while ( yy_base[yy_current_state] != 73 );
627 yy_act = yy_accept[yy_current_state];
629 { /* have to back up */
630 yy_cp = yy_last_accepting_cpos;
631 yy_current_state = yy_last_accepting_state;
632 yy_act = yy_accept[yy_current_state];
638 do_action: /* This label is used only to access EOF actions. */
642 { /* beginning of action switch */
643 case 0: /* must back up */
644 /* undo the effects of YY_DO_BEFORE_ACTION */
645 *yy_cp = yy_hold_char;
646 yy_cp = yy_last_accepting_cpos;
647 yy_current_state = yy_last_accepting_state;
652 #line 8 "quote_fmt.l"
653 /* date */ return SHOW_DATE;
657 #line 9 "quote_fmt.l"
658 /* From */ return SHOW_FROM;
662 #line 10 "quote_fmt.l"
663 /* Full name */ return SHOW_FULLNAME;
667 #line 11 "quote_fmt.l"
668 /* firt name */ return SHOW_FIRST_NAME;
672 #line 12 "quote_fmt.l"
673 /* initial of sender */ return SHOW_SENDER_INITIAL;
677 #line 13 "quote_fmt.l"
678 /* subject */ return SHOW_SUBJECT;
682 #line 14 "quote_fmt.l"
683 /* to */ return SHOW_TO;
687 #line 15 "quote_fmt.l"
688 /* cc */ return SHOW_CC;
692 #line 16 "quote_fmt.l"
693 /* newsgroups */ return SHOW_NEWSGROUPS;
697 #line 17 "quote_fmt.l"
698 /* message-id */ return SHOW_MESSAGEID;
702 #line 18 "quote_fmt.l"
703 /* references */ return SHOW_REFERENCES;
707 #line 19 "quote_fmt.l"
708 /* message */ return SHOW_MESSAGE;
712 #line 20 "quote_fmt.l"
713 /* quoted message */ return SHOW_QUOTED_MESSAGE;
717 #line 21 "quote_fmt.l"
718 /* % */ return SHOW_PERCENT;
722 #line 22 "quote_fmt.l"
723 /* \ */ return SHOW_BACKSLASH;
727 #line 23 "quote_fmt.l"
728 /* tab */ return SHOW_TAB;
732 #line 24 "quote_fmt.l"
733 /* retour à la ligne */ return SHOW_EOL;
737 #line 25 "quote_fmt.l"
738 /* ? */ return SHOW_QUESTION_MARK;
742 #line 26 "quote_fmt.l"
747 #line 27 "quote_fmt.l"
752 #line 28 "quote_fmt.l"
753 /* query date */ return QUERY_DATE;
757 #line 29 "quote_fmt.l"
758 /* query from */ return QUERY_FROM;
762 #line 30 "quote_fmt.l"
763 /* query from name */ return QUERY_FULLNAME;
767 #line 31 "quote_fmt.l"
768 /* query subject */ return QUERY_SUBJECT;
772 #line 32 "quote_fmt.l"
773 /* query to */ return QUERY_TO;
777 #line 33 "quote_fmt.l"
778 /* query cc */ return QUERY_CC;
782 #line 34 "quote_fmt.l"
783 /* query newsgroups */ return QUERY_NEWSGROUPS;
787 #line 35 "quote_fmt.l"
788 /* query message-id */ return QUERY_MESSAGEID;
792 #line 36 "quote_fmt.l"
793 /* query references */ return QUERY_REFERENCES;
797 #line 37 "quote_fmt.l"
802 #line 38 "quote_fmt.l"
807 #line 39 "quote_fmt.l"
812 #line 41 "quote_fmt.l"
815 #line 816 "lex.quote_fmt.c"
816 case YY_STATE_EOF(INITIAL):
819 case YY_END_OF_BUFFER:
821 /* Amount of text matched not including the EOB char. */
822 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
824 /* Undo the effects of YY_DO_BEFORE_ACTION. */
825 *yy_cp = yy_hold_char;
826 YY_RESTORE_YY_MORE_OFFSET
828 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
830 /* We're scanning a new file or input source. It's
831 * possible that this happened because the user
832 * just pointed yyin at a new source and called
833 * yylex(). If so, then we have to assure
834 * consistency between yy_current_buffer and our
835 * globals. Here is the right place to do so, because
836 * this is the first action (other than possibly a
837 * back-up) that will match for the new input source.
839 yy_n_chars = yy_current_buffer->yy_n_chars;
840 yy_current_buffer->yy_input_file = yyin;
841 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
844 /* Note that here we test for yy_c_buf_p "<=" to the position
845 * of the first EOB in the buffer, since yy_c_buf_p will
846 * already have been incremented past the NUL character
847 * (since all states make transitions on EOB to the
848 * end-of-buffer state). Contrast this with the test
851 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
852 { /* This was really a NUL. */
853 yy_state_type yy_next_state;
855 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
857 yy_current_state = yy_get_previous_state();
859 /* Okay, we're now positioned to make the NUL
860 * transition. We couldn't have
861 * yy_get_previous_state() go ahead and do it
862 * for us because it doesn't know how to deal
863 * with the possibility of jamming (and we don't
864 * want to build jamming into it because then it
865 * will run more slowly).
868 yy_next_state = yy_try_NUL_trans( yy_current_state );
870 yy_bp = yytext_ptr + YY_MORE_ADJ;
874 /* Consume the NUL. */
875 yy_cp = ++yy_c_buf_p;
876 yy_current_state = yy_next_state;
887 else switch ( yy_get_next_buffer() )
889 case EOB_ACT_END_OF_FILE:
891 yy_did_buffer_switch_on_eof = 0;
895 /* Note: because we've taken care in
896 * yy_get_next_buffer() to have set up
897 * yytext, we can now set up
898 * yy_c_buf_p so that if some total
899 * hoser (like flex itself) wants to
900 * call the scanner after we return the
901 * YY_NULL, it'll still work - another
902 * YY_NULL will get returned.
904 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
906 yy_act = YY_STATE_EOF(YY_START);
912 if ( ! yy_did_buffer_switch_on_eof )
918 case EOB_ACT_CONTINUE_SCAN:
920 yytext_ptr + yy_amount_of_matched_text;
922 yy_current_state = yy_get_previous_state();
925 yy_bp = yytext_ptr + YY_MORE_ADJ;
928 case EOB_ACT_LAST_MATCH:
930 &yy_current_buffer->yy_ch_buf[yy_n_chars];
932 yy_current_state = yy_get_previous_state();
935 yy_bp = yytext_ptr + YY_MORE_ADJ;
943 "fatal flex scanner internal error--no action found" );
944 } /* end of action switch */
945 } /* end of scanning one token */
949 /* yy_get_next_buffer - try to read in a new buffer
951 * Returns a code representing an action:
952 * EOB_ACT_LAST_MATCH -
953 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
954 * EOB_ACT_END_OF_FILE - end of file
957 static int yy_get_next_buffer()
959 register char *dest = yy_current_buffer->yy_ch_buf;
960 register char *source = yytext_ptr;
961 register int number_to_move, i;
964 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
966 "fatal flex scanner internal error--end of buffer missed" );
968 if ( yy_current_buffer->yy_fill_buffer == 0 )
969 { /* Don't try to fill the buffer, so this is an EOF. */
970 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
972 /* We matched a single character, the EOB, so
973 * treat this as a final EOF.
975 return EOB_ACT_END_OF_FILE;
980 /* We matched some text prior to the EOB, first
983 return EOB_ACT_LAST_MATCH;
987 /* Try to read more data. */
989 /* First move last chars to start of buffer. */
990 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
992 for ( i = 0; i < number_to_move; ++i )
993 *(dest++) = *(source++);
995 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
996 /* don't do the read, it's not guaranteed to return an EOF,
999 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1004 yy_current_buffer->yy_buf_size - number_to_move - 1;
1006 while ( num_to_read <= 0 )
1007 { /* Not enough room in the buffer - grow it. */
1008 #ifdef YY_USES_REJECT
1010 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1013 /* just a shorter name for the current buffer */
1014 YY_BUFFER_STATE b = yy_current_buffer;
1016 int yy_c_buf_p_offset =
1017 (int) (yy_c_buf_p - b->yy_ch_buf);
1019 if ( b->yy_is_our_buffer )
1021 int new_size = b->yy_buf_size * 2;
1023 if ( new_size <= 0 )
1024 b->yy_buf_size += b->yy_buf_size / 8;
1026 b->yy_buf_size *= 2;
1028 b->yy_ch_buf = (char *)
1029 /* Include room in for 2 EOB chars. */
1030 yy_flex_realloc( (void *) b->yy_ch_buf,
1031 b->yy_buf_size + 2 );
1034 /* Can't grow it, we don't own it. */
1037 if ( ! b->yy_ch_buf )
1039 "fatal error - scanner input buffer overflow" );
1041 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1043 num_to_read = yy_current_buffer->yy_buf_size -
1048 if ( num_to_read > YY_READ_BUF_SIZE )
1049 num_to_read = YY_READ_BUF_SIZE;
1051 /* Read in more data. */
1052 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1053 yy_n_chars, num_to_read );
1055 yy_current_buffer->yy_n_chars = yy_n_chars;
1058 if ( yy_n_chars == 0 )
1060 if ( number_to_move == YY_MORE_ADJ )
1062 ret_val = EOB_ACT_END_OF_FILE;
1068 ret_val = EOB_ACT_LAST_MATCH;
1069 yy_current_buffer->yy_buffer_status =
1070 YY_BUFFER_EOF_PENDING;
1075 ret_val = EOB_ACT_CONTINUE_SCAN;
1077 yy_n_chars += number_to_move;
1078 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1079 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1081 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1087 /* yy_get_previous_state - get the state just before the EOB char was reached */
1089 static yy_state_type yy_get_previous_state()
1091 register yy_state_type yy_current_state;
1092 register char *yy_cp;
1094 yy_current_state = yy_start;
1096 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1098 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1099 if ( yy_accept[yy_current_state] )
1101 yy_last_accepting_state = yy_current_state;
1102 yy_last_accepting_cpos = yy_cp;
1104 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1106 yy_current_state = (int) yy_def[yy_current_state];
1107 if ( yy_current_state >= 41 )
1108 yy_c = yy_meta[(unsigned int) yy_c];
1110 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1113 return yy_current_state;
1117 /* yy_try_NUL_trans - try to make a transition on the NUL character
1120 * next_state = yy_try_NUL_trans( current_state );
1123 #ifdef YY_USE_PROTOS
1124 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1126 static yy_state_type yy_try_NUL_trans( yy_current_state )
1127 yy_state_type yy_current_state;
1130 register int yy_is_jam;
1131 register char *yy_cp = yy_c_buf_p;
1133 register YY_CHAR yy_c = 1;
1134 if ( yy_accept[yy_current_state] )
1136 yy_last_accepting_state = yy_current_state;
1137 yy_last_accepting_cpos = yy_cp;
1139 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1141 yy_current_state = (int) yy_def[yy_current_state];
1142 if ( yy_current_state >= 41 )
1143 yy_c = yy_meta[(unsigned int) yy_c];
1145 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1146 yy_is_jam = (yy_current_state == 40);
1148 return yy_is_jam ? 0 : yy_current_state;
1153 #ifdef YY_USE_PROTOS
1154 static void yyunput( int c, register char *yy_bp )
1156 static void yyunput( c, yy_bp )
1158 register char *yy_bp;
1161 register char *yy_cp = yy_c_buf_p;
1163 /* undo effects of setting up yytext */
1164 *yy_cp = yy_hold_char;
1166 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1167 { /* need to shift things up to make room */
1168 /* +2 for EOB chars. */
1169 register int number_to_move = yy_n_chars + 2;
1170 register char *dest = &yy_current_buffer->yy_ch_buf[
1171 yy_current_buffer->yy_buf_size + 2];
1172 register char *source =
1173 &yy_current_buffer->yy_ch_buf[number_to_move];
1175 while ( source > yy_current_buffer->yy_ch_buf )
1176 *--dest = *--source;
1178 yy_cp += (int) (dest - source);
1179 yy_bp += (int) (dest - source);
1180 yy_current_buffer->yy_n_chars =
1181 yy_n_chars = yy_current_buffer->yy_buf_size;
1183 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1184 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1187 *--yy_cp = (char) c;
1191 yy_hold_char = *yy_cp;
1194 #endif /* ifndef YY_NO_UNPUT */
1198 static int yyinput()
1205 *yy_c_buf_p = yy_hold_char;
1207 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1209 /* yy_c_buf_p now points to the character we want to return.
1210 * If this occurs *before* the EOB characters, then it's a
1211 * valid NUL; if not, then we've hit the end of the buffer.
1213 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1214 /* This was really a NUL. */
1218 { /* need more input */
1219 int offset = yy_c_buf_p - yytext_ptr;
1222 switch ( yy_get_next_buffer() )
1224 case EOB_ACT_LAST_MATCH:
1225 /* This happens because yy_g_n_b()
1226 * sees that we've accumulated a
1227 * token and flags that we need to
1228 * try matching the token before
1229 * proceeding. But for input(),
1230 * there's no matching to consider.
1231 * So convert the EOB_ACT_LAST_MATCH
1232 * to EOB_ACT_END_OF_FILE.
1235 /* Reset buffer status. */
1240 case EOB_ACT_END_OF_FILE:
1245 if ( ! yy_did_buffer_switch_on_eof )
1254 case EOB_ACT_CONTINUE_SCAN:
1255 yy_c_buf_p = yytext_ptr + offset;
1261 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1262 *yy_c_buf_p = '\0'; /* preserve yytext */
1263 yy_hold_char = *++yy_c_buf_p;
1270 #ifdef YY_USE_PROTOS
1271 void yyrestart( FILE *input_file )
1273 void yyrestart( input_file )
1277 if ( ! yy_current_buffer )
1278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1280 yy_init_buffer( yy_current_buffer, input_file );
1281 yy_load_buffer_state();
1285 #ifdef YY_USE_PROTOS
1286 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1288 void yy_switch_to_buffer( new_buffer )
1289 YY_BUFFER_STATE new_buffer;
1292 if ( yy_current_buffer == new_buffer )
1295 if ( yy_current_buffer )
1297 /* Flush out information for old buffer. */
1298 *yy_c_buf_p = yy_hold_char;
1299 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1300 yy_current_buffer->yy_n_chars = yy_n_chars;
1303 yy_current_buffer = new_buffer;
1304 yy_load_buffer_state();
1306 /* We don't actually know whether we did this switch during
1307 * EOF (yywrap()) processing, but the only time this flag
1308 * is looked at is after yywrap() is called, so it's safe
1309 * to go ahead and always set it.
1311 yy_did_buffer_switch_on_eof = 1;
1315 #ifdef YY_USE_PROTOS
1316 void yy_load_buffer_state( void )
1318 void yy_load_buffer_state()
1321 yy_n_chars = yy_current_buffer->yy_n_chars;
1322 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1323 yyin = yy_current_buffer->yy_input_file;
1324 yy_hold_char = *yy_c_buf_p;
1328 #ifdef YY_USE_PROTOS
1329 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1331 YY_BUFFER_STATE yy_create_buffer( file, size )
1338 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1340 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1342 b->yy_buf_size = size;
1344 /* yy_ch_buf has to be 2 characters longer than the size given because
1345 * we need to put in 2 end-of-buffer characters.
1347 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1348 if ( ! b->yy_ch_buf )
1349 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1351 b->yy_is_our_buffer = 1;
1353 yy_init_buffer( b, file );
1359 #ifdef YY_USE_PROTOS
1360 void yy_delete_buffer( YY_BUFFER_STATE b )
1362 void yy_delete_buffer( b )
1369 if ( b == yy_current_buffer )
1370 yy_current_buffer = (YY_BUFFER_STATE) 0;
1372 if ( b->yy_is_our_buffer )
1373 yy_flex_free( (void *) b->yy_ch_buf );
1375 yy_flex_free( (void *) b );
1379 #ifndef YY_ALWAYS_INTERACTIVE
1380 #ifndef YY_NEVER_INTERACTIVE
1381 extern int isatty YY_PROTO(( int ));
1385 #ifdef YY_USE_PROTOS
1386 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1388 void yy_init_buffer( b, file )
1395 yy_flush_buffer( b );
1397 b->yy_input_file = file;
1398 b->yy_fill_buffer = 1;
1400 #if YY_ALWAYS_INTERACTIVE
1401 b->yy_is_interactive = 1;
1403 #if YY_NEVER_INTERACTIVE
1404 b->yy_is_interactive = 0;
1406 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1412 #ifdef YY_USE_PROTOS
1413 void yy_flush_buffer( YY_BUFFER_STATE b )
1415 void yy_flush_buffer( b )
1425 /* We always need two end-of-buffer characters. The first causes
1426 * a transition to the end-of-buffer state. The second causes
1427 * a jam in that state.
1429 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1430 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1432 b->yy_buf_pos = &b->yy_ch_buf[0];
1435 b->yy_buffer_status = YY_BUFFER_NEW;
1437 if ( b == yy_current_buffer )
1438 yy_load_buffer_state();
1442 #ifndef YY_NO_SCAN_BUFFER
1443 #ifdef YY_USE_PROTOS
1444 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1446 YY_BUFFER_STATE yy_scan_buffer( base, size )
1454 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1455 base[size-1] != YY_END_OF_BUFFER_CHAR )
1456 /* They forgot to leave room for the EOB's. */
1459 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1461 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1463 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1464 b->yy_buf_pos = b->yy_ch_buf = base;
1465 b->yy_is_our_buffer = 0;
1466 b->yy_input_file = 0;
1467 b->yy_n_chars = b->yy_buf_size;
1468 b->yy_is_interactive = 0;
1470 b->yy_fill_buffer = 0;
1471 b->yy_buffer_status = YY_BUFFER_NEW;
1473 yy_switch_to_buffer( b );
1480 #ifndef YY_NO_SCAN_STRING
1481 #ifdef YY_USE_PROTOS
1482 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1484 YY_BUFFER_STATE yy_scan_string( yy_str )
1485 yyconst char *yy_str;
1489 for ( len = 0; yy_str[len]; ++len )
1492 return yy_scan_bytes( yy_str, len );
1497 #ifndef YY_NO_SCAN_BYTES
1498 #ifdef YY_USE_PROTOS
1499 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1501 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1502 yyconst char *bytes;
1511 /* Get memory for full buffer, including space for trailing EOB's. */
1513 buf = (char *) yy_flex_alloc( n );
1515 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1517 for ( i = 0; i < len; ++i )
1520 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1522 b = yy_scan_buffer( buf, n );
1524 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1526 /* It's okay to grow etc. this buffer, and we should throw it
1527 * away when we're done.
1529 b->yy_is_our_buffer = 1;
1536 #ifndef YY_NO_PUSH_STATE
1537 #ifdef YY_USE_PROTOS
1538 static void yy_push_state( int new_state )
1540 static void yy_push_state( new_state )
1544 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1548 yy_start_stack_depth += YY_START_STACK_INCR;
1549 new_size = yy_start_stack_depth * sizeof( int );
1551 if ( ! yy_start_stack )
1552 yy_start_stack = (int *) yy_flex_alloc( new_size );
1555 yy_start_stack = (int *) yy_flex_realloc(
1556 (void *) yy_start_stack, new_size );
1558 if ( ! yy_start_stack )
1560 "out of memory expanding start-condition stack" );
1563 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1570 #ifndef YY_NO_POP_STATE
1571 static void yy_pop_state()
1573 if ( --yy_start_stack_ptr < 0 )
1574 YY_FATAL_ERROR( "start-condition stack underflow" );
1576 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1581 #ifndef YY_NO_TOP_STATE
1582 static int yy_top_state()
1584 return yy_start_stack[yy_start_stack_ptr - 1];
1588 #ifndef YY_EXIT_FAILURE
1589 #define YY_EXIT_FAILURE 2
1592 #ifdef YY_USE_PROTOS
1593 static void yy_fatal_error( yyconst char msg[] )
1595 static void yy_fatal_error( msg )
1599 (void) fprintf( stderr, "%s\n", msg );
1600 exit( YY_EXIT_FAILURE );
1605 /* Redefine yyless() so it works in section 3 code. */
1611 /* Undo effects of setting up yytext. */ \
1612 yytext[yyleng] = yy_hold_char; \
1613 yy_c_buf_p = yytext + n; \
1614 yy_hold_char = *yy_c_buf_p; \
1615 *yy_c_buf_p = '\0'; \
1621 /* Internal utility routines. */
1624 #ifdef YY_USE_PROTOS
1625 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1627 static void yy_flex_strncpy( s1, s2, n )
1634 for ( i = 0; i < n; ++i )
1639 #ifdef YY_NEED_STRLEN
1640 #ifdef YY_USE_PROTOS
1641 static int yy_flex_strlen( yyconst char *s )
1643 static int yy_flex_strlen( s )
1648 for ( n = 0; s[n]; ++n )
1656 #ifdef YY_USE_PROTOS
1657 static void *yy_flex_alloc( yy_size_t size )
1659 static void *yy_flex_alloc( size )
1663 return (void *) malloc( size );
1666 #ifdef YY_USE_PROTOS
1667 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1669 static void *yy_flex_realloc( ptr, size )
1674 /* The cast to (char *) in the following accommodates both
1675 * implementations that use char* generic pointers, and those
1676 * that use void* generic pointers. It works with the latter
1677 * because both ANSI C and C++ allow castless assignment from
1678 * any pointer type to void*, and deal with argument conversions
1679 * as though doing an assignment.
1681 return (void *) realloc( (char *) ptr, size );
1684 #ifdef YY_USE_PROTOS
1685 static void yy_flex_free( void *ptr )
1687 static void yy_flex_free( ptr )
1701 #line 41 "quote_fmt.l"