Import binutils 2.18
[nacl-binutils.git] / binutils / arlex.c
blob5dda7b8ee69f35d2bb14b4d40903ea9627f0e3da
2 #line 3 "arlex.c"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
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
13 #define FLEX_BETA
14 #endif
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
24 /* end standard C headers. */
26 /* flex integer type definitions */
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
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
40 #endif
42 #include <inttypes.h>
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 #else
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;
56 #endif /* ! C99 */
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
87 #endif /* ! FLEXINT_H */
89 #ifdef __cplusplus
91 /* The "const" storage-class-modifier is valid. */
92 #define YY_USE_CONST
94 #else /* ! __cplusplus */
96 #if __STDC__
98 #define YY_USE_CONST
100 #endif /* __STDC__ */
101 #endif /* ! __cplusplus */
103 #ifdef YY_USE_CONST
104 #define yyconst const
105 #else
106 #define yyconst
107 #endif
109 /* Returned upon end-of-file. */
110 #define YY_NULL 0
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
115 * double cast.
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
127 * compatibility.
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. */
141 #ifndef YY_BUF_SIZE
142 #define YY_BUF_SIZE 16384
143 #endif
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;
152 #endif
154 extern int yyleng;
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. */
165 #define yyless(n) \
166 do \
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 */ \
176 while ( 0 )
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;
188 #endif
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
194 FILE *yy_input_file;
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
200 * characters.
202 yy_size_t yy_buf_size;
204 /* Number of characters read into yy_ch_buf, not including EOB
205 * characters.
207 int yy_n_chars;
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
211 * delete it.
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
218 * each newline.
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
224 * not.
226 int yy_at_bol;
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
232 * end of it.
234 int yy_fill_buffer;
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
262 * "scanner state".
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)] \
268 : NULL)
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 */
278 int yyleng;
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;
344 extern int yylineno;
346 int yylineno = 1;
348 extern char *yytext;
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; \
363 *yy_cp = '\0'; \
364 (yy_c_buf_p) = yy_cp;
366 #define YY_NUM_RULES 40
367 #define YY_END_OF_BUFFER 41
368 /* This struct is not used in this scanner,
369 but its presence is necessary. */
370 struct yy_trans_info
372 flex_int32_t yy_verify;
373 flex_int32_t yy_nxt;
375 static yyconst flex_int16_t yy_accept[177] =
376 { 0,
377 0, 0, 41, 40, 39, 38, 35, 32, 33, 36,
378 40, 34, 37, 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, 36, 31, 37, 35,
381 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
382 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
383 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
384 35, 35, 7, 35, 35, 35, 35, 35, 35, 35,
385 35, 35, 35, 35, 35, 35, 22, 35, 35, 35,
386 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
388 35, 35, 35, 10, 11, 12, 35, 15, 35, 35,
389 35, 35, 35, 35, 35, 35, 35, 25, 26, 27,
390 35, 30, 35, 35, 35, 3, 35, 35, 35, 35,
391 35, 35, 35, 35, 35, 18, 35, 35, 35, 35,
392 35, 35, 35, 1, 2, 4, 5, 35, 35, 35,
393 35, 35, 16, 17, 19, 20, 35, 35, 35, 35,
394 35, 35, 8, 9, 13, 14, 35, 23, 24, 28,
395 29, 35, 35, 6, 21, 0
398 static yyconst flex_int32_t yy_ec[256] =
399 { 0,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 3, 1, 1, 1, 4, 1, 1, 1, 5,
404 6, 7, 8, 9, 4, 4, 4, 4, 4, 4,
405 4, 4, 4, 4, 4, 4, 4, 4, 10, 1,
406 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
407 4, 17, 18, 4, 4, 19, 20, 21, 22, 23,
408 4, 24, 25, 26, 27, 28, 4, 29, 30, 4,
409 1, 4, 1, 1, 4, 1, 31, 32, 33, 34,
411 35, 36, 4, 37, 38, 4, 4, 39, 40, 41,
412 42, 43, 4, 44, 45, 46, 47, 48, 4, 49,
413 50, 4, 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,
427 1, 1, 1, 1, 1
430 static yyconst flex_int32_t yy_meta[51] =
431 { 0,
432 1, 2, 1, 3, 1, 1, 1, 1, 1, 1,
433 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
434 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
435 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
436 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
439 static yyconst flex_int16_t yy_base[180] =
440 { 0,
441 0, 0, 193, 194, 194, 194, 0, 194, 194, 0,
442 190, 194, 0, 177, 32, 37, 32, 163, 174, 170,
443 164, 171, 174, 169, 149, 15, 22, 17, 135, 146,
444 142, 136, 143, 146, 141, 0, 0, 194, 0, 161,
445 159, 158, 153, 147, 156, 143, 149, 148, 141, 150,
446 141, 135, 138, 127, 125, 124, 119, 113, 122, 109,
447 115, 114, 107, 116, 107, 101, 104, 43, 136, 135,
448 130, 129, 0, 119, 123, 118, 114, 118, 119, 122,
449 124, 25, 104, 103, 98, 97, 0, 87, 91, 86,
450 82, 86, 87, 90, 92, 105, 100, 97, 94, 93,
452 105, 106, 102, 0, 0, 0, 104, 0, 92, 75,
453 70, 67, 64, 63, 75, 76, 72, 0, 0, 0,
454 74, 0, 62, 91, 88, 0, 86, 85, 73, 85,
455 79, 83, 70, 62, 59, 0, 57, 56, 44, 56,
456 50, 54, 41, 0, 0, 0, 0, 63, 58, 59,
457 67, 66, 0, 0, 0, 0, 38, 33, 34, 42,
458 41, 51, 0, 0, 0, 0, 30, 0, 0, 0,
459 0, 43, 21, 0, 0, 194, 65, 66, 69
462 static yyconst flex_int16_t yy_def[180] =
463 { 0,
464 176, 1, 176, 176, 176, 176, 177, 176, 176, 178,
465 176, 176, 179, 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, 178, 176, 179, 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,
471 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,
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, 177, 177, 177, 177, 177,
480 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
481 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
482 177, 177, 177, 177, 177, 0, 176, 176, 176
485 static yyconst flex_int16_t yy_nxt[245] =
486 { 0,
487 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
488 14, 7, 15, 16, 17, 18, 19, 7, 20, 7,
489 7, 21, 7, 22, 23, 7, 7, 24, 7, 7,
490 25, 7, 26, 27, 28, 29, 30, 7, 31, 7,
491 7, 32, 7, 33, 34, 7, 7, 35, 7, 7,
492 41, 43, 45, 55, 44, 42, 57, 59, 56, 58,
493 46, 96, 97, 110, 111, 60, 37, 36, 37, 39,
494 175, 39, 174, 173, 172, 171, 170, 169, 168, 167,
495 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
496 156, 155, 154, 153, 152, 151, 150, 149, 148, 147,
498 146, 145, 144, 143, 142, 141, 140, 139, 138, 137,
499 136, 135, 134, 133, 132, 131, 130, 129, 128, 127,
500 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
501 116, 115, 114, 113, 112, 109, 108, 107, 106, 105,
502 104, 103, 102, 101, 100, 99, 98, 95, 94, 93,
503 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
504 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
505 72, 71, 70, 69, 68, 67, 66, 65, 64, 63,
506 62, 61, 54, 53, 52, 51, 50, 49, 48, 47,
507 40, 38, 176, 3, 176, 176, 176, 176, 176, 176,
509 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
510 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
511 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
512 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
513 176, 176, 176, 176
516 static yyconst flex_int16_t yy_chk[245] =
517 { 0,
518 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
519 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
520 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
521 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
522 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
523 15, 16, 17, 26, 16, 15, 27, 28, 26, 27,
524 17, 68, 68, 82, 82, 28, 178, 177, 178, 179,
525 173, 179, 172, 167, 162, 161, 160, 159, 158, 157,
526 152, 151, 150, 149, 148, 143, 142, 141, 140, 139,
527 138, 137, 135, 134, 133, 132, 131, 130, 129, 128,
529 127, 125, 124, 123, 121, 117, 116, 115, 114, 113,
530 112, 111, 110, 109, 107, 103, 102, 101, 100, 99,
531 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
532 88, 86, 85, 84, 83, 81, 80, 79, 78, 77,
533 76, 75, 74, 72, 71, 70, 69, 67, 66, 65,
534 64, 63, 62, 61, 60, 59, 58, 57, 56, 55,
535 54, 53, 52, 51, 50, 49, 48, 47, 46, 45,
536 44, 43, 42, 41, 40, 35, 34, 33, 32, 31,
537 30, 29, 25, 24, 23, 22, 21, 20, 19, 18,
538 14, 11, 3, 176, 176, 176, 176, 176, 176, 176,
540 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
541 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
542 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
543 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
544 176, 176, 176, 176
547 static yy_state_type yy_last_accepting_state;
548 static char *yy_last_accepting_cpos;
550 extern int yy_flex_debug;
551 int yy_flex_debug = 0;
553 /* The intent behind this definition is that it'll catch
554 * any uses of REJECT which flex missed.
556 #define REJECT reject_used_but_not_detected
557 #define yymore() yymore_used_but_not_detected
558 #define YY_MORE_ADJ 0
559 #define YY_RESTORE_YY_MORE_OFFSET
560 char *yytext;
561 #line 1 "arlex.l"
562 #line 2 "arlex.l"
563 /* arlex.l - Strange script language lexer */
565 /* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004, 2007
566 Free Software Foundation, Inc.
568 This file is part of GNU Binutils.
570 This program is free software; you can redistribute it and/or modify
571 it under the terms of the GNU General Public License as published by
572 the Free Software Foundation; either version 3 of the License, or
573 (at your option) any later version.
575 This program is distributed in the hope that it will be useful,
576 but WITHOUT ANY WARRANTY; without even the implied warranty of
577 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
578 GNU General Public License for more details.
580 You should have received a copy of the GNU General Public License
581 along with this program; if not, write to the Free Software
582 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
583 MA 02110-1301, USA. */
586 /* Contributed by Steve Chamberlain <sac@cygnus.com>. */
588 #define DONTDECLARE_MALLOC
589 #include "ansidecl.h"
590 #include "libiberty.h"
591 #include "arparse.h"
593 #define YY_NO_UNPUT
595 extern int yylex (void);
597 int linenumber;
598 #line 599 "arlex.c"
600 #define INITIAL 0
602 #ifndef YY_NO_UNISTD_H
603 /* Special case for "unistd.h", since it is non-ANSI. We include it way
604 * down here because we want the user's section 1 to have been scanned first.
605 * The user has a chance to override it with an option.
607 #include <unistd.h>
608 #endif
610 #ifndef YY_EXTRA_TYPE
611 #define YY_EXTRA_TYPE void *
612 #endif
614 static int yy_init_globals (void );
616 /* Macros after this point can all be overridden by user definitions in
617 * section 1.
620 #ifndef YY_SKIP_YYWRAP
621 #ifdef __cplusplus
622 extern "C" int yywrap (void );
623 #else
624 extern int yywrap (void );
625 #endif
626 #endif
628 static void yyunput (int c,char *buf_ptr );
630 #ifndef yytext_ptr
631 static void yy_flex_strncpy (char *,yyconst char *,int );
632 #endif
634 #ifdef YY_NEED_STRLEN
635 static int yy_flex_strlen (yyconst char * );
636 #endif
638 #ifndef YY_NO_INPUT
640 #ifdef __cplusplus
641 static int yyinput (void );
642 #else
643 static int input (void );
644 #endif
646 #endif
648 /* Amount of stuff to slurp up with each read. */
649 #ifndef YY_READ_BUF_SIZE
650 #define YY_READ_BUF_SIZE 8192
651 #endif
653 /* Copy whatever the last rule matched to the standard output. */
654 #ifndef ECHO
655 /* This used to be an fputs(), but since the string might contain NUL's,
656 * we now use fwrite().
658 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
659 #endif
661 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
662 * is returned in "result".
664 #ifndef YY_INPUT
665 #define YY_INPUT(buf,result,max_size) \
666 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
668 int c = '*'; \
669 size_t n; \
670 for ( n = 0; n < max_size && \
671 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
672 buf[n] = (char) c; \
673 if ( c == '\n' ) \
674 buf[n++] = (char) c; \
675 if ( c == EOF && ferror( yyin ) ) \
676 YY_FATAL_ERROR( "input in flex scanner failed" ); \
677 result = n; \
679 else \
681 errno=0; \
682 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
684 if( errno != EINTR) \
686 YY_FATAL_ERROR( "input in flex scanner failed" ); \
687 break; \
689 errno=0; \
690 clearerr(yyin); \
695 #endif
697 /* No semi-colon after return; correct usage is to write "yyterminate();" -
698 * we don't want an extra ';' after the "return" because that will cause
699 * some compilers to complain about unreachable statements.
701 #ifndef yyterminate
702 #define yyterminate() return YY_NULL
703 #endif
705 /* Number of entries by which start-condition stack grows. */
706 #ifndef YY_START_STACK_INCR
707 #define YY_START_STACK_INCR 25
708 #endif
710 /* Report a fatal error. */
711 #ifndef YY_FATAL_ERROR
712 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
713 #endif
715 /* end tables serialization structures and prototypes */
717 /* Default declaration of generated scanner - a define so the user can
718 * easily add parameters.
720 #ifndef YY_DECL
721 #define YY_DECL_IS_OURS 1
723 extern int yylex (void);
725 #define YY_DECL int yylex (void)
726 #endif /* !YY_DECL */
728 /* Code executed at the beginning of each rule, after yytext and yyleng
729 * have been set up.
731 #ifndef YY_USER_ACTION
732 #define YY_USER_ACTION
733 #endif
735 /* Code executed at the end of each rule. */
736 #ifndef YY_BREAK
737 #define YY_BREAK break;
738 #endif
740 #define YY_RULE_SETUP \
741 YY_USER_ACTION
743 /** The main scanner function which does all the work.
745 YY_DECL
747 register yy_state_type yy_current_state;
748 register char *yy_cp, *yy_bp;
749 register int yy_act;
751 #line 42 "arlex.l"
754 #line 755 "arlex.c"
756 if ( !(yy_init) )
758 (yy_init) = 1;
760 #ifdef YY_USER_INIT
761 YY_USER_INIT;
762 #endif
764 if ( ! (yy_start) )
765 (yy_start) = 1; /* first start state */
767 if ( ! yyin )
768 yyin = stdin;
770 if ( ! yyout )
771 yyout = stdout;
773 if ( ! YY_CURRENT_BUFFER ) {
774 yyensure_buffer_stack ();
775 YY_CURRENT_BUFFER_LVALUE =
776 yy_create_buffer(yyin,YY_BUF_SIZE );
779 yy_load_buffer_state( );
782 while ( 1 ) /* loops until end-of-file is reached */
784 yy_cp = (yy_c_buf_p);
786 /* Support of yytext. */
787 *yy_cp = (yy_hold_char);
789 /* yy_bp points to the position in yy_ch_buf of the start of
790 * the current run.
792 yy_bp = yy_cp;
794 yy_current_state = (yy_start);
795 yy_match:
798 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
799 if ( yy_accept[yy_current_state] )
801 (yy_last_accepting_state) = yy_current_state;
802 (yy_last_accepting_cpos) = yy_cp;
804 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
806 yy_current_state = (int) yy_def[yy_current_state];
807 if ( yy_current_state >= 177 )
808 yy_c = yy_meta[(unsigned int) yy_c];
810 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
811 ++yy_cp;
813 while ( yy_base[yy_current_state] != 194 );
815 yy_find_action:
816 yy_act = yy_accept[yy_current_state];
817 if ( yy_act == 0 )
818 { /* have to back up */
819 yy_cp = (yy_last_accepting_cpos);
820 yy_current_state = (yy_last_accepting_state);
821 yy_act = yy_accept[yy_current_state];
824 YY_DO_BEFORE_ACTION;
826 do_action: /* This label is used only to access EOF actions. */
828 switch ( yy_act )
829 { /* beginning of action switch */
830 case 0: /* must back up */
831 /* undo the effects of YY_DO_BEFORE_ACTION */
832 *yy_cp = (yy_hold_char);
833 yy_cp = (yy_last_accepting_cpos);
834 yy_current_state = (yy_last_accepting_state);
835 goto yy_find_action;
837 case 1:
838 YY_RULE_SETUP
839 #line 44 "arlex.l"
840 { return ADDLIB; }
841 YY_BREAK
842 case 2:
843 YY_RULE_SETUP
844 #line 45 "arlex.l"
845 { return ADDMOD; }
846 YY_BREAK
847 case 3:
848 YY_RULE_SETUP
849 #line 46 "arlex.l"
850 { return CLEAR; }
851 YY_BREAK
852 case 4:
853 YY_RULE_SETUP
854 #line 47 "arlex.l"
855 { return CREATE; }
856 YY_BREAK
857 case 5:
858 YY_RULE_SETUP
859 #line 48 "arlex.l"
860 { return DELETE; }
861 YY_BREAK
862 case 6:
863 YY_RULE_SETUP
864 #line 49 "arlex.l"
865 { return DIRECTORY; }
866 YY_BREAK
867 case 7:
868 YY_RULE_SETUP
869 #line 50 "arlex.l"
870 { return END; }
871 YY_BREAK
872 case 8:
873 YY_RULE_SETUP
874 #line 51 "arlex.l"
875 { return EXTRACT; }
876 YY_BREAK
877 case 9:
878 YY_RULE_SETUP
879 #line 52 "arlex.l"
880 { return FULLDIR; }
881 YY_BREAK
882 case 10:
883 YY_RULE_SETUP
884 #line 53 "arlex.l"
885 { return HELP; }
886 YY_BREAK
887 case 11:
888 YY_RULE_SETUP
889 #line 54 "arlex.l"
890 { return LIST; }
891 YY_BREAK
892 case 12:
893 YY_RULE_SETUP
894 #line 55 "arlex.l"
895 { return OPEN; }
896 YY_BREAK
897 case 13:
898 YY_RULE_SETUP
899 #line 56 "arlex.l"
900 { return REPLACE; }
901 YY_BREAK
902 case 14:
903 YY_RULE_SETUP
904 #line 57 "arlex.l"
905 { return VERBOSE; }
906 YY_BREAK
907 case 15:
908 YY_RULE_SETUP
909 #line 58 "arlex.l"
910 { return SAVE; }
911 YY_BREAK
912 case 16:
913 YY_RULE_SETUP
914 #line 59 "arlex.l"
915 { return ADDLIB; }
916 YY_BREAK
917 case 17:
918 YY_RULE_SETUP
919 #line 60 "arlex.l"
920 { return ADDMOD; }
921 YY_BREAK
922 case 18:
923 YY_RULE_SETUP
924 #line 61 "arlex.l"
925 { return CLEAR; }
926 YY_BREAK
927 case 19:
928 YY_RULE_SETUP
929 #line 62 "arlex.l"
930 { return CREATE; }
931 YY_BREAK
932 case 20:
933 YY_RULE_SETUP
934 #line 63 "arlex.l"
935 { return DELETE; }
936 YY_BREAK
937 case 21:
938 YY_RULE_SETUP
939 #line 64 "arlex.l"
940 { return DIRECTORY; }
941 YY_BREAK
942 case 22:
943 YY_RULE_SETUP
944 #line 65 "arlex.l"
945 { return END; }
946 YY_BREAK
947 case 23:
948 YY_RULE_SETUP
949 #line 66 "arlex.l"
950 { return EXTRACT; }
951 YY_BREAK
952 case 24:
953 YY_RULE_SETUP
954 #line 67 "arlex.l"
955 { return FULLDIR; }
956 YY_BREAK
957 case 25:
958 YY_RULE_SETUP
959 #line 68 "arlex.l"
960 { return HELP; }
961 YY_BREAK
962 case 26:
963 YY_RULE_SETUP
964 #line 69 "arlex.l"
965 { return LIST; }
966 YY_BREAK
967 case 27:
968 YY_RULE_SETUP
969 #line 70 "arlex.l"
970 { return OPEN; }
971 YY_BREAK
972 case 28:
973 YY_RULE_SETUP
974 #line 71 "arlex.l"
975 { return REPLACE; }
976 YY_BREAK
977 case 29:
978 YY_RULE_SETUP
979 #line 72 "arlex.l"
980 { return VERBOSE; }
981 YY_BREAK
982 case 30:
983 YY_RULE_SETUP
984 #line 73 "arlex.l"
985 { return SAVE; }
986 YY_BREAK
987 case 31:
988 /* rule 31 can match eol */
989 YY_RULE_SETUP
990 #line 74 "arlex.l"
991 { linenumber ++; }
992 YY_BREAK
993 case 32:
994 YY_RULE_SETUP
995 #line 75 "arlex.l"
996 { return '('; }
997 YY_BREAK
998 case 33:
999 YY_RULE_SETUP
1000 #line 76 "arlex.l"
1001 { return ')'; }
1002 YY_BREAK
1003 case 34:
1004 YY_RULE_SETUP
1005 #line 77 "arlex.l"
1006 { return ','; }
1007 YY_BREAK
1008 case 35:
1009 YY_RULE_SETUP
1010 #line 78 "arlex.l"
1012 yylval.name = xstrdup (yytext);
1013 return FILENAME;
1015 YY_BREAK
1016 case 36:
1017 YY_RULE_SETUP
1018 #line 82 "arlex.l"
1020 YY_BREAK
1021 case 37:
1022 YY_RULE_SETUP
1023 #line 83 "arlex.l"
1025 YY_BREAK
1026 case 38:
1027 YY_RULE_SETUP
1028 #line 84 "arlex.l"
1030 YY_BREAK
1031 case 39:
1032 /* rule 39 can match eol */
1033 YY_RULE_SETUP
1034 #line 85 "arlex.l"
1035 { linenumber ++; return NEWLINE; }
1036 YY_BREAK
1037 case 40:
1038 YY_RULE_SETUP
1039 #line 87 "arlex.l"
1040 ECHO;
1041 YY_BREAK
1042 #line 1043 "arlex.c"
1043 case YY_STATE_EOF(INITIAL):
1044 yyterminate();
1046 case YY_END_OF_BUFFER:
1048 /* Amount of text matched not including the EOB char. */
1049 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1051 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1052 *yy_cp = (yy_hold_char);
1053 YY_RESTORE_YY_MORE_OFFSET
1055 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1057 /* We're scanning a new file or input source. It's
1058 * possible that this happened because the user
1059 * just pointed yyin at a new source and called
1060 * yylex(). If so, then we have to assure
1061 * consistency between YY_CURRENT_BUFFER and our
1062 * globals. Here is the right place to do so, because
1063 * this is the first action (other than possibly a
1064 * back-up) that will match for the new input source.
1066 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1067 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1068 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1071 /* Note that here we test for yy_c_buf_p "<=" to the position
1072 * of the first EOB in the buffer, since yy_c_buf_p will
1073 * already have been incremented past the NUL character
1074 * (since all states make transitions on EOB to the
1075 * end-of-buffer state). Contrast this with the test
1076 * in input().
1078 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1079 { /* This was really a NUL. */
1080 yy_state_type yy_next_state;
1082 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1084 yy_current_state = yy_get_previous_state( );
1086 /* Okay, we're now positioned to make the NUL
1087 * transition. We couldn't have
1088 * yy_get_previous_state() go ahead and do it
1089 * for us because it doesn't know how to deal
1090 * with the possibility of jamming (and we don't
1091 * want to build jamming into it because then it
1092 * will run more slowly).
1095 yy_next_state = yy_try_NUL_trans( yy_current_state );
1097 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1099 if ( yy_next_state )
1101 /* Consume the NUL. */
1102 yy_cp = ++(yy_c_buf_p);
1103 yy_current_state = yy_next_state;
1104 goto yy_match;
1107 else
1109 yy_cp = (yy_c_buf_p);
1110 goto yy_find_action;
1114 else switch ( yy_get_next_buffer( ) )
1116 case EOB_ACT_END_OF_FILE:
1118 (yy_did_buffer_switch_on_eof) = 0;
1120 if ( yywrap( ) )
1122 /* Note: because we've taken care in
1123 * yy_get_next_buffer() to have set up
1124 * yytext, we can now set up
1125 * yy_c_buf_p so that if some total
1126 * hoser (like flex itself) wants to
1127 * call the scanner after we return the
1128 * YY_NULL, it'll still work - another
1129 * YY_NULL will get returned.
1131 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1133 yy_act = YY_STATE_EOF(YY_START);
1134 goto do_action;
1137 else
1139 if ( ! (yy_did_buffer_switch_on_eof) )
1140 YY_NEW_FILE;
1142 break;
1145 case EOB_ACT_CONTINUE_SCAN:
1146 (yy_c_buf_p) =
1147 (yytext_ptr) + yy_amount_of_matched_text;
1149 yy_current_state = yy_get_previous_state( );
1151 yy_cp = (yy_c_buf_p);
1152 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1153 goto yy_match;
1155 case EOB_ACT_LAST_MATCH:
1156 (yy_c_buf_p) =
1157 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1159 yy_current_state = yy_get_previous_state( );
1161 yy_cp = (yy_c_buf_p);
1162 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1163 goto yy_find_action;
1165 break;
1168 default:
1169 YY_FATAL_ERROR(
1170 "fatal flex scanner internal error--no action found" );
1171 } /* end of action switch */
1172 } /* end of scanning one token */
1173 } /* end of yylex */
1175 /* yy_get_next_buffer - try to read in a new buffer
1177 * Returns a code representing an action:
1178 * EOB_ACT_LAST_MATCH -
1179 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1180 * EOB_ACT_END_OF_FILE - end of file
1182 static int yy_get_next_buffer (void)
1184 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1185 register char *source = (yytext_ptr);
1186 register int number_to_move, i;
1187 int ret_val;
1189 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1190 YY_FATAL_ERROR(
1191 "fatal flex scanner internal error--end of buffer missed" );
1193 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1194 { /* Don't try to fill the buffer, so this is an EOF. */
1195 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1197 /* We matched a single character, the EOB, so
1198 * treat this as a final EOF.
1200 return EOB_ACT_END_OF_FILE;
1203 else
1205 /* We matched some text prior to the EOB, first
1206 * process it.
1208 return EOB_ACT_LAST_MATCH;
1212 /* Try to read more data. */
1214 /* First move last chars to start of buffer. */
1215 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1217 for ( i = 0; i < number_to_move; ++i )
1218 *(dest++) = *(source++);
1220 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1221 /* don't do the read, it's not guaranteed to return an EOF,
1222 * just force an EOF
1224 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1226 else
1228 int num_to_read =
1229 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1231 while ( num_to_read <= 0 )
1232 { /* Not enough room in the buffer - grow it. */
1234 /* just a shorter name for the current buffer */
1235 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1237 int yy_c_buf_p_offset =
1238 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1240 if ( b->yy_is_our_buffer )
1242 int new_size = b->yy_buf_size * 2;
1244 if ( new_size <= 0 )
1245 b->yy_buf_size += b->yy_buf_size / 8;
1246 else
1247 b->yy_buf_size *= 2;
1249 b->yy_ch_buf = (char *)
1250 /* Include room in for 2 EOB chars. */
1251 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1253 else
1254 /* Can't grow it, we don't own it. */
1255 b->yy_ch_buf = 0;
1257 if ( ! b->yy_ch_buf )
1258 YY_FATAL_ERROR(
1259 "fatal error - scanner input buffer overflow" );
1261 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1263 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1264 number_to_move - 1;
1268 if ( num_to_read > YY_READ_BUF_SIZE )
1269 num_to_read = YY_READ_BUF_SIZE;
1271 /* Read in more data. */
1272 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1273 (yy_n_chars), (size_t) num_to_read );
1275 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1278 if ( (yy_n_chars) == 0 )
1280 if ( number_to_move == YY_MORE_ADJ )
1282 ret_val = EOB_ACT_END_OF_FILE;
1283 yyrestart(yyin );
1286 else
1288 ret_val = EOB_ACT_LAST_MATCH;
1289 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1290 YY_BUFFER_EOF_PENDING;
1294 else
1295 ret_val = EOB_ACT_CONTINUE_SCAN;
1297 (yy_n_chars) += number_to_move;
1298 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1299 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1301 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1303 return ret_val;
1306 /* yy_get_previous_state - get the state just before the EOB char was reached */
1308 static yy_state_type yy_get_previous_state (void)
1310 register yy_state_type yy_current_state;
1311 register char *yy_cp;
1313 yy_current_state = (yy_start);
1315 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1317 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1318 if ( yy_accept[yy_current_state] )
1320 (yy_last_accepting_state) = yy_current_state;
1321 (yy_last_accepting_cpos) = yy_cp;
1323 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1325 yy_current_state = (int) yy_def[yy_current_state];
1326 if ( yy_current_state >= 177 )
1327 yy_c = yy_meta[(unsigned int) yy_c];
1329 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1332 return yy_current_state;
1335 /* yy_try_NUL_trans - try to make a transition on the NUL character
1337 * synopsis
1338 * next_state = yy_try_NUL_trans( current_state );
1340 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1342 register int yy_is_jam;
1343 register char *yy_cp = (yy_c_buf_p);
1345 register YY_CHAR yy_c = 1;
1346 if ( yy_accept[yy_current_state] )
1348 (yy_last_accepting_state) = yy_current_state;
1349 (yy_last_accepting_cpos) = yy_cp;
1351 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1353 yy_current_state = (int) yy_def[yy_current_state];
1354 if ( yy_current_state >= 177 )
1355 yy_c = yy_meta[(unsigned int) yy_c];
1357 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1358 yy_is_jam = (yy_current_state == 176);
1360 return yy_is_jam ? 0 : yy_current_state;
1363 static void yyunput (int c, register char * yy_bp )
1365 register char *yy_cp;
1367 yy_cp = (yy_c_buf_p);
1369 /* undo effects of setting up yytext */
1370 *yy_cp = (yy_hold_char);
1372 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1373 { /* need to shift things up to make room */
1374 /* +2 for EOB chars. */
1375 register int number_to_move = (yy_n_chars) + 2;
1376 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1377 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1378 register char *source =
1379 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1381 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1382 *--dest = *--source;
1384 yy_cp += (int) (dest - source);
1385 yy_bp += (int) (dest - source);
1386 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1387 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1389 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1390 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1393 *--yy_cp = (char) c;
1395 (yytext_ptr) = yy_bp;
1396 (yy_hold_char) = *yy_cp;
1397 (yy_c_buf_p) = yy_cp;
1400 #ifndef YY_NO_INPUT
1401 #ifdef __cplusplus
1402 static int yyinput (void)
1403 #else
1404 static int input (void)
1405 #endif
1408 int c;
1410 *(yy_c_buf_p) = (yy_hold_char);
1412 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1414 /* yy_c_buf_p now points to the character we want to return.
1415 * If this occurs *before* the EOB characters, then it's a
1416 * valid NUL; if not, then we've hit the end of the buffer.
1418 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1419 /* This was really a NUL. */
1420 *(yy_c_buf_p) = '\0';
1422 else
1423 { /* need more input */
1424 int offset = (yy_c_buf_p) - (yytext_ptr);
1425 ++(yy_c_buf_p);
1427 switch ( yy_get_next_buffer( ) )
1429 case EOB_ACT_LAST_MATCH:
1430 /* This happens because yy_g_n_b()
1431 * sees that we've accumulated a
1432 * token and flags that we need to
1433 * try matching the token before
1434 * proceeding. But for input(),
1435 * there's no matching to consider.
1436 * So convert the EOB_ACT_LAST_MATCH
1437 * to EOB_ACT_END_OF_FILE.
1440 /* Reset buffer status. */
1441 yyrestart(yyin );
1443 /*FALLTHROUGH*/
1445 case EOB_ACT_END_OF_FILE:
1447 if ( yywrap( ) )
1448 return EOF;
1450 if ( ! (yy_did_buffer_switch_on_eof) )
1451 YY_NEW_FILE;
1452 #ifdef __cplusplus
1453 return yyinput();
1454 #else
1455 return input();
1456 #endif
1459 case EOB_ACT_CONTINUE_SCAN:
1460 (yy_c_buf_p) = (yytext_ptr) + offset;
1461 break;
1466 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1467 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1468 (yy_hold_char) = *++(yy_c_buf_p);
1470 return c;
1472 #endif /* ifndef YY_NO_INPUT */
1474 /** Immediately switch to a different input stream.
1475 * @param input_file A readable stream.
1477 * @note This function does not reset the start condition to @c INITIAL .
1479 void yyrestart (FILE * input_file )
1482 if ( ! YY_CURRENT_BUFFER ){
1483 yyensure_buffer_stack ();
1484 YY_CURRENT_BUFFER_LVALUE =
1485 yy_create_buffer(yyin,YY_BUF_SIZE );
1488 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1489 yy_load_buffer_state( );
1492 /** Switch to a different input buffer.
1493 * @param new_buffer The new input buffer.
1496 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1499 /* TODO. We should be able to replace this entire function body
1500 * with
1501 * yypop_buffer_state();
1502 * yypush_buffer_state(new_buffer);
1504 yyensure_buffer_stack ();
1505 if ( YY_CURRENT_BUFFER == new_buffer )
1506 return;
1508 if ( YY_CURRENT_BUFFER )
1510 /* Flush out information for old buffer. */
1511 *(yy_c_buf_p) = (yy_hold_char);
1512 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1513 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1516 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1517 yy_load_buffer_state( );
1519 /* We don't actually know whether we did this switch during
1520 * EOF (yywrap()) processing, but the only time this flag
1521 * is looked at is after yywrap() is called, so it's safe
1522 * to go ahead and always set it.
1524 (yy_did_buffer_switch_on_eof) = 1;
1527 static void yy_load_buffer_state (void)
1529 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1530 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1531 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1532 (yy_hold_char) = *(yy_c_buf_p);
1535 /** Allocate and initialize an input buffer state.
1536 * @param file A readable stream.
1537 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1539 * @return the allocated buffer state.
1541 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1543 YY_BUFFER_STATE b;
1545 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1546 if ( ! b )
1547 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1549 b->yy_buf_size = size;
1551 /* yy_ch_buf has to be 2 characters longer than the size given because
1552 * we need to put in 2 end-of-buffer characters.
1554 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1555 if ( ! b->yy_ch_buf )
1556 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1558 b->yy_is_our_buffer = 1;
1560 yy_init_buffer(b,file );
1562 return b;
1565 /** Destroy the buffer.
1566 * @param b a buffer created with yy_create_buffer()
1569 void yy_delete_buffer (YY_BUFFER_STATE b )
1572 if ( ! b )
1573 return;
1575 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1576 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1578 if ( b->yy_is_our_buffer )
1579 yyfree((void *) b->yy_ch_buf );
1581 yyfree((void *) b );
1584 #ifndef __cplusplus
1585 extern int isatty (int );
1586 #endif /* __cplusplus */
1588 /* Initializes or reinitializes a buffer.
1589 * This function is sometimes called more than once on the same buffer,
1590 * such as during a yyrestart() or at EOF.
1592 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1595 int oerrno = errno;
1597 yy_flush_buffer(b );
1599 b->yy_input_file = file;
1600 b->yy_fill_buffer = 1;
1602 /* If b is the current buffer, then yy_init_buffer was _probably_
1603 * called from yyrestart() or through yy_get_next_buffer.
1604 * In that case, we don't want to reset the lineno or column.
1606 if (b != YY_CURRENT_BUFFER){
1607 b->yy_bs_lineno = 1;
1608 b->yy_bs_column = 0;
1611 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1613 errno = oerrno;
1616 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1617 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1620 void yy_flush_buffer (YY_BUFFER_STATE b )
1622 if ( ! b )
1623 return;
1625 b->yy_n_chars = 0;
1627 /* We always need two end-of-buffer characters. The first causes
1628 * a transition to the end-of-buffer state. The second causes
1629 * a jam in that state.
1631 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1632 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1634 b->yy_buf_pos = &b->yy_ch_buf[0];
1636 b->yy_at_bol = 1;
1637 b->yy_buffer_status = YY_BUFFER_NEW;
1639 if ( b == YY_CURRENT_BUFFER )
1640 yy_load_buffer_state( );
1643 /** Pushes the new state onto the stack. The new state becomes
1644 * the current state. This function will allocate the stack
1645 * if necessary.
1646 * @param new_buffer The new state.
1649 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1651 if (new_buffer == NULL)
1652 return;
1654 yyensure_buffer_stack();
1656 /* This block is copied from yy_switch_to_buffer. */
1657 if ( YY_CURRENT_BUFFER )
1659 /* Flush out information for old buffer. */
1660 *(yy_c_buf_p) = (yy_hold_char);
1661 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1662 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1665 /* Only push if top exists. Otherwise, replace top. */
1666 if (YY_CURRENT_BUFFER)
1667 (yy_buffer_stack_top)++;
1668 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1670 /* copied from yy_switch_to_buffer. */
1671 yy_load_buffer_state( );
1672 (yy_did_buffer_switch_on_eof) = 1;
1675 /** Removes and deletes the top of the stack, if present.
1676 * The next element becomes the new top.
1679 void yypop_buffer_state (void)
1681 if (!YY_CURRENT_BUFFER)
1682 return;
1684 yy_delete_buffer(YY_CURRENT_BUFFER );
1685 YY_CURRENT_BUFFER_LVALUE = NULL;
1686 if ((yy_buffer_stack_top) > 0)
1687 --(yy_buffer_stack_top);
1689 if (YY_CURRENT_BUFFER) {
1690 yy_load_buffer_state( );
1691 (yy_did_buffer_switch_on_eof) = 1;
1695 /* Allocates the stack if it does not exist.
1696 * Guarantees space for at least one push.
1698 static void yyensure_buffer_stack (void)
1700 int num_to_alloc;
1702 if (!(yy_buffer_stack)) {
1704 /* First allocation is just for 2 elements, since we don't know if this
1705 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1706 * immediate realloc on the next call.
1708 num_to_alloc = 1;
1709 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1710 (num_to_alloc * sizeof(struct yy_buffer_state*)
1713 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1715 (yy_buffer_stack_max) = num_to_alloc;
1716 (yy_buffer_stack_top) = 0;
1717 return;
1720 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1722 /* Increase the buffer to prepare for a possible push. */
1723 int grow_size = 8 /* arbitrary grow size */;
1725 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1726 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1727 ((yy_buffer_stack),
1728 num_to_alloc * sizeof(struct yy_buffer_state*)
1731 /* zero only the new slots.*/
1732 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1733 (yy_buffer_stack_max) = num_to_alloc;
1737 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1738 * @param base the character buffer
1739 * @param size the size in bytes of the character buffer
1741 * @return the newly allocated buffer state object.
1743 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1745 YY_BUFFER_STATE b;
1747 if ( size < 2 ||
1748 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1749 base[size-1] != YY_END_OF_BUFFER_CHAR )
1750 /* They forgot to leave room for the EOB's. */
1751 return 0;
1753 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1754 if ( ! b )
1755 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1757 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1758 b->yy_buf_pos = b->yy_ch_buf = base;
1759 b->yy_is_our_buffer = 0;
1760 b->yy_input_file = 0;
1761 b->yy_n_chars = b->yy_buf_size;
1762 b->yy_is_interactive = 0;
1763 b->yy_at_bol = 1;
1764 b->yy_fill_buffer = 0;
1765 b->yy_buffer_status = YY_BUFFER_NEW;
1767 yy_switch_to_buffer(b );
1769 return b;
1772 /** Setup the input buffer state to scan a string. The next call to yylex() will
1773 * scan from a @e copy of @a str.
1774 * @param yystr a NUL-terminated string to scan
1776 * @return the newly allocated buffer state object.
1777 * @note If you want to scan bytes that may contain NUL values, then use
1778 * yy_scan_bytes() instead.
1780 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1783 return yy_scan_bytes(yystr,strlen(yystr) );
1786 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1787 * scan from a @e copy of @a bytes.
1788 * @param bytes the byte buffer to scan
1789 * @param len the number of bytes in the buffer pointed to by @a bytes.
1791 * @return the newly allocated buffer state object.
1793 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1795 YY_BUFFER_STATE b;
1796 char *buf;
1797 yy_size_t n;
1798 int i;
1800 /* Get memory for full buffer, including space for trailing EOB's. */
1801 n = _yybytes_len + 2;
1802 buf = (char *) yyalloc(n );
1803 if ( ! buf )
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 );
1812 if ( ! b )
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;
1820 return b;
1823 #ifndef YY_EXIT_FAILURE
1824 #define YY_EXIT_FAILURE 2
1825 #endif
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. */
1835 #undef yyless
1836 #define yyless(n) \
1837 do \
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; \
1848 while ( 0 )
1850 /* Accessor methods (get/set functions) to struct members. */
1852 /** Get the current line number.
1855 int yyget_lineno (void)
1858 return yylineno;
1861 /** Get the input stream.
1864 FILE *yyget_in (void)
1866 return yyin;
1869 /** Get the output stream.
1872 FILE *yyget_out (void)
1874 return yyout;
1877 /** Get the length of the current token.
1880 int yyget_leng (void)
1882 return yyleng;
1885 /** Get the current token.
1889 char *yyget_text (void)
1891 return yytext;
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
1905 * input buffer.
1906 * @param in_str A readable stream.
1908 * @see yy_switch_to_buffer
1910 void yyset_in (FILE * in_str )
1912 yyin = in_str ;
1915 void yyset_out (FILE * out_str )
1917 yyout = 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;
1940 (yy_init) = 0;
1941 (yy_start) = 0;
1943 /* Defined in main.c */
1944 #ifdef YY_STDINIT
1945 yyin = stdin;
1946 yyout = stdout;
1947 #else
1948 yyin = (FILE *) 0;
1949 yyout = (FILE *) 0;
1950 #endif
1952 /* For future reference: Set errno on error, since we are called by
1953 * yylex_init()
1955 return 0;
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. */
1975 yy_init_globals( );
1977 return 0;
1981 * Internal utility routines.
1984 #ifndef yytext_ptr
1985 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1987 register int i;
1988 for ( i = 0; i < n; ++i )
1989 s1[i] = s2[i];
1991 #endif
1993 #ifdef YY_NEED_STRLEN
1994 static int yy_flex_strlen (yyconst char * s )
1996 register int n;
1997 for ( n = 0; s[n]; ++n )
2000 return n;
2002 #endif
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"
2028 #line 87 "arlex.l"
2031 #ifndef yywrap
2032 /* Needed for lex, though not flex. */
2033 int yywrap(void) { return 1; }
2034 #endif