2001-03-22 Philip Blundell <philb@gnu.org>
[binutils.git] / binutils / arlex.c
blob23ca1f01dd5bde83343e49c32205e1503f717561
1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header$
5 */
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
11 #include <stdio.h>
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
22 #ifdef __cplusplus
24 #include <stdlib.h>
25 #include <unistd.h>
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
33 #else /* ! __cplusplus */
35 #if __STDC__
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
40 #endif /* __STDC__ */
41 #endif /* ! __cplusplus */
43 #ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46 #include <io.h>
47 #include <stdlib.h>
48 #define YY_USE_CONST
49 #define YY_USE_PROTOS
50 #endif
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
71 * double cast.
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
83 * compatibility.
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
124 #define yyless(n) \
125 do \
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 while ( 0 )
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
146 FILE *yy_input_file;
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
159 int yy_n_chars;
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
163 * delete it.
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
170 * each newline.
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
176 * not.
178 int yy_at_bol;
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
183 int yy_fill_buffer;
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
205 * "scanner state".
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
216 int yyleng;
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1; /* whether we need to initialize */
221 static int yy_start = 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR;
265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266 typedef int yy_state_type;
267 extern char *yytext;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272 static int yy_get_next_buffer YY_PROTO(( void ));
273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
282 *yy_cp = '\0'; \
283 yy_c_buf_p = yy_cp;
285 #define YY_NUM_RULES 40
286 #define YY_END_OF_BUFFER 41
287 static yyconst short int yy_accept[177] =
288 { 0,
289 0, 0, 41, 40, 39, 38, 35, 32, 33, 36,
290 40, 34, 37, 35, 35, 35, 35, 35, 35, 35,
291 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
292 35, 35, 35, 35, 35, 35, 36, 31, 37, 35,
293 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
294 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
295 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
296 35, 35, 7, 35, 35, 35, 35, 35, 35, 35,
297 35, 35, 35, 35, 35, 35, 22, 35, 35, 35,
298 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
300 35, 35, 35, 10, 11, 12, 35, 15, 35, 35,
301 35, 35, 35, 35, 35, 35, 35, 25, 26, 27,
302 35, 30, 35, 35, 35, 3, 35, 35, 35, 35,
303 35, 35, 35, 35, 35, 18, 35, 35, 35, 35,
304 35, 35, 35, 1, 2, 4, 5, 35, 35, 35,
305 35, 35, 16, 17, 19, 20, 35, 35, 35, 35,
306 35, 35, 8, 9, 13, 14, 35, 23, 24, 28,
307 29, 35, 35, 6, 21, 0
310 static yyconst int yy_ec[256] =
311 { 0,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 3, 1, 1, 1, 4, 1, 1, 1, 5,
316 6, 7, 8, 9, 4, 4, 4, 4, 4, 4,
317 4, 4, 4, 4, 4, 4, 4, 4, 10, 1,
318 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
319 4, 17, 18, 4, 4, 19, 20, 21, 22, 23,
320 4, 24, 25, 26, 27, 28, 4, 29, 30, 4,
321 1, 1, 1, 1, 4, 1, 31, 32, 33, 34,
323 35, 36, 4, 37, 38, 4, 4, 39, 40, 41,
324 42, 43, 4, 44, 45, 46, 47, 48, 4, 49,
325 50, 4, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1
342 static yyconst int yy_meta[51] =
343 { 0,
344 1, 2, 1, 3, 1, 1, 1, 1, 1, 1,
345 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
346 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
347 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
348 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
351 static yyconst short int yy_base[180] =
352 { 0,
353 0, 0, 193, 194, 194, 194, 0, 194, 194, 0,
354 190, 194, 0, 177, 32, 37, 32, 163, 174, 170,
355 164, 171, 174, 169, 149, 15, 22, 17, 135, 146,
356 142, 136, 143, 146, 141, 0, 0, 194, 0, 161,
357 159, 158, 153, 147, 156, 143, 149, 148, 141, 150,
358 141, 135, 138, 127, 125, 124, 119, 113, 122, 109,
359 115, 114, 107, 116, 107, 101, 104, 43, 136, 135,
360 130, 129, 0, 119, 123, 118, 114, 118, 119, 122,
361 124, 25, 104, 103, 98, 97, 0, 87, 91, 86,
362 82, 86, 87, 90, 92, 105, 100, 97, 94, 93,
364 105, 106, 102, 0, 0, 0, 104, 0, 92, 75,
365 70, 67, 64, 63, 75, 76, 72, 0, 0, 0,
366 74, 0, 62, 91, 88, 0, 86, 85, 73, 85,
367 79, 83, 70, 62, 59, 0, 57, 56, 44, 56,
368 50, 54, 41, 0, 0, 0, 0, 63, 58, 59,
369 67, 66, 0, 0, 0, 0, 38, 33, 34, 42,
370 41, 51, 0, 0, 0, 0, 30, 0, 0, 0,
371 0, 43, 21, 0, 0, 194, 65, 66, 69
374 static yyconst short int yy_def[180] =
375 { 0,
376 176, 1, 176, 176, 176, 176, 177, 176, 176, 178,
377 176, 176, 179, 177, 177, 177, 177, 177, 177, 177,
378 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
379 177, 177, 177, 177, 177, 177, 178, 176, 179, 177,
380 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
381 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
382 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
383 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
384 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
385 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
387 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
388 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
389 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
390 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
391 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
392 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
393 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
394 177, 177, 177, 177, 177, 0, 176, 176, 176
397 static yyconst short int yy_nxt[245] =
398 { 0,
399 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
400 14, 7, 15, 16, 17, 18, 19, 7, 20, 7,
401 7, 21, 7, 22, 23, 7, 7, 24, 7, 7,
402 25, 7, 26, 27, 28, 29, 30, 7, 31, 7,
403 7, 32, 7, 33, 34, 7, 7, 35, 7, 7,
404 41, 43, 45, 55, 44, 42, 57, 59, 56, 58,
405 46, 96, 97, 110, 111, 60, 37, 36, 37, 39,
406 175, 39, 174, 173, 172, 171, 170, 169, 168, 167,
407 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
408 156, 155, 154, 153, 152, 151, 150, 149, 148, 147,
410 146, 145, 144, 143, 142, 141, 140, 139, 138, 137,
411 136, 135, 134, 133, 132, 131, 130, 129, 128, 127,
412 126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
413 116, 115, 114, 113, 112, 109, 108, 107, 106, 105,
414 104, 103, 102, 101, 100, 99, 98, 95, 94, 93,
415 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
416 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
417 72, 71, 70, 69, 68, 67, 66, 65, 64, 63,
418 62, 61, 54, 53, 52, 51, 50, 49, 48, 47,
419 40, 38, 176, 3, 176, 176, 176, 176, 176, 176,
421 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
422 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
423 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
424 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
425 176, 176, 176, 176
428 static yyconst short int yy_chk[245] =
429 { 0,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 15, 16, 17, 26, 16, 15, 27, 28, 26, 27,
436 17, 68, 68, 82, 82, 28, 178, 177, 178, 179,
437 173, 179, 172, 167, 162, 161, 160, 159, 158, 157,
438 152, 151, 150, 149, 148, 143, 142, 141, 140, 139,
439 138, 137, 135, 134, 133, 132, 131, 130, 129, 128,
441 127, 125, 124, 123, 121, 117, 116, 115, 114, 113,
442 112, 111, 110, 109, 107, 103, 102, 101, 100, 99,
443 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
444 88, 86, 85, 84, 83, 81, 80, 79, 78, 77,
445 76, 75, 74, 72, 71, 70, 69, 67, 66, 65,
446 64, 63, 62, 61, 60, 59, 58, 57, 56, 55,
447 54, 53, 52, 51, 50, 49, 48, 47, 46, 45,
448 44, 43, 42, 41, 40, 35, 34, 33, 32, 31,
449 30, 29, 25, 24, 23, 22, 21, 20, 19, 18,
450 14, 11, 3, 176, 176, 176, 176, 176, 176, 176,
452 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
453 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
454 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
455 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
456 176, 176, 176, 176
459 static yy_state_type yy_last_accepting_state;
460 static char *yy_last_accepting_cpos;
462 /* The intent behind this definition is that it'll catch
463 * any uses of REJECT which flex missed.
465 #define REJECT reject_used_but_not_detected
466 #define yymore() yymore_used_but_not_detected
467 #define YY_MORE_ADJ 0
468 #define YY_RESTORE_YY_MORE_OFFSET
469 char *yytext;
470 #line 1 "arlex.l"
471 #define INITIAL 0
472 #line 2 "arlex.l"
473 /* arlex.l - Strange script language lexer */
475 /* Copyright (C) 1992, 95, 1997 Free Software Foundation, Inc.
477 This file is part of GNU Binutils.
479 This program is free software; you can redistribute it and/or modify
480 it under the terms of the GNU General Public License as published by
481 the Free Software Foundation; either version 2 of the License, or
482 (at your option) any later version.
484 This program is distributed in the hope that it will be useful,
485 but WITHOUT ANY WARRANTY; without even the implied warranty of
486 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
487 GNU General Public License for more details.
489 You should have received a copy of the GNU General Public License
490 along with this program; if not, write to the Free Software
491 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
494 /* Contributed by Steve Chamberlain
495 sac@cygnus.com
498 #define DONTDECLARE_MALLOC
499 #include <ansidecl.h>
500 #include "libiberty.h"
501 #include "arparse.h"
503 int linenumber;
504 #line 505 "lex.yy.c"
506 /* Macros after this point can all be overridden by user definitions in
507 * section 1.
510 #ifndef YY_SKIP_YYWRAP
511 #ifdef __cplusplus
512 extern "C" int yywrap YY_PROTO(( void ));
513 #else
514 extern int yywrap YY_PROTO(( void ));
515 #endif
516 #endif
518 #ifndef YY_NO_UNPUT
519 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
520 #endif
522 #ifndef yytext_ptr
523 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
524 #endif
526 #ifdef YY_NEED_STRLEN
527 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
528 #endif
530 #ifndef YY_NO_INPUT
531 #ifdef __cplusplus
532 static int yyinput YY_PROTO(( void ));
533 #else
534 static int input YY_PROTO(( void ));
535 #endif
536 #endif
538 #if YY_STACK_USED
539 static int yy_start_stack_ptr = 0;
540 static int yy_start_stack_depth = 0;
541 static int *yy_start_stack = 0;
542 #ifndef YY_NO_PUSH_STATE
543 static void yy_push_state YY_PROTO(( int new_state ));
544 #endif
545 #ifndef YY_NO_POP_STATE
546 static void yy_pop_state YY_PROTO(( void ));
547 #endif
548 #ifndef YY_NO_TOP_STATE
549 static int yy_top_state YY_PROTO(( void ));
550 #endif
552 #else
553 #define YY_NO_PUSH_STATE 1
554 #define YY_NO_POP_STATE 1
555 #define YY_NO_TOP_STATE 1
556 #endif
558 #ifdef YY_MALLOC_DECL
559 YY_MALLOC_DECL
560 #else
561 #if __STDC__
562 #ifndef __cplusplus
563 #include <stdlib.h>
564 #endif
565 #else
566 /* Just try to get by without declaring the routines. This will fail
567 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
568 * or sizeof(void*) != sizeof(int).
570 #endif
571 #endif
573 /* Amount of stuff to slurp up with each read. */
574 #ifndef YY_READ_BUF_SIZE
575 #define YY_READ_BUF_SIZE 8192
576 #endif
578 /* Copy whatever the last rule matched to the standard output. */
580 #ifndef ECHO
581 /* This used to be an fputs(), but since the string might contain NUL's,
582 * we now use fwrite().
584 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
585 #endif
587 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
588 * is returned in "result".
590 #ifndef YY_INPUT
591 #define YY_INPUT(buf,result,max_size) \
592 if ( yy_current_buffer->yy_is_interactive ) \
594 int c = '*', n; \
595 for ( n = 0; n < max_size && \
596 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
597 buf[n] = (char) c; \
598 if ( c == '\n' ) \
599 buf[n++] = (char) c; \
600 if ( c == EOF && ferror( yyin ) ) \
601 YY_FATAL_ERROR( "input in flex scanner failed" ); \
602 result = n; \
604 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
605 && ferror( yyin ) ) \
606 YY_FATAL_ERROR( "input in flex scanner failed" );
607 #endif
609 /* No semi-colon after return; correct usage is to write "yyterminate();" -
610 * we don't want an extra ';' after the "return" because that will cause
611 * some compilers to complain about unreachable statements.
613 #ifndef yyterminate
614 #define yyterminate() return YY_NULL
615 #endif
617 /* Number of entries by which start-condition stack grows. */
618 #ifndef YY_START_STACK_INCR
619 #define YY_START_STACK_INCR 25
620 #endif
622 /* Report a fatal error. */
623 #ifndef YY_FATAL_ERROR
624 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
625 #endif
627 /* Default declaration of generated scanner - a define so the user can
628 * easily add parameters.
630 #ifndef YY_DECL
631 #define YY_DECL int yylex YY_PROTO(( void ))
632 #endif
634 /* Code executed at the beginning of each rule, after yytext and yyleng
635 * have been set up.
637 #ifndef YY_USER_ACTION
638 #define YY_USER_ACTION
639 #endif
641 /* Code executed at the end of each rule. */
642 #ifndef YY_BREAK
643 #define YY_BREAK break;
644 #endif
646 #define YY_RULE_SETUP \
647 YY_USER_ACTION
649 YY_DECL
651 register yy_state_type yy_current_state;
652 register char *yy_cp, *yy_bp;
653 register int yy_act;
655 #line 38 "arlex.l"
658 #line 659 "lex.yy.c"
660 if ( yy_init )
662 yy_init = 0;
664 #ifdef YY_USER_INIT
665 YY_USER_INIT;
666 #endif
668 if ( ! yy_start )
669 yy_start = 1; /* first start state */
671 if ( ! yyin )
672 yyin = stdin;
674 if ( ! yyout )
675 yyout = stdout;
677 if ( ! yy_current_buffer )
678 yy_current_buffer =
679 yy_create_buffer( yyin, YY_BUF_SIZE );
681 yy_load_buffer_state();
684 while ( 1 ) /* loops until end-of-file is reached */
686 yy_cp = yy_c_buf_p;
688 /* Support of yytext. */
689 *yy_cp = yy_hold_char;
691 /* yy_bp points to the position in yy_ch_buf of the start of
692 * the current run.
694 yy_bp = yy_cp;
696 yy_current_state = yy_start;
697 yy_match:
700 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
701 if ( yy_accept[yy_current_state] )
703 yy_last_accepting_state = yy_current_state;
704 yy_last_accepting_cpos = yy_cp;
706 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
708 yy_current_state = (int) yy_def[yy_current_state];
709 if ( yy_current_state >= 177 )
710 yy_c = yy_meta[(unsigned int) yy_c];
712 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
713 ++yy_cp;
715 while ( yy_base[yy_current_state] != 194 );
717 yy_find_action:
718 yy_act = yy_accept[yy_current_state];
719 if ( yy_act == 0 )
720 { /* have to back up */
721 yy_cp = yy_last_accepting_cpos;
722 yy_current_state = yy_last_accepting_state;
723 yy_act = yy_accept[yy_current_state];
726 YY_DO_BEFORE_ACTION;
729 do_action: /* This label is used only to access EOF actions. */
732 switch ( yy_act )
733 { /* beginning of action switch */
734 case 0: /* must back up */
735 /* undo the effects of YY_DO_BEFORE_ACTION */
736 *yy_cp = yy_hold_char;
737 yy_cp = yy_last_accepting_cpos;
738 yy_current_state = yy_last_accepting_state;
739 goto yy_find_action;
741 case 1:
742 YY_RULE_SETUP
743 #line 40 "arlex.l"
744 { return ADDLIB; }
745 YY_BREAK
746 case 2:
747 YY_RULE_SETUP
748 #line 41 "arlex.l"
749 { return ADDMOD; }
750 YY_BREAK
751 case 3:
752 YY_RULE_SETUP
753 #line 42 "arlex.l"
754 { return CLEAR; }
755 YY_BREAK
756 case 4:
757 YY_RULE_SETUP
758 #line 43 "arlex.l"
759 { return CREATE; }
760 YY_BREAK
761 case 5:
762 YY_RULE_SETUP
763 #line 44 "arlex.l"
764 { return DELETE; }
765 YY_BREAK
766 case 6:
767 YY_RULE_SETUP
768 #line 45 "arlex.l"
769 { return DIRECTORY; }
770 YY_BREAK
771 case 7:
772 YY_RULE_SETUP
773 #line 46 "arlex.l"
774 { return END; }
775 YY_BREAK
776 case 8:
777 YY_RULE_SETUP
778 #line 47 "arlex.l"
779 { return EXTRACT; }
780 YY_BREAK
781 case 9:
782 YY_RULE_SETUP
783 #line 48 "arlex.l"
784 { return FULLDIR; }
785 YY_BREAK
786 case 10:
787 YY_RULE_SETUP
788 #line 49 "arlex.l"
789 { return HELP; }
790 YY_BREAK
791 case 11:
792 YY_RULE_SETUP
793 #line 50 "arlex.l"
794 { return LIST; }
795 YY_BREAK
796 case 12:
797 YY_RULE_SETUP
798 #line 51 "arlex.l"
799 { return OPEN; }
800 YY_BREAK
801 case 13:
802 YY_RULE_SETUP
803 #line 52 "arlex.l"
804 { return REPLACE; }
805 YY_BREAK
806 case 14:
807 YY_RULE_SETUP
808 #line 53 "arlex.l"
809 { return VERBOSE; }
810 YY_BREAK
811 case 15:
812 YY_RULE_SETUP
813 #line 54 "arlex.l"
814 { return SAVE; }
815 YY_BREAK
816 case 16:
817 YY_RULE_SETUP
818 #line 55 "arlex.l"
819 { return ADDLIB; }
820 YY_BREAK
821 case 17:
822 YY_RULE_SETUP
823 #line 56 "arlex.l"
824 { return ADDMOD; }
825 YY_BREAK
826 case 18:
827 YY_RULE_SETUP
828 #line 57 "arlex.l"
829 { return CLEAR; }
830 YY_BREAK
831 case 19:
832 YY_RULE_SETUP
833 #line 58 "arlex.l"
834 { return CREATE; }
835 YY_BREAK
836 case 20:
837 YY_RULE_SETUP
838 #line 59 "arlex.l"
839 { return DELETE; }
840 YY_BREAK
841 case 21:
842 YY_RULE_SETUP
843 #line 60 "arlex.l"
844 { return DIRECTORY; }
845 YY_BREAK
846 case 22:
847 YY_RULE_SETUP
848 #line 61 "arlex.l"
849 { return END; }
850 YY_BREAK
851 case 23:
852 YY_RULE_SETUP
853 #line 62 "arlex.l"
854 { return EXTRACT; }
855 YY_BREAK
856 case 24:
857 YY_RULE_SETUP
858 #line 63 "arlex.l"
859 { return FULLDIR; }
860 YY_BREAK
861 case 25:
862 YY_RULE_SETUP
863 #line 64 "arlex.l"
864 { return HELP; }
865 YY_BREAK
866 case 26:
867 YY_RULE_SETUP
868 #line 65 "arlex.l"
869 { return LIST; }
870 YY_BREAK
871 case 27:
872 YY_RULE_SETUP
873 #line 66 "arlex.l"
874 { return OPEN; }
875 YY_BREAK
876 case 28:
877 YY_RULE_SETUP
878 #line 67 "arlex.l"
879 { return REPLACE; }
880 YY_BREAK
881 case 29:
882 YY_RULE_SETUP
883 #line 68 "arlex.l"
884 { return VERBOSE; }
885 YY_BREAK
886 case 30:
887 YY_RULE_SETUP
888 #line 69 "arlex.l"
889 { return SAVE; }
890 YY_BREAK
891 case 31:
892 YY_RULE_SETUP
893 #line 70 "arlex.l"
894 { linenumber ++; }
895 YY_BREAK
896 case 32:
897 YY_RULE_SETUP
898 #line 71 "arlex.l"
899 { return '('; }
900 YY_BREAK
901 case 33:
902 YY_RULE_SETUP
903 #line 72 "arlex.l"
904 { return ')'; }
905 YY_BREAK
906 case 34:
907 YY_RULE_SETUP
908 #line 73 "arlex.l"
909 { return ','; }
910 YY_BREAK
911 case 35:
912 YY_RULE_SETUP
913 #line 74 "arlex.l"
915 yylval.name = xstrdup (yytext);
916 return FILENAME;
918 YY_BREAK
919 case 36:
920 YY_RULE_SETUP
921 #line 78 "arlex.l"
923 YY_BREAK
924 case 37:
925 YY_RULE_SETUP
926 #line 79 "arlex.l"
928 YY_BREAK
929 case 38:
930 YY_RULE_SETUP
931 #line 80 "arlex.l"
933 YY_BREAK
934 case 39:
935 YY_RULE_SETUP
936 #line 81 "arlex.l"
937 { linenumber ++; return NEWLINE; }
938 YY_BREAK
939 case 40:
940 YY_RULE_SETUP
941 #line 83 "arlex.l"
942 ECHO;
943 YY_BREAK
944 #line 945 "lex.yy.c"
945 case YY_STATE_EOF(INITIAL):
946 yyterminate();
948 case YY_END_OF_BUFFER:
950 /* Amount of text matched not including the EOB char. */
951 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
953 /* Undo the effects of YY_DO_BEFORE_ACTION. */
954 *yy_cp = yy_hold_char;
955 YY_RESTORE_YY_MORE_OFFSET
957 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
959 /* We're scanning a new file or input source. It's
960 * possible that this happened because the user
961 * just pointed yyin at a new source and called
962 * yylex(). If so, then we have to assure
963 * consistency between yy_current_buffer and our
964 * globals. Here is the right place to do so, because
965 * this is the first action (other than possibly a
966 * back-up) that will match for the new input source.
968 yy_n_chars = yy_current_buffer->yy_n_chars;
969 yy_current_buffer->yy_input_file = yyin;
970 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
973 /* Note that here we test for yy_c_buf_p "<=" to the position
974 * of the first EOB in the buffer, since yy_c_buf_p will
975 * already have been incremented past the NUL character
976 * (since all states make transitions on EOB to the
977 * end-of-buffer state). Contrast this with the test
978 * in input().
980 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
981 { /* This was really a NUL. */
982 yy_state_type yy_next_state;
984 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
986 yy_current_state = yy_get_previous_state();
988 /* Okay, we're now positioned to make the NUL
989 * transition. We couldn't have
990 * yy_get_previous_state() go ahead and do it
991 * for us because it doesn't know how to deal
992 * with the possibility of jamming (and we don't
993 * want to build jamming into it because then it
994 * will run more slowly).
997 yy_next_state = yy_try_NUL_trans( yy_current_state );
999 yy_bp = yytext_ptr + YY_MORE_ADJ;
1001 if ( yy_next_state )
1003 /* Consume the NUL. */
1004 yy_cp = ++yy_c_buf_p;
1005 yy_current_state = yy_next_state;
1006 goto yy_match;
1009 else
1011 yy_cp = yy_c_buf_p;
1012 goto yy_find_action;
1016 else switch ( yy_get_next_buffer() )
1018 case EOB_ACT_END_OF_FILE:
1020 yy_did_buffer_switch_on_eof = 0;
1022 if ( yywrap() )
1024 /* Note: because we've taken care in
1025 * yy_get_next_buffer() to have set up
1026 * yytext, we can now set up
1027 * yy_c_buf_p so that if some total
1028 * hoser (like flex itself) wants to
1029 * call the scanner after we return the
1030 * YY_NULL, it'll still work - another
1031 * YY_NULL will get returned.
1033 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1035 yy_act = YY_STATE_EOF(YY_START);
1036 goto do_action;
1039 else
1041 if ( ! yy_did_buffer_switch_on_eof )
1042 YY_NEW_FILE;
1044 break;
1047 case EOB_ACT_CONTINUE_SCAN:
1048 yy_c_buf_p =
1049 yytext_ptr + yy_amount_of_matched_text;
1051 yy_current_state = yy_get_previous_state();
1053 yy_cp = yy_c_buf_p;
1054 yy_bp = yytext_ptr + YY_MORE_ADJ;
1055 goto yy_match;
1057 case EOB_ACT_LAST_MATCH:
1058 yy_c_buf_p =
1059 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1061 yy_current_state = yy_get_previous_state();
1063 yy_cp = yy_c_buf_p;
1064 yy_bp = yytext_ptr + YY_MORE_ADJ;
1065 goto yy_find_action;
1067 break;
1070 default:
1071 YY_FATAL_ERROR(
1072 "fatal flex scanner internal error--no action found" );
1073 } /* end of action switch */
1074 } /* end of scanning one token */
1075 } /* end of yylex */
1078 /* yy_get_next_buffer - try to read in a new buffer
1080 * Returns a code representing an action:
1081 * EOB_ACT_LAST_MATCH -
1082 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1083 * EOB_ACT_END_OF_FILE - end of file
1086 static int yy_get_next_buffer()
1088 register char *dest = yy_current_buffer->yy_ch_buf;
1089 register char *source = yytext_ptr;
1090 register int number_to_move, i;
1091 int ret_val;
1093 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1094 YY_FATAL_ERROR(
1095 "fatal flex scanner internal error--end of buffer missed" );
1097 if ( yy_current_buffer->yy_fill_buffer == 0 )
1098 { /* Don't try to fill the buffer, so this is an EOF. */
1099 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1101 /* We matched a single character, the EOB, so
1102 * treat this as a final EOF.
1104 return EOB_ACT_END_OF_FILE;
1107 else
1109 /* We matched some text prior to the EOB, first
1110 * process it.
1112 return EOB_ACT_LAST_MATCH;
1116 /* Try to read more data. */
1118 /* First move last chars to start of buffer. */
1119 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1121 for ( i = 0; i < number_to_move; ++i )
1122 *(dest++) = *(source++);
1124 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1125 /* don't do the read, it's not guaranteed to return an EOF,
1126 * just force an EOF
1128 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1130 else
1132 int num_to_read =
1133 yy_current_buffer->yy_buf_size - number_to_move - 1;
1135 while ( num_to_read <= 0 )
1136 { /* Not enough room in the buffer - grow it. */
1137 #ifdef YY_USES_REJECT
1138 YY_FATAL_ERROR(
1139 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1140 #else
1142 /* just a shorter name for the current buffer */
1143 YY_BUFFER_STATE b = yy_current_buffer;
1145 int yy_c_buf_p_offset =
1146 (int) (yy_c_buf_p - b->yy_ch_buf);
1148 if ( b->yy_is_our_buffer )
1150 int new_size = b->yy_buf_size * 2;
1152 if ( new_size <= 0 )
1153 b->yy_buf_size += b->yy_buf_size / 8;
1154 else
1155 b->yy_buf_size *= 2;
1157 b->yy_ch_buf = (char *)
1158 /* Include room in for 2 EOB chars. */
1159 yy_flex_realloc( (void *) b->yy_ch_buf,
1160 b->yy_buf_size + 2 );
1162 else
1163 /* Can't grow it, we don't own it. */
1164 b->yy_ch_buf = 0;
1166 if ( ! b->yy_ch_buf )
1167 YY_FATAL_ERROR(
1168 "fatal error - scanner input buffer overflow" );
1170 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1172 num_to_read = yy_current_buffer->yy_buf_size -
1173 number_to_move - 1;
1174 #endif
1177 if ( num_to_read > YY_READ_BUF_SIZE )
1178 num_to_read = YY_READ_BUF_SIZE;
1180 /* Read in more data. */
1181 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1182 yy_n_chars, num_to_read );
1184 yy_current_buffer->yy_n_chars = yy_n_chars;
1187 if ( yy_n_chars == 0 )
1189 if ( number_to_move == YY_MORE_ADJ )
1191 ret_val = EOB_ACT_END_OF_FILE;
1192 yyrestart( yyin );
1195 else
1197 ret_val = EOB_ACT_LAST_MATCH;
1198 yy_current_buffer->yy_buffer_status =
1199 YY_BUFFER_EOF_PENDING;
1203 else
1204 ret_val = EOB_ACT_CONTINUE_SCAN;
1206 yy_n_chars += number_to_move;
1207 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1208 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1210 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1212 return ret_val;
1216 /* yy_get_previous_state - get the state just before the EOB char was reached */
1218 static yy_state_type yy_get_previous_state()
1220 register yy_state_type yy_current_state;
1221 register char *yy_cp;
1223 yy_current_state = yy_start;
1225 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1227 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1228 if ( yy_accept[yy_current_state] )
1230 yy_last_accepting_state = yy_current_state;
1231 yy_last_accepting_cpos = yy_cp;
1233 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1235 yy_current_state = (int) yy_def[yy_current_state];
1236 if ( yy_current_state >= 177 )
1237 yy_c = yy_meta[(unsigned int) yy_c];
1239 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1242 return yy_current_state;
1246 /* yy_try_NUL_trans - try to make a transition on the NUL character
1248 * synopsis
1249 * next_state = yy_try_NUL_trans( current_state );
1252 #ifdef YY_USE_PROTOS
1253 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1254 #else
1255 static yy_state_type yy_try_NUL_trans( yy_current_state )
1256 yy_state_type yy_current_state;
1257 #endif
1259 register int yy_is_jam;
1260 register char *yy_cp = yy_c_buf_p;
1262 register YY_CHAR yy_c = 1;
1263 if ( yy_accept[yy_current_state] )
1265 yy_last_accepting_state = yy_current_state;
1266 yy_last_accepting_cpos = yy_cp;
1268 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1270 yy_current_state = (int) yy_def[yy_current_state];
1271 if ( yy_current_state >= 177 )
1272 yy_c = yy_meta[(unsigned int) yy_c];
1274 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1275 yy_is_jam = (yy_current_state == 176);
1277 return yy_is_jam ? 0 : yy_current_state;
1281 #ifndef YY_NO_UNPUT
1282 #ifdef YY_USE_PROTOS
1283 static void yyunput( int c, register char *yy_bp )
1284 #else
1285 static void yyunput( c, yy_bp )
1286 int c;
1287 register char *yy_bp;
1288 #endif
1290 register char *yy_cp = yy_c_buf_p;
1292 /* undo effects of setting up yytext */
1293 *yy_cp = yy_hold_char;
1295 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1296 { /* need to shift things up to make room */
1297 /* +2 for EOB chars. */
1298 register int number_to_move = yy_n_chars + 2;
1299 register char *dest = &yy_current_buffer->yy_ch_buf[
1300 yy_current_buffer->yy_buf_size + 2];
1301 register char *source =
1302 &yy_current_buffer->yy_ch_buf[number_to_move];
1304 while ( source > yy_current_buffer->yy_ch_buf )
1305 *--dest = *--source;
1307 yy_cp += (int) (dest - source);
1308 yy_bp += (int) (dest - source);
1309 yy_current_buffer->yy_n_chars =
1310 yy_n_chars = yy_current_buffer->yy_buf_size;
1312 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1313 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1316 *--yy_cp = (char) c;
1319 yytext_ptr = yy_bp;
1320 yy_hold_char = *yy_cp;
1321 yy_c_buf_p = yy_cp;
1323 #endif /* ifndef YY_NO_UNPUT */
1326 #ifdef __cplusplus
1327 static int yyinput()
1328 #else
1329 static int input()
1330 #endif
1332 int c;
1334 *yy_c_buf_p = yy_hold_char;
1336 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1338 /* yy_c_buf_p now points to the character we want to return.
1339 * If this occurs *before* the EOB characters, then it's a
1340 * valid NUL; if not, then we've hit the end of the buffer.
1342 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1343 /* This was really a NUL. */
1344 *yy_c_buf_p = '\0';
1346 else
1347 { /* need more input */
1348 int offset = yy_c_buf_p - yytext_ptr;
1349 ++yy_c_buf_p;
1351 switch ( yy_get_next_buffer() )
1353 case EOB_ACT_LAST_MATCH:
1354 /* This happens because yy_g_n_b()
1355 * sees that we've accumulated a
1356 * token and flags that we need to
1357 * try matching the token before
1358 * proceeding. But for input(),
1359 * there's no matching to consider.
1360 * So convert the EOB_ACT_LAST_MATCH
1361 * to EOB_ACT_END_OF_FILE.
1364 /* Reset buffer status. */
1365 yyrestart( yyin );
1367 /* fall through */
1369 case EOB_ACT_END_OF_FILE:
1371 if ( yywrap() )
1372 return EOF;
1374 if ( ! yy_did_buffer_switch_on_eof )
1375 YY_NEW_FILE;
1376 #ifdef __cplusplus
1377 return yyinput();
1378 #else
1379 return input();
1380 #endif
1383 case EOB_ACT_CONTINUE_SCAN:
1384 yy_c_buf_p = yytext_ptr + offset;
1385 break;
1390 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1391 *yy_c_buf_p = '\0'; /* preserve yytext */
1392 yy_hold_char = *++yy_c_buf_p;
1395 return c;
1399 #ifdef YY_USE_PROTOS
1400 void yyrestart( FILE *input_file )
1401 #else
1402 void yyrestart( input_file )
1403 FILE *input_file;
1404 #endif
1406 if ( ! yy_current_buffer )
1407 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1409 yy_init_buffer( yy_current_buffer, input_file );
1410 yy_load_buffer_state();
1414 #ifdef YY_USE_PROTOS
1415 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1416 #else
1417 void yy_switch_to_buffer( new_buffer )
1418 YY_BUFFER_STATE new_buffer;
1419 #endif
1421 if ( yy_current_buffer == new_buffer )
1422 return;
1424 if ( yy_current_buffer )
1426 /* Flush out information for old buffer. */
1427 *yy_c_buf_p = yy_hold_char;
1428 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1429 yy_current_buffer->yy_n_chars = yy_n_chars;
1432 yy_current_buffer = new_buffer;
1433 yy_load_buffer_state();
1435 /* We don't actually know whether we did this switch during
1436 * EOF (yywrap()) processing, but the only time this flag
1437 * is looked at is after yywrap() is called, so it's safe
1438 * to go ahead and always set it.
1440 yy_did_buffer_switch_on_eof = 1;
1444 #ifdef YY_USE_PROTOS
1445 void yy_load_buffer_state( void )
1446 #else
1447 void yy_load_buffer_state()
1448 #endif
1450 yy_n_chars = yy_current_buffer->yy_n_chars;
1451 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1452 yyin = yy_current_buffer->yy_input_file;
1453 yy_hold_char = *yy_c_buf_p;
1457 #ifdef YY_USE_PROTOS
1458 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1459 #else
1460 YY_BUFFER_STATE yy_create_buffer( file, size )
1461 FILE *file;
1462 int size;
1463 #endif
1465 YY_BUFFER_STATE b;
1467 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1468 if ( ! b )
1469 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1471 b->yy_buf_size = size;
1473 /* yy_ch_buf has to be 2 characters longer than the size given because
1474 * we need to put in 2 end-of-buffer characters.
1476 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1477 if ( ! b->yy_ch_buf )
1478 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1480 b->yy_is_our_buffer = 1;
1482 yy_init_buffer( b, file );
1484 return b;
1488 #ifdef YY_USE_PROTOS
1489 void yy_delete_buffer( YY_BUFFER_STATE b )
1490 #else
1491 void yy_delete_buffer( b )
1492 YY_BUFFER_STATE b;
1493 #endif
1495 if ( ! b )
1496 return;
1498 if ( b == yy_current_buffer )
1499 yy_current_buffer = (YY_BUFFER_STATE) 0;
1501 if ( b->yy_is_our_buffer )
1502 yy_flex_free( (void *) b->yy_ch_buf );
1504 yy_flex_free( (void *) b );
1508 #ifndef YY_ALWAYS_INTERACTIVE
1509 #ifndef YY_NEVER_INTERACTIVE
1510 extern int isatty YY_PROTO(( int ));
1511 #endif
1512 #endif
1514 #ifdef YY_USE_PROTOS
1515 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1516 #else
1517 void yy_init_buffer( b, file )
1518 YY_BUFFER_STATE b;
1519 FILE *file;
1520 #endif
1524 yy_flush_buffer( b );
1526 b->yy_input_file = file;
1527 b->yy_fill_buffer = 1;
1529 #if YY_ALWAYS_INTERACTIVE
1530 b->yy_is_interactive = 1;
1531 #else
1532 #if YY_NEVER_INTERACTIVE
1533 b->yy_is_interactive = 0;
1534 #else
1535 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1536 #endif
1537 #endif
1541 #ifdef YY_USE_PROTOS
1542 void yy_flush_buffer( YY_BUFFER_STATE b )
1543 #else
1544 void yy_flush_buffer( b )
1545 YY_BUFFER_STATE b;
1546 #endif
1549 if ( ! b )
1550 return;
1552 b->yy_n_chars = 0;
1554 /* We always need two end-of-buffer characters. The first causes
1555 * a transition to the end-of-buffer state. The second causes
1556 * a jam in that state.
1558 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1559 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1561 b->yy_buf_pos = &b->yy_ch_buf[0];
1563 b->yy_at_bol = 1;
1564 b->yy_buffer_status = YY_BUFFER_NEW;
1566 if ( b == yy_current_buffer )
1567 yy_load_buffer_state();
1571 #ifndef YY_NO_SCAN_BUFFER
1572 #ifdef YY_USE_PROTOS
1573 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1574 #else
1575 YY_BUFFER_STATE yy_scan_buffer( base, size )
1576 char *base;
1577 yy_size_t size;
1578 #endif
1580 YY_BUFFER_STATE b;
1582 if ( size < 2 ||
1583 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1584 base[size-1] != YY_END_OF_BUFFER_CHAR )
1585 /* They forgot to leave room for the EOB's. */
1586 return 0;
1588 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1589 if ( ! b )
1590 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1592 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1593 b->yy_buf_pos = b->yy_ch_buf = base;
1594 b->yy_is_our_buffer = 0;
1595 b->yy_input_file = 0;
1596 b->yy_n_chars = b->yy_buf_size;
1597 b->yy_is_interactive = 0;
1598 b->yy_at_bol = 1;
1599 b->yy_fill_buffer = 0;
1600 b->yy_buffer_status = YY_BUFFER_NEW;
1602 yy_switch_to_buffer( b );
1604 return b;
1606 #endif
1609 #ifndef YY_NO_SCAN_STRING
1610 #ifdef YY_USE_PROTOS
1611 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1612 #else
1613 YY_BUFFER_STATE yy_scan_string( yy_str )
1614 yyconst char *yy_str;
1615 #endif
1617 int len;
1618 for ( len = 0; yy_str[len]; ++len )
1621 return yy_scan_bytes( yy_str, len );
1623 #endif
1626 #ifndef YY_NO_SCAN_BYTES
1627 #ifdef YY_USE_PROTOS
1628 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1629 #else
1630 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1631 yyconst char *bytes;
1632 int len;
1633 #endif
1635 YY_BUFFER_STATE b;
1636 char *buf;
1637 yy_size_t n;
1638 int i;
1640 /* Get memory for full buffer, including space for trailing EOB's. */
1641 n = len + 2;
1642 buf = (char *) yy_flex_alloc( n );
1643 if ( ! buf )
1644 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1646 for ( i = 0; i < len; ++i )
1647 buf[i] = bytes[i];
1649 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1651 b = yy_scan_buffer( buf, n );
1652 if ( ! b )
1653 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1655 /* It's okay to grow etc. this buffer, and we should throw it
1656 * away when we're done.
1658 b->yy_is_our_buffer = 1;
1660 return b;
1662 #endif
1665 #ifndef YY_NO_PUSH_STATE
1666 #ifdef YY_USE_PROTOS
1667 static void yy_push_state( int new_state )
1668 #else
1669 static void yy_push_state( new_state )
1670 int new_state;
1671 #endif
1673 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1675 yy_size_t new_size;
1677 yy_start_stack_depth += YY_START_STACK_INCR;
1678 new_size = yy_start_stack_depth * sizeof( int );
1680 if ( ! yy_start_stack )
1681 yy_start_stack = (int *) yy_flex_alloc( new_size );
1683 else
1684 yy_start_stack = (int *) yy_flex_realloc(
1685 (void *) yy_start_stack, new_size );
1687 if ( ! yy_start_stack )
1688 YY_FATAL_ERROR(
1689 "out of memory expanding start-condition stack" );
1692 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1694 BEGIN(new_state);
1696 #endif
1699 #ifndef YY_NO_POP_STATE
1700 static void yy_pop_state()
1702 if ( --yy_start_stack_ptr < 0 )
1703 YY_FATAL_ERROR( "start-condition stack underflow" );
1705 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1707 #endif
1710 #ifndef YY_NO_TOP_STATE
1711 static int yy_top_state()
1713 return yy_start_stack[yy_start_stack_ptr - 1];
1715 #endif
1717 #ifndef YY_EXIT_FAILURE
1718 #define YY_EXIT_FAILURE 2
1719 #endif
1721 #ifdef YY_USE_PROTOS
1722 static void yy_fatal_error( yyconst char msg[] )
1723 #else
1724 static void yy_fatal_error( msg )
1725 char msg[];
1726 #endif
1728 (void) fprintf( stderr, "%s\n", msg );
1729 exit( YY_EXIT_FAILURE );
1734 /* Redefine yyless() so it works in section 3 code. */
1736 #undef yyless
1737 #define yyless(n) \
1738 do \
1740 /* Undo effects of setting up yytext. */ \
1741 yytext[yyleng] = yy_hold_char; \
1742 yy_c_buf_p = yytext + n; \
1743 yy_hold_char = *yy_c_buf_p; \
1744 *yy_c_buf_p = '\0'; \
1745 yyleng = n; \
1747 while ( 0 )
1750 /* Internal utility routines. */
1752 #ifndef yytext_ptr
1753 #ifdef YY_USE_PROTOS
1754 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1755 #else
1756 static void yy_flex_strncpy( s1, s2, n )
1757 char *s1;
1758 yyconst char *s2;
1759 int n;
1760 #endif
1762 register int i;
1763 for ( i = 0; i < n; ++i )
1764 s1[i] = s2[i];
1766 #endif
1768 #ifdef YY_NEED_STRLEN
1769 #ifdef YY_USE_PROTOS
1770 static int yy_flex_strlen( yyconst char *s )
1771 #else
1772 static int yy_flex_strlen( s )
1773 yyconst char *s;
1774 #endif
1776 register int n;
1777 for ( n = 0; s[n]; ++n )
1780 return n;
1782 #endif
1785 #ifdef YY_USE_PROTOS
1786 static void *yy_flex_alloc( yy_size_t size )
1787 #else
1788 static void *yy_flex_alloc( size )
1789 yy_size_t size;
1790 #endif
1792 return (void *) malloc( size );
1795 #ifdef YY_USE_PROTOS
1796 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1797 #else
1798 static void *yy_flex_realloc( ptr, size )
1799 void *ptr;
1800 yy_size_t size;
1801 #endif
1803 /* The cast to (char *) in the following accommodates both
1804 * implementations that use char* generic pointers, and those
1805 * that use void* generic pointers. It works with the latter
1806 * because both ANSI C and C++ allow castless assignment from
1807 * any pointer type to void*, and deal with argument conversions
1808 * as though doing an assignment.
1810 return (void *) realloc( (char *) ptr, size );
1813 #ifdef YY_USE_PROTOS
1814 static void yy_flex_free( void *ptr )
1815 #else
1816 static void yy_flex_free( ptr )
1817 void *ptr;
1818 #endif
1820 free( ptr );
1823 #if YY_MAIN
1824 int main()
1826 yylex();
1827 return 0;
1829 #endif
1830 #line 83 "arlex.l"
1832 #ifndef yywrap
1833 /* Needed for lex, though not flex. */
1834 int yywrap() { return 1; }
1835 #endif