4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 33
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t
;
44 typedef uint8_t flex_uint8_t
;
45 typedef int16_t flex_int16_t
;
46 typedef uint16_t flex_uint16_t
;
47 typedef int32_t flex_int32_t
;
48 typedef uint32_t flex_uint32_t
;
50 typedef signed char flex_int8_t
;
51 typedef short int flex_int16_t
;
52 typedef int flex_int32_t
;
53 typedef unsigned char flex_uint8_t
;
54 typedef unsigned short int flex_uint16_t
;
55 typedef unsigned int flex_uint32_t
;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
100 #endif /* __STDC__ */
101 #endif /* ! __cplusplus */
104 #define yyconst const
109 /* Returned upon end-of-file. */
112 /* Promotes a possibly negative, possibly signed char to an unsigned
113 * integer for use as an array index. If the signed char is negative,
114 * we want to instead treat it as an 8-bit unsigned char, hence the
117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119 /* Enter a start condition. This macro really ought to take a parameter,
120 * but we do it the disgusting crufty way forced on us by the ()-less
121 * definition of BEGIN.
123 #define BEGIN (yy_start) = 1 + 2 *
125 /* Translate the current start state into a value that can be later handed
126 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 #define YY_START (((yy_start) - 1) / 2)
130 #define YYSTATE YY_START
132 /* Action number for EOF rule of a given start state. */
133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135 /* Special action meaning "start processing a new file". */
136 #define YY_NEW_FILE yyrestart(yyin )
138 #define YY_END_OF_BUFFER_CHAR 0
140 /* Size of default input buffer. */
142 #define YY_BUF_SIZE 16384
145 /* The state buf must be large enough to hold one state per character in the main buffer.
147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
156 extern FILE *yyin
, *yyout
;
158 #define EOB_ACT_CONTINUE_SCAN 0
159 #define EOB_ACT_END_OF_FILE 1
160 #define EOB_ACT_LAST_MATCH 2
162 #define YY_LESS_LINENO(n)
164 /* Return all but the first "n" matched characters back to the input stream. */
168 /* Undo effects of setting up yytext. */ \
169 int yyless_macro_arg = (n); \
170 YY_LESS_LINENO(yyless_macro_arg);\
171 *yy_cp = (yy_hold_char); \
172 YY_RESTORE_YY_MORE_OFFSET \
173 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
174 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
178 #define unput(c) yyunput( c, (yytext_ptr) )
180 /* The following is because we cannot portably get our hands on size_t
181 * (without autoconf's help, which isn't available because we want
182 * flex-generated scanners to compile on their own).
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef unsigned int yy_size_t
;
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
196 char *yy_ch_buf
; /* input buffer */
197 char *yy_buf_pos
; /* current position in input buffer */
199 /* Size of input buffer in bytes, not including room for EOB
202 yy_size_t yy_buf_size
;
204 /* Number of characters read into yy_ch_buf, not including EOB
209 /* Whether we "own" the buffer - i.e., we know we created it,
210 * and can realloc() it to grow it, and should free() it to
213 int yy_is_our_buffer
;
215 /* Whether this is an "interactive" input source; if so, and
216 * if we're using stdio for input, then we want to use getc()
217 * instead of fread(), to make sure we stop fetching input after
220 int yy_is_interactive
;
222 /* Whether we're considered to be at the beginning of a line.
223 * If so, '^' rules will be active on the next match, otherwise
228 int yy_bs_lineno
; /**< The line count. */
229 int yy_bs_column
; /**< The column count. */
231 /* Whether to try to fill the input buffer when we reach the
236 int yy_buffer_status
;
238 #define YY_BUFFER_NEW 0
239 #define YY_BUFFER_NORMAL 1
240 /* When an EOF's been seen but there's still some text to process
241 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
242 * shouldn't try reading from the input source any more. We might
243 * still have a bunch of tokens to match, though, because of
244 * possible backing-up.
246 * When we actually see the EOF, we change the status to "new"
247 * (via yyrestart()), so that the user can continue scanning by
248 * just pointing yyin at a new input file.
250 #define YY_BUFFER_EOF_PENDING 2
253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
255 /* Stack of input buffers. */
256 static size_t yy_buffer_stack_top
= 0; /**< index of top of stack. */
257 static size_t yy_buffer_stack_max
= 0; /**< capacity of stack. */
258 static YY_BUFFER_STATE
* yy_buffer_stack
= 0; /**< Stack as an array. */
260 /* We provide macros for accessing buffer states in case in the
261 * future we want to put the buffer states in a more general
264 * Returns the top of the stack, or NULL.
266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
270 /* Same as previous macro, but useful when we know that the buffer stack is not
271 * NULL or when we need an lvalue. For internal use only.
273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 /* yy_hold_char holds the character lost when yytext is formed. */
276 static char yy_hold_char
;
277 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
280 /* Points to current character in buffer. */
281 static char *yy_c_buf_p
= (char *) 0;
282 static int yy_init
= 0; /* whether we need to initialize */
283 static int yy_start
= 0; /* start state number */
285 /* Flag which is used to allow yywrap()'s to do buffer switches
286 * instead of setting up a fresh yyin. A bit of a hack ...
288 static int yy_did_buffer_switch_on_eof
;
290 void yyrestart (FILE *input_file
);
291 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
);
292 YY_BUFFER_STATE
yy_create_buffer (FILE *file
,int size
);
293 void yy_delete_buffer (YY_BUFFER_STATE b
);
294 void yy_flush_buffer (YY_BUFFER_STATE b
);
295 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
);
296 void yypop_buffer_state (void );
298 static void yyensure_buffer_stack (void );
299 static void yy_load_buffer_state (void );
300 static void yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
);
302 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
304 YY_BUFFER_STATE
yy_scan_buffer (char *base
,yy_size_t size
);
305 YY_BUFFER_STATE
yy_scan_string (yyconst
char *yy_str
);
306 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char *bytes
,int len
);
308 void *yyalloc (yy_size_t
);
309 void *yyrealloc (void *,yy_size_t
);
310 void yyfree (void * );
312 #define yy_new_buffer yy_create_buffer
314 #define yy_set_interactive(is_interactive) \
316 if ( ! YY_CURRENT_BUFFER ){ \
317 yyensure_buffer_stack (); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 yy_create_buffer(yyin,YY_BUF_SIZE ); \
321 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
324 #define yy_set_bol(at_bol) \
326 if ( ! YY_CURRENT_BUFFER ){\
327 yyensure_buffer_stack (); \
328 YY_CURRENT_BUFFER_LVALUE = \
329 yy_create_buffer(yyin,YY_BUF_SIZE ); \
331 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 /* Begin user sect3 */
338 typedef unsigned char YY_CHAR
;
340 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
342 typedef int yy_state_type
;
349 #define yytext_ptr yytext
351 static yy_state_type
yy_get_previous_state (void );
352 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
);
353 static int yy_get_next_buffer (void );
354 static void yy_fatal_error (yyconst
char msg
[] );
356 /* Done after the current pattern has been matched and before the
357 * corresponding action - sets up yytext.
359 #define YY_DO_BEFORE_ACTION \
360 (yytext_ptr) = yy_bp; \
361 yyleng = (size_t) (yy_cp - yy_bp); \
362 (yy_hold_char) = *yy_cp; \
364 (yy_c_buf_p) = yy_cp;
366 #define YY_NUM_RULES 41
367 #define YY_END_OF_BUFFER 42
368 /* This struct is not used in this scanner,
369 but its presence is necessary. */
372 flex_int32_t yy_verify
;
375 static yyconst flex_int16_t yy_accept
[198] =
377 0, 0, 42, 41, 34, 36, 35, 33, 41, 28,
378 41, 31, 40, 38, 27, 32, 37, 39, 28, 28,
379 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
380 28, 28, 28, 0, 29, 28, 0, 30, 31, 27,
381 32, 28, 28, 28, 28, 28, 28, 28, 28, 28,
382 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
383 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
384 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
385 28, 28, 28, 28, 28, 28, 12, 6, 28, 7,
386 28, 28, 28, 28, 28, 28, 28, 28, 1, 28,
388 28, 28, 16, 28, 28, 28, 28, 28, 28, 28,
389 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
390 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
391 17, 28, 28, 28, 28, 28, 28, 28, 28, 28,
392 28, 14, 28, 28, 28, 19, 21, 28, 28, 28,
393 28, 28, 28, 18, 9, 28, 10, 28, 28, 2,
394 28, 28, 15, 28, 28, 28, 28, 11, 13, 28,
395 5, 28, 28, 22, 28, 8, 28, 28, 28, 28,
396 28, 28, 20, 4, 28, 28, 28, 24, 28, 26,
397 28, 3, 28, 28, 23, 25, 0
401 static yyconst flex_int32_t yy_ec
[256] =
403 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
404 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 5, 1, 6, 1, 7, 1, 1, 8, 1,
407 1, 9, 1, 10, 7, 11, 12, 13, 13, 13,
408 13, 13, 13, 13, 13, 13, 13, 7, 14, 1,
409 15, 1, 7, 16, 17, 18, 19, 20, 21, 22,
410 23, 24, 25, 7, 26, 27, 28, 29, 30, 31,
411 7, 32, 33, 34, 35, 36, 37, 38, 39, 40,
412 1, 1, 1, 1, 7, 1, 22, 22, 22, 22,
414 22, 22, 7, 7, 7, 7, 7, 7, 7, 7,
415 7, 7, 7, 7, 7, 7, 7, 7, 7, 22,
416 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 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, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 static yyconst flex_int32_t yy_meta
[41] =
435 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
436 1, 4, 5, 1, 1, 4, 6, 6, 6, 6,
437 6, 6, 3, 3, 3, 3, 3, 3, 3, 3,
438 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
441 static yyconst flex_int16_t yy_base
[205] =
443 0, 0, 229, 230, 230, 230, 230, 230, 222, 0,
444 219, 0, 230, 230, 0, 0, 230, 0, 209, 195,
445 24, 186, 202, 14, 197, 186, 27, 188, 198, 25,
446 197, 196, 184, 209, 230, 0, 206, 230, 0, 0,
447 0, 0, 180, 27, 178, 178, 27, 193, 178, 183,
448 189, 179, 177, 175, 178, 185, 182, 183, 170, 181,
449 165, 164, 170, 173, 172, 159, 174, 171, 170, 158,
450 156, 156, 151, 152, 149, 161, 34, 145, 160, 145,
451 146, 154, 157, 147, 141, 139, 0, 0, 138, 0,
452 139, 135, 137, 135, 135, 29, 149, 140, 0, 136,
454 139, 145, 0, 136, 139, 132, 132, 30, 132, 135,
455 138, 129, 119, 118, 126, 116, 122, 119, 115, 115,
456 124, 127, 109, 112, 121, 119, 106, 111, 108, 106,
457 0, 106, 103, 112, 99, 91, 97, 99, 95, 88,
458 99, 0, 93, 103, 94, 0, 0, 97, 91, 87,
459 90, 84, 83, 0, 0, 95, 0, 97, 80, 0,
460 92, 91, 0, 78, 70, 91, 74, 0, 0, 82,
461 0, 89, 88, 0, 84, 0, 82, 85, 83, 69,
462 66, 56, 0, 0, 39, 36, 35, 0, 44, 0,
463 43, 0, 40, 39, 0, 0, 230, 67, 71, 77,
468 static yyconst flex_int16_t yy_def
[205] =
470 197, 1, 197, 197, 197, 197, 197, 197, 198, 199,
471 200, 201, 197, 197, 202, 203, 197, 204, 199, 199,
472 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
473 199, 199, 199, 198, 197, 199, 200, 197, 201, 202,
474 203, 199, 199, 199, 199, 199, 199, 199, 199, 199,
475 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
476 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
477 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
478 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
479 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
481 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
482 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
483 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
484 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
485 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
486 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
487 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
488 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
489 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
490 199, 199, 199, 199, 199, 199, 0, 197, 197, 197,
495 static yyconst flex_int16_t yy_nxt
[271] =
497 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
498 14, 4, 15, 16, 17, 18, 10, 19, 20, 21,
499 22, 10, 10, 23, 24, 10, 25, 26, 27, 10,
500 28, 29, 30, 31, 10, 32, 33, 10, 10, 10,
501 45, 49, 50, 53, 46, 57, 65, 69, 58, 59,
502 100, 117, 128, 118, 129, 66, 54, 70, 60, 196,
503 195, 194, 193, 192, 191, 190, 101, 34, 34, 34,
504 34, 34, 34, 36, 36, 36, 36, 37, 37, 37,
505 37, 37, 37, 39, 189, 39, 39, 39, 39, 40,
506 40, 41, 188, 41, 41, 41, 41, 42, 187, 186,
508 42, 185, 184, 183, 182, 181, 180, 179, 178, 177,
509 176, 175, 174, 173, 172, 171, 170, 169, 168, 167,
510 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
511 156, 155, 154, 153, 152, 151, 150, 149, 148, 147,
512 146, 145, 144, 143, 142, 141, 140, 139, 138, 137,
513 136, 135, 134, 133, 132, 131, 130, 127, 126, 125,
514 124, 123, 122, 121, 120, 119, 116, 115, 114, 113,
515 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
516 102, 99, 98, 97, 96, 95, 94, 93, 92, 91,
517 90, 89, 88, 87, 86, 85, 84, 83, 82, 81,
519 80, 79, 78, 77, 76, 75, 74, 73, 72, 71,
520 68, 67, 64, 38, 35, 63, 62, 61, 56, 55,
521 52, 51, 48, 47, 44, 43, 38, 35, 197, 3,
522 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
523 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
524 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
525 197, 197, 197, 197, 197, 197, 197, 197, 197, 197
528 static yyconst flex_int16_t yy_chk
[271] =
530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
532 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
533 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
534 21, 24, 24, 27, 21, 30, 44, 47, 30, 30,
535 77, 96, 108, 96, 108, 44, 27, 47, 30, 194,
536 193, 191, 189, 187, 186, 185, 77, 198, 198, 198,
537 198, 198, 198, 199, 199, 199, 199, 200, 200, 200,
538 200, 200, 200, 201, 182, 201, 201, 201, 201, 202,
539 202, 203, 181, 203, 203, 203, 203, 204, 180, 179,
541 204, 178, 177, 175, 173, 172, 170, 167, 166, 165,
542 164, 162, 161, 159, 158, 156, 153, 152, 151, 150,
543 149, 148, 145, 144, 143, 141, 140, 139, 138, 137,
544 136, 135, 134, 133, 132, 130, 129, 128, 127, 126,
545 125, 124, 123, 122, 121, 120, 119, 118, 117, 116,
546 115, 114, 113, 112, 111, 110, 109, 107, 106, 105,
547 104, 102, 101, 100, 98, 97, 95, 94, 93, 92,
548 91, 89, 86, 85, 84, 83, 82, 81, 80, 79,
549 78, 76, 75, 74, 73, 72, 71, 70, 69, 68,
550 67, 66, 65, 64, 63, 62, 61, 60, 59, 58,
552 57, 56, 55, 54, 53, 52, 51, 50, 49, 48,
553 46, 45, 43, 37, 34, 33, 32, 31, 29, 28,
554 26, 25, 23, 22, 20, 19, 11, 9, 3, 197,
555 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
556 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
557 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
558 197, 197, 197, 197, 197, 197, 197, 197, 197, 197
561 static yy_state_type yy_last_accepting_state
;
562 static char *yy_last_accepting_cpos
;
564 extern int yy_flex_debug
;
565 int yy_flex_debug
= 0;
567 /* The intent behind this definition is that it'll catch
568 * any uses of REJECT which flex missed.
570 #define REJECT reject_used_but_not_detected
571 #define yymore() yymore_used_but_not_detected
572 #define YY_MORE_ADJ 0
573 #define YY_RESTORE_YY_MORE_OFFSET
578 /* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2005, 2007
579 Free Software Foundation, Inc.
581 This file is part of GNU Binutils.
583 This program is free software; you can redistribute it and/or modify
584 it under the terms of the GNU General Public License as published by
585 the Free Software Foundation; either version 3 of the License, or
586 (at your option) any later version.
588 This program is distributed in the hope that it will be useful,
589 but WITHOUT ANY WARRANTY; without even the implied warranty of
590 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
591 GNU General Public License for more details.
593 You should have received a copy of the GNU General Public License
594 along with this program; if not, write to the Free Software
595 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
596 MA 02110-1301, USA. */
599 /* Contributed by Steve Chamberlain: sac@cygnus.com */
601 #define DONTDECLARE_MALLOC
602 #include "libiberty.h"
603 #include "defparse.h"
614 #ifndef YY_NO_UNISTD_H
615 /* Special case for "unistd.h", since it is non-ANSI. We include it way
616 * down here because we want the user's section 1 to have been scanned first.
617 * The user has a chance to override it with an option.
622 #ifndef YY_EXTRA_TYPE
623 #define YY_EXTRA_TYPE void *
626 static int yy_init_globals (void );
628 /* Macros after this point can all be overridden by user definitions in
632 #ifndef YY_SKIP_YYWRAP
634 extern "C" int yywrap (void );
636 extern int yywrap (void );
640 static void yyunput (int c
,char *buf_ptr
);
643 static void yy_flex_strncpy (char *,yyconst
char *,int );
646 #ifdef YY_NEED_STRLEN
647 static int yy_flex_strlen (yyconst
char * );
653 static int yyinput (void );
655 static int input (void );
660 /* Amount of stuff to slurp up with each read. */
661 #ifndef YY_READ_BUF_SIZE
662 #define YY_READ_BUF_SIZE 8192
665 /* Copy whatever the last rule matched to the standard output. */
667 /* This used to be an fputs(), but since the string might contain NUL's,
668 * we now use fwrite().
670 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
673 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
674 * is returned in "result".
677 #define YY_INPUT(buf,result,max_size) \
678 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
682 for ( n = 0; n < max_size && \
683 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
686 buf[n++] = (char) c; \
687 if ( c == EOF && ferror( yyin ) ) \
688 YY_FATAL_ERROR( "input in flex scanner failed" ); \
694 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
696 if( errno != EINTR) \
698 YY_FATAL_ERROR( "input in flex scanner failed" ); \
709 /* No semi-colon after return; correct usage is to write "yyterminate();" -
710 * we don't want an extra ';' after the "return" because that will cause
711 * some compilers to complain about unreachable statements.
714 #define yyterminate() return YY_NULL
717 /* Number of entries by which start-condition stack grows. */
718 #ifndef YY_START_STACK_INCR
719 #define YY_START_STACK_INCR 25
722 /* Report a fatal error. */
723 #ifndef YY_FATAL_ERROR
724 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
727 /* end tables serialization structures and prototypes */
729 /* Default declaration of generated scanner - a define so the user can
730 * easily add parameters.
733 #define YY_DECL_IS_OURS 1
735 extern int yylex (void);
737 #define YY_DECL int yylex (void)
738 #endif /* !YY_DECL */
740 /* Code executed at the beginning of each rule, after yytext and yyleng
743 #ifndef YY_USER_ACTION
744 #define YY_USER_ACTION
747 /* Code executed at the end of each rule. */
749 #define YY_BREAK break;
752 #define YY_RULE_SETUP \
755 /** The main scanner function which does all the work.
759 register yy_state_type yy_current_state
;
760 register char *yy_cp
, *yy_bp
;
776 (yy_start
) = 1; /* first start state */
784 if ( ! YY_CURRENT_BUFFER
) {
785 yyensure_buffer_stack ();
786 YY_CURRENT_BUFFER_LVALUE
=
787 yy_create_buffer(yyin
,YY_BUF_SIZE
);
790 yy_load_buffer_state( );
793 while ( 1 ) /* loops until end-of-file is reached */
795 yy_cp
= (yy_c_buf_p
);
797 /* Support of yytext. */
798 *yy_cp
= (yy_hold_char
);
800 /* yy_bp points to the position in yy_ch_buf of the start of
805 yy_current_state
= (yy_start
);
809 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
810 if ( yy_accept
[yy_current_state
] )
812 (yy_last_accepting_state
) = yy_current_state
;
813 (yy_last_accepting_cpos
) = yy_cp
;
815 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
817 yy_current_state
= (int) yy_def
[yy_current_state
];
818 if ( yy_current_state
>= 198 )
819 yy_c
= yy_meta
[(unsigned int) yy_c
];
821 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
824 while ( yy_base
[yy_current_state
] != 230 );
827 yy_act
= yy_accept
[yy_current_state
];
829 { /* have to back up */
830 yy_cp
= (yy_last_accepting_cpos
);
831 yy_current_state
= (yy_last_accepting_state
);
832 yy_act
= yy_accept
[yy_current_state
];
837 do_action
: /* This label is used only to access EOF actions. */
840 { /* beginning of action switch */
841 case 0: /* must back up */
842 /* undo the effects of YY_DO_BEFORE_ACTION */
843 *yy_cp
= (yy_hold_char
);
844 yy_cp
= (yy_last_accepting_cpos
);
845 yy_current_state
= (yy_last_accepting_state
);
861 { return DESCRIPTION
;}
961 { return INITINSTANCE
;}
966 { return INITGLOBAL
;}
971 { return TERMINSTANCE
;}
976 { return TERMGLOBAL
;}
981 { yylval
.number
= strtol (yytext
,0,0);
988 yylval
.id
= xstrdup (yytext
);
993 /* rule 29 can match eol */
997 yylval
.id
= xstrdup (yytext
+1);
998 yylval
.id
[yyleng
-2] = 0;
1003 /* rule 30 can match eol */
1007 yylval
.id
= xstrdup (yytext
+1);
1008 yylval
.id
[yyleng
-2] = 0;
1038 /* rule 36 can match eol */
1068 #line 1069 "deflex.c"
1069 case YY_STATE_EOF(INITIAL
):
1072 case YY_END_OF_BUFFER
:
1074 /* Amount of text matched not including the EOB char. */
1075 int yy_amount_of_matched_text
= (int) (yy_cp
- (yytext_ptr
)) - 1;
1077 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1078 *yy_cp
= (yy_hold_char
);
1079 YY_RESTORE_YY_MORE_OFFSET
1081 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1083 /* We're scanning a new file or input source. It's
1084 * possible that this happened because the user
1085 * just pointed yyin at a new source and called
1086 * yylex(). If so, then we have to assure
1087 * consistency between YY_CURRENT_BUFFER and our
1088 * globals. Here is the right place to do so, because
1089 * this is the first action (other than possibly a
1090 * back-up) that will match for the new input source.
1092 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1093 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1094 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1097 /* Note that here we test for yy_c_buf_p "<=" to the position
1098 * of the first EOB in the buffer, since yy_c_buf_p will
1099 * already have been incremented past the NUL character
1100 * (since all states make transitions on EOB to the
1101 * end-of-buffer state). Contrast this with the test
1104 if ( (yy_c_buf_p
) <= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1105 { /* This was really a NUL. */
1106 yy_state_type yy_next_state
;
1108 (yy_c_buf_p
) = (yytext_ptr
) + yy_amount_of_matched_text
;
1110 yy_current_state
= yy_get_previous_state( );
1112 /* Okay, we're now positioned to make the NUL
1113 * transition. We couldn't have
1114 * yy_get_previous_state() go ahead and do it
1115 * for us because it doesn't know how to deal
1116 * with the possibility of jamming (and we don't
1117 * want to build jamming into it because then it
1118 * will run more slowly).
1121 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1123 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1125 if ( yy_next_state
)
1127 /* Consume the NUL. */
1128 yy_cp
= ++(yy_c_buf_p
);
1129 yy_current_state
= yy_next_state
;
1135 yy_cp
= (yy_c_buf_p
);
1136 goto yy_find_action
;
1140 else switch ( yy_get_next_buffer( ) )
1142 case EOB_ACT_END_OF_FILE
:
1144 (yy_did_buffer_switch_on_eof
) = 0;
1148 /* Note: because we've taken care in
1149 * yy_get_next_buffer() to have set up
1150 * yytext, we can now set up
1151 * yy_c_buf_p so that if some total
1152 * hoser (like flex itself) wants to
1153 * call the scanner after we return the
1154 * YY_NULL, it'll still work - another
1155 * YY_NULL will get returned.
1157 (yy_c_buf_p
) = (yytext_ptr
) + YY_MORE_ADJ
;
1159 yy_act
= YY_STATE_EOF(YY_START
);
1165 if ( ! (yy_did_buffer_switch_on_eof
) )
1171 case EOB_ACT_CONTINUE_SCAN
:
1173 (yytext_ptr
) + yy_amount_of_matched_text
;
1175 yy_current_state
= yy_get_previous_state( );
1177 yy_cp
= (yy_c_buf_p
);
1178 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1181 case EOB_ACT_LAST_MATCH
:
1183 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)];
1185 yy_current_state
= yy_get_previous_state( );
1187 yy_cp
= (yy_c_buf_p
);
1188 yy_bp
= (yytext_ptr
) + YY_MORE_ADJ
;
1189 goto yy_find_action
;
1196 "fatal flex scanner internal error--no action found" );
1197 } /* end of action switch */
1198 } /* end of scanning one token */
1199 } /* end of yylex */
1201 /* yy_get_next_buffer - try to read in a new buffer
1203 * Returns a code representing an action:
1204 * EOB_ACT_LAST_MATCH -
1205 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1206 * EOB_ACT_END_OF_FILE - end of file
1208 static int yy_get_next_buffer (void)
1210 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1211 register char *source
= (yytext_ptr
);
1212 register int number_to_move
, i
;
1215 if ( (yy_c_buf_p
) > &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] )
1217 "fatal flex scanner internal error--end of buffer missed" );
1219 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1220 { /* Don't try to fill the buffer, so this is an EOF. */
1221 if ( (yy_c_buf_p
) - (yytext_ptr
) - YY_MORE_ADJ
== 1 )
1223 /* We matched a single character, the EOB, so
1224 * treat this as a final EOF.
1226 return EOB_ACT_END_OF_FILE
;
1231 /* We matched some text prior to the EOB, first
1234 return EOB_ACT_LAST_MATCH
;
1238 /* Try to read more data. */
1240 /* First move last chars to start of buffer. */
1241 number_to_move
= (int) ((yy_c_buf_p
) - (yytext_ptr
)) - 1;
1243 for ( i
= 0; i
< number_to_move
; ++i
)
1244 *(dest
++) = *(source
++);
1246 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1247 /* don't do the read, it's not guaranteed to return an EOF,
1250 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
) = 0;
1255 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1257 while ( num_to_read
<= 0 )
1258 { /* Not enough room in the buffer - grow it. */
1260 /* just a shorter name for the current buffer */
1261 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1263 int yy_c_buf_p_offset
=
1264 (int) ((yy_c_buf_p
) - b
->yy_ch_buf
);
1266 if ( b
->yy_is_our_buffer
)
1268 int new_size
= b
->yy_buf_size
* 2;
1270 if ( new_size
<= 0 )
1271 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1273 b
->yy_buf_size
*= 2;
1275 b
->yy_ch_buf
= (char *)
1276 /* Include room in for 2 EOB chars. */
1277 yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 );
1280 /* Can't grow it, we don't own it. */
1283 if ( ! b
->yy_ch_buf
)
1285 "fatal error - scanner input buffer overflow" );
1287 (yy_c_buf_p
) = &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1289 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1294 if ( num_to_read
> YY_READ_BUF_SIZE
)
1295 num_to_read
= YY_READ_BUF_SIZE
;
1297 /* Read in more data. */
1298 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1299 (yy_n_chars
), (size_t) num_to_read
);
1301 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1304 if ( (yy_n_chars
) == 0 )
1306 if ( number_to_move
== YY_MORE_ADJ
)
1308 ret_val
= EOB_ACT_END_OF_FILE
;
1314 ret_val
= EOB_ACT_LAST_MATCH
;
1315 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1316 YY_BUFFER_EOF_PENDING
;
1321 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1323 (yy_n_chars
) += number_to_move
;
1324 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] = YY_END_OF_BUFFER_CHAR
;
1325 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
) + 1] = YY_END_OF_BUFFER_CHAR
;
1327 (yytext_ptr
) = &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1332 /* yy_get_previous_state - get the state just before the EOB char was reached */
1334 static yy_state_type
yy_get_previous_state (void)
1336 register yy_state_type yy_current_state
;
1337 register char *yy_cp
;
1339 yy_current_state
= (yy_start
);
1341 for ( yy_cp
= (yytext_ptr
) + YY_MORE_ADJ
; yy_cp
< (yy_c_buf_p
); ++yy_cp
)
1343 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1344 if ( yy_accept
[yy_current_state
] )
1346 (yy_last_accepting_state
) = yy_current_state
;
1347 (yy_last_accepting_cpos
) = yy_cp
;
1349 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1351 yy_current_state
= (int) yy_def
[yy_current_state
];
1352 if ( yy_current_state
>= 198 )
1353 yy_c
= yy_meta
[(unsigned int) yy_c
];
1355 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1358 return yy_current_state
;
1361 /* yy_try_NUL_trans - try to make a transition on the NUL character
1364 * next_state = yy_try_NUL_trans( current_state );
1366 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
)
1368 register int yy_is_jam
;
1369 register char *yy_cp
= (yy_c_buf_p
);
1371 register YY_CHAR yy_c
= 1;
1372 if ( yy_accept
[yy_current_state
] )
1374 (yy_last_accepting_state
) = yy_current_state
;
1375 (yy_last_accepting_cpos
) = yy_cp
;
1377 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1379 yy_current_state
= (int) yy_def
[yy_current_state
];
1380 if ( yy_current_state
>= 198 )
1381 yy_c
= yy_meta
[(unsigned int) yy_c
];
1383 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1384 yy_is_jam
= (yy_current_state
== 197);
1386 return yy_is_jam
? 0 : yy_current_state
;
1389 static void yyunput (int c
, register char * yy_bp
)
1391 register char *yy_cp
;
1393 yy_cp
= (yy_c_buf_p
);
1395 /* undo effects of setting up yytext */
1396 *yy_cp
= (yy_hold_char
);
1398 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1399 { /* need to shift things up to make room */
1400 /* +2 for EOB chars. */
1401 register int number_to_move
= (yy_n_chars
) + 2;
1402 register char *dest
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[
1403 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
+ 2];
1404 register char *source
=
1405 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
];
1407 while ( source
> YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1408 *--dest
= *--source
;
1410 yy_cp
+= (int) (dest
- source
);
1411 yy_bp
+= (int) (dest
- source
);
1412 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
=
1413 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
;
1415 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1416 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1419 *--yy_cp
= (char) c
;
1421 (yytext_ptr
) = yy_bp
;
1422 (yy_hold_char
) = *yy_cp
;
1423 (yy_c_buf_p
) = yy_cp
;
1428 static int yyinput (void)
1430 static int input (void)
1436 *(yy_c_buf_p
) = (yy_hold_char
);
1438 if ( *(yy_c_buf_p
) == YY_END_OF_BUFFER_CHAR
)
1440 /* yy_c_buf_p now points to the character we want to return.
1441 * If this occurs *before* the EOB characters, then it's a
1442 * valid NUL; if not, then we've hit the end of the buffer.
1444 if ( (yy_c_buf_p
) < &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[(yy_n_chars
)] )
1445 /* This was really a NUL. */
1446 *(yy_c_buf_p
) = '\0';
1449 { /* need more input */
1450 int offset
= (yy_c_buf_p
) - (yytext_ptr
);
1453 switch ( yy_get_next_buffer( ) )
1455 case EOB_ACT_LAST_MATCH
:
1456 /* This happens because yy_g_n_b()
1457 * sees that we've accumulated a
1458 * token and flags that we need to
1459 * try matching the token before
1460 * proceeding. But for input(),
1461 * there's no matching to consider.
1462 * So convert the EOB_ACT_LAST_MATCH
1463 * to EOB_ACT_END_OF_FILE.
1466 /* Reset buffer status. */
1471 case EOB_ACT_END_OF_FILE
:
1476 if ( ! (yy_did_buffer_switch_on_eof
) )
1485 case EOB_ACT_CONTINUE_SCAN
:
1486 (yy_c_buf_p
) = (yytext_ptr
) + offset
;
1492 c
= *(unsigned char *) (yy_c_buf_p
); /* cast for 8-bit char's */
1493 *(yy_c_buf_p
) = '\0'; /* preserve yytext */
1494 (yy_hold_char
) = *++(yy_c_buf_p
);
1498 #endif /* ifndef YY_NO_INPUT */
1500 /** Immediately switch to a different input stream.
1501 * @param input_file A readable stream.
1503 * @note This function does not reset the start condition to @c INITIAL .
1505 void yyrestart (FILE * input_file
)
1508 if ( ! YY_CURRENT_BUFFER
){
1509 yyensure_buffer_stack ();
1510 YY_CURRENT_BUFFER_LVALUE
=
1511 yy_create_buffer(yyin
,YY_BUF_SIZE
);
1514 yy_init_buffer(YY_CURRENT_BUFFER
,input_file
);
1515 yy_load_buffer_state( );
1518 /** Switch to a different input buffer.
1519 * @param new_buffer The new input buffer.
1522 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
)
1525 /* TODO. We should be able to replace this entire function body
1527 * yypop_buffer_state();
1528 * yypush_buffer_state(new_buffer);
1530 yyensure_buffer_stack ();
1531 if ( YY_CURRENT_BUFFER
== new_buffer
)
1534 if ( YY_CURRENT_BUFFER
)
1536 /* Flush out information for old buffer. */
1537 *(yy_c_buf_p
) = (yy_hold_char
);
1538 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1539 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1542 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1543 yy_load_buffer_state( );
1545 /* We don't actually know whether we did this switch during
1546 * EOF (yywrap()) processing, but the only time this flag
1547 * is looked at is after yywrap() is called, so it's safe
1548 * to go ahead and always set it.
1550 (yy_did_buffer_switch_on_eof
) = 1;
1553 static void yy_load_buffer_state (void)
1555 (yy_n_chars
) = YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1556 (yytext_ptr
) = (yy_c_buf_p
) = YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1557 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1558 (yy_hold_char
) = *(yy_c_buf_p
);
1561 /** Allocate and initialize an input buffer state.
1562 * @param file A readable stream.
1563 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1565 * @return the allocated buffer state.
1567 YY_BUFFER_STATE
yy_create_buffer (FILE * file
, int size
)
1571 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1573 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1575 b
->yy_buf_size
= size
;
1577 /* yy_ch_buf has to be 2 characters longer than the size given because
1578 * we need to put in 2 end-of-buffer characters.
1580 b
->yy_ch_buf
= (char *) yyalloc(b
->yy_buf_size
+ 2 );
1581 if ( ! b
->yy_ch_buf
)
1582 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1584 b
->yy_is_our_buffer
= 1;
1586 yy_init_buffer(b
,file
);
1591 /** Destroy the buffer.
1592 * @param b a buffer created with yy_create_buffer()
1595 void yy_delete_buffer (YY_BUFFER_STATE b
)
1601 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1602 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1604 if ( b
->yy_is_our_buffer
)
1605 yyfree((void *) b
->yy_ch_buf
);
1607 yyfree((void *) b
);
1611 extern int isatty (int );
1612 #endif /* __cplusplus */
1614 /* Initializes or reinitializes a buffer.
1615 * This function is sometimes called more than once on the same buffer,
1616 * such as during a yyrestart() or at EOF.
1618 static void yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
)
1623 yy_flush_buffer(b
);
1625 b
->yy_input_file
= file
;
1626 b
->yy_fill_buffer
= 1;
1628 /* If b is the current buffer, then yy_init_buffer was _probably_
1629 * called from yyrestart() or through yy_get_next_buffer.
1630 * In that case, we don't want to reset the lineno or column.
1632 if (b
!= YY_CURRENT_BUFFER
){
1633 b
->yy_bs_lineno
= 1;
1634 b
->yy_bs_column
= 0;
1637 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1642 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1643 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1646 void yy_flush_buffer (YY_BUFFER_STATE b
)
1653 /* We always need two end-of-buffer characters. The first causes
1654 * a transition to the end-of-buffer state. The second causes
1655 * a jam in that state.
1657 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1658 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1660 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1663 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1665 if ( b
== YY_CURRENT_BUFFER
)
1666 yy_load_buffer_state( );
1669 /** Pushes the new state onto the stack. The new state becomes
1670 * the current state. This function will allocate the stack
1672 * @param new_buffer The new state.
1675 void yypush_buffer_state (YY_BUFFER_STATE new_buffer
)
1677 if (new_buffer
== NULL
)
1680 yyensure_buffer_stack();
1682 /* This block is copied from yy_switch_to_buffer. */
1683 if ( YY_CURRENT_BUFFER
)
1685 /* Flush out information for old buffer. */
1686 *(yy_c_buf_p
) = (yy_hold_char
);
1687 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= (yy_c_buf_p
);
1688 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= (yy_n_chars
);
1691 /* Only push if top exists. Otherwise, replace top. */
1692 if (YY_CURRENT_BUFFER
)
1693 (yy_buffer_stack_top
)++;
1694 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1696 /* copied from yy_switch_to_buffer. */
1697 yy_load_buffer_state( );
1698 (yy_did_buffer_switch_on_eof
) = 1;
1701 /** Removes and deletes the top of the stack, if present.
1702 * The next element becomes the new top.
1705 void yypop_buffer_state (void)
1707 if (!YY_CURRENT_BUFFER
)
1710 yy_delete_buffer(YY_CURRENT_BUFFER
);
1711 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1712 if ((yy_buffer_stack_top
) > 0)
1713 --(yy_buffer_stack_top
);
1715 if (YY_CURRENT_BUFFER
) {
1716 yy_load_buffer_state( );
1717 (yy_did_buffer_switch_on_eof
) = 1;
1721 /* Allocates the stack if it does not exist.
1722 * Guarantees space for at least one push.
1724 static void yyensure_buffer_stack (void)
1728 if (!(yy_buffer_stack
)) {
1730 /* First allocation is just for 2 elements, since we don't know if this
1731 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1732 * immediate realloc on the next call.
1735 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyalloc
1736 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1739 memset((yy_buffer_stack
), 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1741 (yy_buffer_stack_max
) = num_to_alloc
;
1742 (yy_buffer_stack_top
) = 0;
1746 if ((yy_buffer_stack_top
) >= ((yy_buffer_stack_max
)) - 1){
1748 /* Increase the buffer to prepare for a possible push. */
1749 int grow_size
= 8 /* arbitrary grow size */;
1751 num_to_alloc
= (yy_buffer_stack_max
) + grow_size
;
1752 (yy_buffer_stack
) = (struct yy_buffer_state
**)yyrealloc
1754 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1757 /* zero only the new slots.*/
1758 memset((yy_buffer_stack
) + (yy_buffer_stack_max
), 0, grow_size
* sizeof(struct yy_buffer_state
*));
1759 (yy_buffer_stack_max
) = num_to_alloc
;
1763 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1764 * @param base the character buffer
1765 * @param size the size in bytes of the character buffer
1767 * @return the newly allocated buffer state object.
1769 YY_BUFFER_STATE
yy_scan_buffer (char * base
, yy_size_t size
)
1774 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1775 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1776 /* They forgot to leave room for the EOB's. */
1779 b
= (YY_BUFFER_STATE
) yyalloc(sizeof( struct yy_buffer_state
) );
1781 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1783 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1784 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1785 b
->yy_is_our_buffer
= 0;
1786 b
->yy_input_file
= 0;
1787 b
->yy_n_chars
= b
->yy_buf_size
;
1788 b
->yy_is_interactive
= 0;
1790 b
->yy_fill_buffer
= 0;
1791 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1793 yy_switch_to_buffer(b
);
1798 /** Setup the input buffer state to scan a string. The next call to yylex() will
1799 * scan from a @e copy of @a str.
1800 * @param yystr a NUL-terminated string to scan
1802 * @return the newly allocated buffer state object.
1803 * @note If you want to scan bytes that may contain NUL values, then use
1804 * yy_scan_bytes() instead.
1806 YY_BUFFER_STATE
yy_scan_string (yyconst
char * yystr
)
1809 return yy_scan_bytes(yystr
,strlen(yystr
) );
1812 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1813 * scan from a @e copy of @a bytes.
1814 * @param bytes the byte buffer to scan
1815 * @param len the number of bytes in the buffer pointed to by @a bytes.
1817 * @return the newly allocated buffer state object.
1819 YY_BUFFER_STATE
yy_scan_bytes (yyconst
char * yybytes
, int _yybytes_len
)
1826 /* Get memory for full buffer, including space for trailing EOB's. */
1827 n
= _yybytes_len
+ 2;
1828 buf
= (char *) yyalloc(n
);
1830 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1832 for ( i
= 0; i
< _yybytes_len
; ++i
)
1833 buf
[i
] = yybytes
[i
];
1835 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1837 b
= yy_scan_buffer(buf
,n
);
1839 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1841 /* It's okay to grow etc. this buffer, and we should throw it
1842 * away when we're done.
1844 b
->yy_is_our_buffer
= 1;
1849 #ifndef YY_EXIT_FAILURE
1850 #define YY_EXIT_FAILURE 2
1853 static void yy_fatal_error (yyconst
char* msg
)
1855 (void) fprintf( stderr
, "%s\n", msg
);
1856 exit( YY_EXIT_FAILURE
);
1859 /* Redefine yyless() so it works in section 3 code. */
1865 /* Undo effects of setting up yytext. */ \
1866 int yyless_macro_arg = (n); \
1867 YY_LESS_LINENO(yyless_macro_arg);\
1868 yytext[yyleng] = (yy_hold_char); \
1869 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1870 (yy_hold_char) = *(yy_c_buf_p); \
1871 *(yy_c_buf_p) = '\0'; \
1872 yyleng = yyless_macro_arg; \
1876 /* Accessor methods (get/set functions) to struct members. */
1878 /** Get the current line number.
1881 int yyget_lineno (void)
1887 /** Get the input stream.
1890 FILE *yyget_in (void)
1895 /** Get the output stream.
1898 FILE *yyget_out (void)
1903 /** Get the length of the current token.
1906 int yyget_leng (void)
1911 /** Get the current token.
1915 char *yyget_text (void)
1920 /** Set the current line number.
1921 * @param line_number
1924 void yyset_lineno (int line_number
)
1927 yylineno
= line_number
;
1930 /** Set the input stream. This does not discard the current
1932 * @param in_str A readable stream.
1934 * @see yy_switch_to_buffer
1936 void yyset_in (FILE * in_str
)
1941 void yyset_out (FILE * out_str
)
1946 int yyget_debug (void)
1948 return yy_flex_debug
;
1951 void yyset_debug (int bdebug
)
1953 yy_flex_debug
= bdebug
;
1956 static int yy_init_globals (void)
1958 /* Initialization is the same as for the non-reentrant scanner.
1959 * This function is called from yylex_destroy(), so don't allocate here.
1962 (yy_buffer_stack
) = 0;
1963 (yy_buffer_stack_top
) = 0;
1964 (yy_buffer_stack_max
) = 0;
1965 (yy_c_buf_p
) = (char *) 0;
1969 /* Defined in main.c */
1978 /* For future reference: Set errno on error, since we are called by
1984 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1985 int yylex_destroy (void)
1988 /* Pop the buffer stack, destroying each element. */
1989 while(YY_CURRENT_BUFFER
){
1990 yy_delete_buffer(YY_CURRENT_BUFFER
);
1991 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1992 yypop_buffer_state();
1995 /* Destroy the stack itself. */
1996 yyfree((yy_buffer_stack
) );
1997 (yy_buffer_stack
) = NULL
;
1999 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2000 * yylex() is called, initialization will occur. */
2007 * Internal utility routines.
2011 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
)
2014 for ( i
= 0; i
< n
; ++i
)
2019 #ifdef YY_NEED_STRLEN
2020 static int yy_flex_strlen (yyconst
char * s
)
2023 for ( n
= 0; s
[n
]; ++n
)
2030 void *yyalloc (yy_size_t size
)
2032 return (void *) malloc( size
);
2035 void *yyrealloc (void * ptr
, yy_size_t size
)
2037 /* The cast to (char *) in the following accommodates both
2038 * implementations that use char* generic pointers, and those
2039 * that use void* generic pointers. It works with the latter
2040 * because both ANSI C and C++ allow castless assignment from
2041 * any pointer type to void*, and deal with argument conversions
2042 * as though doing an assignment.
2044 return (void *) realloc( (char *) ptr
, size
);
2047 void yyfree (void * ptr
)
2049 free( (char *) ptr
); /* see yyrealloc() for (char *) cast */
2052 #define YYTABLES_NAME "yytables"
2058 /* Needed for lex, though not flex. */
2059 int yywrap(void) { return 1; }