1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28 #ifndef YY_ALWAYS_INTERACTIVE
29 #ifndef YY_NEVER_INTERACTIVE
30 extern int isatty
YY_PROTO(( int ));
35 /* Use prototypes in function declarations. */
38 /* The "const" storage-class-modifier is valid. */
41 #else /* ! __cplusplus */
49 #endif /* ! __cplusplus */
68 #define YY_PROTO(proto) proto
70 #define YY_PROTO(proto) ()
73 /* Returned upon end-of-file. */
76 /* Promotes a possibly negative, possibly signed char to an unsigned
77 * integer for use as an array index. If the signed char is negative,
78 * we want to instead treat it as an 8-bit unsigned char, hence the
81 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83 /* Enter a start condition. This macro really ought to take a parameter,
84 * but we do it the disgusting crufty way forced on us by the ()-less
85 * definition of BEGIN.
87 #define BEGIN yy_start = 1 + 2 *
89 /* Translate the current start state into a value that can be later handed
90 * to BEGIN to return to the state. The YYSTATE alias is for lex
93 #define YY_START ((yy_start - 1) / 2)
94 #define YYSTATE YY_START
96 /* Action number for EOF rule of a given start state. */
97 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99 /* Special action meaning "start processing a new file". */
100 #define YY_NEW_FILE yyrestart( yyin )
102 #define YY_END_OF_BUFFER_CHAR 0
104 /* Size of default input buffer. */
105 #define YY_BUF_SIZE 16384
107 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
110 extern FILE *yyin
, *yyout
;
112 #define EOB_ACT_CONTINUE_SCAN 0
113 #define EOB_ACT_END_OF_FILE 1
114 #define EOB_ACT_LAST_MATCH 2
116 /* The funky do-while in the following #define is used to turn the definition
117 * int a single C statement (which needs a semi-colon terminator). This
118 * avoids problems with code like:
120 * if ( condition_holds )
123 * do_something_else();
125 * Prior to using the do-while the compiler would get upset at the
126 * "else" because it interpreted the "if" statement as being all
127 * done when it reached the ';' after the yyless() call.
130 /* Return all but the first 'n' matched characters back to the input stream. */
135 /* Undo effects of setting up yytext. */ \
136 *yy_cp = yy_hold_char; \
137 YY_RESTORE_YY_MORE_OFFSET \
138 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
139 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
143 #define unput(c) yyunput( c, yytext_ptr )
145 /* The following is because we cannot portably get our hands on size_t
146 * (without autoconf's help, which isn't available because we want
147 * flex-generated scanners to compile on their own).
149 typedef unsigned int yy_size_t
;
152 struct yy_buffer_state
156 char *yy_ch_buf
; /* input buffer */
157 char *yy_buf_pos
; /* current position in input buffer */
159 /* Size of input buffer in bytes, not including room for EOB
162 yy_size_t yy_buf_size
;
164 /* Number of characters read into yy_ch_buf, not including EOB
169 /* Whether we "own" the buffer - i.e., we know we created it,
170 * and can realloc() it to grow it, and should free() it to
173 int yy_is_our_buffer
;
175 /* Whether this is an "interactive" input source; if so, and
176 * if we're using stdio for input, then we want to use getc()
177 * instead of fread(), to make sure we stop fetching input after
180 int yy_is_interactive
;
182 /* Whether we're considered to be at the beginning of a line.
183 * If so, '^' rules will be active on the next match, otherwise
188 /* Whether to try to fill the input buffer when we reach the
193 int yy_buffer_status
;
194 #define YY_BUFFER_NEW 0
195 #define YY_BUFFER_NORMAL 1
196 /* When an EOF's been seen but there's still some text to process
197 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
198 * shouldn't try reading from the input source any more. We might
199 * still have a bunch of tokens to match, though, because of
200 * possible backing-up.
202 * When we actually see the EOF, we change the status to "new"
203 * (via yyrestart()), so that the user can continue scanning by
204 * just pointing yyin at a new input file.
206 #define YY_BUFFER_EOF_PENDING 2
209 static YY_BUFFER_STATE yy_current_buffer
= 0;
211 /* We provide macros for accessing buffer states in case in the
212 * future we want to put the buffer states in a more general
215 #define YY_CURRENT_BUFFER yy_current_buffer
218 /* yy_hold_char holds the character lost when yytext is formed. */
219 static char yy_hold_char
;
221 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
226 /* Points to current character in buffer. */
227 static char *yy_c_buf_p
= (char *) 0;
228 static int yy_init
= 1; /* whether we need to initialize */
229 static int yy_start
= 0; /* start state number */
231 /* Flag which is used to allow yywrap()'s to do buffer switches
232 * instead of setting up a fresh yyin. A bit of a hack ...
234 static int yy_did_buffer_switch_on_eof
;
236 void yyrestart
YY_PROTO(( FILE *input_file
));
238 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
239 void yy_load_buffer_state
YY_PROTO(( void ));
240 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
241 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
242 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
243 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
244 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
246 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
247 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
248 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
250 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
251 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
252 static void yy_flex_free
YY_PROTO(( void * ));
254 #define yy_new_buffer yy_create_buffer
256 #define yy_set_interactive(is_interactive) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_is_interactive = is_interactive; \
263 #define yy_set_bol(at_bol) \
265 if ( ! yy_current_buffer ) \
266 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
267 yy_current_buffer->yy_at_bol = at_bol; \
270 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
272 typedef unsigned char YY_CHAR
;
273 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
274 typedef int yy_state_type
;
276 #define yytext_ptr yytext
278 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
279 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
280 static int yy_get_next_buffer
YY_PROTO(( void ));
281 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
283 /* Done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext.
286 #define YY_DO_BEFORE_ACTION \
287 yytext_ptr = yy_bp; \
288 yyleng = (int) (yy_cp - yy_bp); \
289 yy_hold_char = *yy_cp; \
293 #define YY_NUM_RULES 17
294 #define YY_END_OF_BUFFER 18
295 static yyconst
short int yy_accept
[42] =
297 0, 0, 18, 17, 16, 15, 17, 17, 4, 11,
298 3, 13, 13, 13, 13, 1, 2, 16, 0, 0,
299 11, 13, 13, 13, 13, 12, 14, 13, 13, 13,
300 13, 5, 6, 7, 8, 13, 13, 10, 13, 9,
304 static yyconst
int yy_ec
[256] =
306 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
307 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
308 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
310 1, 1, 1, 1, 6, 1, 1, 7, 8, 9,
311 10, 11, 7, 7, 7, 7, 7, 1, 12, 1,
312 1, 1, 1, 1, 13, 13, 14, 13, 13, 13,
313 13, 13, 13, 13, 13, 13, 15, 13, 13, 13,
314 13, 13, 16, 13, 13, 13, 13, 13, 13, 13,
315 1, 1, 1, 1, 13, 1, 13, 13, 13, 17,
317 13, 18, 13, 19, 20, 13, 13, 21, 13, 22,
318 23, 13, 13, 24, 13, 25, 13, 13, 13, 13,
319 13, 13, 26, 1, 27, 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
[28] =
338 1, 1, 2, 1, 1, 1, 3, 3, 3, 3,
339 3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
343 static yyconst
short int yy_base
[45] =
345 0, 0, 64, 65, 61, 65, 0, 0, 65, 21,
346 65, 0, 39, 38, 41, 65, 65, 57, 54, 54,
347 26, 0, 34, 38, 34, 49, 65, 27, 30, 33,
348 26, 0, 0, 0, 0, 24, 25, 0, 25, 0,
352 static yyconst
short int yy_def
[45] =
354 41, 1, 41, 41, 41, 41, 42, 43, 41, 44,
355 41, 44, 44, 44, 44, 41, 41, 41, 42, 43,
356 44, 44, 44, 44, 44, 42, 41, 44, 44, 44,
357 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
361 static yyconst
short int yy_nxt
[93] =
363 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
364 10, 11, 12, 13, 14, 15, 12, 12, 12, 12,
365 12, 12, 12, 12, 12, 16, 17, 21, 21, 21,
366 21, 21, 21, 21, 21, 21, 21, 32, 33, 34,
367 35, 19, 22, 19, 20, 40, 20, 39, 38, 37,
368 36, 31, 26, 30, 29, 28, 27, 26, 18, 25,
369 24, 23, 18, 41, 3, 41, 41, 41, 41, 41,
370 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
371 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
376 static yyconst
short int yy_chk
[93] =
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 10, 10, 10,
381 10, 10, 21, 21, 21, 21, 21, 29, 29, 29,
382 29, 42, 44, 42, 43, 39, 43, 37, 36, 31,
383 30, 28, 26, 25, 24, 23, 20, 19, 18, 15,
384 14, 13, 5, 3, 41, 41, 41, 41, 41, 41,
385 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
386 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
391 static yy_state_type yy_last_accepting_state
;
392 static char *yy_last_accepting_cpos
;
394 /* The intent behind this definition is that it'll catch
395 * any uses of REJECT which flex missed.
397 #define REJECT reject_used_but_not_detected
398 #define yymore() yymore_used_but_not_detected
399 #define YY_MORE_ADJ 0
400 #define YY_RESTORE_YY_MORE_OFFSET
407 #include "yacc_parser.hh"
409 extern YYSTYPE yylval
;
413 /* Macros after this point can all be overridden by user definitions in
417 #ifndef YY_SKIP_YYWRAP
419 extern "C" int yywrap
YY_PROTO(( void ));
421 extern int yywrap
YY_PROTO(( void ));
426 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
430 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
433 #ifdef YY_NEED_STRLEN
434 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
439 static int yyinput
YY_PROTO(( void ));
441 static int input
YY_PROTO(( void ));
446 static int yy_start_stack_ptr
= 0;
447 static int yy_start_stack_depth
= 0;
448 static int *yy_start_stack
= 0;
449 #ifndef YY_NO_PUSH_STATE
450 static void yy_push_state
YY_PROTO(( int new_state
));
452 #ifndef YY_NO_POP_STATE
453 static void yy_pop_state
YY_PROTO(( void ));
455 #ifndef YY_NO_TOP_STATE
456 static int yy_top_state
YY_PROTO(( void ));
460 #define YY_NO_PUSH_STATE 1
461 #define YY_NO_POP_STATE 1
462 #define YY_NO_TOP_STATE 1
465 #ifdef YY_MALLOC_DECL
473 /* Just try to get by without declaring the routines. This will fail
474 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
475 * or sizeof(void*) != sizeof(int).
480 /* Amount of stuff to slurp up with each read. */
481 #ifndef YY_READ_BUF_SIZE
482 #define YY_READ_BUF_SIZE 8192
485 /* Copy whatever the last rule matched to the standard output. */
488 /* This used to be an fputs(), but since the string might contain NUL's,
489 * we now use fwrite().
491 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
494 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
495 * is returned in "result".
498 #define YY_INPUT(buf,result,max_size) \
499 if ( yy_current_buffer->yy_is_interactive ) \
502 for ( n = 0; n < max_size && \
503 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
506 buf[n++] = (char) c; \
507 if ( c == EOF && ferror( yyin ) ) \
508 YY_FATAL_ERROR( "input in flex scanner failed" ); \
514 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
516 if( errno != EINTR) \
518 YY_FATAL_ERROR( "input in flex scanner failed" ); \
527 /* No semi-colon after return; correct usage is to write "yyterminate();" -
528 * we don't want an extra ';' after the "return" because that will cause
529 * some compilers to complain about unreachable statements.
532 #define yyterminate() return YY_NULL
535 /* Number of entries by which start-condition stack grows. */
536 #ifndef YY_START_STACK_INCR
537 #define YY_START_STACK_INCR 25
540 /* Report a fatal error. */
541 #ifndef YY_FATAL_ERROR
542 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
545 /* Default declaration of generated scanner - a define so the user can
546 * easily add parameters.
549 #define YY_DECL int yylex YY_PROTO(( void ))
552 /* Code executed at the beginning of each rule, after yytext and yyleng
555 #ifndef YY_USER_ACTION
556 #define YY_USER_ACTION
559 /* Code executed at the end of each rule. */
561 #define YY_BREAK break;
564 #define YY_RULE_SETUP \
569 register yy_state_type yy_current_state
;
570 register char *yy_cp
, *yy_bp
;
587 yy_start
= 1; /* first start state */
595 if ( ! yy_current_buffer
)
597 yy_create_buffer( yyin
, YY_BUF_SIZE
);
599 yy_load_buffer_state();
602 while ( 1 ) /* loops until end-of-file is reached */
606 /* Support of yytext. */
607 *yy_cp
= yy_hold_char
;
609 /* yy_bp points to the position in yy_ch_buf of the start of
614 yy_current_state
= yy_start
;
618 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
619 if ( yy_accept
[yy_current_state
] )
621 yy_last_accepting_state
= yy_current_state
;
622 yy_last_accepting_cpos
= yy_cp
;
624 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
626 yy_current_state
= (int) yy_def
[yy_current_state
];
627 if ( yy_current_state
>= 42 )
628 yy_c
= yy_meta
[(unsigned int) yy_c
];
630 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
633 while ( yy_base
[yy_current_state
] != 65 );
636 yy_act
= yy_accept
[yy_current_state
];
638 { /* have to back up */
639 yy_cp
= yy_last_accepting_cpos
;
640 yy_current_state
= yy_last_accepting_state
;
641 yy_act
= yy_accept
[yy_current_state
];
647 do_action
: /* This label is used only to access EOF actions. */
651 { /* beginning of action switch */
652 case 0: /* must back up */
653 /* undo the effects of YY_DO_BEFORE_ACTION */
654 *yy_cp
= yy_hold_char
;
655 yy_cp
= yy_last_accepting_cpos
;
656 yy_current_state
= yy_last_accepting_state
;
692 yylval
= (int) strdup(yytext
); return BINDING
;
697 yylval
= (int) strdup(yytext
); return NUMBER
;
702 yylval
= (int) strdup(yytext
); return QUOTES
;
707 yylval
= (int) strdup(yytext
); return WORD
;
730 case YY_STATE_EOF(INITIAL
):
733 case YY_END_OF_BUFFER
:
735 /* Amount of text matched not including the EOB char. */
736 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
738 /* Undo the effects of YY_DO_BEFORE_ACTION. */
739 *yy_cp
= yy_hold_char
;
740 YY_RESTORE_YY_MORE_OFFSET
742 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
744 /* We're scanning a new file or input source. It's
745 * possible that this happened because the user
746 * just pointed yyin at a new source and called
747 * yylex(). If so, then we have to assure
748 * consistency between yy_current_buffer and our
749 * globals. Here is the right place to do so, because
750 * this is the first action (other than possibly a
751 * back-up) that will match for the new input source.
753 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
754 yy_current_buffer
->yy_input_file
= yyin
;
755 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
758 /* Note that here we test for yy_c_buf_p "<=" to the position
759 * of the first EOB in the buffer, since yy_c_buf_p will
760 * already have been incremented past the NUL character
761 * (since all states make transitions on EOB to the
762 * end-of-buffer state). Contrast this with the test
765 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
766 { /* This was really a NUL. */
767 yy_state_type yy_next_state
;
769 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
771 yy_current_state
= yy_get_previous_state();
773 /* Okay, we're now positioned to make the NUL
774 * transition. We couldn't have
775 * yy_get_previous_state() go ahead and do it
776 * for us because it doesn't know how to deal
777 * with the possibility of jamming (and we don't
778 * want to build jamming into it because then it
779 * will run more slowly).
782 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
784 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
788 /* Consume the NUL. */
789 yy_cp
= ++yy_c_buf_p
;
790 yy_current_state
= yy_next_state
;
801 else switch ( yy_get_next_buffer() )
803 case EOB_ACT_END_OF_FILE
:
805 yy_did_buffer_switch_on_eof
= 0;
809 /* Note: because we've taken care in
810 * yy_get_next_buffer() to have set up
811 * yytext, we can now set up
812 * yy_c_buf_p so that if some total
813 * hoser (like flex itself) wants to
814 * call the scanner after we return the
815 * YY_NULL, it'll still work - another
816 * YY_NULL will get returned.
818 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
820 yy_act
= YY_STATE_EOF(YY_START
);
826 if ( ! yy_did_buffer_switch_on_eof
)
832 case EOB_ACT_CONTINUE_SCAN
:
834 yytext_ptr
+ yy_amount_of_matched_text
;
836 yy_current_state
= yy_get_previous_state();
839 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
842 case EOB_ACT_LAST_MATCH
:
844 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
846 yy_current_state
= yy_get_previous_state();
849 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
857 "fatal flex scanner internal error--no action found" );
858 } /* end of action switch */
859 } /* end of scanning one token */
863 /* yy_get_next_buffer - try to read in a new buffer
865 * Returns a code representing an action:
866 * EOB_ACT_LAST_MATCH -
867 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
868 * EOB_ACT_END_OF_FILE - end of file
871 static int yy_get_next_buffer()
873 register char *dest
= yy_current_buffer
->yy_ch_buf
;
874 register char *source
= yytext_ptr
;
875 register int number_to_move
, i
;
878 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
880 "fatal flex scanner internal error--end of buffer missed" );
882 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
883 { /* Don't try to fill the buffer, so this is an EOF. */
884 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
886 /* We matched a single character, the EOB, so
887 * treat this as a final EOF.
889 return EOB_ACT_END_OF_FILE
;
894 /* We matched some text prior to the EOB, first
897 return EOB_ACT_LAST_MATCH
;
901 /* Try to read more data. */
903 /* First move last chars to start of buffer. */
904 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
906 for ( i
= 0; i
< number_to_move
; ++i
)
907 *(dest
++) = *(source
++);
909 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
910 /* don't do the read, it's not guaranteed to return an EOF,
913 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
918 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
920 while ( num_to_read
<= 0 )
921 { /* Not enough room in the buffer - grow it. */
922 #ifdef YY_USES_REJECT
924 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
927 /* just a shorter name for the current buffer */
928 YY_BUFFER_STATE b
= yy_current_buffer
;
930 int yy_c_buf_p_offset
=
931 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
933 if ( b
->yy_is_our_buffer
)
935 int new_size
= b
->yy_buf_size
* 2;
938 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
942 b
->yy_ch_buf
= (char *)
943 /* Include room in for 2 EOB chars. */
944 yy_flex_realloc( (void *) b
->yy_ch_buf
,
945 b
->yy_buf_size
+ 2 );
948 /* Can't grow it, we don't own it. */
951 if ( ! b
->yy_ch_buf
)
953 "fatal error - scanner input buffer overflow" );
955 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
957 num_to_read
= yy_current_buffer
->yy_buf_size
-
962 if ( num_to_read
> YY_READ_BUF_SIZE
)
963 num_to_read
= YY_READ_BUF_SIZE
;
965 /* Read in more data. */
966 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
967 yy_n_chars
, num_to_read
);
969 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
972 if ( yy_n_chars
== 0 )
974 if ( number_to_move
== YY_MORE_ADJ
)
976 ret_val
= EOB_ACT_END_OF_FILE
;
982 ret_val
= EOB_ACT_LAST_MATCH
;
983 yy_current_buffer
->yy_buffer_status
=
984 YY_BUFFER_EOF_PENDING
;
989 ret_val
= EOB_ACT_CONTINUE_SCAN
;
991 yy_n_chars
+= number_to_move
;
992 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
993 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
995 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1001 /* yy_get_previous_state - get the state just before the EOB char was reached */
1003 static yy_state_type
yy_get_previous_state()
1005 register yy_state_type yy_current_state
;
1006 register char *yy_cp
;
1008 yy_current_state
= yy_start
;
1010 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1012 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1013 if ( yy_accept
[yy_current_state
] )
1015 yy_last_accepting_state
= yy_current_state
;
1016 yy_last_accepting_cpos
= yy_cp
;
1018 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1020 yy_current_state
= (int) yy_def
[yy_current_state
];
1021 if ( yy_current_state
>= 42 )
1022 yy_c
= yy_meta
[(unsigned int) yy_c
];
1024 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1027 return yy_current_state
;
1031 /* yy_try_NUL_trans - try to make a transition on the NUL character
1034 * next_state = yy_try_NUL_trans( current_state );
1037 #ifdef YY_USE_PROTOS
1038 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1040 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1041 yy_state_type yy_current_state
;
1044 register int yy_is_jam
;
1045 register char *yy_cp
= yy_c_buf_p
;
1047 register YY_CHAR yy_c
= 1;
1048 if ( yy_accept
[yy_current_state
] )
1050 yy_last_accepting_state
= yy_current_state
;
1051 yy_last_accepting_cpos
= yy_cp
;
1053 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1055 yy_current_state
= (int) yy_def
[yy_current_state
];
1056 if ( yy_current_state
>= 42 )
1057 yy_c
= yy_meta
[(unsigned int) yy_c
];
1059 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1060 yy_is_jam
= (yy_current_state
== 41);
1062 return yy_is_jam
? 0 : yy_current_state
;
1067 #ifdef YY_USE_PROTOS
1068 static void yyunput( int c
, register char *yy_bp
)
1070 static void yyunput( c
, yy_bp
)
1072 register char *yy_bp
;
1075 register char *yy_cp
= yy_c_buf_p
;
1077 /* undo effects of setting up yytext */
1078 *yy_cp
= yy_hold_char
;
1080 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1081 { /* need to shift things up to make room */
1082 /* +2 for EOB chars. */
1083 register int number_to_move
= yy_n_chars
+ 2;
1084 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1085 yy_current_buffer
->yy_buf_size
+ 2];
1086 register char *source
=
1087 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1089 while ( source
> yy_current_buffer
->yy_ch_buf
)
1090 *--dest
= *--source
;
1092 yy_cp
+= (int) (dest
- source
);
1093 yy_bp
+= (int) (dest
- source
);
1094 yy_current_buffer
->yy_n_chars
=
1095 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1097 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1098 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1101 *--yy_cp
= (char) c
;
1105 yy_hold_char
= *yy_cp
;
1108 #endif /* ifndef YY_NO_UNPUT */
1112 static int yyinput()
1119 *yy_c_buf_p
= yy_hold_char
;
1121 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1123 /* yy_c_buf_p now points to the character we want to return.
1124 * If this occurs *before* the EOB characters, then it's a
1125 * valid NUL; if not, then we've hit the end of the buffer.
1127 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1128 /* This was really a NUL. */
1132 { /* need more input */
1133 int offset
= yy_c_buf_p
- yytext_ptr
;
1136 switch ( yy_get_next_buffer() )
1138 case EOB_ACT_LAST_MATCH
:
1139 /* This happens because yy_g_n_b()
1140 * sees that we've accumulated a
1141 * token and flags that we need to
1142 * try matching the token before
1143 * proceeding. But for input(),
1144 * there's no matching to consider.
1145 * So convert the EOB_ACT_LAST_MATCH
1146 * to EOB_ACT_END_OF_FILE.
1149 /* Reset buffer status. */
1154 case EOB_ACT_END_OF_FILE
:
1159 if ( ! yy_did_buffer_switch_on_eof
)
1168 case EOB_ACT_CONTINUE_SCAN
:
1169 yy_c_buf_p
= yytext_ptr
+ offset
;
1175 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1176 *yy_c_buf_p
= '\0'; /* preserve yytext */
1177 yy_hold_char
= *++yy_c_buf_p
;
1184 #ifdef YY_USE_PROTOS
1185 void yyrestart( FILE *input_file
)
1187 void yyrestart( input_file
)
1191 if ( ! yy_current_buffer
)
1192 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1194 yy_init_buffer( yy_current_buffer
, input_file
);
1195 yy_load_buffer_state();
1199 #ifdef YY_USE_PROTOS
1200 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1202 void yy_switch_to_buffer( new_buffer
)
1203 YY_BUFFER_STATE new_buffer
;
1206 if ( yy_current_buffer
== new_buffer
)
1209 if ( yy_current_buffer
)
1211 /* Flush out information for old buffer. */
1212 *yy_c_buf_p
= yy_hold_char
;
1213 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1214 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1217 yy_current_buffer
= new_buffer
;
1218 yy_load_buffer_state();
1220 /* We don't actually know whether we did this switch during
1221 * EOF (yywrap()) processing, but the only time this flag
1222 * is looked at is after yywrap() is called, so it's safe
1223 * to go ahead and always set it.
1225 yy_did_buffer_switch_on_eof
= 1;
1229 #ifdef YY_USE_PROTOS
1230 void yy_load_buffer_state( void )
1232 void yy_load_buffer_state()
1235 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1236 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1237 yyin
= yy_current_buffer
->yy_input_file
;
1238 yy_hold_char
= *yy_c_buf_p
;
1242 #ifdef YY_USE_PROTOS
1243 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1245 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1252 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1254 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1256 b
->yy_buf_size
= size
;
1258 /* yy_ch_buf has to be 2 characters longer than the size given because
1259 * we need to put in 2 end-of-buffer characters.
1261 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1262 if ( ! b
->yy_ch_buf
)
1263 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1265 b
->yy_is_our_buffer
= 1;
1267 yy_init_buffer( b
, file
);
1273 #ifdef YY_USE_PROTOS
1274 void yy_delete_buffer( YY_BUFFER_STATE b
)
1276 void yy_delete_buffer( b
)
1283 if ( b
== yy_current_buffer
)
1284 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1286 if ( b
->yy_is_our_buffer
)
1287 yy_flex_free( (void *) b
->yy_ch_buf
);
1289 yy_flex_free( (void *) b
);
1296 #ifndef YY_ALWAYS_INTERACTIVE
1297 #ifndef YY_NEVER_INTERACTIVE
1298 extern int isatty
YY_PROTO(( int ));
1303 #ifdef YY_USE_PROTOS
1304 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1306 void yy_init_buffer( b
, file
)
1313 yy_flush_buffer( b
);
1315 b
->yy_input_file
= file
;
1316 b
->yy_fill_buffer
= 1;
1318 #if YY_ALWAYS_INTERACTIVE
1319 b
->yy_is_interactive
= 1;
1321 #if YY_NEVER_INTERACTIVE
1322 b
->yy_is_interactive
= 0;
1324 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1330 #ifdef YY_USE_PROTOS
1331 void yy_flush_buffer( YY_BUFFER_STATE b
)
1333 void yy_flush_buffer( b
)
1343 /* We always need two end-of-buffer characters. The first causes
1344 * a transition to the end-of-buffer state. The second causes
1345 * a jam in that state.
1347 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1348 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1350 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1353 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1355 if ( b
== yy_current_buffer
)
1356 yy_load_buffer_state();
1360 #ifndef YY_NO_SCAN_BUFFER
1361 #ifdef YY_USE_PROTOS
1362 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1364 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1372 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1373 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1374 /* They forgot to leave room for the EOB's. */
1377 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1379 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1381 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1382 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1383 b
->yy_is_our_buffer
= 0;
1384 b
->yy_input_file
= 0;
1385 b
->yy_n_chars
= b
->yy_buf_size
;
1386 b
->yy_is_interactive
= 0;
1388 b
->yy_fill_buffer
= 0;
1389 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1391 yy_switch_to_buffer( b
);
1398 #ifndef YY_NO_SCAN_STRING
1399 #ifdef YY_USE_PROTOS
1400 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1402 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1403 yyconst
char *yy_str
;
1407 for ( len
= 0; yy_str
[len
]; ++len
)
1410 return yy_scan_bytes( yy_str
, len
);
1415 #ifndef YY_NO_SCAN_BYTES
1416 #ifdef YY_USE_PROTOS
1417 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1419 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1420 yyconst
char *bytes
;
1429 /* Get memory for full buffer, including space for trailing EOB's. */
1431 buf
= (char *) yy_flex_alloc( n
);
1433 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1435 for ( i
= 0; i
< len
; ++i
)
1438 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1440 b
= yy_scan_buffer( buf
, n
);
1442 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1444 /* It's okay to grow etc. this buffer, and we should throw it
1445 * away when we're done.
1447 b
->yy_is_our_buffer
= 1;
1454 #ifndef YY_NO_PUSH_STATE
1455 #ifdef YY_USE_PROTOS
1456 static void yy_push_state( int new_state
)
1458 static void yy_push_state( new_state
)
1462 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1466 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1467 new_size
= yy_start_stack_depth
* sizeof( int );
1469 if ( ! yy_start_stack
)
1470 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1473 yy_start_stack
= (int *) yy_flex_realloc(
1474 (void *) yy_start_stack
, new_size
);
1476 if ( ! yy_start_stack
)
1478 "out of memory expanding start-condition stack" );
1481 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1488 #ifndef YY_NO_POP_STATE
1489 static void yy_pop_state()
1491 if ( --yy_start_stack_ptr
< 0 )
1492 YY_FATAL_ERROR( "start-condition stack underflow" );
1494 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1499 #ifndef YY_NO_TOP_STATE
1500 static int yy_top_state()
1502 return yy_start_stack
[yy_start_stack_ptr
- 1];
1506 #ifndef YY_EXIT_FAILURE
1507 #define YY_EXIT_FAILURE 2
1510 #ifdef YY_USE_PROTOS
1511 static void yy_fatal_error( yyconst
char msg
[] )
1513 static void yy_fatal_error( msg
)
1517 (void) fprintf( stderr
, "%s\n", msg
);
1518 exit( YY_EXIT_FAILURE
);
1523 /* Redefine yyless() so it works in section 3 code. */
1529 /* Undo effects of setting up yytext. */ \
1530 yytext[yyleng] = yy_hold_char; \
1531 yy_c_buf_p = yytext + n; \
1532 yy_hold_char = *yy_c_buf_p; \
1533 *yy_c_buf_p = '\0'; \
1539 /* Internal utility routines. */
1542 #ifdef YY_USE_PROTOS
1543 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1545 static void yy_flex_strncpy( s1
, s2
, n
)
1552 for ( i
= 0; i
< n
; ++i
)
1557 #ifdef YY_NEED_STRLEN
1558 #ifdef YY_USE_PROTOS
1559 static int yy_flex_strlen( yyconst
char *s
)
1561 static int yy_flex_strlen( s
)
1566 for ( n
= 0; s
[n
]; ++n
)
1574 #ifdef YY_USE_PROTOS
1575 static void *yy_flex_alloc( yy_size_t size
)
1577 static void *yy_flex_alloc( size
)
1581 return (void *) malloc( size
);
1584 #ifdef YY_USE_PROTOS
1585 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1587 static void *yy_flex_realloc( ptr
, size
)
1592 /* The cast to (char *) in the following accommodates both
1593 * implementations that use char* generic pointers, and those
1594 * that use void* generic pointers. It works with the latter
1595 * because both ANSI C and C++ allow castless assignment from
1596 * any pointer type to void*, and deal with argument conversions
1597 * as though doing an assignment.
1599 return (void *) realloc( (char *) ptr
, size
);
1602 #ifdef YY_USE_PROTOS
1603 static void yy_flex_free( void *ptr
)
1605 static void yy_flex_free( ptr
)