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