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 40
364 #define YY_END_OF_BUFFER 41
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[177] =
374 0, 0, 41, 40, 39, 38, 35, 32, 33, 36,
375 40, 34, 37, 35, 35, 35, 35, 35, 35, 35,
376 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
377 35, 35, 35, 35, 35, 35, 36, 31, 37, 35,
378 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
379 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
380 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
381 35, 35, 7, 35, 35, 35, 35, 35, 35, 35,
382 35, 35, 35, 35, 35, 35, 22, 35, 35, 35,
383 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
385 35, 35, 35, 10, 11, 12, 35, 15, 35, 35,
386 35, 35, 35, 35, 35, 35, 35, 25, 26, 27,
387 35, 30, 35, 35, 35, 3, 35, 35, 35, 35,
388 35, 35, 35, 35, 35, 18, 35, 35, 35, 35,
389 35, 35, 35, 1, 2, 4, 5, 35, 35, 35,
390 35, 35, 16, 17, 19, 20, 35, 35, 35, 35,
391 35, 35, 8, 9, 13, 14, 35, 23, 24, 28,
395 static yyconst flex_int32_t yy_ec[256] =
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 3, 1, 1, 1, 4, 1, 1, 1, 5,
401 6, 7, 8, 9, 4, 4, 4, 4, 4, 4,
402 4, 4, 4, 4, 4, 4, 4, 4, 10, 1,
403 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
404 4, 17, 18, 4, 4, 19, 20, 21, 22, 23,
405 4, 24, 25, 26, 27, 28, 4, 29, 30, 4,
406 1, 4, 1, 1, 4, 1, 31, 32, 33, 34,
408 35, 36, 4, 37, 38, 4, 4, 39, 40, 41,
409 42, 43, 4, 44, 45, 46, 47, 48, 4, 49,
410 50, 4, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 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,
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,
427 static yyconst flex_int32_t yy_meta[51] =
429 1, 2, 1, 3, 1, 1, 1, 1, 1, 1,
430 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
431 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
432 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
433 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
436 static yyconst flex_int16_t yy_base[180] =
438 0, 0, 193, 194, 194, 194, 0, 194, 194, 0,
439 190, 194, 0, 177, 32, 37, 32, 163, 174, 170,
440 164, 171, 174, 169, 149, 15, 22, 17, 135, 146,
441 142, 136, 143, 146, 141, 0, 0, 194, 0, 161,
442 159, 158, 153, 147, 156, 143, 149, 148, 141, 150,
443 141, 135, 138, 127, 125, 124, 119, 113, 122, 109,
444 115, 114, 107, 116, 107, 101, 104, 43, 136, 135,
445 130, 129, 0, 119, 123, 118, 114, 118, 119, 122,
446 124, 25, 104, 103, 98, 97, 0, 87, 91, 86,
447 82, 86, 87, 90, 92, 105, 100, 97, 94, 93,
449 105, 106, 102, 0, 0, 0, 104, 0, 92, 75,
450 70, 67, 64, 63, 75, 76, 72, 0, 0, 0,
451 74, 0, 62, 91, 88, 0, 86, 85, 73, 85,
452 79, 83, 70, 62, 59, 0, 57, 56, 44, 56,
453 50, 54, 41, 0, 0, 0, 0, 63, 58, 59,
454 67, 66, 0, 0, 0, 0, 38, 33, 34, 42,
455 41, 51, 0, 0, 0, 0, 30, 0, 0, 0,
456 0, 43, 21, 0, 0, 194, 65, 66, 69
459 static yyconst flex_int16_t yy_def[180] =
461 176, 1, 176, 176, 176, 176, 177, 176, 176, 178,
462 176, 176, 179, 177, 177, 177, 177, 177, 177, 177,
463 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
464 177, 177, 177, 177, 177, 177, 178, 176, 179, 177,
465 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
466 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
467 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
468 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
469 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
470 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
472 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
473 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
474 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
475 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
476 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
477 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
478 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
479 177, 177, 177, 177, 177, 0, 176, 176, 176
482 static yyconst flex_int16_t yy_nxt[245] =
484 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
485 14, 7, 15, 16, 17, 18, 19, 7, 20, 7,
486 7, 21, 7, 22, 23, 7, 7, 24, 7, 7,
487 25, 7, 26, 27, 28, 29, 30, 7, 31, 7,
488 7, 32, 7, 33, 34, 7, 7, 35, 7, 7,
489 41, 43, 45, 55, 44, 42, 57, 59, 56, 58,
490 46, 96, 97, 110, 111, 60, 37, 36, 37, 39,
491 175, 39, 174, 173, 172, 171, 170, 169, 168, 167,
492 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
493 156, 155, 154, 153, 152, 151, 150, 149, 148, 147,
495 146, 145, 144, 143, 142, 141, 140, 139, 138, 137,
496 136, 135, 134, 133, 132, 131, 130, 129, 128, 127,
497 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
498 116, 115, 114, 113, 112, 109, 108, 107, 106, 105,
499 104, 103, 102, 101, 100, 99, 98, 95, 94, 93,
500 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
501 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
502 72, 71, 70, 69, 68, 67, 66, 65, 64, 63,
503 62, 61, 54, 53, 52, 51, 50, 49, 48, 47,
504 40, 38, 176, 3, 176, 176, 176, 176, 176, 176,
506 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
507 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
508 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
509 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
513 static yyconst flex_int16_t yy_chk[245] =
515 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
516 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
517 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
518 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
519 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
520 15, 16, 17, 26, 16, 15, 27, 28, 26, 27,
521 17, 68, 68, 82, 82, 28, 178, 177, 178, 179,
522 173, 179, 172, 167, 162, 161, 160, 159, 158, 157,
523 152, 151, 150, 149, 148, 143, 142, 141, 140, 139,
524 138, 137, 135, 134, 133, 132, 131, 130, 129, 128,
526 127, 125, 124, 123, 121, 117, 116, 115, 114, 113,
527 112, 111, 110, 109, 107, 103, 102, 101, 100, 99,
528 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
529 88, 86, 85, 84, 83, 81, 80, 79, 78, 77,
530 76, 75, 74, 72, 71, 70, 69, 67, 66, 65,
531 64, 63, 62, 61, 60, 59, 58, 57, 56, 55,
532 54, 53, 52, 51, 50, 49, 48, 47, 46, 45,
533 44, 43, 42, 41, 40, 35, 34, 33, 32, 31,
534 30, 29, 25, 24, 23, 22, 21, 20, 19, 18,
535 14, 11, 3, 176, 176, 176, 176, 176, 176, 176,
537 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
538 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
539 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
540 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
544 static yy_state_type yy_last_accepting_state;
545 static char *yy_last_accepting_cpos;
547 extern int yy_flex_debug;
548 int yy_flex_debug = 0;
550 /* The intent behind this definition is that it'll catch
551 * any uses of REJECT which flex missed.
553 #define REJECT reject_used_but_not_detected
554 #define yymore() yymore_used_but_not_detected
555 #define YY_MORE_ADJ 0
556 #define YY_RESTORE_YY_MORE_OFFSET
559 #define YY_NO_INPUT 1
561 /* arlex.l - Strange script language lexer */
563 /* Copyright (C) 1992-2014 Free Software Foundation, Inc.
565 This file is part of GNU Binutils.
567 This program is free software; you can redistribute it and/or modify
568 it under the terms of the GNU General Public License as published by
569 the Free Software Foundation; either version 3 of the License, or
570 (at your option) any later version.
572 This program is distributed in the hope that it will be useful,
573 but WITHOUT ANY WARRANTY; without even the implied warranty of
574 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
575 GNU General Public License for more details.
577 You should have received a copy of the GNU General Public License
578 along with this program; if not, write to the Free Software
579 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
580 MA 02110-1301, USA. */
583 /* Contributed by Steve Chamberlain <sac@cygnus.com>. */
585 #define DONTDECLARE_MALLOC
586 #include "ansidecl.h"
587 #include "libiberty.h"
594 extern int yylex (void);
601 #ifndef YY_NO_UNISTD_H
602 /* Special case for "unistd.h", since it is non-ANSI. We include it way
603 * down here because we want the user's section 1 to have been scanned first.
604 * The user has a chance to override it with an option.
609 #ifndef YY_EXTRA_TYPE
610 #define YY_EXTRA_TYPE void *
613 static int yy_init_globals (void );
615 /* Accessor methods to globals.
616 These are made visible to non-reentrant scanners for convenience. */
618 int yylex_destroy (void );
620 int yyget_debug (void );
622 void yyset_debug (int debug_flag );
624 YY_EXTRA_TYPE yyget_extra (void );
626 void yyset_extra (YY_EXTRA_TYPE user_defined );
628 FILE *yyget_in (void );
630 void yyset_in (FILE * in_str );
632 FILE *yyget_out (void );
634 void yyset_out (FILE * out_str );
636 yy_size_t yyget_leng (void );
638 char *yyget_text (void );
640 int yyget_lineno (void );
642 void yyset_lineno (int line_number );
644 /* Macros after this point can all be overridden by user definitions in
648 #ifndef YY_SKIP_YYWRAP
650 extern "C" int yywrap (void );
652 extern int yywrap (void );
657 static void yy_flex_strncpy (char *,yyconst char *,int );
660 #ifdef YY_NEED_STRLEN
661 static int yy_flex_strlen (yyconst char * );
667 static int yyinput (void );
669 static int input (void );
674 /* Amount of stuff to slurp up with each read. */
675 #ifndef YY_READ_BUF_SIZE
676 #define YY_READ_BUF_SIZE 8192
679 /* Copy whatever the last rule matched to the standard output. */
681 /* This used to be an fputs(), but since the string might contain NUL's,
682 * we now use fwrite().
684 #define ECHO fwrite( yytext, yyleng, 1, yyout )
687 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
688 * is returned in "result".
691 #define YY_INPUT(buf,result,max_size) \
692 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
696 for ( n = 0; n < max_size && \
697 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
700 buf[n++] = (char) c; \
701 if ( c == EOF && ferror( yyin ) ) \
702 YY_FATAL_ERROR( "input in flex scanner failed" ); \
708 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
710 if( errno != EINTR) \
712 YY_FATAL_ERROR( "input in flex scanner failed" ); \
723 /* No semi-colon after return; correct usage is to write "yyterminate();" -
724 * we don't want an extra ';' after the "return" because that will cause
725 * some compilers to complain about unreachable statements.
728 #define yyterminate() return YY_NULL
731 /* Number of entries by which start-condition stack grows. */
732 #ifndef YY_START_STACK_INCR
733 #define YY_START_STACK_INCR 25
736 /* Report a fatal error. */
737 #ifndef YY_FATAL_ERROR
738 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
741 /* end tables serialization structures and prototypes */
743 /* Default declaration of generated scanner - a define so the user can
744 * easily add parameters.
747 #define YY_DECL_IS_OURS 1
749 extern int yylex (void);
751 #define YY_DECL int yylex (void)
752 #endif /* !YY_DECL */
754 /* Code executed at the beginning of each rule, after yytext and yyleng
757 #ifndef YY_USER_ACTION
758 #define YY_USER_ACTION
761 /* Code executed at the end of each rule. */
763 #define YY_BREAK break;
766 #define YY_RULE_SETUP \
769 /** The main scanner function which does all the work.
773 register yy_state_type yy_current_state;
774 register char *yy_cp, *yy_bp;
791 (yy_start) = 1; /* first start state */
799 if ( ! YY_CURRENT_BUFFER ) {
800 yyensure_buffer_stack ();
801 YY_CURRENT_BUFFER_LVALUE =
802 yy_create_buffer(yyin,YY_BUF_SIZE );
805 yy_load_buffer_state( );
808 while ( 1 ) /* loops until end-of-file is reached */
810 yy_cp = (yy_c_buf_p);
812 /* Support of yytext. */
813 *yy_cp = (yy_hold_char);
815 /* yy_bp points to the position in yy_ch_buf of the start of
820 yy_current_state = (yy_start);
824 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
825 if ( yy_accept[yy_current_state] )
827 (yy_last_accepting_state) = yy_current_state;
828 (yy_last_accepting_cpos) = yy_cp;
830 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
832 yy_current_state = (int) yy_def[yy_current_state];
833 if ( yy_current_state >= 177 )
834 yy_c = yy_meta[(unsigned int) yy_c];
836 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
839 while ( yy_base[yy_current_state] != 194 );
842 yy_act = yy_accept[yy_current_state];
844 { /* have to back up */
845 yy_cp = (yy_last_accepting_cpos);
846 yy_current_state = (yy_last_accepting_state);
847 yy_act = yy_accept[yy_current_state];
852 do_action: /* This label is used only to access EOF actions. */
855 { /* beginning of action switch */
856 case 0: /* must back up */
857 /* undo the effects of YY_DO_BEFORE_ACTION */
858 *yy_cp = (yy_hold_char);
859 yy_cp = (yy_last_accepting_cpos);
860 yy_current_state = (yy_last_accepting_state);
891 { return DIRECTORY; }
966 { return DIRECTORY; }
1014 /* rule 31 can match eol */
1038 yylval.name = xstrdup (yytext);
1058 /* rule 39 can match eol */
1061 { linenumber ++; return NEWLINE; }
1068 #line 1069 "arlex.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;
1254 yy_size_t num_to_read =
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 yy_size_t 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), 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 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1324 /* Extend the array by 50%, plus the number we really need. */
1325 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1326 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1327 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1328 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1331 (yy_n_chars) += number_to_move;
1332 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1333 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1335 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1340 /* yy_get_previous_state - get the state just before the EOB char was reached */
1342 static yy_state_type yy_get_previous_state (void)
1344 register yy_state_type yy_current_state;
1345 register char *yy_cp;
1347 yy_current_state = (yy_start);
1349 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1351 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1352 if ( yy_accept[yy_current_state] )
1354 (yy_last_accepting_state) = yy_current_state;
1355 (yy_last_accepting_cpos) = yy_cp;
1357 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1359 yy_current_state = (int) yy_def[yy_current_state];
1360 if ( yy_current_state >= 177 )
1361 yy_c = yy_meta[(unsigned int) yy_c];
1363 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1366 return yy_current_state;
1369 /* yy_try_NUL_trans - try to make a transition on the NUL character
1372 * next_state = yy_try_NUL_trans( current_state );
1374 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1376 register int yy_is_jam;
1377 register char *yy_cp = (yy_c_buf_p);
1379 register YY_CHAR yy_c = 1;
1380 if ( yy_accept[yy_current_state] )
1382 (yy_last_accepting_state) = yy_current_state;
1383 (yy_last_accepting_cpos) = yy_cp;
1385 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1387 yy_current_state = (int) yy_def[yy_current_state];
1388 if ( yy_current_state >= 177 )
1389 yy_c = yy_meta[(unsigned int) yy_c];
1391 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1392 yy_is_jam = (yy_current_state == 176);
1394 return yy_is_jam ? 0 : yy_current_state;
1399 static int yyinput (void)
1401 static int input (void)
1407 *(yy_c_buf_p) = (yy_hold_char);
1409 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1411 /* yy_c_buf_p now points to the character we want to return.
1412 * If this occurs *before* the EOB characters, then it's a
1413 * valid NUL; if not, then we've hit the end of the buffer.
1415 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1416 /* This was really a NUL. */
1417 *(yy_c_buf_p) = '\0';
1420 { /* need more input */
1421 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1424 switch ( yy_get_next_buffer( ) )
1426 case EOB_ACT_LAST_MATCH:
1427 /* This happens because yy_g_n_b()
1428 * sees that we've accumulated a
1429 * token and flags that we need to
1430 * try matching the token before
1431 * proceeding. But for input(),
1432 * there's no matching to consider.
1433 * So convert the EOB_ACT_LAST_MATCH
1434 * to EOB_ACT_END_OF_FILE.
1437 /* Reset buffer status. */
1442 case EOB_ACT_END_OF_FILE:
1447 if ( ! (yy_did_buffer_switch_on_eof) )
1456 case EOB_ACT_CONTINUE_SCAN:
1457 (yy_c_buf_p) = (yytext_ptr) + offset;
1463 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1464 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1465 (yy_hold_char) = *++(yy_c_buf_p);
1469 #endif /* ifndef YY_NO_INPUT */
1471 /** Immediately switch to a different input stream.
1472 * @param input_file A readable stream.
1474 * @note This function does not reset the start condition to @c INITIAL .
1476 void yyrestart (FILE * input_file )
1479 if ( ! YY_CURRENT_BUFFER ){
1480 yyensure_buffer_stack ();
1481 YY_CURRENT_BUFFER_LVALUE =
1482 yy_create_buffer(yyin,YY_BUF_SIZE );
1485 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1486 yy_load_buffer_state( );
1489 /** Switch to a different input buffer.
1490 * @param new_buffer The new input buffer.
1493 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1496 /* TODO. We should be able to replace this entire function body
1498 * yypop_buffer_state();
1499 * yypush_buffer_state(new_buffer);
1501 yyensure_buffer_stack ();
1502 if ( YY_CURRENT_BUFFER == new_buffer )
1505 if ( YY_CURRENT_BUFFER )
1507 /* Flush out information for old buffer. */
1508 *(yy_c_buf_p) = (yy_hold_char);
1509 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1510 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1513 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1514 yy_load_buffer_state( );
1516 /* We don't actually know whether we did this switch during
1517 * EOF (yywrap()) processing, but the only time this flag
1518 * is looked at is after yywrap() is called, so it's safe
1519 * to go ahead and always set it.
1521 (yy_did_buffer_switch_on_eof) = 1;
1524 static void yy_load_buffer_state (void)
1526 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1527 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1528 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1529 (yy_hold_char) = *(yy_c_buf_p);
1532 /** Allocate and initialize an input buffer state.
1533 * @param file A readable stream.
1534 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1536 * @return the allocated buffer state.
1538 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1542 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1544 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1546 b->yy_buf_size = size;
1548 /* yy_ch_buf has to be 2 characters longer than the size given because
1549 * we need to put in 2 end-of-buffer characters.
1551 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1552 if ( ! b->yy_ch_buf )
1553 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1555 b->yy_is_our_buffer = 1;
1557 yy_init_buffer(b,file );
1562 /** Destroy the buffer.
1563 * @param b a buffer created with yy_create_buffer()
1566 void yy_delete_buffer (YY_BUFFER_STATE b )
1572 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1573 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1575 if ( b->yy_is_our_buffer )
1576 yyfree((void *) b->yy_ch_buf );
1578 yyfree((void *) b );
1582 extern int isatty (int );
1583 #endif /* __cplusplus */
1585 /* Initializes or reinitializes a buffer.
1586 * This function is sometimes called more than once on the same buffer,
1587 * such as during a yyrestart() or at EOF.
1589 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1594 yy_flush_buffer(b );
1596 b->yy_input_file = file;
1597 b->yy_fill_buffer = 1;
1599 /* If b is the current buffer, then yy_init_buffer was _probably_
1600 * called from yyrestart() or through yy_get_next_buffer.
1601 * In that case, we don't want to reset the lineno or column.
1603 if (b != YY_CURRENT_BUFFER){
1604 b->yy_bs_lineno = 1;
1605 b->yy_bs_column = 0;
1608 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1613 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1614 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1617 void yy_flush_buffer (YY_BUFFER_STATE b )
1624 /* We always need two end-of-buffer characters. The first causes
1625 * a transition to the end-of-buffer state. The second causes
1626 * a jam in that state.
1628 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1629 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1631 b->yy_buf_pos = &b->yy_ch_buf[0];
1634 b->yy_buffer_status = YY_BUFFER_NEW;
1636 if ( b == YY_CURRENT_BUFFER )
1637 yy_load_buffer_state( );
1640 /** Pushes the new state onto the stack. The new state becomes
1641 * the current state. This function will allocate the stack
1643 * @param new_buffer The new state.
1646 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1648 if (new_buffer == NULL)
1651 yyensure_buffer_stack();
1653 /* This block is copied from yy_switch_to_buffer. */
1654 if ( YY_CURRENT_BUFFER )
1656 /* Flush out information for old buffer. */
1657 *(yy_c_buf_p) = (yy_hold_char);
1658 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1659 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1662 /* Only push if top exists. Otherwise, replace top. */
1663 if (YY_CURRENT_BUFFER)
1664 (yy_buffer_stack_top)++;
1665 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1667 /* copied from yy_switch_to_buffer. */
1668 yy_load_buffer_state( );
1669 (yy_did_buffer_switch_on_eof) = 1;
1672 /** Removes and deletes the top of the stack, if present.
1673 * The next element becomes the new top.
1676 void yypop_buffer_state (void)
1678 if (!YY_CURRENT_BUFFER)
1681 yy_delete_buffer(YY_CURRENT_BUFFER );
1682 YY_CURRENT_BUFFER_LVALUE = NULL;
1683 if ((yy_buffer_stack_top) > 0)
1684 --(yy_buffer_stack_top);
1686 if (YY_CURRENT_BUFFER) {
1687 yy_load_buffer_state( );
1688 (yy_did_buffer_switch_on_eof) = 1;
1692 /* Allocates the stack if it does not exist.
1693 * Guarantees space for at least one push.
1695 static void yyensure_buffer_stack (void)
1697 yy_size_t num_to_alloc;
1699 if (!(yy_buffer_stack)) {
1701 /* First allocation is just for 2 elements, since we don't know if this
1702 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1703 * immediate realloc on the next call.
1706 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1707 (num_to_alloc * sizeof(struct yy_buffer_state*)
1709 if ( ! (yy_buffer_stack) )
1710 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1712 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1714 (yy_buffer_stack_max) = num_to_alloc;
1715 (yy_buffer_stack_top) = 0;
1719 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1721 /* Increase the buffer to prepare for a possible push. */
1722 int grow_size = 8 /* arbitrary grow size */;
1724 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1725 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1727 num_to_alloc * sizeof(struct yy_buffer_state*)
1729 if ( ! (yy_buffer_stack) )
1730 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1732 /* zero only the new slots.*/
1733 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1734 (yy_buffer_stack_max) = num_to_alloc;
1738 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1739 * @param base the character buffer
1740 * @param size the size in bytes of the character buffer
1742 * @return the newly allocated buffer state object.
1744 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1749 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1750 base[size-1] != YY_END_OF_BUFFER_CHAR )
1751 /* They forgot to leave room for the EOB's. */
1754 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1756 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1758 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1759 b->yy_buf_pos = b->yy_ch_buf = base;
1760 b->yy_is_our_buffer = 0;
1761 b->yy_input_file = 0;
1762 b->yy_n_chars = b->yy_buf_size;
1763 b->yy_is_interactive = 0;
1765 b->yy_fill_buffer = 0;
1766 b->yy_buffer_status = YY_BUFFER_NEW;
1768 yy_switch_to_buffer(b );
1773 /** Setup the input buffer state to scan a string. The next call to yylex() will
1774 * scan from a @e copy of @a str.
1775 * @param yystr a NUL-terminated string to scan
1777 * @return the newly allocated buffer state object.
1778 * @note If you want to scan bytes that may contain NUL values, then use
1779 * yy_scan_bytes() instead.
1781 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1784 return yy_scan_bytes(yystr,strlen(yystr) );
1787 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1788 * scan from a @e copy of @a bytes.
1789 * @param bytes the byte buffer to scan
1790 * @param len the number of bytes in the buffer pointed to by @a bytes.
1792 * @return the newly allocated buffer state object.
1794 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1800 /* Get memory for full buffer, including space for trailing EOB's. */
1801 n = _yybytes_len + 2;
1802 buf = (char *) yyalloc(n );
1804 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1806 for ( i = 0; i < _yybytes_len; ++i )
1807 buf[i] = yybytes[i];
1809 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1811 b = yy_scan_buffer(buf,n );
1813 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1815 /* It's okay to grow etc. this buffer, and we should throw it
1816 * away when we're done.
1818 b->yy_is_our_buffer = 1;
1823 #ifndef YY_EXIT_FAILURE
1824 #define YY_EXIT_FAILURE 2
1827 static void yy_fatal_error (yyconst char* msg )
1829 (void) fprintf( stderr, "%s\n", msg );
1830 exit( YY_EXIT_FAILURE );
1833 /* Redefine yyless() so it works in section 3 code. */
1839 /* Undo effects of setting up yytext. */ \
1840 int yyless_macro_arg = (n); \
1841 YY_LESS_LINENO(yyless_macro_arg);\
1842 yytext[yyleng] = (yy_hold_char); \
1843 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1844 (yy_hold_char) = *(yy_c_buf_p); \
1845 *(yy_c_buf_p) = '\0'; \
1846 yyleng = yyless_macro_arg; \
1850 /* Accessor methods (get/set functions) to struct members. */
1852 /** Get the current line number.
1855 int yyget_lineno (void)
1861 /** Get the input stream.
1864 FILE *yyget_in (void)
1869 /** Get the output stream.
1872 FILE *yyget_out (void)
1877 /** Get the length of the current token.
1880 yy_size_t yyget_leng (void)
1885 /** Get the current token.
1889 char *yyget_text (void)
1894 /** Set the current line number.
1895 * @param line_number
1898 void yyset_lineno (int line_number )
1901 yylineno = line_number;
1904 /** Set the input stream. This does not discard the current
1906 * @param in_str A readable stream.
1908 * @see yy_switch_to_buffer
1910 void yyset_in (FILE * in_str )
1915 void yyset_out (FILE * out_str )
1920 int yyget_debug (void)
1922 return yy_flex_debug;
1925 void yyset_debug (int bdebug )
1927 yy_flex_debug = bdebug ;
1930 static int yy_init_globals (void)
1932 /* Initialization is the same as for the non-reentrant scanner.
1933 * This function is called from yylex_destroy(), so don't allocate here.
1936 (yy_buffer_stack) = 0;
1937 (yy_buffer_stack_top) = 0;
1938 (yy_buffer_stack_max) = 0;
1939 (yy_c_buf_p) = (char *) 0;
1943 /* Defined in main.c */
1952 /* For future reference: Set errno on error, since we are called by
1958 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1959 int yylex_destroy (void)
1962 /* Pop the buffer stack, destroying each element. */
1963 while(YY_CURRENT_BUFFER){
1964 yy_delete_buffer(YY_CURRENT_BUFFER );
1965 YY_CURRENT_BUFFER_LVALUE = NULL;
1966 yypop_buffer_state();
1969 /* Destroy the stack itself. */
1970 yyfree((yy_buffer_stack) );
1971 (yy_buffer_stack) = NULL;
1973 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1974 * yylex() is called, initialization will occur. */
1981 * Internal utility routines.
1985 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1988 for ( i = 0; i < n; ++i )
1993 #ifdef YY_NEED_STRLEN
1994 static int yy_flex_strlen (yyconst char * s )
1997 for ( n = 0; s[n]; ++n )
2004 void *yyalloc (yy_size_t size )
2006 return (void *) malloc( size );
2009 void *yyrealloc (void * ptr, yy_size_t size )
2011 /* The cast to (char *) in the following accommodates both
2012 * implementations that use char* generic pointers, and those
2013 * that use void* generic pointers. It works with the latter
2014 * because both ANSI C and C++ allow castless assignment from
2015 * any pointer type to void*, and deal with argument conversions
2016 * as though doing an assignment.
2018 return (void *) realloc( (char *) ptr, size );
2021 void yyfree (void * ptr )
2023 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2026 #define YYTABLES_NAME "yytables"
2032 /* Needed for lex, though not flex. */
2033 int yywrap(void) { return 1; }