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)
265 #define YY_USES_REJECT
266 typedef unsigned char YY_CHAR
;
267 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
268 typedef int yy_state_type
;
272 #define yytext_ptr yytext
274 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
275 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
276 static int yy_get_next_buffer
YY_PROTO(( void ));
277 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
279 /* Done after the current pattern has been matched and before the
280 * corresponding action - sets up yytext.
282 #define YY_DO_BEFORE_ACTION \
283 yytext_ptr = yy_bp; \
284 yyleng = (int) (yy_cp - yy_bp); \
285 yy_hold_char = *yy_cp; \
289 #define YY_NUM_RULES 35
290 #define YY_END_OF_BUFFER 36
291 static yyconst
short int yy_acclist
[142] =
293 36, 35, 34, 35, 33, 35, 35, 35, 4, 35,
294 29, 31, 35, 3, 35, 31, 35, 31, 35, 31,
295 35, 31, 35, 31, 35, 31, 35, 31, 35, 31,
296 35, 31, 35, 31, 35, 31, 35, 31, 35, 31,
297 35, 1, 35, 2, 35, 34, 29, 31, 31, 31,
298 31, 31, 31, 22, 31, 31, 31, 31, 31, 31,
299 31, 31, 21, 31, 31, 31, 31, 30, 32, 31,
300 31, 31, 25, 31, 31, 31, 31, 31, 31, 31,
301 26, 31, 31, 31, 31, 31, 31, 7, 31, 9,
302 31, 11, 31, 13, 31, 15, 31, 31, 31, 24,
304 31, 31, 31, 8, 31, 10, 31, 12, 31, 14,
305 31, 16, 31, 31, 31, 23, 31, 31, 28, 31,
306 31, 20, 31, 31, 27, 31, 31, 19, 31, 31,
307 31, 31, 31, 17, 31, 5, 31, 18, 31, 6,
311 static yyconst
short int yy_accept
[102] =
313 1, 1, 1, 2, 3, 5, 7, 8, 9, 11,
314 14, 16, 18, 20, 22, 24, 26, 28, 30, 32,
315 34, 36, 38, 40, 42, 44, 46, 47, 47, 47,
316 49, 50, 51, 52, 53, 54, 56, 57, 58, 59,
317 60, 61, 62, 63, 65, 66, 67, 68, 69, 70,
318 71, 72, 73, 75, 76, 77, 78, 79, 80, 81,
319 83, 84, 85, 86, 87, 88, 90, 92, 94, 96,
320 98, 99, 100, 102, 103, 104, 106, 108, 110, 112,
321 114, 115, 116, 118, 119, 121, 122, 124, 125, 127,
322 128, 130, 131, 132, 133, 134, 136, 138, 140, 142,
327 static yyconst
int yy_ec
[256] =
329 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 6, 1, 1, 7, 8, 9,
334 10, 11, 12, 7, 7, 7, 7, 1, 13, 1,
335 1, 1, 1, 1, 14, 14, 15, 14, 14, 16,
336 14, 14, 14, 14, 14, 14, 17, 14, 18, 14,
337 14, 14, 19, 20, 14, 14, 14, 14, 14, 14,
338 1, 1, 1, 1, 14, 1, 21, 14, 22, 23,
340 24, 25, 14, 26, 27, 14, 14, 28, 29, 30,
341 31, 32, 14, 33, 34, 35, 36, 14, 14, 14,
342 14, 14, 37, 1, 38, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 static yyconst
int yy_meta
[39] =
361 1, 1, 2, 1, 1, 1, 3, 3, 3, 3,
362 3, 3, 1, 3, 3, 3, 3, 3, 3, 3,
363 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
364 3, 3, 3, 3, 3, 3, 1, 1
367 static yyconst
short int yy_base
[104] =
369 0, 0, 127, 128, 124, 128, 0, 0, 128, 32,
370 128, 0, 94, 103, 92, 20, 96, 88, 89, 98,
371 87, 21, 91, 83, 128, 128, 113, 110, 110, 47,
372 0, 82, 83, 87, 84, 0, 73, 80, 70, 75,
373 76, 80, 77, 0, 66, 73, 63, 94, 128, 62,
374 62, 52, 0, 68, 69, 69, 57, 57, 57, 0,
375 63, 64, 64, 54, 62, 0, 0, 0, 0, 0,
376 54, 49, 0, 50, 58, 0, 0, 0, 0, 0,
377 50, 45, 0, 48, 0, 48, 0, 46, 0, 46,
378 0, 46, 37, 21, 14, 0, 0, 0, 0, 128,
383 static yyconst
short int yy_def
[104] =
385 100, 1, 100, 100, 100, 100, 101, 102, 100, 103,
386 100, 103, 103, 103, 103, 103, 103, 103, 103, 103,
387 103, 103, 103, 103, 100, 100, 100, 101, 102, 103,
388 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
389 103, 103, 103, 103, 103, 103, 103, 101, 100, 103,
390 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
391 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
392 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
393 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
394 103, 103, 103, 103, 103, 103, 103, 103, 103, 0,
399 static yyconst
short int yy_nxt
[167] =
401 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
402 10, 10, 11, 12, 13, 14, 15, 16, 17, 18,
403 12, 19, 12, 12, 20, 12, 12, 12, 21, 12,
404 22, 12, 12, 23, 24, 12, 25, 26, 30, 30,
405 30, 30, 30, 30, 35, 43, 31, 99, 98, 36,
406 44, 37, 45, 30, 30, 30, 30, 30, 30, 66,
407 67, 68, 69, 70, 76, 77, 78, 79, 80, 28,
408 97, 28, 29, 96, 29, 95, 94, 93, 92, 91,
409 90, 89, 88, 87, 86, 85, 84, 83, 82, 81,
410 75, 74, 73, 72, 71, 65, 64, 48, 63, 62,
412 61, 60, 59, 58, 57, 56, 55, 54, 53, 52,
413 51, 50, 49, 48, 27, 47, 46, 42, 41, 40,
414 39, 38, 34, 33, 32, 27, 100, 3, 100, 100,
415 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
416 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
417 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
418 100, 100, 100, 100, 100, 100
421 static yyconst
short int yy_chk
[167] =
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 10, 10,
427 10, 10, 10, 10, 16, 22, 103, 95, 94, 16,
428 22, 16, 22, 30, 30, 30, 30, 30, 30, 52,
429 52, 52, 52, 52, 59, 59, 59, 59, 59, 101,
430 93, 101, 102, 92, 102, 90, 88, 86, 84, 82,
431 81, 75, 74, 72, 71, 65, 64, 63, 62, 61,
432 58, 57, 56, 55, 54, 51, 50, 48, 47, 46,
434 45, 43, 42, 41, 40, 39, 38, 37, 35, 34,
435 33, 32, 29, 28, 27, 24, 23, 21, 20, 19,
436 18, 17, 15, 14, 13, 5, 3, 100, 100, 100,
437 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
438 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
439 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
440 100, 100, 100, 100, 100, 100
443 static yy_state_type yy_state_buf
[YY_BUF_SIZE
+ 2], *yy_state_ptr
;
444 static char *yy_full_match
;
448 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
449 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
453 #define yymore() yymore_used_but_not_detected
454 #define YY_MORE_ADJ 0
455 #define YY_RESTORE_YY_MORE_OFFSET
461 # include "../../config.h"
462 #endif // HAVE_CONFIG_H
466 #include "yacc_parser.hh"
468 extern YYSTYPE yylval
;
472 /* Macros after this point can all be overridden by user definitions in
476 #ifndef YY_SKIP_YYWRAP
478 extern "C" int yywrap
YY_PROTO(( void ));
480 extern int yywrap
YY_PROTO(( void ));
485 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
489 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
492 #ifdef YY_NEED_STRLEN
493 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
498 static int yyinput
YY_PROTO(( void ));
500 static int input
YY_PROTO(( void ));
505 static int yy_start_stack_ptr
= 0;
506 static int yy_start_stack_depth
= 0;
507 static int *yy_start_stack
= 0;
508 #ifndef YY_NO_PUSH_STATE
509 static void yy_push_state
YY_PROTO(( int new_state
));
511 #ifndef YY_NO_POP_STATE
512 static void yy_pop_state
YY_PROTO(( void ));
514 #ifndef YY_NO_TOP_STATE
515 static int yy_top_state
YY_PROTO(( void ));
519 #define YY_NO_PUSH_STATE 1
520 #define YY_NO_POP_STATE 1
521 #define YY_NO_TOP_STATE 1
524 #ifdef YY_MALLOC_DECL
532 /* Just try to get by without declaring the routines. This will fail
533 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
534 * or sizeof(void*) != sizeof(int).
539 /* Amount of stuff to slurp up with each read. */
540 #ifndef YY_READ_BUF_SIZE
541 #define YY_READ_BUF_SIZE 8192
544 /* Copy whatever the last rule matched to the standard output. */
547 /* This used to be an fputs(), but since the string might contain NUL's,
548 * we now use fwrite().
550 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
553 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
554 * is returned in "result".
557 #define YY_INPUT(buf,result,max_size) \
558 if ( yy_current_buffer->yy_is_interactive ) \
561 for ( n = 0; n < max_size && \
562 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
565 buf[n++] = (char) c; \
566 if ( c == EOF && ferror( yyin ) ) \
567 YY_FATAL_ERROR( "input in flex scanner failed" ); \
570 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
571 && ferror( yyin ) ) \
572 YY_FATAL_ERROR( "input in flex scanner failed" );
575 /* No semi-colon after return; correct usage is to write "yyterminate();" -
576 * we don't want an extra ';' after the "return" because that will cause
577 * some compilers to complain about unreachable statements.
580 #define yyterminate() return YY_NULL
583 /* Number of entries by which start-condition stack grows. */
584 #ifndef YY_START_STACK_INCR
585 #define YY_START_STACK_INCR 25
588 /* Report a fatal error. */
589 #ifndef YY_FATAL_ERROR
590 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
593 /* Default declaration of generated scanner - a define so the user can
594 * easily add parameters.
597 #define YY_DECL int yylex YY_PROTO(( void ))
600 /* Code executed at the beginning of each rule, after yytext and yyleng
603 #ifndef YY_USER_ACTION
604 #define YY_USER_ACTION
607 /* Code executed at the end of each rule. */
609 #define YY_BREAK break;
612 #define YY_RULE_SETUP \
617 register yy_state_type yy_current_state
;
618 register char *yy_cp
, *yy_bp
;
635 yy_start
= 1; /* first start state */
643 if ( ! yy_current_buffer
)
645 yy_create_buffer( yyin
, YY_BUF_SIZE
);
647 yy_load_buffer_state();
650 while ( 1 ) /* loops until end-of-file is reached */
654 /* Support of yytext. */
655 *yy_cp
= yy_hold_char
;
657 /* yy_bp points to the position in yy_ch_buf of the start of
662 yy_current_state
= yy_start
;
663 yy_state_ptr
= yy_state_buf
;
664 *yy_state_ptr
++ = yy_current_state
;
668 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
669 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
671 yy_current_state
= (int) yy_def
[yy_current_state
];
672 if ( yy_current_state
>= 101 )
673 yy_c
= yy_meta
[(unsigned int) yy_c
];
675 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
676 *yy_state_ptr
++ = yy_current_state
;
679 while ( yy_base
[yy_current_state
] != 128 );
682 yy_current_state
= *--yy_state_ptr
;
683 yy_lp
= yy_accept
[yy_current_state
];
684 find_rule
: /* we branch to this label when backing up */
685 for ( ; ; ) /* until we find what rule we matched */
687 if ( yy_lp
&& yy_lp
< yy_accept
[yy_current_state
+ 1] )
689 yy_act
= yy_acclist
[yy_lp
];
691 yy_full_match
= yy_cp
;
696 yy_current_state
= *--yy_state_ptr
;
697 yy_lp
= yy_accept
[yy_current_state
];
702 if ( yy_act
!= YY_END_OF_BUFFER
)
705 for ( yyl
= 0; yyl
< yyleng
; ++yyl
)
706 if ( yytext
[yyl
] == '\n' )
710 do_action
: /* This label is used only to access EOF actions. */
714 { /* beginning of action switch */
771 yylval
= (int) strdup(yytext
); return BINDING
;
782 yylval
= (int) strdup(yytext
); return TRUE
;
793 yylval
= (int) strdup(yytext
); return FALSE
;
798 yylval
= (int) strdup(yytext
); return NUMBER
;
803 yylval
= (int) strdup(yytext
); return QUOTES
;
808 yylval
= (int) strdup(yytext
); return WORD
;
831 case YY_STATE_EOF(INITIAL
):
834 case YY_END_OF_BUFFER
:
836 /* Amount of text matched not including the EOB char. */
837 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
839 /* Undo the effects of YY_DO_BEFORE_ACTION. */
840 *yy_cp
= yy_hold_char
;
841 YY_RESTORE_YY_MORE_OFFSET
843 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
845 /* We're scanning a new file or input source. It's
846 * possible that this happened because the user
847 * just pointed yyin at a new source and called
848 * yylex(). If so, then we have to assure
849 * consistency between yy_current_buffer and our
850 * globals. Here is the right place to do so, because
851 * this is the first action (other than possibly a
852 * back-up) that will match for the new input source.
854 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
855 yy_current_buffer
->yy_input_file
= yyin
;
856 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
859 /* Note that here we test for yy_c_buf_p "<=" to the position
860 * of the first EOB in the buffer, since yy_c_buf_p will
861 * already have been incremented past the NUL character
862 * (since all states make transitions on EOB to the
863 * end-of-buffer state). Contrast this with the test
866 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
867 { /* This was really a NUL. */
868 yy_state_type yy_next_state
;
870 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
872 yy_current_state
= yy_get_previous_state();
874 /* Okay, we're now positioned to make the NUL
875 * transition. We couldn't have
876 * yy_get_previous_state() go ahead and do it
877 * for us because it doesn't know how to deal
878 * with the possibility of jamming (and we don't
879 * want to build jamming into it because then it
880 * will run more slowly).
883 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
885 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
889 /* Consume the NUL. */
890 yy_cp
= ++yy_c_buf_p
;
891 yy_current_state
= yy_next_state
;
902 else switch ( yy_get_next_buffer() )
904 case EOB_ACT_END_OF_FILE
:
906 yy_did_buffer_switch_on_eof
= 0;
910 /* Note: because we've taken care in
911 * yy_get_next_buffer() to have set up
912 * yytext, we can now set up
913 * yy_c_buf_p so that if some total
914 * hoser (like flex itself) wants to
915 * call the scanner after we return the
916 * YY_NULL, it'll still work - another
917 * YY_NULL will get returned.
919 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
921 yy_act
= YY_STATE_EOF(YY_START
);
927 if ( ! yy_did_buffer_switch_on_eof
)
933 case EOB_ACT_CONTINUE_SCAN
:
935 yytext_ptr
+ yy_amount_of_matched_text
;
937 yy_current_state
= yy_get_previous_state();
940 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
943 case EOB_ACT_LAST_MATCH
:
945 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
947 yy_current_state
= yy_get_previous_state();
950 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
958 "fatal flex scanner internal error--no action found" );
959 } /* end of action switch */
960 } /* end of scanning one token */
964 /* yy_get_next_buffer - try to read in a new buffer
966 * Returns a code representing an action:
967 * EOB_ACT_LAST_MATCH -
968 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
969 * EOB_ACT_END_OF_FILE - end of file
972 static int yy_get_next_buffer()
974 register char *dest
= yy_current_buffer
->yy_ch_buf
;
975 register char *source
= yytext_ptr
;
976 register int number_to_move
, i
;
979 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
981 "fatal flex scanner internal error--end of buffer missed" );
983 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
984 { /* Don't try to fill the buffer, so this is an EOF. */
985 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
987 /* We matched a single character, the EOB, so
988 * treat this as a final EOF.
990 return EOB_ACT_END_OF_FILE
;
995 /* We matched some text prior to the EOB, first
998 return EOB_ACT_LAST_MATCH
;
1002 /* Try to read more data. */
1004 /* First move last chars to start of buffer. */
1005 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
1007 for ( i
= 0; i
< number_to_move
; ++i
)
1008 *(dest
++) = *(source
++);
1010 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1011 /* don't do the read, it's not guaranteed to return an EOF,
1014 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
1019 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
1021 while ( num_to_read
<= 0 )
1022 { /* Not enough room in the buffer - grow it. */
1023 #ifdef YY_USES_REJECT
1025 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1028 /* just a shorter name for the current buffer */
1029 YY_BUFFER_STATE b
= yy_current_buffer
;
1031 int yy_c_buf_p_offset
=
1032 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
1034 if ( b
->yy_is_our_buffer
)
1036 int new_size
= b
->yy_buf_size
* 2;
1038 if ( new_size
<= 0 )
1039 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1041 b
->yy_buf_size
*= 2;
1043 b
->yy_ch_buf
= (char *)
1044 /* Include room in for 2 EOB chars. */
1045 yy_flex_realloc( (void *) b
->yy_ch_buf
,
1046 b
->yy_buf_size
+ 2 );
1049 /* Can't grow it, we don't own it. */
1052 if ( ! b
->yy_ch_buf
)
1054 "fatal error - scanner input buffer overflow" );
1056 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1058 num_to_read
= yy_current_buffer
->yy_buf_size
-
1063 if ( num_to_read
> YY_READ_BUF_SIZE
)
1064 num_to_read
= YY_READ_BUF_SIZE
;
1066 /* Read in more data. */
1067 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1068 yy_n_chars
, num_to_read
);
1070 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1073 if ( yy_n_chars
== 0 )
1075 if ( number_to_move
== YY_MORE_ADJ
)
1077 ret_val
= EOB_ACT_END_OF_FILE
;
1083 ret_val
= EOB_ACT_LAST_MATCH
;
1084 yy_current_buffer
->yy_buffer_status
=
1085 YY_BUFFER_EOF_PENDING
;
1090 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1092 yy_n_chars
+= number_to_move
;
1093 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1094 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1096 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1102 /* yy_get_previous_state - get the state just before the EOB char was reached */
1104 static yy_state_type
yy_get_previous_state()
1106 register yy_state_type yy_current_state
;
1107 register char *yy_cp
;
1109 yy_current_state
= yy_start
;
1110 yy_state_ptr
= yy_state_buf
;
1111 *yy_state_ptr
++ = yy_current_state
;
1113 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1115 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1116 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1118 yy_current_state
= (int) yy_def
[yy_current_state
];
1119 if ( yy_current_state
>= 101 )
1120 yy_c
= yy_meta
[(unsigned int) yy_c
];
1122 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1123 *yy_state_ptr
++ = yy_current_state
;
1126 return yy_current_state
;
1130 /* yy_try_NUL_trans - try to make a transition on the NUL character
1133 * next_state = yy_try_NUL_trans( current_state );
1136 #ifdef YY_USE_PROTOS
1137 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1139 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1140 yy_state_type yy_current_state
;
1143 register int yy_is_jam
;
1145 register YY_CHAR yy_c
= 1;
1146 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1148 yy_current_state
= (int) yy_def
[yy_current_state
];
1149 if ( yy_current_state
>= 101 )
1150 yy_c
= yy_meta
[(unsigned int) yy_c
];
1152 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1153 yy_is_jam
= (yy_current_state
== 100);
1155 *yy_state_ptr
++ = yy_current_state
;
1157 return yy_is_jam
? 0 : yy_current_state
;
1162 #ifdef YY_USE_PROTOS
1163 static void yyunput( int c
, register char *yy_bp
)
1165 static void yyunput( c
, yy_bp
)
1167 register char *yy_bp
;
1170 register char *yy_cp
= yy_c_buf_p
;
1172 /* undo effects of setting up yytext */
1173 *yy_cp
= yy_hold_char
;
1175 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1176 { /* need to shift things up to make room */
1177 /* +2 for EOB chars. */
1178 register int number_to_move
= yy_n_chars
+ 2;
1179 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1180 yy_current_buffer
->yy_buf_size
+ 2];
1181 register char *source
=
1182 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1184 while ( source
> yy_current_buffer
->yy_ch_buf
)
1185 *--dest
= *--source
;
1187 yy_cp
+= (int) (dest
- source
);
1188 yy_bp
+= (int) (dest
- source
);
1189 yy_current_buffer
->yy_n_chars
=
1190 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1192 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1193 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1196 *--yy_cp
= (char) c
;
1202 yy_hold_char
= *yy_cp
;
1205 #endif /* ifndef YY_NO_UNPUT */
1209 static int yyinput()
1216 *yy_c_buf_p
= yy_hold_char
;
1218 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1220 /* yy_c_buf_p now points to the character we want to return.
1221 * If this occurs *before* the EOB characters, then it's a
1222 * valid NUL; if not, then we've hit the end of the buffer.
1224 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1225 /* This was really a NUL. */
1229 { /* need more input */
1230 int offset
= yy_c_buf_p
- yytext_ptr
;
1233 switch ( yy_get_next_buffer() )
1235 case EOB_ACT_LAST_MATCH
:
1236 /* This happens because yy_g_n_b()
1237 * sees that we've accumulated a
1238 * token and flags that we need to
1239 * try matching the token before
1240 * proceeding. But for input(),
1241 * there's no matching to consider.
1242 * So convert the EOB_ACT_LAST_MATCH
1243 * to EOB_ACT_END_OF_FILE.
1246 /* Reset buffer status. */
1251 case EOB_ACT_END_OF_FILE
:
1256 if ( ! yy_did_buffer_switch_on_eof
)
1265 case EOB_ACT_CONTINUE_SCAN
:
1266 yy_c_buf_p
= yytext_ptr
+ offset
;
1272 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1273 *yy_c_buf_p
= '\0'; /* preserve yytext */
1274 yy_hold_char
= *++yy_c_buf_p
;
1283 #ifdef YY_USE_PROTOS
1284 void yyrestart( FILE *input_file
)
1286 void yyrestart( input_file
)
1290 if ( ! yy_current_buffer
)
1291 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1293 yy_init_buffer( yy_current_buffer
, input_file
);
1294 yy_load_buffer_state();
1298 #ifdef YY_USE_PROTOS
1299 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1301 void yy_switch_to_buffer( new_buffer
)
1302 YY_BUFFER_STATE new_buffer
;
1305 if ( yy_current_buffer
== new_buffer
)
1308 if ( yy_current_buffer
)
1310 /* Flush out information for old buffer. */
1311 *yy_c_buf_p
= yy_hold_char
;
1312 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1313 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1316 yy_current_buffer
= new_buffer
;
1317 yy_load_buffer_state();
1319 /* We don't actually know whether we did this switch during
1320 * EOF (yywrap()) processing, but the only time this flag
1321 * is looked at is after yywrap() is called, so it's safe
1322 * to go ahead and always set it.
1324 yy_did_buffer_switch_on_eof
= 1;
1328 #ifdef YY_USE_PROTOS
1329 void yy_load_buffer_state( void )
1331 void yy_load_buffer_state()
1334 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1335 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1336 yyin
= yy_current_buffer
->yy_input_file
;
1337 yy_hold_char
= *yy_c_buf_p
;
1341 #ifdef YY_USE_PROTOS
1342 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1344 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1351 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1353 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1355 b
->yy_buf_size
= size
;
1357 /* yy_ch_buf has to be 2 characters longer than the size given because
1358 * we need to put in 2 end-of-buffer characters.
1360 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1361 if ( ! b
->yy_ch_buf
)
1362 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1364 b
->yy_is_our_buffer
= 1;
1366 yy_init_buffer( b
, file
);
1372 #ifdef YY_USE_PROTOS
1373 void yy_delete_buffer( YY_BUFFER_STATE b
)
1375 void yy_delete_buffer( b
)
1382 if ( b
== yy_current_buffer
)
1383 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1385 if ( b
->yy_is_our_buffer
)
1386 yy_flex_free( (void *) b
->yy_ch_buf
);
1388 yy_flex_free( (void *) b
);
1392 #ifndef YY_ALWAYS_INTERACTIVE
1393 #ifndef YY_NEVER_INTERACTIVE
1394 extern int isatty
YY_PROTO(( int ));
1398 #ifdef YY_USE_PROTOS
1399 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1401 void yy_init_buffer( b
, file
)
1408 yy_flush_buffer( b
);
1410 b
->yy_input_file
= file
;
1411 b
->yy_fill_buffer
= 1;
1413 #if YY_ALWAYS_INTERACTIVE
1414 b
->yy_is_interactive
= 1;
1416 #if YY_NEVER_INTERACTIVE
1417 b
->yy_is_interactive
= 0;
1419 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1425 #ifdef YY_USE_PROTOS
1426 void yy_flush_buffer( YY_BUFFER_STATE b
)
1428 void yy_flush_buffer( b
)
1438 /* We always need two end-of-buffer characters. The first causes
1439 * a transition to the end-of-buffer state. The second causes
1440 * a jam in that state.
1442 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1443 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1445 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1448 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1450 if ( b
== yy_current_buffer
)
1451 yy_load_buffer_state();
1455 #ifndef YY_NO_SCAN_BUFFER
1456 #ifdef YY_USE_PROTOS
1457 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1459 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1467 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1468 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1469 /* They forgot to leave room for the EOB's. */
1472 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1474 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1476 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1477 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1478 b
->yy_is_our_buffer
= 0;
1479 b
->yy_input_file
= 0;
1480 b
->yy_n_chars
= b
->yy_buf_size
;
1481 b
->yy_is_interactive
= 0;
1483 b
->yy_fill_buffer
= 0;
1484 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1486 yy_switch_to_buffer( b
);
1493 #ifndef YY_NO_SCAN_STRING
1494 #ifdef YY_USE_PROTOS
1495 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1497 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1498 yyconst
char *yy_str
;
1502 for ( len
= 0; yy_str
[len
]; ++len
)
1505 return yy_scan_bytes( yy_str
, len
);
1510 #ifndef YY_NO_SCAN_BYTES
1511 #ifdef YY_USE_PROTOS
1512 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1514 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1515 yyconst
char *bytes
;
1524 /* Get memory for full buffer, including space for trailing EOB's. */
1526 buf
= (char *) yy_flex_alloc( n
);
1528 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1530 for ( i
= 0; i
< len
; ++i
)
1533 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1535 b
= yy_scan_buffer( buf
, n
);
1537 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1539 /* It's okay to grow etc. this buffer, and we should throw it
1540 * away when we're done.
1542 b
->yy_is_our_buffer
= 1;
1549 #ifndef YY_NO_PUSH_STATE
1550 #ifdef YY_USE_PROTOS
1551 static void yy_push_state( int new_state
)
1553 static void yy_push_state( new_state
)
1557 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1561 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1562 new_size
= yy_start_stack_depth
* sizeof( int );
1564 if ( ! yy_start_stack
)
1565 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1568 yy_start_stack
= (int *) yy_flex_realloc(
1569 (void *) yy_start_stack
, new_size
);
1571 if ( ! yy_start_stack
)
1573 "out of memory expanding start-condition stack" );
1576 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1583 #ifndef YY_NO_POP_STATE
1584 static void yy_pop_state()
1586 if ( --yy_start_stack_ptr
< 0 )
1587 YY_FATAL_ERROR( "start-condition stack underflow" );
1589 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1594 #ifndef YY_NO_TOP_STATE
1595 static int yy_top_state()
1597 return yy_start_stack
[yy_start_stack_ptr
- 1];
1601 #ifndef YY_EXIT_FAILURE
1602 #define YY_EXIT_FAILURE 2
1605 #ifdef YY_USE_PROTOS
1606 static void yy_fatal_error( yyconst
char msg
[] )
1608 static void yy_fatal_error( msg
)
1612 (void) fprintf( stderr
, "%s\n", msg
);
1613 exit( YY_EXIT_FAILURE
);
1618 /* Redefine yyless() so it works in section 3 code. */
1624 /* Undo effects of setting up yytext. */ \
1625 yytext[yyleng] = yy_hold_char; \
1626 yy_c_buf_p = yytext + n; \
1627 yy_hold_char = *yy_c_buf_p; \
1628 *yy_c_buf_p = '\0'; \
1634 /* Internal utility routines. */
1637 #ifdef YY_USE_PROTOS
1638 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1640 static void yy_flex_strncpy( s1
, s2
, n
)
1647 for ( i
= 0; i
< n
; ++i
)
1652 #ifdef YY_NEED_STRLEN
1653 #ifdef YY_USE_PROTOS
1654 static int yy_flex_strlen( yyconst
char *s
)
1656 static int yy_flex_strlen( s
)
1661 for ( n
= 0; s
[n
]; ++n
)
1669 #ifdef YY_USE_PROTOS
1670 static void *yy_flex_alloc( yy_size_t size
)
1672 static void *yy_flex_alloc( size
)
1676 return (void *) malloc( size
);
1679 #ifdef YY_USE_PROTOS
1680 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1682 static void *yy_flex_realloc( ptr
, size
)
1687 /* The cast to (char *) in the following accommodates both
1688 * implementations that use char* generic pointers, and those
1689 * that use void* generic pointers. It works with the latter
1690 * because both ANSI C and C++ allow castless assignment from
1691 * any pointer type to void*, and deal with argument conversions
1692 * as though doing an assignment.
1694 return (void *) realloc( (char *) ptr
, size
);
1697 #ifdef YY_USE_PROTOS
1698 static void yy_flex_free( void *ptr
)
1700 static void yy_flex_free( ptr
)