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 35
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 defined (__STDC_VERSION__) && __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;
49 typedef uint64_t flex_uint64_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
144 #define YY_BUF_SIZE 16384
147 /* The state buf must be large enough to hold one state per character in the main buffer.
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
156 #ifndef YY_TYPEDEF_YY_SIZE_T
157 #define YY_TYPEDEF_YY_SIZE_T
158 typedef size_t yy_size_t;
161 extern yy_size_t yyleng;
163 extern FILE *yyin, *yyout;
165 #define EOB_ACT_CONTINUE_SCAN 0
166 #define EOB_ACT_END_OF_FILE 1
167 #define EOB_ACT_LAST_MATCH 2
169 #define YY_LESS_LINENO(n)
171 /* Return all but the first "n" matched characters back to the input stream. */
175 /* Undo effects of setting up yytext. */ \
176 int yyless_macro_arg = (n); \
177 YY_LESS_LINENO(yyless_macro_arg);\
178 *yy_cp = (yy_hold_char); \
179 YY_RESTORE_YY_MORE_OFFSET \
180 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
181 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
185 #define unput(c) yyunput( c, (yytext_ptr) )
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
196 /* Size of input buffer in bytes, not including room for EOB
199 yy_size_t yy_buf_size;
201 /* Number of characters read into yy_ch_buf, not including EOB
204 yy_size_t yy_n_chars;
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can realloc() it to grow it, and should free() it to
210 int yy_is_our_buffer;
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
217 int yy_is_interactive;
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
228 /* Whether to try to fill the input buffer when we reach the
233 int yy_buffer_status;
235 #define YY_BUFFER_NEW 0
236 #define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
247 #define YY_BUFFER_EOF_PENDING 2
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
252 /* Stack of input buffers. */
253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
257 /* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
261 * Returns the top of the stack, or NULL.
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
267 /* Same as previous macro, but useful when we know that the buffer stack is not
268 * NULL or when we need an lvalue. For internal use only.
270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
272 /* yy_hold_char holds the character lost when yytext is formed. */
273 static char yy_hold_char;
274 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
277 /* Points to current character in buffer. */
278 static char *yy_c_buf_p = (char *) 0;
279 static int yy_init = 0; /* whether we need to initialize */
280 static int yy_start = 0; /* start state number */
282 /* Flag which is used to allow yywrap()'s to do buffer switches
283 * instead of setting up a fresh yyin. A bit of a hack ...
285 static int yy_did_buffer_switch_on_eof;
287 void yyrestart (FILE *input_file );
288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
290 void yy_delete_buffer (YY_BUFFER_STATE b );
291 void yy_flush_buffer (YY_BUFFER_STATE b );
292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
293 void yypop_buffer_state (void );
295 static void yyensure_buffer_stack (void );
296 static void yy_load_buffer_state (void );
297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
305 void *yyalloc (yy_size_t );
306 void *yyrealloc (void *,yy_size_t );
307 void yyfree (void * );
309 #define yy_new_buffer yy_create_buffer
311 #define yy_set_interactive(is_interactive) \
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 #define yy_set_bol(at_bol) \
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333 /* Begin user sect3 */
335 typedef unsigned char YY_CHAR;
337 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
339 typedef int yy_state_type;
346 #define yytext_ptr yytext
348 static yy_state_type yy_get_previous_state (void );
349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
350 static int yy_get_next_buffer (void );
351 static void yy_fatal_error (yyconst char msg[] );
353 /* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
356 #define YY_DO_BEFORE_ACTION \
357 (yytext_ptr) = yy_bp; \
358 yyleng = (yy_size_t) (yy_cp - yy_bp); \
359 (yy_hold_char) = *yy_cp; \
361 (yy_c_buf_p) = yy_cp;
363 #define YY_NUM_RULES 42
364 #define YY_END_OF_BUFFER 43
365 /* This struct is not used in this scanner,
366 but its presence is necessary. */
369 flex_int32_t yy_verify;
372 static yyconst flex_int16_t yy_accept[199] =
374 0, 0, 43, 42, 34, 36, 35, 33, 42, 28,
375 42, 31, 41, 39, 27, 32, 38, 40, 28, 28,
376 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
377 28, 28, 28, 0, 29, 28, 0, 30, 31, 27,
378 32, 37, 28, 28, 28, 28, 28, 28, 28, 28,
379 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
380 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
381 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
382 28, 28, 28, 28, 28, 28, 28, 12, 6, 28,
383 7, 28, 28, 28, 28, 28, 28, 28, 28, 1,
385 28, 28, 28, 16, 28, 28, 28, 28, 28, 28,
386 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
387 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
388 28, 17, 28, 28, 28, 28, 28, 28, 28, 28,
389 28, 28, 14, 28, 28, 28, 19, 21, 28, 28,
390 28, 28, 28, 28, 18, 9, 28, 10, 28, 28,
391 2, 28, 28, 15, 28, 28, 28, 28, 11, 13,
392 28, 5, 28, 28, 22, 28, 8, 28, 28, 28,
393 28, 28, 28, 20, 4, 28, 28, 28, 24, 28,
394 26, 28, 3, 28, 28, 23, 25, 0
398 static yyconst flex_int32_t yy_ec[256] =
400 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
401 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 5, 1, 6, 1, 7, 1, 1, 8, 1,
404 1, 9, 1, 10, 7, 11, 12, 13, 13, 13,
405 13, 13, 13, 13, 13, 13, 13, 7, 14, 12,
406 15, 12, 7, 16, 17, 18, 19, 20, 21, 22,
407 23, 24, 25, 7, 26, 27, 28, 29, 30, 31,
408 7, 32, 33, 34, 35, 36, 37, 38, 39, 40,
409 1, 1, 1, 1, 7, 1, 22, 22, 22, 22,
411 22, 22, 7, 7, 7, 7, 7, 7, 7, 7,
412 7, 7, 7, 7, 7, 7, 7, 7, 7, 22,
413 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 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,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1,
430 static yyconst flex_int32_t yy_meta[41] =
432 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
433 1, 4, 5, 1, 1, 4, 6, 6, 6, 6,
434 6, 6, 3, 3, 3, 3, 3, 3, 3, 3,
435 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
438 static yyconst flex_int16_t yy_base[206] =
440 0, 0, 230, 231, 231, 231, 231, 231, 223, 0,
441 220, 0, 231, 231, 0, 0, 212, 0, 209, 195,
442 24, 186, 202, 14, 197, 186, 27, 188, 198, 25,
443 197, 196, 184, 209, 231, 0, 206, 231, 0, 0,
444 0, 231, 0, 180, 27, 178, 178, 27, 193, 178,
445 183, 189, 179, 177, 175, 178, 185, 182, 183, 170,
446 181, 165, 164, 170, 173, 172, 159, 174, 171, 170,
447 158, 156, 156, 151, 152, 149, 161, 34, 145, 160,
448 145, 146, 154, 157, 147, 141, 139, 0, 0, 138,
449 0, 139, 135, 137, 135, 135, 29, 149, 140, 0,
451 136, 139, 145, 0, 136, 139, 132, 132, 30, 132,
452 135, 138, 129, 119, 118, 126, 116, 122, 119, 115,
453 115, 124, 127, 109, 112, 121, 119, 106, 111, 108,
454 106, 0, 106, 103, 112, 99, 91, 97, 99, 95,
455 88, 99, 0, 93, 103, 94, 0, 0, 97, 91,
456 87, 90, 84, 83, 0, 0, 95, 0, 97, 80,
457 0, 92, 91, 0, 78, 70, 91, 74, 0, 0,
458 82, 0, 89, 88, 0, 84, 0, 82, 85, 83,
459 69, 66, 56, 0, 0, 39, 36, 35, 0, 44,
460 0, 43, 0, 40, 39, 0, 0, 231, 67, 71,
465 static yyconst flex_int16_t yy_def[206] =
467 198, 1, 198, 198, 198, 198, 198, 198, 199, 200,
468 201, 202, 198, 198, 203, 204, 198, 205, 200, 200,
469 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
470 200, 200, 200, 199, 198, 200, 201, 198, 202, 203,
471 204, 198, 200, 200, 200, 200, 200, 200, 200, 200,
472 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
473 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
474 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
475 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
476 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
478 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
479 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
480 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
481 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
482 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
483 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
484 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
485 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
486 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
487 200, 200, 200, 200, 200, 200, 200, 0, 198, 198,
489 198, 198, 198, 198, 198
492 static yyconst flex_int16_t yy_nxt[272] =
494 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
495 14, 4, 15, 16, 17, 18, 10, 19, 20, 21,
496 22, 10, 10, 23, 24, 10, 25, 26, 27, 10,
497 28, 29, 30, 31, 10, 32, 33, 10, 10, 10,
498 46, 50, 51, 54, 47, 58, 66, 70, 59, 60,
499 101, 118, 129, 119, 130, 67, 55, 71, 61, 197,
500 196, 195, 194, 193, 192, 191, 102, 34, 34, 34,
501 34, 34, 34, 36, 36, 36, 36, 37, 37, 37,
502 37, 37, 37, 39, 190, 39, 39, 39, 39, 40,
503 40, 41, 189, 41, 41, 41, 41, 43, 188, 187,
505 43, 186, 185, 184, 183, 182, 181, 180, 179, 178,
506 177, 176, 175, 174, 173, 172, 171, 170, 169, 168,
507 167, 166, 165, 164, 163, 162, 161, 160, 159, 158,
508 157, 156, 155, 154, 153, 152, 151, 150, 149, 148,
509 147, 146, 145, 144, 143, 142, 141, 140, 139, 138,
510 137, 136, 135, 134, 133, 132, 131, 128, 127, 126,
511 125, 124, 123, 122, 121, 120, 117, 116, 115, 114,
512 113, 112, 111, 110, 109, 108, 107, 106, 105, 104,
513 103, 100, 99, 98, 97, 96, 95, 94, 93, 92,
514 91, 90, 89, 88, 87, 86, 85, 84, 83, 82,
516 81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
517 69, 68, 65, 38, 35, 64, 63, 62, 57, 56,
518 53, 52, 49, 48, 45, 44, 42, 38, 35, 198,
519 3, 198, 198, 198, 198, 198, 198, 198, 198, 198,
520 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
521 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
522 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
526 static yyconst flex_int16_t yy_chk[272] =
528 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
532 21, 24, 24, 27, 21, 30, 45, 48, 30, 30,
533 78, 97, 109, 97, 109, 45, 27, 48, 30, 195,
534 194, 192, 190, 188, 187, 186, 78, 199, 199, 199,
535 199, 199, 199, 200, 200, 200, 200, 201, 201, 201,
536 201, 201, 201, 202, 183, 202, 202, 202, 202, 203,
537 203, 204, 182, 204, 204, 204, 204, 205, 181, 180,
539 205, 179, 178, 176, 174, 173, 171, 168, 167, 166,
540 165, 163, 162, 160, 159, 157, 154, 153, 152, 151,
541 150, 149, 146, 145, 144, 142, 141, 140, 139, 138,
542 137, 136, 135, 134, 133, 131, 130, 129, 128, 127,
543 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
544 116, 115, 114, 113, 112, 111, 110, 108, 107, 106,
545 105, 103, 102, 101, 99, 98, 96, 95, 94, 93,
546 92, 90, 87, 86, 85, 84, 83, 82, 81, 80,
547 79, 77, 76, 75, 74, 73, 72, 71, 70, 69,
548 68, 67, 66, 65, 64, 63, 62, 61, 60, 59,
550 58, 57, 56, 55, 54, 53, 52, 51, 50, 49,
551 47, 46, 44, 37, 34, 33, 32, 31, 29, 28,
552 26, 25, 23, 22, 20, 19, 17, 11, 9, 3,
553 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
554 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
555 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
556 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
560 static yy_state_type yy_last_accepting_state;
561 static char *yy_last_accepting_cpos;
563 extern int yy_flex_debug;
564 int yy_flex_debug = 0;
566 /* The intent behind this definition is that it'll catch
567 * any uses of REJECT which flex missed.
569 #define REJECT reject_used_but_not_detected
570 #define yymore() yymore_used_but_not_detected
571 #define YY_MORE_ADJ 0
572 #define YY_RESTORE_YY_MORE_OFFSET
575 #define YY_NO_INPUT 1
578 /* Copyright (C) 1995-2014 Free Software Foundation, Inc.
580 This file is part of GNU Binutils.
582 This program is free software; you can redistribute it and/or modify
583 it under the terms of the GNU General Public License as published by
584 the Free Software Foundation; either version 3 of the License, or
585 (at your option) any later version.
587 This program is distributed in the hope that it will be useful,
588 but WITHOUT ANY WARRANTY; without even the implied warranty of
589 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
590 GNU General Public License for more details.
592 You should have received a copy of the GNU General Public License
593 along with this program; if not, write to the Free Software
594 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
595 MA 02110-1301, USA. */
598 /* Contributed by Steve Chamberlain: sac@cygnus.com */
600 #define DONTDECLARE_MALLOC
601 #include "libiberty.h"
602 #include "defparse.h"
611 #ifndef YY_NO_UNISTD_H
612 /* Special case for "unistd.h", since it is non-ANSI. We include it way
613 * down here because we want the user's section 1 to have been scanned first.
614 * The user has a chance to override it with an option.
619 #ifndef YY_EXTRA_TYPE
620 #define YY_EXTRA_TYPE void *
623 static int yy_init_globals (void );
625 /* Accessor methods to globals.
626 These are made visible to non-reentrant scanners for convenience. */
628 int yylex_destroy (void );
630 int yyget_debug (void );
632 void yyset_debug (int debug_flag );
634 YY_EXTRA_TYPE yyget_extra (void );
636 void yyset_extra (YY_EXTRA_TYPE user_defined );
638 FILE *yyget_in (void );
640 void yyset_in (FILE * in_str );
642 FILE *yyget_out (void );
644 void yyset_out (FILE * out_str );
646 yy_size_t yyget_leng (void );
648 char *yyget_text (void );
650 int yyget_lineno (void );
652 void yyset_lineno (int line_number );
654 /* Macros after this point can all be overridden by user definitions in
658 #ifndef YY_SKIP_YYWRAP
660 extern "C" int yywrap (void );
662 extern int yywrap (void );
667 static void yy_flex_strncpy (char *,yyconst char *,int );
670 #ifdef YY_NEED_STRLEN
671 static int yy_flex_strlen (yyconst char * );
677 static int yyinput (void );
679 static int input (void );
684 /* Amount of stuff to slurp up with each read. */
685 #ifndef YY_READ_BUF_SIZE
686 #define YY_READ_BUF_SIZE 8192
689 /* Copy whatever the last rule matched to the standard output. */
691 /* This used to be an fputs(), but since the string might contain NUL's,
692 * we now use fwrite().
694 #define ECHO fwrite( yytext, yyleng, 1, yyout )
697 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
698 * is returned in "result".
701 #define YY_INPUT(buf,result,max_size) \
702 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
706 for ( n = 0; n < max_size && \
707 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
710 buf[n++] = (char) c; \
711 if ( c == EOF && ferror( yyin ) ) \
712 YY_FATAL_ERROR( "input in flex scanner failed" ); \
718 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
720 if( errno != EINTR) \
722 YY_FATAL_ERROR( "input in flex scanner failed" ); \
733 /* No semi-colon after return; correct usage is to write "yyterminate();" -
734 * we don't want an extra ';' after the "return" because that will cause
735 * some compilers to complain about unreachable statements.
738 #define yyterminate() return YY_NULL
741 /* Number of entries by which start-condition stack grows. */
742 #ifndef YY_START_STACK_INCR
743 #define YY_START_STACK_INCR 25
746 /* Report a fatal error. */
747 #ifndef YY_FATAL_ERROR
748 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
751 /* end tables serialization structures and prototypes */
753 /* Default declaration of generated scanner - a define so the user can
754 * easily add parameters.
757 #define YY_DECL_IS_OURS 1
759 extern int yylex (void);
761 #define YY_DECL int yylex (void)
762 #endif /* !YY_DECL */
764 /* Code executed at the beginning of each rule, after yytext and yyleng
767 #ifndef YY_USER_ACTION
768 #define YY_USER_ACTION
771 /* Code executed at the end of each rule. */
773 #define YY_BREAK break;
776 #define YY_RULE_SETUP \
779 /** The main scanner function which does all the work.
783 register yy_state_type yy_current_state;
784 register char *yy_cp, *yy_bp;
800 (yy_start) = 1; /* first start state */
808 if ( ! YY_CURRENT_BUFFER ) {
809 yyensure_buffer_stack ();
810 YY_CURRENT_BUFFER_LVALUE =
811 yy_create_buffer(yyin,YY_BUF_SIZE );
814 yy_load_buffer_state( );
817 while ( 1 ) /* loops until end-of-file is reached */
819 yy_cp = (yy_c_buf_p);
821 /* Support of yytext. */
822 *yy_cp = (yy_hold_char);
824 /* yy_bp points to the position in yy_ch_buf of the start of
829 yy_current_state = (yy_start);
833 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
834 if ( yy_accept[yy_current_state] )
836 (yy_last_accepting_state) = yy_current_state;
837 (yy_last_accepting_cpos) = yy_cp;
839 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
841 yy_current_state = (int) yy_def[yy_current_state];
842 if ( yy_current_state >= 199 )
843 yy_c = yy_meta[(unsigned int) yy_c];
845 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
848 while ( yy_base[yy_current_state] != 231 );
851 yy_act = yy_accept[yy_current_state];
853 { /* have to back up */
854 yy_cp = (yy_last_accepting_cpos);
855 yy_current_state = (yy_last_accepting_state);
856 yy_act = yy_accept[yy_current_state];
861 do_action: /* This label is used only to access EOF actions. */
864 { /* beginning of action switch */
865 case 0: /* must back up */
866 /* undo the effects of YY_DO_BEFORE_ACTION */
867 *yy_cp = (yy_hold_char);
868 yy_cp = (yy_last_accepting_cpos);
869 yy_current_state = (yy_last_accepting_state);
885 { return DESCRIPTION;}
985 { return INITINSTANCE;}
990 { return INITGLOBAL;}
995 { return TERMINSTANCE;}
1000 { return TERMGLOBAL;}
1005 { yylval.number = strtol (yytext,0,0);
1012 yylval.id = xstrdup (yytext);
1017 /* rule 29 can match eol */
1021 yylval.id = xstrdup (yytext+1);
1022 yylval.id[yyleng-2] = 0;
1027 /* rule 30 can match eol */
1031 yylval.id = xstrdup (yytext+1);
1032 yylval.id[yyleng-2] = 0;
1062 /* rule 36 can match eol */
1097 #line 1098 "deflex.c"
1098 case YY_STATE_EOF(INITIAL):
1101 case YY_END_OF_BUFFER:
1103 /* Amount of text matched not including the EOB char. */
1104 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1106 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1107 *yy_cp = (yy_hold_char);
1108 YY_RESTORE_YY_MORE_OFFSET
1110 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1112 /* We're scanning a new file or input source. It's
1113 * possible that this happened because the user
1114 * just pointed yyin at a new source and called
1115 * yylex(). If so, then we have to assure
1116 * consistency between YY_CURRENT_BUFFER and our
1117 * globals. Here is the right place to do so, because
1118 * this is the first action (other than possibly a
1119 * back-up) that will match for the new input source.
1121 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1122 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1123 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1126 /* Note that here we test for yy_c_buf_p "<=" to the position
1127 * of the first EOB in the buffer, since yy_c_buf_p will
1128 * already have been incremented past the NUL character
1129 * (since all states make transitions on EOB to the
1130 * end-of-buffer state). Contrast this with the test
1133 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1134 { /* This was really a NUL. */
1135 yy_state_type yy_next_state;
1137 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1139 yy_current_state = yy_get_previous_state( );
1141 /* Okay, we're now positioned to make the NUL
1142 * transition. We couldn't have
1143 * yy_get_previous_state() go ahead and do it
1144 * for us because it doesn't know how to deal
1145 * with the possibility of jamming (and we don't
1146 * want to build jamming into it because then it
1147 * will run more slowly).
1150 yy_next_state = yy_try_NUL_trans( yy_current_state );
1152 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1154 if ( yy_next_state )
1156 /* Consume the NUL. */
1157 yy_cp = ++(yy_c_buf_p);
1158 yy_current_state = yy_next_state;
1164 yy_cp = (yy_c_buf_p);
1165 goto yy_find_action;
1169 else switch ( yy_get_next_buffer( ) )
1171 case EOB_ACT_END_OF_FILE:
1173 (yy_did_buffer_switch_on_eof) = 0;
1177 /* Note: because we've taken care in
1178 * yy_get_next_buffer() to have set up
1179 * yytext, we can now set up
1180 * yy_c_buf_p so that if some total
1181 * hoser (like flex itself) wants to
1182 * call the scanner after we return the
1183 * YY_NULL, it'll still work - another
1184 * YY_NULL will get returned.
1186 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1188 yy_act = YY_STATE_EOF(YY_START);
1194 if ( ! (yy_did_buffer_switch_on_eof) )
1200 case EOB_ACT_CONTINUE_SCAN:
1202 (yytext_ptr) + yy_amount_of_matched_text;
1204 yy_current_state = yy_get_previous_state( );
1206 yy_cp = (yy_c_buf_p);
1207 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1210 case EOB_ACT_LAST_MATCH:
1212 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1214 yy_current_state = yy_get_previous_state( );
1216 yy_cp = (yy_c_buf_p);
1217 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1218 goto yy_find_action;
1225 "fatal flex scanner internal error--no action found" );
1226 } /* end of action switch */
1227 } /* end of scanning one token */
1228 } /* end of yylex */
1230 /* yy_get_next_buffer - try to read in a new buffer
1232 * Returns a code representing an action:
1233 * EOB_ACT_LAST_MATCH -
1234 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1235 * EOB_ACT_END_OF_FILE - end of file
1237 static int yy_get_next_buffer (void)
1239 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1240 register char *source = (yytext_ptr);
1241 register int number_to_move, i;
1244 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1246 "fatal flex scanner internal error--end of buffer missed" );
1248 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1249 { /* Don't try to fill the buffer, so this is an EOF. */
1250 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1252 /* We matched a single character, the EOB, so
1253 * treat this as a final EOF.
1255 return EOB_ACT_END_OF_FILE;
1260 /* We matched some text prior to the EOB, first
1263 return EOB_ACT_LAST_MATCH;
1267 /* Try to read more data. */
1269 /* First move last chars to start of buffer. */
1270 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1272 for ( i = 0; i < number_to_move; ++i )
1273 *(dest++) = *(source++);
1275 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1276 /* don't do the read, it's not guaranteed to return an EOF,
1279 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1283 yy_size_t num_to_read =
1284 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1286 while ( num_to_read <= 0 )
1287 { /* Not enough room in the buffer - grow it. */
1289 /* just a shorter name for the current buffer */
1290 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1292 int yy_c_buf_p_offset =
1293 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1295 if ( b->yy_is_our_buffer )
1297 yy_size_t new_size = b->yy_buf_size * 2;
1299 if ( new_size <= 0 )
1300 b->yy_buf_size += b->yy_buf_size / 8;
1302 b->yy_buf_size *= 2;
1304 b->yy_ch_buf = (char *)
1305 /* Include room in for 2 EOB chars. */
1306 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1309 /* Can't grow it, we don't own it. */
1312 if ( ! b->yy_ch_buf )
1314 "fatal error - scanner input buffer overflow" );
1316 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1318 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1323 if ( num_to_read > YY_READ_BUF_SIZE )
1324 num_to_read = YY_READ_BUF_SIZE;
1326 /* Read in more data. */
1327 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1328 (yy_n_chars), num_to_read );
1330 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1333 if ( (yy_n_chars) == 0 )
1335 if ( number_to_move == YY_MORE_ADJ )
1337 ret_val = EOB_ACT_END_OF_FILE;
1343 ret_val = EOB_ACT_LAST_MATCH;
1344 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1345 YY_BUFFER_EOF_PENDING;
1350 ret_val = EOB_ACT_CONTINUE_SCAN;
1352 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1353 /* Extend the array by 50%, plus the number we really need. */
1354 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1355 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1356 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1357 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1360 (yy_n_chars) += number_to_move;
1361 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1362 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1364 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1369 /* yy_get_previous_state - get the state just before the EOB char was reached */
1371 static yy_state_type yy_get_previous_state (void)
1373 register yy_state_type yy_current_state;
1374 register char *yy_cp;
1376 yy_current_state = (yy_start);
1378 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1380 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1381 if ( yy_accept[yy_current_state] )
1383 (yy_last_accepting_state) = yy_current_state;
1384 (yy_last_accepting_cpos) = yy_cp;
1386 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1388 yy_current_state = (int) yy_def[yy_current_state];
1389 if ( yy_current_state >= 199 )
1390 yy_c = yy_meta[(unsigned int) yy_c];
1392 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1395 return yy_current_state;
1398 /* yy_try_NUL_trans - try to make a transition on the NUL character
1401 * next_state = yy_try_NUL_trans( current_state );
1403 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1405 register int yy_is_jam;
1406 register char *yy_cp = (yy_c_buf_p);
1408 register YY_CHAR yy_c = 1;
1409 if ( yy_accept[yy_current_state] )
1411 (yy_last_accepting_state) = yy_current_state;
1412 (yy_last_accepting_cpos) = yy_cp;
1414 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1416 yy_current_state = (int) yy_def[yy_current_state];
1417 if ( yy_current_state >= 199 )
1418 yy_c = yy_meta[(unsigned int) yy_c];
1420 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1421 yy_is_jam = (yy_current_state == 198);
1423 return yy_is_jam ? 0 : yy_current_state;
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 yy_size_t 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)
1726 yy_size_t num_to_alloc;
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*)
1738 if ( ! (yy_buffer_stack) )
1739 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1741 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1743 (yy_buffer_stack_max) = num_to_alloc;
1744 (yy_buffer_stack_top) = 0;
1748 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1750 /* Increase the buffer to prepare for a possible push. */
1751 int grow_size = 8 /* arbitrary grow size */;
1753 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1754 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1756 num_to_alloc * sizeof(struct yy_buffer_state*)
1758 if ( ! (yy_buffer_stack) )
1759 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1761 /* zero only the new slots.*/
1762 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1763 (yy_buffer_stack_max) = num_to_alloc;
1767 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1768 * @param base the character buffer
1769 * @param size the size in bytes of the character buffer
1771 * @return the newly allocated buffer state object.
1773 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1778 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1779 base[size-1] != YY_END_OF_BUFFER_CHAR )
1780 /* They forgot to leave room for the EOB's. */
1783 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1785 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1787 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1788 b->yy_buf_pos = b->yy_ch_buf = base;
1789 b->yy_is_our_buffer = 0;
1790 b->yy_input_file = 0;
1791 b->yy_n_chars = b->yy_buf_size;
1792 b->yy_is_interactive = 0;
1794 b->yy_fill_buffer = 0;
1795 b->yy_buffer_status = YY_BUFFER_NEW;
1797 yy_switch_to_buffer(b );
1802 /** Setup the input buffer state to scan a string. The next call to yylex() will
1803 * scan from a @e copy of @a str.
1804 * @param yystr a NUL-terminated string to scan
1806 * @return the newly allocated buffer state object.
1807 * @note If you want to scan bytes that may contain NUL values, then use
1808 * yy_scan_bytes() instead.
1810 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1813 return yy_scan_bytes(yystr,strlen(yystr) );
1816 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1817 * scan from a @e copy of @a bytes.
1818 * @param bytes the byte buffer to scan
1819 * @param len the number of bytes in the buffer pointed to by @a bytes.
1821 * @return the newly allocated buffer state object.
1823 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1829 /* Get memory for full buffer, including space for trailing EOB's. */
1830 n = _yybytes_len + 2;
1831 buf = (char *) yyalloc(n );
1833 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1835 for ( i = 0; i < _yybytes_len; ++i )
1836 buf[i] = yybytes[i];
1838 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1840 b = yy_scan_buffer(buf,n );
1842 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1844 /* It's okay to grow etc. this buffer, and we should throw it
1845 * away when we're done.
1847 b->yy_is_our_buffer = 1;
1852 #ifndef YY_EXIT_FAILURE
1853 #define YY_EXIT_FAILURE 2
1856 static void yy_fatal_error (yyconst char* msg )
1858 (void) fprintf( stderr, "%s\n", msg );
1859 exit( YY_EXIT_FAILURE );
1862 /* Redefine yyless() so it works in section 3 code. */
1868 /* Undo effects of setting up yytext. */ \
1869 int yyless_macro_arg = (n); \
1870 YY_LESS_LINENO(yyless_macro_arg);\
1871 yytext[yyleng] = (yy_hold_char); \
1872 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1873 (yy_hold_char) = *(yy_c_buf_p); \
1874 *(yy_c_buf_p) = '\0'; \
1875 yyleng = yyless_macro_arg; \
1879 /* Accessor methods (get/set functions) to struct members. */
1881 /** Get the current line number.
1884 int yyget_lineno (void)
1890 /** Get the input stream.
1893 FILE *yyget_in (void)
1898 /** Get the output stream.
1901 FILE *yyget_out (void)
1906 /** Get the length of the current token.
1909 yy_size_t yyget_leng (void)
1914 /** Get the current token.
1918 char *yyget_text (void)
1923 /** Set the current line number.
1924 * @param line_number
1927 void yyset_lineno (int line_number )
1930 yylineno = line_number;
1933 /** Set the input stream. This does not discard the current
1935 * @param in_str A readable stream.
1937 * @see yy_switch_to_buffer
1939 void yyset_in (FILE * in_str )
1944 void yyset_out (FILE * out_str )
1949 int yyget_debug (void)
1951 return yy_flex_debug;
1954 void yyset_debug (int bdebug )
1956 yy_flex_debug = bdebug ;
1959 static int yy_init_globals (void)
1961 /* Initialization is the same as for the non-reentrant scanner.
1962 * This function is called from yylex_destroy(), so don't allocate here.
1965 (yy_buffer_stack) = 0;
1966 (yy_buffer_stack_top) = 0;
1967 (yy_buffer_stack_max) = 0;
1968 (yy_c_buf_p) = (char *) 0;
1972 /* Defined in main.c */
1981 /* For future reference: Set errno on error, since we are called by
1987 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1988 int yylex_destroy (void)
1991 /* Pop the buffer stack, destroying each element. */
1992 while(YY_CURRENT_BUFFER){
1993 yy_delete_buffer(YY_CURRENT_BUFFER );
1994 YY_CURRENT_BUFFER_LVALUE = NULL;
1995 yypop_buffer_state();
1998 /* Destroy the stack itself. */
1999 yyfree((yy_buffer_stack) );
2000 (yy_buffer_stack) = NULL;
2002 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2003 * yylex() is called, initialization will occur. */
2010 * Internal utility routines.
2014 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2017 for ( i = 0; i < n; ++i )
2022 #ifdef YY_NEED_STRLEN
2023 static int yy_flex_strlen (yyconst char * s )
2026 for ( n = 0; s[n]; ++n )
2033 void *yyalloc (yy_size_t size )
2035 return (void *) malloc( size );
2038 void *yyrealloc (void * ptr, yy_size_t size )
2040 /* The cast to (char *) in the following accommodates both
2041 * implementations that use char* generic pointers, and those
2042 * that use void* generic pointers. It works with the latter
2043 * because both ANSI C and C++ allow castless assignment from
2044 * any pointer type to void*, and deal with argument conversions
2045 * as though doing an assignment.
2047 return (void *) realloc( (char *) ptr, size );
2050 void yyfree (void * ptr )
2052 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2055 #define YYTABLES_NAME "yytables"
2061 /* Needed for lex, though not flex. */
2062 int yywrap(void) { return 1; }