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" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
102 extern FILE *yyin
, *yyout
;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t
;
144 struct yy_buffer_state
148 char *yy_ch_buf
; /* input buffer */
149 char *yy_buf_pos
; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
154 yy_size_t yy_buf_size
;
156 /* Number of characters read into yy_ch_buf, not including EOB
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
165 int yy_is_our_buffer
;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
172 int yy_is_interactive
;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
180 /* Whether to try to fill the input buffer when we reach the
185 int yy_buffer_status
;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer
= 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char
;
213 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p
= (char *) 0;
220 static int yy_init
= 1; /* whether we need to initialize */
221 static int yy_start
= 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof
;
228 void yyrestart
YY_PROTO(( FILE *input_file
));
230 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
231 void yy_load_buffer_state
YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
233 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
234 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
235 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
239 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
240 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
242 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
243 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
244 static void yy_flex_free
YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR
;
265 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
266 typedef int yy_state_type
;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
272 static int yy_get_next_buffer
YY_PROTO(( void ));
273 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
285 #define YY_NUM_RULES 19
286 #define YY_END_OF_BUFFER 20
287 static yyconst
short int yy_accept
[56] =
289 0, 0, 20, 19, 18, 17, 19, 19, 4, 13,
290 3, 15, 15, 15, 15, 15, 15, 1, 2, 18,
291 0, 0, 13, 15, 15, 15, 15, 15, 15, 14,
292 16, 15, 15, 15, 15, 15, 15, 7, 8, 9,
293 10, 15, 15, 15, 15, 15, 12, 15, 15, 15,
297 static yyconst
int yy_ec
[256] =
299 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
300 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
301 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
302 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
303 1, 1, 1, 1, 6, 1, 1, 7, 8, 9,
304 10, 11, 7, 7, 7, 7, 7, 1, 12, 1,
305 1, 1, 1, 1, 13, 13, 14, 13, 13, 13,
306 13, 13, 13, 13, 13, 13, 15, 13, 16, 13,
307 13, 13, 17, 13, 13, 13, 13, 13, 13, 13,
308 1, 1, 1, 1, 13, 1, 13, 13, 13, 18,
310 13, 19, 13, 20, 21, 13, 13, 22, 13, 23,
311 24, 25, 13, 26, 27, 28, 13, 13, 13, 13,
312 13, 13, 29, 1, 30, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1, 1, 1,
319 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,
329 static yyconst
int yy_meta
[31] =
331 1, 1, 2, 1, 1, 1, 3, 3, 3, 3,
332 3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
333 3, 3, 3, 3, 3, 3, 3, 3, 1, 1
336 static yyconst
short int yy_base
[59] =
338 0, 0, 79, 80, 76, 80, 0, 0, 80, 24,
339 80, 0, 53, 52, 50, 54, 48, 80, 80, 70,
340 67, 67, 29, 0, 46, 50, 39, 45, 37, 60,
341 80, 35, 33, 41, 42, 39, 33, 0, 0, 0,
342 0, 34, 29, 32, 31, 31, 0, 30, 30, 24,
343 22, 0, 0, 0, 80, 44, 47, 43
346 static yyconst
short int yy_def
[59] =
348 55, 1, 55, 55, 55, 55, 56, 57, 55, 58,
349 55, 58, 58, 58, 58, 58, 58, 55, 55, 55,
350 56, 57, 58, 58, 58, 58, 58, 58, 58, 56,
351 55, 58, 58, 58, 58, 58, 58, 58, 58, 58,
352 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
353 58, 58, 58, 58, 0, 55, 55, 55
356 static yyconst
short int yy_nxt
[111] =
358 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
359 10, 11, 12, 13, 14, 15, 16, 12, 12, 12,
360 12, 12, 12, 17, 12, 12, 12, 12, 18, 19,
361 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
362 38, 39, 40, 41, 21, 24, 21, 22, 54, 22,
363 53, 52, 51, 50, 49, 48, 47, 46, 45, 44,
364 43, 42, 37, 30, 36, 35, 34, 33, 32, 31,
365 30, 20, 29, 28, 27, 26, 25, 20, 55, 3,
366 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
367 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
369 55, 55, 55, 55, 55, 55, 55, 55, 55, 55
372 static yyconst
short int yy_chk
[111] =
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 10, 10, 10, 10, 10, 23, 23, 23, 23, 23,
378 33, 33, 33, 33, 56, 58, 56, 57, 51, 57,
379 50, 49, 48, 46, 45, 44, 43, 42, 37, 36,
380 35, 34, 32, 30, 29, 28, 27, 26, 25, 22,
381 21, 20, 17, 16, 15, 14, 13, 5, 3, 55,
382 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
383 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
385 55, 55, 55, 55, 55, 55, 55, 55, 55, 55
388 static yy_state_type yy_last_accepting_state
;
389 static char *yy_last_accepting_cpos
;
391 /* The intent behind this definition is that it'll catch
392 * any uses of REJECT which flex missed.
394 #define REJECT reject_used_but_not_detected
395 #define yymore() yymore_used_but_not_detected
396 #define YY_MORE_ADJ 0
397 #define YY_RESTORE_YY_MORE_OFFSET
404 #include "yacc_parser.hh"
406 extern YYSTYPE yylval
;
410 /* Macros after this point can all be overridden by user definitions in
414 #ifndef YY_SKIP_YYWRAP
416 extern "C" int yywrap
YY_PROTO(( void ));
418 extern int yywrap
YY_PROTO(( void ));
423 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
427 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
430 #ifdef YY_NEED_STRLEN
431 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
436 static int yyinput
YY_PROTO(( void ));
438 static int input
YY_PROTO(( void ));
443 static int yy_start_stack_ptr
= 0;
444 static int yy_start_stack_depth
= 0;
445 static int *yy_start_stack
= 0;
446 #ifndef YY_NO_PUSH_STATE
447 static void yy_push_state
YY_PROTO(( int new_state
));
449 #ifndef YY_NO_POP_STATE
450 static void yy_pop_state
YY_PROTO(( void ));
452 #ifndef YY_NO_TOP_STATE
453 static int yy_top_state
YY_PROTO(( void ));
457 #define YY_NO_PUSH_STATE 1
458 #define YY_NO_POP_STATE 1
459 #define YY_NO_TOP_STATE 1
462 #ifdef YY_MALLOC_DECL
470 /* Just try to get by without declaring the routines. This will fail
471 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
472 * or sizeof(void*) != sizeof(int).
477 /* Amount of stuff to slurp up with each read. */
478 #ifndef YY_READ_BUF_SIZE
479 #define YY_READ_BUF_SIZE 8192
482 /* Copy whatever the last rule matched to the standard output. */
485 /* This used to be an fputs(), but since the string might contain NUL's,
486 * we now use fwrite().
488 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
491 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
492 * is returned in "result".
495 #define YY_INPUT(buf,result,max_size) \
496 if ( yy_current_buffer->yy_is_interactive ) \
499 for ( n = 0; n < max_size && \
500 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
503 buf[n++] = (char) c; \
504 if ( c == EOF && ferror( yyin ) ) \
505 YY_FATAL_ERROR( "input in flex scanner failed" ); \
508 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
509 && ferror( yyin ) ) \
510 YY_FATAL_ERROR( "input in flex scanner failed" );
513 /* No semi-colon after return; correct usage is to write "yyterminate();" -
514 * we don't want an extra ';' after the "return" because that will cause
515 * some compilers to complain about unreachable statements.
518 #define yyterminate() return YY_NULL
521 /* Number of entries by which start-condition stack grows. */
522 #ifndef YY_START_STACK_INCR
523 #define YY_START_STACK_INCR 25
526 /* Report a fatal error. */
527 #ifndef YY_FATAL_ERROR
528 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
531 /* Default declaration of generated scanner - a define so the user can
532 * easily add parameters.
535 #define YY_DECL int yylex YY_PROTO(( void ))
538 /* Code executed at the beginning of each rule, after yytext and yyleng
541 #ifndef YY_USER_ACTION
542 #define YY_USER_ACTION
545 /* Code executed at the end of each rule. */
547 #define YY_BREAK break;
550 #define YY_RULE_SETUP \
555 register yy_state_type yy_current_state
;
556 register char *yy_cp
, *yy_bp
;
573 yy_start
= 1; /* first start state */
581 if ( ! yy_current_buffer
)
583 yy_create_buffer( yyin
, YY_BUF_SIZE
);
585 yy_load_buffer_state();
588 while ( 1 ) /* loops until end-of-file is reached */
592 /* Support of yytext. */
593 *yy_cp
= yy_hold_char
;
595 /* yy_bp points to the position in yy_ch_buf of the start of
600 yy_current_state
= yy_start
;
604 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
605 if ( yy_accept
[yy_current_state
] )
607 yy_last_accepting_state
= yy_current_state
;
608 yy_last_accepting_cpos
= yy_cp
;
610 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
612 yy_current_state
= (int) yy_def
[yy_current_state
];
613 if ( yy_current_state
>= 56 )
614 yy_c
= yy_meta
[(unsigned int) yy_c
];
616 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
619 while ( yy_base
[yy_current_state
] != 80 );
622 yy_act
= yy_accept
[yy_current_state
];
624 { /* have to back up */
625 yy_cp
= yy_last_accepting_cpos
;
626 yy_current_state
= yy_last_accepting_state
;
627 yy_act
= yy_accept
[yy_current_state
];
633 do_action
: /* This label is used only to access EOF actions. */
637 { /* beginning of action switch */
638 case 0: /* must back up */
639 /* undo the effects of YY_DO_BEFORE_ACTION */
640 *yy_cp
= yy_hold_char
;
641 yy_cp
= yy_last_accepting_cpos
;
642 yy_current_state
= yy_last_accepting_state
;
685 yylval
= (int) strdup(yytext
); return BINDING
;
690 yylval
= (int) strdup(yytext
); return NUMBER
;
695 yylval
= (int) strdup(yytext
); return QUOTES
;
700 yylval
= (int) strdup(yytext
); return WORD
;
723 case YY_STATE_EOF(INITIAL
):
726 case YY_END_OF_BUFFER
:
728 /* Amount of text matched not including the EOB char. */
729 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
731 /* Undo the effects of YY_DO_BEFORE_ACTION. */
732 *yy_cp
= yy_hold_char
;
733 YY_RESTORE_YY_MORE_OFFSET
735 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
737 /* We're scanning a new file or input source. It's
738 * possible that this happened because the user
739 * just pointed yyin at a new source and called
740 * yylex(). If so, then we have to assure
741 * consistency between yy_current_buffer and our
742 * globals. Here is the right place to do so, because
743 * this is the first action (other than possibly a
744 * back-up) that will match for the new input source.
746 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
747 yy_current_buffer
->yy_input_file
= yyin
;
748 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
751 /* Note that here we test for yy_c_buf_p "<=" to the position
752 * of the first EOB in the buffer, since yy_c_buf_p will
753 * already have been incremented past the NUL character
754 * (since all states make transitions on EOB to the
755 * end-of-buffer state). Contrast this with the test
758 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
759 { /* This was really a NUL. */
760 yy_state_type yy_next_state
;
762 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
764 yy_current_state
= yy_get_previous_state();
766 /* Okay, we're now positioned to make the NUL
767 * transition. We couldn't have
768 * yy_get_previous_state() go ahead and do it
769 * for us because it doesn't know how to deal
770 * with the possibility of jamming (and we don't
771 * want to build jamming into it because then it
772 * will run more slowly).
775 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
777 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
781 /* Consume the NUL. */
782 yy_cp
= ++yy_c_buf_p
;
783 yy_current_state
= yy_next_state
;
794 else switch ( yy_get_next_buffer() )
796 case EOB_ACT_END_OF_FILE
:
798 yy_did_buffer_switch_on_eof
= 0;
802 /* Note: because we've taken care in
803 * yy_get_next_buffer() to have set up
804 * yytext, we can now set up
805 * yy_c_buf_p so that if some total
806 * hoser (like flex itself) wants to
807 * call the scanner after we return the
808 * YY_NULL, it'll still work - another
809 * YY_NULL will get returned.
811 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
813 yy_act
= YY_STATE_EOF(YY_START
);
819 if ( ! yy_did_buffer_switch_on_eof
)
825 case EOB_ACT_CONTINUE_SCAN
:
827 yytext_ptr
+ yy_amount_of_matched_text
;
829 yy_current_state
= yy_get_previous_state();
832 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
835 case EOB_ACT_LAST_MATCH
:
837 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
839 yy_current_state
= yy_get_previous_state();
842 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
850 "fatal flex scanner internal error--no action found" );
851 } /* end of action switch */
852 } /* end of scanning one token */
856 /* yy_get_next_buffer - try to read in a new buffer
858 * Returns a code representing an action:
859 * EOB_ACT_LAST_MATCH -
860 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
861 * EOB_ACT_END_OF_FILE - end of file
864 static int yy_get_next_buffer()
866 register char *dest
= yy_current_buffer
->yy_ch_buf
;
867 register char *source
= yytext_ptr
;
868 register int number_to_move
, i
;
871 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
873 "fatal flex scanner internal error--end of buffer missed" );
875 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
876 { /* Don't try to fill the buffer, so this is an EOF. */
877 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
879 /* We matched a single character, the EOB, so
880 * treat this as a final EOF.
882 return EOB_ACT_END_OF_FILE
;
887 /* We matched some text prior to the EOB, first
890 return EOB_ACT_LAST_MATCH
;
894 /* Try to read more data. */
896 /* First move last chars to start of buffer. */
897 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
899 for ( i
= 0; i
< number_to_move
; ++i
)
900 *(dest
++) = *(source
++);
902 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
903 /* don't do the read, it's not guaranteed to return an EOF,
906 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
911 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
913 while ( num_to_read
<= 0 )
914 { /* Not enough room in the buffer - grow it. */
915 #ifdef YY_USES_REJECT
917 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
920 /* just a shorter name for the current buffer */
921 YY_BUFFER_STATE b
= yy_current_buffer
;
923 int yy_c_buf_p_offset
=
924 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
926 if ( b
->yy_is_our_buffer
)
928 int new_size
= b
->yy_buf_size
* 2;
931 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
935 b
->yy_ch_buf
= (char *)
936 /* Include room in for 2 EOB chars. */
937 yy_flex_realloc( (void *) b
->yy_ch_buf
,
938 b
->yy_buf_size
+ 2 );
941 /* Can't grow it, we don't own it. */
944 if ( ! b
->yy_ch_buf
)
946 "fatal error - scanner input buffer overflow" );
948 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
950 num_to_read
= yy_current_buffer
->yy_buf_size
-
955 if ( num_to_read
> YY_READ_BUF_SIZE
)
956 num_to_read
= YY_READ_BUF_SIZE
;
958 /* Read in more data. */
959 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
960 yy_n_chars
, num_to_read
);
962 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
965 if ( yy_n_chars
== 0 )
967 if ( number_to_move
== YY_MORE_ADJ
)
969 ret_val
= EOB_ACT_END_OF_FILE
;
975 ret_val
= EOB_ACT_LAST_MATCH
;
976 yy_current_buffer
->yy_buffer_status
=
977 YY_BUFFER_EOF_PENDING
;
982 ret_val
= EOB_ACT_CONTINUE_SCAN
;
984 yy_n_chars
+= number_to_move
;
985 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
986 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
988 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
994 /* yy_get_previous_state - get the state just before the EOB char was reached */
996 static yy_state_type
yy_get_previous_state()
998 register yy_state_type yy_current_state
;
999 register char *yy_cp
;
1001 yy_current_state
= yy_start
;
1003 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1005 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1006 if ( yy_accept
[yy_current_state
] )
1008 yy_last_accepting_state
= yy_current_state
;
1009 yy_last_accepting_cpos
= yy_cp
;
1011 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1013 yy_current_state
= (int) yy_def
[yy_current_state
];
1014 if ( yy_current_state
>= 56 )
1015 yy_c
= yy_meta
[(unsigned int) yy_c
];
1017 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1020 return yy_current_state
;
1024 /* yy_try_NUL_trans - try to make a transition on the NUL character
1027 * next_state = yy_try_NUL_trans( current_state );
1030 #ifdef YY_USE_PROTOS
1031 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1033 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1034 yy_state_type yy_current_state
;
1037 register int yy_is_jam
;
1038 register char *yy_cp
= yy_c_buf_p
;
1040 register YY_CHAR yy_c
= 1;
1041 if ( yy_accept
[yy_current_state
] )
1043 yy_last_accepting_state
= yy_current_state
;
1044 yy_last_accepting_cpos
= yy_cp
;
1046 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1048 yy_current_state
= (int) yy_def
[yy_current_state
];
1049 if ( yy_current_state
>= 56 )
1050 yy_c
= yy_meta
[(unsigned int) yy_c
];
1052 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1053 yy_is_jam
= (yy_current_state
== 55);
1055 return yy_is_jam
? 0 : yy_current_state
;
1060 #ifdef YY_USE_PROTOS
1061 static void yyunput( int c
, register char *yy_bp
)
1063 static void yyunput( c
, yy_bp
)
1065 register char *yy_bp
;
1068 register char *yy_cp
= yy_c_buf_p
;
1070 /* undo effects of setting up yytext */
1071 *yy_cp
= yy_hold_char
;
1073 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1074 { /* need to shift things up to make room */
1075 /* +2 for EOB chars. */
1076 register int number_to_move
= yy_n_chars
+ 2;
1077 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1078 yy_current_buffer
->yy_buf_size
+ 2];
1079 register char *source
=
1080 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1082 while ( source
> yy_current_buffer
->yy_ch_buf
)
1083 *--dest
= *--source
;
1085 yy_cp
+= (int) (dest
- source
);
1086 yy_bp
+= (int) (dest
- source
);
1087 yy_current_buffer
->yy_n_chars
=
1088 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1090 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1091 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1094 *--yy_cp
= (char) c
;
1098 yy_hold_char
= *yy_cp
;
1101 #endif /* ifndef YY_NO_UNPUT */
1105 static int yyinput()
1112 *yy_c_buf_p
= yy_hold_char
;
1114 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1116 /* yy_c_buf_p now points to the character we want to return.
1117 * If this occurs *before* the EOB characters, then it's a
1118 * valid NUL; if not, then we've hit the end of the buffer.
1120 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1121 /* This was really a NUL. */
1125 { /* need more input */
1126 int offset
= yy_c_buf_p
- yytext_ptr
;
1129 switch ( yy_get_next_buffer() )
1131 case EOB_ACT_LAST_MATCH
:
1132 /* This happens because yy_g_n_b()
1133 * sees that we've accumulated a
1134 * token and flags that we need to
1135 * try matching the token before
1136 * proceeding. But for input(),
1137 * there's no matching to consider.
1138 * So convert the EOB_ACT_LAST_MATCH
1139 * to EOB_ACT_END_OF_FILE.
1142 /* Reset buffer status. */
1147 case EOB_ACT_END_OF_FILE
:
1152 if ( ! yy_did_buffer_switch_on_eof
)
1161 case EOB_ACT_CONTINUE_SCAN
:
1162 yy_c_buf_p
= yytext_ptr
+ offset
;
1168 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1169 *yy_c_buf_p
= '\0'; /* preserve yytext */
1170 yy_hold_char
= *++yy_c_buf_p
;
1177 #ifdef YY_USE_PROTOS
1178 void yyrestart( FILE *input_file
)
1180 void yyrestart( input_file
)
1184 if ( ! yy_current_buffer
)
1185 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1187 yy_init_buffer( yy_current_buffer
, input_file
);
1188 yy_load_buffer_state();
1192 #ifdef YY_USE_PROTOS
1193 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1195 void yy_switch_to_buffer( new_buffer
)
1196 YY_BUFFER_STATE new_buffer
;
1199 if ( yy_current_buffer
== new_buffer
)
1202 if ( yy_current_buffer
)
1204 /* Flush out information for old buffer. */
1205 *yy_c_buf_p
= yy_hold_char
;
1206 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1207 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1210 yy_current_buffer
= new_buffer
;
1211 yy_load_buffer_state();
1213 /* We don't actually know whether we did this switch during
1214 * EOF (yywrap()) processing, but the only time this flag
1215 * is looked at is after yywrap() is called, so it's safe
1216 * to go ahead and always set it.
1218 yy_did_buffer_switch_on_eof
= 1;
1222 #ifdef YY_USE_PROTOS
1223 void yy_load_buffer_state( void )
1225 void yy_load_buffer_state()
1228 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1229 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1230 yyin
= yy_current_buffer
->yy_input_file
;
1231 yy_hold_char
= *yy_c_buf_p
;
1235 #ifdef YY_USE_PROTOS
1236 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1238 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1245 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1247 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1249 b
->yy_buf_size
= size
;
1251 /* yy_ch_buf has to be 2 characters longer than the size given because
1252 * we need to put in 2 end-of-buffer characters.
1254 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1255 if ( ! b
->yy_ch_buf
)
1256 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1258 b
->yy_is_our_buffer
= 1;
1260 yy_init_buffer( b
, file
);
1266 #ifdef YY_USE_PROTOS
1267 void yy_delete_buffer( YY_BUFFER_STATE b
)
1269 void yy_delete_buffer( b
)
1276 if ( b
== yy_current_buffer
)
1277 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1279 if ( b
->yy_is_our_buffer
)
1280 yy_flex_free( (void *) b
->yy_ch_buf
);
1282 yy_flex_free( (void *) b
);
1286 #ifndef YY_ALWAYS_INTERACTIVE
1287 #ifndef YY_NEVER_INTERACTIVE
1288 extern int isatty
YY_PROTO(( int ));
1292 #ifdef YY_USE_PROTOS
1293 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1295 void yy_init_buffer( b
, file
)
1302 yy_flush_buffer( b
);
1304 b
->yy_input_file
= file
;
1305 b
->yy_fill_buffer
= 1;
1307 #if YY_ALWAYS_INTERACTIVE
1308 b
->yy_is_interactive
= 1;
1310 #if YY_NEVER_INTERACTIVE
1311 b
->yy_is_interactive
= 0;
1313 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1319 #ifdef YY_USE_PROTOS
1320 void yy_flush_buffer( YY_BUFFER_STATE b
)
1322 void yy_flush_buffer( b
)
1332 /* We always need two end-of-buffer characters. The first causes
1333 * a transition to the end-of-buffer state. The second causes
1334 * a jam in that state.
1336 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1337 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1339 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1342 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1344 if ( b
== yy_current_buffer
)
1345 yy_load_buffer_state();
1349 #ifndef YY_NO_SCAN_BUFFER
1350 #ifdef YY_USE_PROTOS
1351 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1353 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1361 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1362 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1363 /* They forgot to leave room for the EOB's. */
1366 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1368 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1370 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1371 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1372 b
->yy_is_our_buffer
= 0;
1373 b
->yy_input_file
= 0;
1374 b
->yy_n_chars
= b
->yy_buf_size
;
1375 b
->yy_is_interactive
= 0;
1377 b
->yy_fill_buffer
= 0;
1378 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1380 yy_switch_to_buffer( b
);
1387 #ifndef YY_NO_SCAN_STRING
1388 #ifdef YY_USE_PROTOS
1389 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1391 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1392 yyconst
char *yy_str
;
1396 for ( len
= 0; yy_str
[len
]; ++len
)
1399 return yy_scan_bytes( yy_str
, len
);
1404 #ifndef YY_NO_SCAN_BYTES
1405 #ifdef YY_USE_PROTOS
1406 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1408 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1409 yyconst
char *bytes
;
1418 /* Get memory for full buffer, including space for trailing EOB's. */
1420 buf
= (char *) yy_flex_alloc( n
);
1422 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1424 for ( i
= 0; i
< len
; ++i
)
1427 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1429 b
= yy_scan_buffer( buf
, n
);
1431 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1433 /* It's okay to grow etc. this buffer, and we should throw it
1434 * away when we're done.
1436 b
->yy_is_our_buffer
= 1;
1443 #ifndef YY_NO_PUSH_STATE
1444 #ifdef YY_USE_PROTOS
1445 static void yy_push_state( int new_state
)
1447 static void yy_push_state( new_state
)
1451 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1455 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1456 new_size
= yy_start_stack_depth
* sizeof( int );
1458 if ( ! yy_start_stack
)
1459 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1462 yy_start_stack
= (int *) yy_flex_realloc(
1463 (void *) yy_start_stack
, new_size
);
1465 if ( ! yy_start_stack
)
1467 "out of memory expanding start-condition stack" );
1470 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1477 #ifndef YY_NO_POP_STATE
1478 static void yy_pop_state()
1480 if ( --yy_start_stack_ptr
< 0 )
1481 YY_FATAL_ERROR( "start-condition stack underflow" );
1483 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1488 #ifndef YY_NO_TOP_STATE
1489 static int yy_top_state()
1491 return yy_start_stack
[yy_start_stack_ptr
- 1];
1495 #ifndef YY_EXIT_FAILURE
1496 #define YY_EXIT_FAILURE 2
1499 #ifdef YY_USE_PROTOS
1500 static void yy_fatal_error( yyconst
char msg
[] )
1502 static void yy_fatal_error( msg
)
1506 (void) fprintf( stderr
, "%s\n", msg
);
1507 exit( YY_EXIT_FAILURE
);
1512 /* Redefine yyless() so it works in section 3 code. */
1518 /* Undo effects of setting up yytext. */ \
1519 yytext[yyleng] = yy_hold_char; \
1520 yy_c_buf_p = yytext + n; \
1521 yy_hold_char = *yy_c_buf_p; \
1522 *yy_c_buf_p = '\0'; \
1528 /* Internal utility routines. */
1531 #ifdef YY_USE_PROTOS
1532 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1534 static void yy_flex_strncpy( s1
, s2
, n
)
1541 for ( i
= 0; i
< n
; ++i
)
1546 #ifdef YY_NEED_STRLEN
1547 #ifdef YY_USE_PROTOS
1548 static int yy_flex_strlen( yyconst
char *s
)
1550 static int yy_flex_strlen( s
)
1555 for ( n
= 0; s
[n
]; ++n
)
1563 #ifdef YY_USE_PROTOS
1564 static void *yy_flex_alloc( yy_size_t size
)
1566 static void *yy_flex_alloc( size
)
1570 return (void *) malloc( size
);
1573 #ifdef YY_USE_PROTOS
1574 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1576 static void *yy_flex_realloc( ptr
, size
)
1581 /* The cast to (char *) in the following accommodates both
1582 * implementations that use char* generic pointers, and those
1583 * that use void* generic pointers. It works with the latter
1584 * because both ANSI C and C++ allow castless assignment from
1585 * any pointer type to void*, and deal with argument conversions
1586 * as though doing an assignment.
1588 return (void *) realloc( (char *) ptr
, size
);
1591 #ifdef YY_USE_PROTOS
1592 static void yy_flex_free( void *ptr
)
1594 static void yy_flex_free( ptr
)