chiark / gitweb /
Regenerated formatted documentation with correct version no.
[userv.git] / lexer.c
1 /* A lexical scanner generated by flex */
2
3 /* Scanner skeleton version:
4  * $Header$
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
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 #include <unistd.h>
26
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
29
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
32
33 #else   /* ! __cplusplus */
34
35 #if __STDC__
36
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
39
40 #endif  /* __STDC__ */
41 #endif  /* ! __cplusplus */
42
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
51
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
57
58
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
64
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
67
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.
72  */
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
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.
78  */
79 #define BEGIN yy_start = 1 + 2 *
80
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.
84  */
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
87
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
93
94 #define YY_END_OF_BUFFER_CHAR 0
95
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
98
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
103
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
107
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:
111  *
112  *      if ( condition_holds )
113  *              yyless( 5 );
114  *      else
115  *              do_something_else();
116  *
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.
120  */
121
122 /* Return all but the first 'n' matched characters back to the input stream. */
123
124 #define yyless(n) \
125         do \
126                 { \
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 */ \
132                 } \
133         while ( 0 )
134
135 #define unput(c) yyunput( c, yytext_ptr )
136
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).
140  */
141 typedef unsigned int yy_size_t;
142
143
144 struct yy_buffer_state
145         {
146         FILE *yy_input_file;
147
148         char *yy_ch_buf;                /* input buffer */
149         char *yy_buf_pos;               /* current position in input buffer */
150
151         /* Size of input buffer in bytes, not including room for EOB
152          * characters.
153          */
154         yy_size_t yy_buf_size;
155
156         /* Number of characters read into yy_ch_buf, not including EOB
157          * characters.
158          */
159         int yy_n_chars;
160
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.
164          */
165         int yy_is_our_buffer;
166
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.
171          */
172         int yy_is_interactive;
173
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.
177          */
178         int yy_at_bol;
179
180         /* Whether to try to fill the input buffer when we reach the
181          * end of it.
182          */
183         int yy_fill_buffer;
184
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.
193          *
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.
197          */
198 #define YY_BUFFER_EOF_PENDING 2
199         };
200
201 static YY_BUFFER_STATE yy_current_buffer = 0;
202
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".
206  */
207 #define YY_CURRENT_BUFFER yy_current_buffer
208
209
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
212
213 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
214
215
216 int yyleng;
217
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 */
222
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 ...
225  */
226 static int yy_did_buffer_switch_on_eof;
227
228 void yyrestart YY_PROTO(( FILE *input_file ));
229
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 )
237
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 ));
241
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 * ));
245
246 #define yy_new_buffer yy_create_buffer
247
248 #define yy_set_interactive(is_interactive) \
249         { \
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; \
253         }
254
255 #define yy_set_bol(at_bol) \
256         { \
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; \
260         }
261
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263
264
265 #define yywrap() 1
266 #define YY_SKIP_YYWRAP
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 104
289 #define YY_END_OF_BUFFER 105
290 static yyconst short int yy_accept[579] =
291     {   0,
292         0,    0,  105,  103,   97,   98,   90,  102,  100,   87,
293        91,   88,   89,   94,  103,  103,  103,  103,  103,  103,
294       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
295       103,  103,  103,  103,  103,  103,   92,  103,   97,   98,
296       100,  102,  102,  101,  102,  100,  100,   99,   96,   94,
297       103,  103,  103,  103,   19,  103,  103,  103,  103,  103,
298       103,  103,  103,  103,  103,   37,  103,  103,  103,  103,
299        32,  103,  103,  103,  103,  103,  103,  103,  103,  103,
300       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
301       103,  103,  103,  103,  103,  103,  103,  101,  102,  102,
302
303       102,  102,    0,  102,  102,   95,   94,  103,  103,  103,
304       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
305       103,  103,   31,   63,  103,  103,  103,  103,  103,  103,
306       103,  103,  103,  103,   71,  103,  103,  103,  103,  103,
307       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
308       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
309       103,  103,  103,  102,  102,  101,    0,  102,  102,   95,
310        94,  103,  103,  103,   67,  103,  103,   64,   68,  103,
311       103,  103,   35,   36,  103,  103,  103,  103,   40,   42,
312       103,   51,  103,  103,   60,   70,  103,   72,  103,   73,
313
314       103,  103,  103,  103,  103,  103,  103,   30,  103,   85,
315       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
316       103,   75,   76,  103,   62,  103,  102,  102,    0,    0,
317         0,  102,   95,   94,  103,   65,  103,  103,  103,  103,
318       103,   59,  103,   66,  103,   93,  103,   38,  103,  103,
319       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
320        41,  103,  103,   49,  103,  103,  103,  103,  103,  103,
321       103,  103,  103,  103,  103,   86,  102,    0,    0,   95,
322        94,  103,  103,  103,  103,  103,   69,  103,  103,  103,
323       103,  103,  103,   70,   77,   78,   79,   80,   81,   82,
324
325        83,   84,  103,  103,  103,  103,   61,  103,  103,  103,
326         1,  103,  103,  103,  103,  103,   39,  103,   74,  103,
327       103,  103,  103,    0,   95,   94,  103,  103,  103,  103,
328       103,  103,  103,  103,   50,  103,   21,   26,  103,  103,
329       103,   10,  103,  103,  103,  103,  103,   52,  103,  103,
330       103,  103,  103,   45,   62,   95,   94,  103,    9,   67,
331       103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
332       103,  103,   47,  103,  103,  103,  103,  103,   48,  103,
333        46,  103,   95,  103,  103,  103,  103,  103,  103,  103,
334       103,  103,  103,   12,  103,  103,  103,  103,  103,  103,
335
336        44,   11,  103,  103,  103,  103,  103,  103,   95,  103,
337       103,  103,  103,  103,   33,  103,  103,  103,  103,  103,
338       103,  103,  103,  103,  103,  103,  103,    8,  103,  103,
339       103,  103,  103,  103,  103,  103,  103,  103,  103,   43,
340        34,  103,  103,  103,  103,  103,  103,  103,  103,  103,
341       103,  103,  103,  103,  103,   20,  103,  103,  103,  103,
342        53,  103,  103,  103,  103,  103,  103,  103,  103,  103,
343       103,  103,  103,  103,   56,  103,  103,  103,  103,  103,
344        54,  103,  103,  103,  103,  103,  103,  103,  103,  103,
345       103,  103,  103,  103,   57,  103,  103,   15,  103,  103,
346
347       103,  103,   17,    7,  103,  103,  103,  103,  103,  103,
348       103,   23,  103,  103,  103,  103,  103,  103,  103,  103,
349       103,  103,  103,    4,  103,  103,  103,   22,  103,  103,
350       103,  103,  103,   13,  103,  103,  103,  103,    5,    6,
351       103,  103,  103,  103,  103,  103,   16,  103,  103,  103,
352       103,  103,  103,    3,   25,  103,   18,  103,  103,  103,
353        27,  103,   55,  103,   24,   14,   58,  103,  103,  103,
354       103,   28,  103,  103,  103,   29,    2,    0
355     } ;
356
357 static yyconst int yy_ec[256] =
358     {   0,
359         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
360         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
361         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
362         1,    2,    4,    5,    6,    7,    8,    9,    8,   10,
363        11,    8,    8,    8,   12,    8,    8,   13,   14,   15,
364        16,   17,   18,   19,   20,   21,   21,    8,    8,    8,
365         8,    8,    8,    8,   22,   22,   22,   22,   22,   22,
366         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
367         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
368         8,   23,    8,    8,   24,    8,   25,   26,   27,   28,
369
370        29,   30,   31,   32,   33,   34,   35,   36,   37,   38,
371        39,   40,   41,   42,   43,   44,   45,   46,   47,   48,
372        49,   50,    8,   51,    8,    8,    1,    1,    1,    1,
373         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
374         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
375         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
376         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
377         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
378         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
379         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
380
381         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
382         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
383         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
384         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
385         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
386         1,    1,    1,    1,    1
387     } ;
388
389 static yyconst int yy_meta[52] =
390     {   0,
391         1,    2,    3,    1,    1,    1,    1,    1,    1,    1,
392         1,    1,    4,    4,    4,    4,    4,    4,    4,    4,
393         4,    1,    1,    1,    1,    1,    1,    1,    1,    1,
394         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
395         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
396         1
397     } ;
398
399 static yyconst short int yy_base[589] =
400     {   0,
401         0,    0,  924,    0,   50,  925,    0,   52,   56,    0,
402         0,    0,    0,   64,  890,   19,   44,   37,   51,  889,
403        25,   36,   64,  892,   34,   67,   62,  874,  894,  873,
404        75,   74,  878,   65,  887,   72,    0,    0,  109,  925,
405       912,  115,  104,  912,  138,  119,  910,  925,  174,  183,
406       874,   69,  867,   24,    0,   85,  881,  883,  865,   92,
407       878,  860,  875,  862,  874,    0,  863,  872,  856,  863,
408         0,  860,   99,  855,  869,  853,  861,  850,  845,  101,
409       855,  861,   90,  856,  850,  136,  104,  842,  847,  845,
410       841,  843,  853,  854,  838,  837,  845,    0,  204,  875,
411
412         0,  131,  139,  251,  271,  289,  298,  849,  833,  835,
413       841,  836,  844,  826,  831,  831,  822,  839,  835,  835,
414       821,  829,    0,  822,  833,  833,  818,  832,  816,  816,
415       818,  814,  814,  826,    0,  814,  806,  805,  121,  814,
416       810,  803,  811,  818,  798,  810,  812,  810,  793,  808,
417       791,  789,  822,  789,  790,  791,  794,  793,  786,  787,
418       783,  787,  780,  307,  324,  925,  354,  390,  399,  417,
419       426,  787,  778,  774,  780,  786,  786,    0,    0,  778,
420       785,  776,    0,    0,  783,  771,  770,  766,    0,    0,
421       783,    0,  767,  763,    0,  778,  770,    0,  780,    0,
422
423       771,  118,  776,  790,  759,  773,  762,    0,  769,    0,
424       770,  763,  751,  752,  760,  763,  763,  748,  747,  749,
425       758,  774,    0,  752,  751,  754,  435,  444,  134,    0,
426       470,  206,  488,  497,  737,    0,  769,  738,  741,  766,
427       739,    0,  738,    0,  736,  731,  729,    0,  743,  743,
428       734,  506,  738,  725,  723,  726,  736,  734,  730,  733,
429         0,  717,  718,    0,  726,  731,  719,  717,  726,  725,
430       722,  706,  709,  711,  711,    0,  145,    0,  514,  532,
431       541,  720,  717,  713,  714,  703,    0,  705,  704,  729,
432       711,  727,  709,    0,    0,    0,    0,    0,    0,    0,
433
434         0,    0,  708,  709,  723,  694,    0,  705,  704,  687,
435       718,  700,  684,  698,  680,  678,    0,  681,    0,  694,
436       695,  683,  689,  160,  550,  559,  690,  690,  671,  704,
437       670,  685,  676,  127,  700,  681,  698,    0,  670,  679,
438       665,    0,  677,  676,  674,  691,  653,  689,  667,  661,
439       655,  661,  666,    0,    0,  568,  683,  682,    0,    0,
440       135,  660,  665,  662,  645,  650,  143,  660,  148,  649,
441       648,  656,    0,  642,  655,  652,  182,  639,    0,  668,
442         0,  646,  577,  185,  636,  634,  632,  631,  636,  630,
443       660,  626,  628,    0,  636,  638,  628,  628,  619,  621,
444
445         0,    0,  635,  620,  618,  621,  634,  622,    0,  621,
446       607,  612,  615,  624,    0,  640,  607,  618,  100,  616,
447       609,  605,  617,  606,  615,  610,  599,    0,  602,  611,
448       601,  596,  608,  603,  592,  605,  588,  590,  599,    0,
449         0,  596,  165,  589,  584,  588,  557,  566,  573,  496,
450       525,  449,  440,  444,  449,    0,  450,  451,  435,  436,
451       456,  422,  387,  394,  358,  356,  387,  371,  364,  351,
452       351,  355,  368,  352,  379,  361,  346,  350,  348,  374,
453         0,  342,  344,  354,  353,  345,  347,  203,  335,  335,
454       337,  354,  327,  322,    0,  320,  324,    0,  317,  322,
455
456       317,  326,    0,    0,  306,  297,  297,  301,  308,  293,
457       287,  318,  263,  246,  251,  249,  236,  267,  248,  250,
458       246,  232,  232,    0,  220,  217,  218,    0,  234,  213,
459       228,  213,  226,    0,  227,  218,  220,  213,    0,    0,
460       219,  215,  197,  209,  204,  204,    0,  205,  201,  208,
461       205,  201,  209,    0,    0,  199,    0,  190,  197,  194,
462         0,  180,    0,  171,    0,    0,    0,  180,  156,  143,
463       145,    0,  133,  143,  123,    0,    0,  925,  598,  602,
464       606,  610,  614,  618,  622,  626,  138,   67
465     } ;
466
467 static yyconst short int yy_def[589] =
468     {   0,
469       578,    1,  578,  579,  578,  578,  579,  580,  581,  579,
470       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
471       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
472       579,  579,  579,  579,  579,  579,  579,  579,  578,  578,
473       582,  580,  583,  584,  580,  581,  582,  578,  579,   14,
474       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
475       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
476       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
477       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
478       579,  579,  579,  579,  579,  579,  579,  585,  583,  584,
479
480       585,  585,  586,  584,  580,  579,   14,  579,  579,  579,
481       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
482       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
483       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
484       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
485       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
486       579,  579,  579,  585,  583,  578,  586,  104,  105,  579,
487        14,  579,  579,  579,  579,  579,  579,  579,  579,  579,
488       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
489       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
490
491       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
492       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
493       579,  579,  579,  579,  579,  579,  585,  165,  578,  587,
494       586,  580,  579,   14,  579,  579,  579,  579,  579,  579,
495       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
496       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
497       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
498       579,  579,  579,  579,  579,  579,  583,  588,  231,  579,
499        14,  579,  579,  579,  579,  579,  579,  579,  579,  579,
500       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
501
502       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
503       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
504       579,  579,  579,  586,  579,   14,  579,  579,  579,  579,
505       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
506       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
507       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
508       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
509       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
510       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
511       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
512
513       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
514       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
515       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
516       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
517       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
518       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
519       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
520       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
521       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
522       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
523
524       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
525       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
526       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
527       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
528       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
529       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
530       579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
531       579,  579,  579,  579,  579,  579,  579,    0,  578,  578,
532       578,  578,  578,  578,  578,  578,  578,  578
533     } ;
534
535 static yyconst short int yy_nxt[977] =
536     {   0,
537         4,    5,    6,    7,    8,    9,   10,    4,   11,   12,
538        13,    4,   14,   14,   14,   14,   14,   14,   14,   14,
539        14,    4,    4,   15,   16,    4,   17,   18,   19,   20,
540        21,   22,   23,    4,   24,   25,   26,   27,   28,   29,
541        30,   31,   32,   33,   34,   35,   36,    4,    4,    4,
542        37,   39,   40,   43,   52,   41,   44,   47,   48,  112,
543        67,   57,   69,   53,   70,   58,   68,  113,   54,   59,
544       103,   55,   75,   76,   45,   49,   50,   50,   50,   50,
545        50,   50,   50,   50,   50,   56,   60,   61,   62,   63,
546        79,   77,   64,   71,   72,   78,   96,  109,   65,   85,
547
548        80,   73,   87,   86,  110,   88,   81,   93,   98,   94,
549        39,   40,  139,   97,   41,   89,   43,  114,   90,   44,
550        47,   48,   91,  115,  119,  131,   99,  143,  132,  442,
551       151,  144,  102,  103,  120,  229,  103,   45,  100,  102,
552       103,  278,  443,  166,  140,  152,  255,  153,  201,   98,
553       104,  104,  104,  104,  104,  104,  104,  104,  104,  100,
554       147,  167,  256,  202,  166,  385,  365,   99,  392,  148,
555       366,  577,  393,  576,  575,  395,  149,  574,  150,  386,
556       396,  573,  167,  397,  572,  105,  106,  106,  106,  106,
557       106,  106,  106,  106,  106,  107,  107,  107,  107,  107,
558
559       107,  107,  107,  107,  101,  102,  103,   43,  464,  571,
560        44,  410,  404,  465,  570,  569,  164,  164,  164,  164,
561       164,  164,  164,  164,  164,  101,  405,  411,   45,  412,
562       508,  568,  567,  566,  565,  564,  563,  562,  561,  560,
563       559,  558,  509,  557,  556,  555,  554,  553,  552,  551,
564       550,  165,  101,  549,  548,  547,  546,  545,  544,  543,
565       542,  541,  540,  168,  168,  168,  168,  168,  168,  168,
566       168,  168,   43,  539,  538,   44,  537,  536,  535,  534,
567       533,  532,  531,  169,  169,  169,  169,  169,  169,  169,
568       169,  169,  169,   45,  530,  169,  169,  169,  169,  169,
569
570       169,  170,  170,  170,  170,  170,  170,  170,  170,  170,
571       171,  171,  171,  171,  171,  171,  171,  171,  171,  227,
572       227,  227,  227,  227,  227,  227,  227,  227,   98,  529,
573       528,  527,  526,  525,  524,  523,  228,  228,  228,  228,
574       228,  228,  228,  228,  228,  228,   99,  522,  228,  228,
575       228,  228,  228,  228,  578,  229,  103,  521,  520,  519,
576       518,  517,  516,  515,  514,  513,  230,  230,  230,  230,
577       230,  230,  230,  230,  230,  578,  512,  511,  510,  507,
578       506,  505,  504,  503,  502,  501,  500,  499,  498,  497,
579       496,  495,  494,  493,  492,  491,  490,  489,  488,  487,
580
581       486,  231,   42,   42,   42,   42,   42,   42,   42,   42,
582        42,  232,  232,  232,  232,  232,  232,  232,  232,  232,
583       232,  485,  484,  232,  232,  232,  232,  232,  232,  233,
584       233,  233,  233,  233,  233,  233,  233,  233,  234,  234,
585       234,  234,  234,  234,  234,  234,  234,   43,   43,   43,
586        43,   43,   43,   43,   43,   43,  277,  277,  277,  277,
587       277,  277,  277,  277,  277,  277,  483,  482,  277,  277,
588       277,  277,  277,  277,  166,  481,  480,  479,  478,  477,
589       476,  475,  279,  279,  279,  279,  279,  279,  279,  279,
590       279,  279,  167,  474,  279,  279,  279,  279,  279,  279,
591
592       280,  280,  280,  280,  280,  280,  280,  280,  280,  281,
593       281,  281,  281,  281,  281,  281,  281,  281,  295,  296,
594       297,  298,  299,  300,  301,  302,  324,  324,  324,  324,
595       324,  324,  324,  324,  324,  324,  473,  472,  324,  324,
596       324,  324,  324,  324,  325,  325,  325,  325,  325,  325,
597       325,  325,  325,  326,  326,  326,  326,  326,  326,  326,
598       326,  326,  356,  356,  356,  356,  356,  356,  356,  356,
599       356,  357,  357,  357,  357,  357,  357,  357,  357,  357,
600       383,  383,  383,  383,  383,  383,  383,  383,  383,  409,
601       409,  409,  409,  409,  409,  409,  409,  409,   38,  471,
602
603       470,   38,   42,   42,  469,   42,   46,   46,   46,   46,
604        47,   47,   47,   47,   43,   43,  468,   43,  100,  100,
605       467,  100,  101,  101,  466,  101,  103,  103,  463,  103,
606       462,  461,  460,  459,  458,  457,  456,  455,  454,  453,
607       452,  451,  450,  449,  448,  447,  446,  445,  444,  441,
608       440,  439,  438,  437,  436,  435,  434,  433,  432,  431,
609       430,  429,  428,  427,  426,  425,  424,  423,  422,  421,
610       420,  419,  418,  417,  416,  415,  414,  413,  408,  407,
611       406,  403,  402,  401,  400,  399,  398,  394,  391,  390,
612       389,  388,  387,  384,   49,  382,  381,  380,  379,  378,
613
614       377,  360,  376,  375,  374,  373,  372,  371,  370,  369,
615       368,  367,  364,  363,  362,  361,  360,  359,  358,  355,
616       354,  353,  352,  351,  350,  349,  348,  347,  346,  345,
617       344,  343,  342,  341,  340,  339,  338,  337,  336,  335,
618       334,  333,  332,  331,  330,  329,  328,  327,  323,  322,
619       321,  320,  319,  318,  317,  316,  315,  314,  313,  312,
620       311,  310,  309,  308,  307,  306,  305,  304,  303,  294,
621       293,  292,  291,  290,  289,  288,  287,  286,  285,  284,
622       283,  282,  276,  275,  274,  273,  272,  271,  270,  269,
623       268,  267,  266,  265,  264,  263,  262,  261,  260,  244,
624
625       259,  258,  257,  254,  253,  252,  251,  250,  249,  248,
626       247,  246,  245,  244,  243,  242,  241,  240,  239,  238,
627       237,  236,  235,  226,  225,  224,  223,  222,  221,  220,
628       219,  218,  217,  216,  215,  214,  213,  212,  211,  210,
629       209,  208,  207,  206,  205,  204,  203,  200,  199,  198,
630       197,  196,  195,  194,  193,  192,  191,  190,  189,  188,
631       187,  186,  185,  184,  183,  182,  181,  180,  179,  178,
632       177,  176,  175,  174,  173,  172,  101,  163,  162,  161,
633       160,  159,  158,  157,  156,  155,  154,  146,  145,  142,
634       141,  138,  137,  136,  135,  134,  133,  130,  129,  128,
635
636       127,  126,  125,  124,  123,  122,  121,  118,  117,  116,
637       111,  108,   48,  101,   48,   95,   92,   84,   83,   82,
638        74,   66,   51,  578,    3,  578,  578,  578,  578,  578,
639       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
640       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
641       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
642       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
643       578,  578,  578,  578,  578,  578
644     } ;
645
646 static yyconst short int yy_chk[977] =
647     {   0,
648         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
649         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
650         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
651         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
652         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
653         1,    5,    5,    8,   16,    5,    8,    9,    9,   54,
654        21,   18,   22,   16,   22,   18,   21,   54,   17,   18,
655       588,   17,   25,   25,    8,   14,   14,   14,   14,   14,
656        14,   14,   14,   14,   14,   17,   19,   19,   19,   19,
657        27,   26,   19,   23,   23,   26,   36,   52,   19,   31,
658
659        27,   23,   32,   31,   52,   32,   27,   34,   43,   34,
660        39,   39,   80,   36,   39,   32,   42,   56,   32,   42,
661        46,   46,   32,   56,   60,   73,   43,   83,   73,  419,
662        87,   83,  102,  102,   60,  229,  229,   42,   45,   45,
663        45,  587,  419,  103,   80,   87,  202,   87,  139,  277,
664        45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
665        86,  103,  202,  139,  324,  361,  334,  277,  367,   86,
666       334,  575,  367,  574,  573,  369,   86,  571,   86,  361,
667       369,  570,  324,  369,  569,   45,   49,   49,   49,   49,
668        49,   49,   49,   49,   49,   50,   50,   50,   50,   50,
669
670        50,   50,   50,   50,   99,   99,   99,  232,  443,  568,
671       232,  384,  377,  443,  564,  562,   99,   99,   99,   99,
672        99,   99,   99,   99,   99,   99,  377,  384,  232,  384,
673       488,  560,  559,  558,  556,  553,  552,  551,  550,  549,
674       548,  546,  488,  545,  544,  543,  542,  541,  538,  537,
675       536,   99,  104,  535,  533,  532,  531,  530,  529,  527,
676       526,  525,  523,  104,  104,  104,  104,  104,  104,  104,
677       104,  104,  105,  522,  521,  105,  520,  519,  518,  517,
678       516,  515,  514,  105,  105,  105,  105,  105,  105,  105,
679       105,  105,  105,  105,  513,  105,  105,  105,  105,  105,
680
681       105,  106,  106,  106,  106,  106,  106,  106,  106,  106,
682       107,  107,  107,  107,  107,  107,  107,  107,  107,  164,
683       164,  164,  164,  164,  164,  164,  164,  164,  165,  512,
684       511,  510,  509,  508,  507,  506,  165,  165,  165,  165,
685       165,  165,  165,  165,  165,  165,  165,  505,  165,  165,
686       165,  165,  165,  165,  167,  167,  167,  502,  501,  500,
687       499,  497,  496,  494,  493,  492,  167,  167,  167,  167,
688       167,  167,  167,  167,  167,  167,  491,  490,  489,  487,
689       486,  485,  484,  483,  482,  480,  479,  478,  477,  476,
690       475,  474,  473,  472,  471,  470,  469,  468,  467,  466,
691
692       465,  167,  168,  168,  168,  168,  168,  168,  168,  168,
693       168,  169,  169,  169,  169,  169,  169,  169,  169,  169,
694       169,  464,  463,  169,  169,  169,  169,  169,  169,  170,
695       170,  170,  170,  170,  170,  170,  170,  170,  171,  171,
696       171,  171,  171,  171,  171,  171,  171,  227,  227,  227,
697       227,  227,  227,  227,  227,  227,  228,  228,  228,  228,
698       228,  228,  228,  228,  228,  228,  462,  461,  228,  228,
699       228,  228,  228,  228,  231,  460,  459,  458,  457,  455,
700       454,  453,  231,  231,  231,  231,  231,  231,  231,  231,
701       231,  231,  231,  452,  231,  231,  231,  231,  231,  231,
702
703       233,  233,  233,  233,  233,  233,  233,  233,  233,  234,
704       234,  234,  234,  234,  234,  234,  234,  234,  252,  252,
705       252,  252,  252,  252,  252,  252,  279,  279,  279,  279,
706       279,  279,  279,  279,  279,  279,  451,  450,  279,  279,
707       279,  279,  279,  279,  280,  280,  280,  280,  280,  280,
708       280,  280,  280,  281,  281,  281,  281,  281,  281,  281,
709       281,  281,  325,  325,  325,  325,  325,  325,  325,  325,
710       325,  326,  326,  326,  326,  326,  326,  326,  326,  326,
711       356,  356,  356,  356,  356,  356,  356,  356,  356,  383,
712       383,  383,  383,  383,  383,  383,  383,  383,  579,  449,
713
714       448,  579,  580,  580,  447,  580,  581,  581,  581,  581,
715       582,  582,  582,  582,  583,  583,  446,  583,  584,  584,
716       445,  584,  585,  585,  444,  585,  586,  586,  442,  586,
717       439,  438,  437,  436,  435,  434,  433,  432,  431,  430,
718       429,  427,  426,  425,  424,  423,  422,  421,  420,  418,
719       417,  416,  414,  413,  412,  411,  410,  408,  407,  406,
720       405,  404,  403,  400,  399,  398,  397,  396,  395,  393,
721       392,  391,  390,  389,  388,  387,  386,  385,  382,  380,
722       378,  376,  375,  374,  372,  371,  370,  368,  366,  365,
723       364,  363,  362,  358,  357,  353,  352,  351,  350,  349,
724
725       348,  347,  346,  345,  344,  343,  341,  340,  339,  337,
726       336,  335,  333,  332,  331,  330,  329,  328,  327,  323,
727       322,  321,  320,  318,  316,  315,  314,  313,  312,  311,
728       310,  309,  308,  306,  305,  304,  303,  293,  292,  291,
729       290,  289,  288,  286,  285,  284,  283,  282,  275,  274,
730       273,  272,  271,  270,  269,  268,  267,  266,  265,  263,
731       262,  260,  259,  258,  257,  256,  255,  254,  253,  251,
732       250,  249,  247,  246,  245,  243,  241,  240,  239,  238,
733       237,  235,  226,  225,  224,  222,  221,  220,  219,  218,
734       217,  216,  215,  214,  213,  212,  211,  209,  207,  206,
735
736       205,  204,  203,  201,  199,  197,  196,  194,  193,  191,
737       188,  187,  186,  185,  182,  181,  180,  177,  176,  175,
738       174,  173,  172,  163,  162,  161,  160,  159,  158,  157,
739       156,  155,  154,  153,  152,  151,  150,  149,  148,  147,
740       146,  145,  144,  143,  142,  141,  140,  138,  137,  136,
741       134,  133,  132,  131,  130,  129,  128,  127,  126,  125,
742       124,  122,  121,  120,  119,  118,  117,  116,  115,  114,
743       113,  112,  111,  110,  109,  108,  100,   97,   96,   95,
744        94,   93,   92,   91,   90,   89,   88,   85,   84,   82,
745        81,   79,   78,   77,   76,   75,   74,   72,   70,   69,
746
747        68,   67,   65,   64,   63,   62,   61,   59,   58,   57,
748        53,   51,   47,   44,   41,   35,   33,   30,   29,   28,
749        24,   20,   15,    3,  578,  578,  578,  578,  578,  578,
750       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
751       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
752       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
753       578,  578,  578,  578,  578,  578,  578,  578,  578,  578,
754       578,  578,  578,  578,  578,  578
755     } ;
756
757 static yy_state_type yy_last_accepting_state;
758 static char *yy_last_accepting_cpos;
759
760 /* The intent behind this definition is that it'll catch
761  * any uses of REJECT which flex missed.
762  */
763 #define REJECT reject_used_but_not_detected
764 #define yymore() yymore_used_but_not_detected
765 #define YY_MORE_ADJ 0
766 #define YY_RESTORE_YY_MORE_OFFSET
767 char *yytext;
768 #line 1 "lexer.l"
769 #define INITIAL 0
770 /*
771  *   Copyright (C)1996-1997,1999 Ian Jackson
772  *  
773  *   This is free software; you can redistribute it and/or modify it
774  *   under the terms of the GNU General Public License as published by
775  *   the Free Software Foundation; either version 2 of the License, or
776  *   (at your option) any later version.
777  *  
778  *   This program is distributed in the hope that it will be useful, but
779  *   WITHOUT ANY WARRANTY; without even the implied warranty of
780  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
781  *   General Public License for more details.
782  *  
783  *   You should have received a copy of the GNU General Public License
784  *   along with userv; if not, write to the Free Software
785  *   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
786  */
787 #line 20 "lexer.l"
788
789
790
791
792
793 #include <syslog.h>
794 #include <assert.h>
795 #include <stdio.h>
796 #include <stdarg.h>
797 #include <ctype.h>
798 #include <string.h>
799 #include <unistd.h>
800 #include <pwd.h>
801 #include <grp.h>
802 #include <fnmatch.h>
803 #include <limits.h>
804 #include <dirent.h>
805 #include <sys/types.h>
806 #include <sys/stat.h>
807 #include <time.h>
808 #include <errno.h>
809
810 #include "config.h"
811 #include "common.h"
812 #include "daemon.h"
813 #include "lib.h"
814 #include "tokens.h"
815
816 #define HYPHEN '-'
817
818 typedef int directive_fnt(int dtoken);
819 static directive_fnt df_reject, df_execute, df_executefrompath;
820 static directive_fnt df_executefromdirectory, df_executebuiltin;
821 static directive_fnt df_errorstostderr, df_errorstosyslog, df_errorstofile;
822 static directive_fnt dfg_fdwant, dfg_setflag;
823 static directive_fnt df_reset, df_cd, df_userrcfile, df_include;
824 static directive_fnt df_includelookup, df_includedirectory;
825 static directive_fnt df_message, df_error, df_quit, df_eof;
826 static directive_fnt df_if, df_catchquit, df_errorspush;
827 static directive_fnt dfi_includeuserrcfile, dfi_includeclientconfig;
828 /* directive functions return:
829  *  0 for success having scanned up to and including end of line but not beyond,
830  *  or tokv_error or tokv_quit.
831  * They expect to parse the whitespace before their parameters (if any).
832  */
833
834 typedef int parmcondition_fnt(int ctoken, char *const *parmvalues, int *rtrue);
835 static parmcondition_fnt pcf_glob, pcf_range, pcf_grep;
836 /* all conditional functions return tokv_error for failure or 0 for success
837  *  at parsing and testing, in which case *rtrue is set to 0 or 1.
838  *  On success they have scanned up to and including the condition's
839  *  terminating newline; the pcf_... functions expect to parse the whitespace
840  *  between the parameter name and the condition's arguments.
841  * Otherwise they return tokv_error.
842  * The parameter-based conditionals take a list of parameter values
843  * as obtained from the parameter functions and pa_parameter,
844  * and do _not_ free it.
845  */
846
847 typedef int parameter_fnt(int ptoken, char ***rvalues);
848 static parameter_fnt pf_service;
849 static parameter_fnt pf_callinguser, pf_serviceuser;
850 static parameter_fnt pf_callinggroup, pf_servicegroup;
851 static parameter_fnt pf_callingusershell, pf_serviceusershell;
852 /* Parameter functions return tokv_error or 0 for success at parsing
853  * and determining the value, in which case *rvalues is made to be
854  * a mallocd null-terminated array of pointers to mallocd strings.
855  * freeparm can be used to free such an array.
856  */
857
858 typedef int builtinserviceparse_fnt(char ***rnewargs);
859 static builtinserviceparse_fnt bispa_none, bispa_parameter;
860 /* These parse the arguments to a builtin service, including the
861  * newline at the end of the line.  *rnewargs will initially be
862  * null, indicating that no arguments are to be set; the function
863  * may store a mallocd array of mallocd strings in it,
864  * containing the arguments it wishes to have set (null-pointer
865  * terminated).
866  */
867
868 static int yylex(void);
869 /* Returns a token (which may be an eof or error exception) */
870
871 static directive_fnt *lr_dir;
872 static parmcondition_fnt *lr_parmcond;
873 static builtinserviceparse_fnt *lr_bispa;
874 static builtinserviceexec_fnt *lr_bisexec;
875 static parameter_fnt *lr_parameter;
876 static int lr_loglevel, lr_logfacility, lr_min, lr_max, *lr_flag;
877 static int lr_flagval, lr_controlend;
878 static int lr_fdwant_readwrite; /* -1=never, 0=opt, 1=always */
879
880 /* Forward declarations of things used in lexer and parser */
881
882 struct parser_state {
883   int lineno, reportlineno, notedreferer, isinternal;
884   const char *filename;
885   struct stat filestab;
886   YY_BUFFER_STATE ybuf;
887   struct parser_state *upstate;
888 };
889
890 static struct parser_state *cstate;
891
892 struct error_handling {
893   int handling; /* One of the error handling modes tokt_ehandlemode */
894   int logfacility, loglevel;
895   int filekeep; /* File is in use by higher-level errors-push, leave it open */
896   FILE *file;
897   char *filename;
898 };
899
900 static struct error_handling eh = { tokv_word_errorstostderr, 0,0,0,0,0 };
901
902 static int dequote(char *inplace);
903
904 #define YY_NO_UNPUT
905
906
907 /* Macros after this point can all be overridden by user definitions in
908  * section 1.
909  */
910
911 #ifndef YY_SKIP_YYWRAP
912 #ifdef __cplusplus
913 extern "C" int yywrap YY_PROTO(( void ));
914 #else
915 extern int yywrap YY_PROTO(( void ));
916 #endif
917 #endif
918
919 #ifndef YY_NO_UNPUT
920 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
921 #endif
922
923 #ifndef yytext_ptr
924 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
925 #endif
926
927 #ifdef YY_NEED_STRLEN
928 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
929 #endif
930
931 #ifndef YY_NO_INPUT
932 #ifdef __cplusplus
933 static int yyinput YY_PROTO(( void ));
934 #else
935 static int input YY_PROTO(( void ));
936 #endif
937 #endif
938
939 #if YY_STACK_USED
940 static int yy_start_stack_ptr = 0;
941 static int yy_start_stack_depth = 0;
942 static int *yy_start_stack = 0;
943 #ifndef YY_NO_PUSH_STATE
944 static void yy_push_state YY_PROTO(( int new_state ));
945 #endif
946 #ifndef YY_NO_POP_STATE
947 static void yy_pop_state YY_PROTO(( void ));
948 #endif
949 #ifndef YY_NO_TOP_STATE
950 static int yy_top_state YY_PROTO(( void ));
951 #endif
952
953 #else
954 #define YY_NO_PUSH_STATE 1
955 #define YY_NO_POP_STATE 1
956 #define YY_NO_TOP_STATE 1
957 #endif
958
959 #ifdef YY_MALLOC_DECL
960 YY_MALLOC_DECL
961 #else
962 #if __STDC__
963 #ifndef __cplusplus
964 #include <stdlib.h>
965 #endif
966 #else
967 /* Just try to get by without declaring the routines.  This will fail
968  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
969  * or sizeof(void*) != sizeof(int).
970  */
971 #endif
972 #endif
973
974 /* Amount of stuff to slurp up with each read. */
975 #ifndef YY_READ_BUF_SIZE
976 #define YY_READ_BUF_SIZE 8192
977 #endif
978
979 /* Copy whatever the last rule matched to the standard output. */
980
981 #ifndef ECHO
982 /* This used to be an fputs(), but since the string might contain NUL's,
983  * we now use fwrite().
984  */
985 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
986 #endif
987
988 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
989  * is returned in "result".
990  */
991 #ifndef YY_INPUT
992 #define YY_INPUT(buf,result,max_size) \
993         if ( yy_current_buffer->yy_is_interactive ) \
994                 { \
995                 int c = '*', n; \
996                 for ( n = 0; n < max_size && \
997                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
998                         buf[n] = (char) c; \
999                 if ( c == '\n' ) \
1000                         buf[n++] = (char) c; \
1001                 if ( c == EOF && ferror( yyin ) ) \
1002                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1003                 result = n; \
1004                 } \
1005         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1006                   && ferror( yyin ) ) \
1007                 YY_FATAL_ERROR( "input in flex scanner failed" );
1008 #endif
1009
1010 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1011  * we don't want an extra ';' after the "return" because that will cause
1012  * some compilers to complain about unreachable statements.
1013  */
1014 #ifndef yyterminate
1015 #define yyterminate() return YY_NULL
1016 #endif
1017
1018 /* Number of entries by which start-condition stack grows. */
1019 #ifndef YY_START_STACK_INCR
1020 #define YY_START_STACK_INCR 25
1021 #endif
1022
1023 /* Report a fatal error. */
1024 #ifndef YY_FATAL_ERROR
1025 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1026 #endif
1027
1028 /* Default declaration of generated scanner - a define so the user can
1029  * easily add parameters.
1030  */
1031 #ifndef YY_DECL
1032 #define YY_DECL int yylex YY_PROTO(( void ))
1033 #endif
1034
1035 /* Code executed at the beginning of each rule, after yytext and yyleng
1036  * have been set up.
1037  */
1038 #ifndef YY_USER_ACTION
1039 #define YY_USER_ACTION
1040 #endif
1041
1042 /* Code executed at the end of each rule. */
1043 #ifndef YY_BREAK
1044 #define YY_BREAK break;
1045 #endif
1046
1047 #define YY_RULE_SETUP \
1048         YY_USER_ACTION
1049
1050 YY_DECL
1051         {
1052         register yy_state_type yy_current_state;
1053         register char *yy_cp, *yy_bp;
1054         register int yy_act;
1055
1056 #line 142 "lexer.l"
1057
1058
1059
1060         if ( yy_init )
1061                 {
1062                 yy_init = 0;
1063
1064 #ifdef YY_USER_INIT
1065                 YY_USER_INIT;
1066 #endif
1067
1068                 if ( ! yy_start )
1069                         yy_start = 1;   /* first start state */
1070
1071                 if ( ! yyin )
1072                         yyin = stdin;
1073
1074                 if ( ! yyout )
1075                         yyout = stdout;
1076
1077                 if ( ! yy_current_buffer )
1078                         yy_current_buffer =
1079                                 yy_create_buffer( yyin, YY_BUF_SIZE );
1080
1081                 yy_load_buffer_state();
1082                 }
1083
1084         while ( 1 )             /* loops until end-of-file is reached */
1085                 {
1086                 yy_cp = yy_c_buf_p;
1087
1088                 /* Support of yytext. */
1089                 *yy_cp = yy_hold_char;
1090
1091                 /* yy_bp points to the position in yy_ch_buf of the start of
1092                  * the current run.
1093                  */
1094                 yy_bp = yy_cp;
1095
1096                 yy_current_state = yy_start;
1097 yy_match:
1098                 do
1099                         {
1100                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1101                         if ( yy_accept[yy_current_state] )
1102                                 {
1103                                 yy_last_accepting_state = yy_current_state;
1104                                 yy_last_accepting_cpos = yy_cp;
1105                                 }
1106                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1107                                 {
1108                                 yy_current_state = (int) yy_def[yy_current_state];
1109                                 if ( yy_current_state >= 579 )
1110                                         yy_c = yy_meta[(unsigned int) yy_c];
1111                                 }
1112                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1113                         ++yy_cp;
1114                         }
1115                 while ( yy_base[yy_current_state] != 925 );
1116
1117 yy_find_action:
1118                 yy_act = yy_accept[yy_current_state];
1119                 if ( yy_act == 0 )
1120                         { /* have to back up */
1121                         yy_cp = yy_last_accepting_cpos;
1122                         yy_current_state = yy_last_accepting_state;
1123                         yy_act = yy_accept[yy_current_state];
1124                         }
1125
1126                 YY_DO_BEFORE_ACTION;
1127
1128
1129 do_action:      /* This label is used only to access EOF actions. */
1130
1131
1132                 switch ( yy_act )
1133         { /* beginning of action switch */
1134                         case 0: /* must back up */
1135                         /* undo the effects of YY_DO_BEFORE_ACTION */
1136                         *yy_cp = yy_hold_char;
1137                         yy_cp = yy_last_accepting_cpos;
1138                         yy_current_state = yy_last_accepting_state;
1139                         goto yy_find_action;
1140
1141 case 1:
1142 YY_RULE_SETUP
1143 #line 144 "lexer.l"
1144 { lr_dir= df_reject; return tokv_word_reject; }
1145         YY_BREAK
1146 case 2:
1147 YY_RULE_SETUP
1148 #line 145 "lexer.l"
1149 { lr_dir= df_executefromdirectory; return tokv_word_executefromdirectory; }
1150         YY_BREAK
1151 case 3:
1152 YY_RULE_SETUP
1153 #line 146 "lexer.l"
1154 { lr_dir= df_executefrompath; return tokv_word_executefrompath; }
1155         YY_BREAK
1156 case 4:
1157 YY_RULE_SETUP
1158 #line 147 "lexer.l"
1159 { lr_dir= df_executebuiltin; return tokv_word_executebuiltin; }
1160         YY_BREAK
1161 case 5:
1162 YY_RULE_SETUP
1163 #line 148 "lexer.l"
1164 { lr_dir= df_errorstostderr; return tokv_word_errorstostderr; }
1165         YY_BREAK
1166 case 6:
1167 YY_RULE_SETUP
1168 #line 149 "lexer.l"
1169 { lr_dir= df_errorstosyslog; return tokv_word_errorstosyslog; }
1170         YY_BREAK
1171 case 7:
1172 YY_RULE_SETUP
1173 #line 150 "lexer.l"
1174 { lr_dir= df_errorstofile; return tokv_word_errorstofile; }
1175         YY_BREAK
1176 case 8:
1177 YY_RULE_SETUP
1178 #line 151 "lexer.l"
1179 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=1; return tokv_word_requirefd; }
1180         YY_BREAK
1181 case 9:
1182 YY_RULE_SETUP
1183 #line 152 "lexer.l"
1184 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_allowfd; }
1185         YY_BREAK
1186 case 10:
1187 YY_RULE_SETUP
1188 #line 153 "lexer.l"
1189 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_nullfd; }
1190         YY_BREAK
1191 case 11:
1192 YY_RULE_SETUP
1193 #line 154 "lexer.l"
1194 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=-1; return tokv_word_rejectfd; }
1195         YY_BREAK
1196 case 12:
1197 YY_RULE_SETUP
1198 #line 155 "lexer.l"
1199 { lr_dir= dfg_fdwant; lr_fdwant_readwrite=-1; return tokv_word_ignorefd; }
1200         YY_BREAK
1201 case 13:
1202 YY_RULE_SETUP
1203 #line 156 "lexer.l"
1204 { lr_dir= dfg_setflag; lr_flag= &setenvironment; lr_flagval= 1; return tokv_word_setenvironment; }
1205         YY_BREAK
1206 case 14:
1207 YY_RULE_SETUP
1208 #line 157 "lexer.l"
1209 { lr_dir= dfg_setflag; lr_flag= &setenvironment; lr_flagval= 0; return tokv_word_nosetenvironment; }
1210         YY_BREAK
1211 case 15:
1212 YY_RULE_SETUP
1213 #line 158 "lexer.l"
1214 { lr_dir= dfg_setflag; lr_flag= &suppressargs; lr_flagval= 1; return tokv_word_suppressargs; }
1215         YY_BREAK
1216 case 16:
1217 YY_RULE_SETUP
1218 #line 159 "lexer.l"
1219 { lr_dir= dfg_setflag; lr_flag= &suppressargs; lr_flagval= 0; return tokv_word_nosuppressargs; }
1220         YY_BREAK
1221 case 17:
1222 YY_RULE_SETUP
1223 #line 160 "lexer.l"
1224 { lr_dir= dfg_setflag; lr_flag= &disconnecthup; lr_flagval= 1; return tokv_word_disconnecthup; }
1225         YY_BREAK
1226 case 18:
1227 YY_RULE_SETUP
1228 #line 161 "lexer.l"
1229 { lr_dir= dfg_setflag; lr_flag= &disconnecthup; lr_flagval= 0; return tokv_word_nodisconnecthup; }
1230         YY_BREAK
1231 case 19:
1232 YY_RULE_SETUP
1233 #line 162 "lexer.l"
1234 { lr_dir= df_cd; return tokv_word_cd; }
1235         YY_BREAK
1236 case 20:
1237 YY_RULE_SETUP
1238 #line 163 "lexer.l"
1239 { lr_dir= df_userrcfile; return tokv_word_userrcfile; }
1240         YY_BREAK
1241 case 21:
1242 YY_RULE_SETUP
1243 #line 164 "lexer.l"
1244 { lr_dir= df_include; return tokv_word_include; }
1245         YY_BREAK
1246 case 22:
1247 YY_RULE_SETUP
1248 #line 165 "lexer.l"
1249 { lr_dir= df_include; return tokv_word_includeifexist; }
1250         YY_BREAK
1251 case 23:
1252 YY_RULE_SETUP
1253 #line 166 "lexer.l"
1254 { lr_dir= df_includelookup; return tokv_word_includelookup; }
1255         YY_BREAK
1256 case 24:
1257 YY_RULE_SETUP
1258 #line 167 "lexer.l"
1259 { lr_dir= df_includelookup; return tokv_word_includelookupall; }
1260         YY_BREAK
1261 case 25:
1262 YY_RULE_SETUP
1263 #line 168 "lexer.l"
1264 { lr_dir= df_includedirectory; return tokv_word_includedirectory; }
1265         YY_BREAK
1266 case 26:
1267 YY_RULE_SETUP
1268 #line 169 "lexer.l"
1269 { lr_dir= df_message; return tokv_word_message; }
1270         YY_BREAK
1271 case 27:
1272 YY_RULE_SETUP
1273 #line 170 "lexer.l"
1274 { lr_dir= df_include; return tokv_word_includesysconfig; }
1275         YY_BREAK
1276 case 28:
1277 YY_RULE_SETUP
1278 #line 171 "lexer.l"
1279 { lr_dir= dfi_includeuserrcfile; return tokv_word_includeuserrcfile; }
1280         YY_BREAK
1281 case 29:
1282 YY_RULE_SETUP
1283 #line 172 "lexer.l"
1284 { lr_dir= dfi_includeclientconfig; return tokv_word_includeclientconfig; }
1285         YY_BREAK
1286 case 30:
1287 YY_RULE_SETUP
1288 #line 173 "lexer.l"
1289 { lr_dir= df_quit; return tokv_word_quit; }
1290         YY_BREAK
1291 case 31:
1292 YY_RULE_SETUP
1293 #line 174 "lexer.l"
1294 { lr_dir= df_eof; return tokv_word_eof; }
1295         YY_BREAK
1296 case 32:
1297 YY_RULE_SETUP
1298 #line 175 "lexer.l"
1299 { lr_dir= df_if; return tokv_word_if; }
1300         YY_BREAK
1301 case 33:
1302 YY_RULE_SETUP
1303 #line 176 "lexer.l"
1304 { lr_dir= df_catchquit; return tokv_word_catchquit; }
1305         YY_BREAK
1306 case 34:
1307 YY_RULE_SETUP
1308 #line 177 "lexer.l"
1309 { lr_dir= df_errorspush; return tokv_word_errorspush; }
1310         YY_BREAK
1311 case 35:
1312 YY_RULE_SETUP
1313 #line 178 "lexer.l"
1314 { lr_controlend= tokv_word_if; return tokv_word_elif; }
1315         YY_BREAK
1316 case 36:
1317 YY_RULE_SETUP
1318 #line 179 "lexer.l"
1319 { lr_controlend= tokv_word_if; return tokv_word_else; }
1320         YY_BREAK
1321 case 37:
1322 YY_RULE_SETUP
1323 #line 180 "lexer.l"
1324 { lr_controlend= tokv_word_if; return tokv_word_fi; }
1325         YY_BREAK
1326 case 38:
1327 YY_RULE_SETUP
1328 #line 181 "lexer.l"
1329 { lr_controlend= tokv_word_catchquit; return tokv_word_hctac; }
1330         YY_BREAK
1331 case 39:
1332 YY_RULE_SETUP
1333 #line 182 "lexer.l"
1334 { lr_controlend= tokv_word_errorspush; return tokv_word_srorre; }
1335         YY_BREAK
1336 case 40:
1337 YY_RULE_SETUP
1338 #line 183 "lexer.l"
1339 { lr_parmcond= pcf_glob; return tokv_word_glob; }
1340         YY_BREAK
1341 case 41:
1342 YY_RULE_SETUP
1343 #line 184 "lexer.l"
1344 { lr_parmcond= pcf_range; return tokv_word_range; }
1345         YY_BREAK
1346 case 42:
1347 YY_RULE_SETUP
1348 #line 185 "lexer.l"
1349 { lr_parmcond= pcf_grep; return tokv_word_grep; }
1350         YY_BREAK
1351 case 43:
1352 YY_RULE_SETUP
1353 #line 186 "lexer.l"
1354 { lr_bispa= bispa_none; lr_bisexec= bisexec_environment; return tokv_word_environment; }
1355         YY_BREAK
1356 case 44:
1357 YY_RULE_SETUP
1358 #line 187 "lexer.l"
1359 { lr_bispa= bispa_parameter; lr_bisexec= bisexec_parameter; return tokv_word_parameter; }
1360         YY_BREAK
1361 case 45:
1362 YY_RULE_SETUP
1363 #line 188 "lexer.l"
1364 { lr_bispa= bispa_none; lr_bisexec= bisexec_version; return tokv_word_version; }
1365         YY_BREAK
1366 case 46:
1367 YY_RULE_SETUP
1368 #line 189 "lexer.l"
1369 { lr_bispa= bispa_none; lr_bisexec= bisexec_toplevel; return tokv_word_toplevel; }
1370         YY_BREAK
1371 case 47:
1372 YY_RULE_SETUP
1373 #line 190 "lexer.l"
1374 { lr_bispa= bispa_none; lr_bisexec= bisexec_override; return tokv_word_override; }
1375         YY_BREAK
1376 case 48:
1377 YY_RULE_SETUP
1378 #line 191 "lexer.l"
1379 { lr_bispa= bispa_none; lr_bisexec= bisexec_shutdown; return tokv_word_shutdown; }
1380         YY_BREAK
1381 case 49:
1382 YY_RULE_SETUP
1383 #line 192 "lexer.l"
1384 { lr_bispa= bispa_none; lr_bisexec= bisexec_reset; lr_dir= df_reset; return tokv_word_reset; }
1385         YY_BREAK
1386 case 50:
1387 YY_RULE_SETUP
1388 #line 193 "lexer.l"
1389 { lr_bispa= bispa_none; lr_bisexec= bisexec_execute; lr_dir= df_execute; return tokv_word_execute; }
1390         YY_BREAK
1391 case 51:
1392 YY_RULE_SETUP
1393 #line 194 "lexer.l"
1394 { lr_bispa= bispa_none; lr_bisexec= bisexec_help; return tokv_word_help; }
1395         YY_BREAK
1396 case 52:
1397 YY_RULE_SETUP
1398 #line 195 "lexer.l"
1399 { lr_parameter= pf_service; return tokv_word_service; }
1400         YY_BREAK
1401 case 53:
1402 YY_RULE_SETUP
1403 #line 196 "lexer.l"
1404 { lr_parameter= pf_callinguser; return tokv_word_callinguser; }
1405         YY_BREAK
1406 case 54:
1407 YY_RULE_SETUP
1408 #line 197 "lexer.l"
1409 { lr_parameter= pf_callinggroup; return tokv_word_callinggroup; }
1410         YY_BREAK
1411 case 55:
1412 YY_RULE_SETUP
1413 #line 198 "lexer.l"
1414 { lr_parameter= pf_callingusershell; return tokv_word_callingusershell; }
1415         YY_BREAK
1416 case 56:
1417 YY_RULE_SETUP
1418 #line 199 "lexer.l"
1419 { lr_parameter= pf_serviceuser; return tokv_word_serviceuser; }
1420         YY_BREAK
1421 case 57:
1422 YY_RULE_SETUP
1423 #line 200 "lexer.l"
1424 { lr_parameter= pf_servicegroup; return tokv_word_servicegroup; }
1425         YY_BREAK
1426 case 58:
1427 YY_RULE_SETUP
1428 #line 201 "lexer.l"
1429 { lr_parameter= pf_serviceusershell; return tokv_word_serviceusershell; }
1430         YY_BREAK
1431 case 59:
1432 YY_RULE_SETUP
1433 #line 202 "lexer.l"
1434 { lr_loglevel= LOG_DEBUG; return tokv_syslog_debug; }
1435         YY_BREAK
1436 case 60:
1437 YY_RULE_SETUP
1438 #line 203 "lexer.l"
1439 { lr_loglevel= LOG_INFO; return tokv_syslog_info; }
1440         YY_BREAK
1441 case 61:
1442 YY_RULE_SETUP
1443 #line 204 "lexer.l"
1444 { lr_loglevel= LOG_NOTICE; return tokv_syslog_notice; }
1445         YY_BREAK
1446 case 62:
1447 YY_RULE_SETUP
1448 #line 205 "lexer.l"
1449 { lr_loglevel= LOG_WARNING; return tokv_syslog_warning; }
1450         YY_BREAK
1451 case 63:
1452 YY_RULE_SETUP
1453 #line 206 "lexer.l"
1454 { lr_loglevel= LOG_ERR; return tokv_syslog_err; }
1455         YY_BREAK
1456 case 64:
1457 YY_RULE_SETUP
1458 #line 207 "lexer.l"
1459 { lr_loglevel= LOG_CRIT; return tokv_syslog_crit; }
1460         YY_BREAK
1461 case 65:
1462 YY_RULE_SETUP
1463 #line 208 "lexer.l"
1464 { lr_loglevel= LOG_ALERT; return tokv_syslog_alert; }
1465         YY_BREAK
1466 case 66:
1467 YY_RULE_SETUP
1468 #line 209 "lexer.l"
1469 { lr_loglevel= LOG_EMERG; return tokv_syslog_emerg; }
1470         YY_BREAK
1471 case 67:
1472 YY_RULE_SETUP
1473 #line 210 "lexer.l"
1474 { lr_logfacility= LOG_AUTHPRIV; return tokv_syslog_authpriv; }
1475         YY_BREAK
1476 case 68:
1477 YY_RULE_SETUP
1478 #line 211 "lexer.l"
1479 { lr_logfacility= LOG_CRON; return tokv_syslog_cron; }
1480         YY_BREAK
1481 case 69:
1482 YY_RULE_SETUP
1483 #line 212 "lexer.l"
1484 { lr_logfacility= LOG_DAEMON; return tokv_syslog_daemon; }
1485         YY_BREAK
1486 case 70:
1487 YY_RULE_SETUP
1488 #line 213 "lexer.l"
1489 { lr_logfacility= LOG_KERN; return tokv_syslog_kern; }
1490         YY_BREAK
1491 case 71:
1492 YY_RULE_SETUP
1493 #line 214 "lexer.l"
1494 { lr_logfacility= LOG_LPR; return tokv_syslog_lpr; }
1495         YY_BREAK
1496 case 72:
1497 YY_RULE_SETUP
1498 #line 215 "lexer.l"
1499 { lr_logfacility= LOG_MAIL; return tokv_syslog_mail; }
1500         YY_BREAK
1501 case 73:
1502 YY_RULE_SETUP
1503 #line 216 "lexer.l"
1504 { lr_logfacility= LOG_NEWS; return tokv_syslog_news; }
1505         YY_BREAK
1506 case 74:
1507 YY_RULE_SETUP
1508 #line 217 "lexer.l"
1509 { lr_logfacility= LOG_SYSLOG; return tokv_syslog_syslog; }
1510         YY_BREAK
1511 case 75:
1512 YY_RULE_SETUP
1513 #line 218 "lexer.l"
1514 { lr_logfacility= LOG_USER; return tokv_syslog_user; }
1515         YY_BREAK
1516 case 76:
1517 YY_RULE_SETUP
1518 #line 219 "lexer.l"
1519 { lr_logfacility= LOG_UUCP; return tokv_syslog_uucp; }
1520         YY_BREAK
1521 case 77:
1522 YY_RULE_SETUP
1523 #line 220 "lexer.l"
1524 { lr_logfacility= LOG_LOCAL0; return tokv_syslog_local0; }
1525         YY_BREAK
1526 case 78:
1527 YY_RULE_SETUP
1528 #line 221 "lexer.l"
1529 { lr_logfacility= LOG_LOCAL1; return tokv_syslog_local1; }
1530         YY_BREAK
1531 case 79:
1532 YY_RULE_SETUP
1533 #line 222 "lexer.l"
1534 { lr_logfacility= LOG_LOCAL2; return tokv_syslog_local2; }
1535         YY_BREAK
1536 case 80:
1537 YY_RULE_SETUP
1538 #line 223 "lexer.l"
1539 { lr_logfacility= LOG_LOCAL3; return tokv_syslog_local3; }
1540         YY_BREAK
1541 case 81:
1542 YY_RULE_SETUP
1543 #line 224 "lexer.l"
1544 { lr_logfacility= LOG_LOCAL4; return tokv_syslog_local4; }
1545         YY_BREAK
1546 case 82:
1547 YY_RULE_SETUP
1548 #line 225 "lexer.l"
1549 { lr_logfacility= LOG_LOCAL5; return tokv_syslog_local5; }
1550         YY_BREAK
1551 case 83:
1552 YY_RULE_SETUP
1553 #line 226 "lexer.l"
1554 { lr_logfacility= LOG_LOCAL6; return tokv_syslog_local6; }
1555         YY_BREAK
1556 case 84:
1557 YY_RULE_SETUP
1558 #line 227 "lexer.l"
1559 { lr_logfacility= LOG_LOCAL7; return tokv_syslog_local7; }
1560         YY_BREAK
1561 case 85:
1562 YY_RULE_SETUP
1563 #line 228 "lexer.l"
1564 { return tokv_word_read; }
1565         YY_BREAK
1566 case 86:
1567 YY_RULE_SETUP
1568 #line 229 "lexer.l"
1569 { return tokv_word_write; }
1570         YY_BREAK
1571 case 87:
1572 YY_RULE_SETUP
1573 #line 230 "lexer.l"
1574 { return tokv_dollar; }
1575         YY_BREAK
1576 case 88:
1577 YY_RULE_SETUP
1578 #line 231 "lexer.l"
1579 { return tokv_openparen; }
1580         YY_BREAK
1581 case 89:
1582 YY_RULE_SETUP
1583 #line 232 "lexer.l"
1584 { return tokv_closeparen; }
1585         YY_BREAK
1586 case 90:
1587 YY_RULE_SETUP
1588 #line 233 "lexer.l"
1589 { return tokv_not; }
1590         YY_BREAK
1591 case 91:
1592 YY_RULE_SETUP
1593 #line 234 "lexer.l"
1594 { return tokv_and; }
1595         YY_BREAK
1596 case 92:
1597 YY_RULE_SETUP
1598 #line 235 "lexer.l"
1599 { return tokv_or; }
1600         YY_BREAK
1601 case 93:
1602 YY_RULE_SETUP
1603 #line 236 "lexer.l"
1604 { lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; }
1605         YY_BREAK
1606 case 94:
1607 YY_RULE_SETUP
1608 #line 240 "lexer.l"
1609 {
1610                           char *ep;
1611                           lr_min=lr_max= (int)strtoul(yytext,&ep,10);
1612                           assert(!*ep);
1613                           return tokv_ordinal;
1614                         }
1615         YY_BREAK
1616 case 95:
1617 YY_RULE_SETUP
1618 #line 246 "lexer.l"
1619 {
1620                           char *ep;
1621                           lr_min= (int)strtoul(yytext,&ep,10);
1622                           assert(*ep == HYPHEN);
1623                           assert(*++ep);
1624                           lr_max= (int)strtoul(ep,&ep,10);
1625                           assert(!*ep);
1626                           if (lr_max < lr_min) {
1627                             parseerrprint("fd range has min > max");
1628                             return tokv_error;
1629                           }
1630                           return tokv_fdrange;
1631                         }
1632         YY_BREAK
1633 case 96:
1634 YY_RULE_SETUP
1635 #line 259 "lexer.l"
1636 {
1637                           char *ep;
1638                           lr_min= (int)strtoul(yytext,&ep,10);
1639                           assert(*ep == HYPHEN);
1640                           assert(!*++ep);
1641                           lr_max=-1;
1642                           return tokv_fdstoend;
1643                         }
1644         YY_BREAK
1645 case 97:
1646 YY_RULE_SETUP
1647 #line 267 "lexer.l"
1648 return tokv_lwsp;
1649         YY_BREAK
1650 case 98:
1651 YY_RULE_SETUP
1652 #line 268 "lexer.l"
1653 cstate->lineno++; return tokv_newline;
1654         YY_BREAK
1655 case 99:
1656 YY_RULE_SETUP
1657 #line 269 "lexer.l"
1658 cstate->lineno++; return tokv_newline;
1659         YY_BREAK
1660 case 100:
1661 YY_RULE_SETUP
1662 #line 270 "lexer.l"
1663 {
1664                           parseerrprint("missing newline at eof after comment");
1665                           return tokv_error;
1666                         }
1667         YY_BREAK
1668 case 101:
1669 YY_RULE_SETUP
1670 #line 274 "lexer.l"
1671 {
1672                           return dequote(yytext);
1673                         }
1674         YY_BREAK
1675 case 102:
1676 YY_RULE_SETUP
1677 #line 277 "lexer.l"
1678 {
1679                           parseerrprint("misquoted or unterminated string");
1680                           return tokv_error;
1681                         }
1682         YY_BREAK
1683 case 103:
1684 YY_RULE_SETUP
1685 #line 281 "lexer.l"
1686 return tokv_barestring;
1687         YY_BREAK
1688 case YY_STATE_EOF(INITIAL):
1689 #line 282 "lexer.l"
1690 return tokv_eof;
1691         YY_BREAK
1692 case 104:
1693 YY_RULE_SETUP
1694 #line 285 "lexer.l"
1695 ECHO;
1696         YY_BREAK
1697
1698         case YY_END_OF_BUFFER:
1699                 {
1700                 /* Amount of text matched not including the EOB char. */
1701                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1702
1703                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1704                 *yy_cp = yy_hold_char;
1705                 YY_RESTORE_YY_MORE_OFFSET
1706
1707                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1708                         {
1709                         /* We're scanning a new file or input source.  It's
1710                          * possible that this happened because the user
1711                          * just pointed yyin at a new source and called
1712                          * yylex().  If so, then we have to assure
1713                          * consistency between yy_current_buffer and our
1714                          * globals.  Here is the right place to do so, because
1715                          * this is the first action (other than possibly a
1716                          * back-up) that will match for the new input source.
1717                          */
1718                         yy_n_chars = yy_current_buffer->yy_n_chars;
1719                         yy_current_buffer->yy_input_file = yyin;
1720                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1721                         }
1722
1723                 /* Note that here we test for yy_c_buf_p "<=" to the position
1724                  * of the first EOB in the buffer, since yy_c_buf_p will
1725                  * already have been incremented past the NUL character
1726                  * (since all states make transitions on EOB to the
1727                  * end-of-buffer state).  Contrast this with the test
1728                  * in input().
1729                  */
1730                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1731                         { /* This was really a NUL. */
1732                         yy_state_type yy_next_state;
1733
1734                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1735
1736                         yy_current_state = yy_get_previous_state();
1737
1738                         /* Okay, we're now positioned to make the NUL
1739                          * transition.  We couldn't have
1740                          * yy_get_previous_state() go ahead and do it
1741                          * for us because it doesn't know how to deal
1742                          * with the possibility of jamming (and we don't
1743                          * want to build jamming into it because then it
1744                          * will run more slowly).
1745                          */
1746
1747                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1748
1749                         yy_bp = yytext_ptr + YY_MORE_ADJ;
1750
1751                         if ( yy_next_state )
1752                                 {
1753                                 /* Consume the NUL. */
1754                                 yy_cp = ++yy_c_buf_p;
1755                                 yy_current_state = yy_next_state;
1756                                 goto yy_match;
1757                                 }
1758
1759                         else
1760                                 {
1761                                 yy_cp = yy_c_buf_p;
1762                                 goto yy_find_action;
1763                                 }
1764                         }
1765
1766                 else switch ( yy_get_next_buffer() )
1767                         {
1768                         case EOB_ACT_END_OF_FILE:
1769                                 {
1770                                 yy_did_buffer_switch_on_eof = 0;
1771
1772                                 if ( yywrap() )
1773                                         {
1774                                         /* Note: because we've taken care in
1775                                          * yy_get_next_buffer() to have set up
1776                                          * yytext, we can now set up
1777                                          * yy_c_buf_p so that if some total
1778                                          * hoser (like flex itself) wants to
1779                                          * call the scanner after we return the
1780                                          * YY_NULL, it'll still work - another
1781                                          * YY_NULL will get returned.
1782                                          */
1783                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1784
1785                                         yy_act = YY_STATE_EOF(YY_START);
1786                                         goto do_action;
1787                                         }
1788
1789                                 else
1790                                         {
1791                                         if ( ! yy_did_buffer_switch_on_eof )
1792                                                 YY_NEW_FILE;
1793                                         }
1794                                 break;
1795                                 }
1796
1797                         case EOB_ACT_CONTINUE_SCAN:
1798                                 yy_c_buf_p =
1799                                         yytext_ptr + yy_amount_of_matched_text;
1800
1801                                 yy_current_state = yy_get_previous_state();
1802
1803                                 yy_cp = yy_c_buf_p;
1804                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1805                                 goto yy_match;
1806
1807                         case EOB_ACT_LAST_MATCH:
1808                                 yy_c_buf_p =
1809                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1810
1811                                 yy_current_state = yy_get_previous_state();
1812
1813                                 yy_cp = yy_c_buf_p;
1814                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1815                                 goto yy_find_action;
1816                         }
1817                 break;
1818                 }
1819
1820         default:
1821                 YY_FATAL_ERROR(
1822                         "fatal flex scanner internal error--no action found" );
1823         } /* end of action switch */
1824                 } /* end of scanning one token */
1825         } /* end of yylex */
1826
1827
1828 /* yy_get_next_buffer - try to read in a new buffer
1829  *
1830  * Returns a code representing an action:
1831  *      EOB_ACT_LAST_MATCH -
1832  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1833  *      EOB_ACT_END_OF_FILE - end of file
1834  */
1835
1836 static int yy_get_next_buffer()
1837         {
1838         register char *dest = yy_current_buffer->yy_ch_buf;
1839         register char *source = yytext_ptr;
1840         register int number_to_move, i;
1841         int ret_val;
1842
1843         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1844                 YY_FATAL_ERROR(
1845                 "fatal flex scanner internal error--end of buffer missed" );
1846
1847         if ( yy_current_buffer->yy_fill_buffer == 0 )
1848                 { /* Don't try to fill the buffer, so this is an EOF. */
1849                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1850                         {
1851                         /* We matched a single character, the EOB, so
1852                          * treat this as a final EOF.
1853                          */
1854                         return EOB_ACT_END_OF_FILE;
1855                         }
1856
1857                 else
1858                         {
1859                         /* We matched some text prior to the EOB, first
1860                          * process it.
1861                          */
1862                         return EOB_ACT_LAST_MATCH;
1863                         }
1864                 }
1865
1866         /* Try to read more data. */
1867
1868         /* First move last chars to start of buffer. */
1869         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1870
1871         for ( i = 0; i < number_to_move; ++i )
1872                 *(dest++) = *(source++);
1873
1874         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1875                 /* don't do the read, it's not guaranteed to return an EOF,
1876                  * just force an EOF
1877                  */
1878                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1879
1880         else
1881                 {
1882                 int num_to_read =
1883                         yy_current_buffer->yy_buf_size - number_to_move - 1;
1884
1885                 while ( num_to_read <= 0 )
1886                         { /* Not enough room in the buffer - grow it. */
1887 #ifdef YY_USES_REJECT
1888                         YY_FATAL_ERROR(
1889 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1890 #else
1891
1892                         /* just a shorter name for the current buffer */
1893                         YY_BUFFER_STATE b = yy_current_buffer;
1894
1895                         int yy_c_buf_p_offset =
1896                                 (int) (yy_c_buf_p - b->yy_ch_buf);
1897
1898                         if ( b->yy_is_our_buffer )
1899                                 {
1900                                 int new_size = b->yy_buf_size * 2;
1901
1902                                 if ( new_size <= 0 )
1903                                         b->yy_buf_size += b->yy_buf_size / 8;
1904                                 else
1905                                         b->yy_buf_size *= 2;
1906
1907                                 b->yy_ch_buf = (char *)
1908                                         /* Include room in for 2 EOB chars. */
1909                                         yy_flex_realloc( (void *) b->yy_ch_buf,
1910                                                          b->yy_buf_size + 2 );
1911                                 }
1912                         else
1913                                 /* Can't grow it, we don't own it. */
1914                                 b->yy_ch_buf = 0;
1915
1916                         if ( ! b->yy_ch_buf )
1917                                 YY_FATAL_ERROR(
1918                                 "fatal error - scanner input buffer overflow" );
1919
1920                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1921
1922                         num_to_read = yy_current_buffer->yy_buf_size -
1923                                                 number_to_move - 1;
1924 #endif
1925                         }
1926
1927                 if ( num_to_read > YY_READ_BUF_SIZE )
1928                         num_to_read = YY_READ_BUF_SIZE;
1929
1930                 /* Read in more data. */
1931                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1932                         yy_n_chars, num_to_read );
1933
1934                 yy_current_buffer->yy_n_chars = yy_n_chars;
1935                 }
1936
1937         if ( yy_n_chars == 0 )
1938                 {
1939                 if ( number_to_move == YY_MORE_ADJ )
1940                         {
1941                         ret_val = EOB_ACT_END_OF_FILE;
1942                         yyrestart( yyin );
1943                         }
1944
1945                 else
1946                         {
1947                         ret_val = EOB_ACT_LAST_MATCH;
1948                         yy_current_buffer->yy_buffer_status =
1949                                 YY_BUFFER_EOF_PENDING;
1950                         }
1951                 }
1952
1953         else
1954                 ret_val = EOB_ACT_CONTINUE_SCAN;
1955
1956         yy_n_chars += number_to_move;
1957         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1958         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1959
1960         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1961
1962         return ret_val;
1963         }
1964
1965
1966 /* yy_get_previous_state - get the state just before the EOB char was reached */
1967
1968 static yy_state_type yy_get_previous_state()
1969         {
1970         register yy_state_type yy_current_state;
1971         register char *yy_cp;
1972
1973         yy_current_state = yy_start;
1974
1975         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1976                 {
1977                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1978                 if ( yy_accept[yy_current_state] )
1979                         {
1980                         yy_last_accepting_state = yy_current_state;
1981                         yy_last_accepting_cpos = yy_cp;
1982                         }
1983                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1984                         {
1985                         yy_current_state = (int) yy_def[yy_current_state];
1986                         if ( yy_current_state >= 579 )
1987                                 yy_c = yy_meta[(unsigned int) yy_c];
1988                         }
1989                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1990                 }
1991
1992         return yy_current_state;
1993         }
1994
1995
1996 /* yy_try_NUL_trans - try to make a transition on the NUL character
1997  *
1998  * synopsis
1999  *      next_state = yy_try_NUL_trans( current_state );
2000  */
2001
2002 #ifdef YY_USE_PROTOS
2003 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2004 #else
2005 static yy_state_type yy_try_NUL_trans( yy_current_state )
2006 yy_state_type yy_current_state;
2007 #endif
2008         {
2009         register int yy_is_jam;
2010         register char *yy_cp = yy_c_buf_p;
2011
2012         register YY_CHAR yy_c = 1;
2013         if ( yy_accept[yy_current_state] )
2014                 {
2015                 yy_last_accepting_state = yy_current_state;
2016                 yy_last_accepting_cpos = yy_cp;
2017                 }
2018         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2019                 {
2020                 yy_current_state = (int) yy_def[yy_current_state];
2021                 if ( yy_current_state >= 579 )
2022                         yy_c = yy_meta[(unsigned int) yy_c];
2023                 }
2024         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2025         yy_is_jam = (yy_current_state == 578);
2026
2027         return yy_is_jam ? 0 : yy_current_state;
2028         }
2029
2030
2031 #ifndef YY_NO_UNPUT
2032 #ifdef YY_USE_PROTOS
2033 static void yyunput( int c, register char *yy_bp )
2034 #else
2035 static void yyunput( c, yy_bp )
2036 int c;
2037 register char *yy_bp;
2038 #endif
2039         {
2040         register char *yy_cp = yy_c_buf_p;
2041
2042         /* undo effects of setting up yytext */
2043         *yy_cp = yy_hold_char;
2044
2045         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2046                 { /* need to shift things up to make room */
2047                 /* +2 for EOB chars. */
2048                 register int number_to_move = yy_n_chars + 2;
2049                 register char *dest = &yy_current_buffer->yy_ch_buf[
2050                                         yy_current_buffer->yy_buf_size + 2];
2051                 register char *source =
2052                                 &yy_current_buffer->yy_ch_buf[number_to_move];
2053
2054                 while ( source > yy_current_buffer->yy_ch_buf )
2055                         *--dest = *--source;
2056
2057                 yy_cp += (int) (dest - source);
2058                 yy_bp += (int) (dest - source);
2059                 yy_current_buffer->yy_n_chars =
2060                         yy_n_chars = yy_current_buffer->yy_buf_size;
2061
2062                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2063                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2064                 }
2065
2066         *--yy_cp = (char) c;
2067
2068
2069         yytext_ptr = yy_bp;
2070         yy_hold_char = *yy_cp;
2071         yy_c_buf_p = yy_cp;
2072         }
2073 #endif  /* ifndef YY_NO_UNPUT */
2074
2075
2076 #ifdef __cplusplus
2077 static int yyinput()
2078 #else
2079 static int input()
2080 #endif
2081         {
2082         int c;
2083
2084         *yy_c_buf_p = yy_hold_char;
2085
2086         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2087                 {
2088                 /* yy_c_buf_p now points to the character we want to return.
2089                  * If this occurs *before* the EOB characters, then it's a
2090                  * valid NUL; if not, then we've hit the end of the buffer.
2091                  */
2092                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2093                         /* This was really a NUL. */
2094                         *yy_c_buf_p = '\0';
2095
2096                 else
2097                         { /* need more input */
2098                         int offset = yy_c_buf_p - yytext_ptr;
2099                         ++yy_c_buf_p;
2100
2101                         switch ( yy_get_next_buffer() )
2102                                 {
2103                                 case EOB_ACT_LAST_MATCH:
2104                                         /* This happens because yy_g_n_b()
2105                                          * sees that we've accumulated a
2106                                          * token and flags that we need to
2107                                          * try matching the token before
2108                                          * proceeding.  But for input(),
2109                                          * there's no matching to consider.
2110                                          * So convert the EOB_ACT_LAST_MATCH
2111                                          * to EOB_ACT_END_OF_FILE.
2112                                          */
2113
2114                                         /* Reset buffer status. */
2115                                         yyrestart( yyin );
2116
2117                                         /* fall through */
2118
2119                                 case EOB_ACT_END_OF_FILE:
2120                                         {
2121                                         if ( yywrap() )
2122                                                 return EOF;
2123
2124                                         if ( ! yy_did_buffer_switch_on_eof )
2125                                                 YY_NEW_FILE;
2126 #ifdef __cplusplus
2127                                         return yyinput();
2128 #else
2129                                         return input();
2130 #endif
2131                                         }
2132
2133                                 case EOB_ACT_CONTINUE_SCAN:
2134                                         yy_c_buf_p = yytext_ptr + offset;
2135                                         break;
2136                                 }
2137                         }
2138                 }
2139
2140         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
2141         *yy_c_buf_p = '\0';     /* preserve yytext */
2142         yy_hold_char = *++yy_c_buf_p;
2143
2144
2145         return c;
2146         }
2147
2148
2149 #ifdef YY_USE_PROTOS
2150 void yyrestart( FILE *input_file )
2151 #else
2152 void yyrestart( input_file )
2153 FILE *input_file;
2154 #endif
2155         {
2156         if ( ! yy_current_buffer )
2157                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2158
2159         yy_init_buffer( yy_current_buffer, input_file );
2160         yy_load_buffer_state();
2161         }
2162
2163
2164 #ifdef YY_USE_PROTOS
2165 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2166 #else
2167 void yy_switch_to_buffer( new_buffer )
2168 YY_BUFFER_STATE new_buffer;
2169 #endif
2170         {
2171         if ( yy_current_buffer == new_buffer )
2172                 return;
2173
2174         if ( yy_current_buffer )
2175                 {
2176                 /* Flush out information for old buffer. */
2177                 *yy_c_buf_p = yy_hold_char;
2178                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2179                 yy_current_buffer->yy_n_chars = yy_n_chars;
2180                 }
2181
2182         yy_current_buffer = new_buffer;
2183         yy_load_buffer_state();
2184
2185         /* We don't actually know whether we did this switch during
2186          * EOF (yywrap()) processing, but the only time this flag
2187          * is looked at is after yywrap() is called, so it's safe
2188          * to go ahead and always set it.
2189          */
2190         yy_did_buffer_switch_on_eof = 1;
2191         }
2192
2193
2194 #ifdef YY_USE_PROTOS
2195 void yy_load_buffer_state( void )
2196 #else
2197 void yy_load_buffer_state()
2198 #endif
2199         {
2200         yy_n_chars = yy_current_buffer->yy_n_chars;
2201         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2202         yyin = yy_current_buffer->yy_input_file;
2203         yy_hold_char = *yy_c_buf_p;
2204         }
2205
2206
2207 #ifdef YY_USE_PROTOS
2208 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2209 #else
2210 YY_BUFFER_STATE yy_create_buffer( file, size )
2211 FILE *file;
2212 int size;
2213 #endif
2214         {
2215         YY_BUFFER_STATE b;
2216
2217         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2218         if ( ! b )
2219                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2220
2221         b->yy_buf_size = size;
2222
2223         /* yy_ch_buf has to be 2 characters longer than the size given because
2224          * we need to put in 2 end-of-buffer characters.
2225          */
2226         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2227         if ( ! b->yy_ch_buf )
2228                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2229
2230         b->yy_is_our_buffer = 1;
2231
2232         yy_init_buffer( b, file );
2233
2234         return b;
2235         }
2236
2237
2238 #ifdef YY_USE_PROTOS
2239 void yy_delete_buffer( YY_BUFFER_STATE b )
2240 #else
2241 void yy_delete_buffer( b )
2242 YY_BUFFER_STATE b;
2243 #endif
2244         {
2245         if ( ! b )
2246                 return;
2247
2248         if ( b == yy_current_buffer )
2249                 yy_current_buffer = (YY_BUFFER_STATE) 0;
2250
2251         if ( b->yy_is_our_buffer )
2252                 yy_flex_free( (void *) b->yy_ch_buf );
2253
2254         yy_flex_free( (void *) b );
2255         }
2256
2257
2258 #ifndef YY_ALWAYS_INTERACTIVE
2259 #ifndef YY_NEVER_INTERACTIVE
2260 extern int isatty YY_PROTO(( int ));
2261 #endif
2262 #endif
2263
2264 #ifdef YY_USE_PROTOS
2265 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2266 #else
2267 void yy_init_buffer( b, file )
2268 YY_BUFFER_STATE b;
2269 FILE *file;
2270 #endif
2271
2272
2273         {
2274         yy_flush_buffer( b );
2275
2276         b->yy_input_file = file;
2277         b->yy_fill_buffer = 1;
2278
2279 #if YY_ALWAYS_INTERACTIVE
2280         b->yy_is_interactive = 1;
2281 #else
2282 #if YY_NEVER_INTERACTIVE
2283         b->yy_is_interactive = 0;
2284 #else
2285         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2286 #endif
2287 #endif
2288         }
2289
2290
2291 #ifdef YY_USE_PROTOS
2292 void yy_flush_buffer( YY_BUFFER_STATE b )
2293 #else
2294 void yy_flush_buffer( b )
2295 YY_BUFFER_STATE b;
2296 #endif
2297
2298         {
2299         if ( ! b )
2300                 return;
2301
2302         b->yy_n_chars = 0;
2303
2304         /* We always need two end-of-buffer characters.  The first causes
2305          * a transition to the end-of-buffer state.  The second causes
2306          * a jam in that state.
2307          */
2308         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2309         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2310
2311         b->yy_buf_pos = &b->yy_ch_buf[0];
2312
2313         b->yy_at_bol = 1;
2314         b->yy_buffer_status = YY_BUFFER_NEW;
2315
2316         if ( b == yy_current_buffer )
2317                 yy_load_buffer_state();
2318         }
2319
2320
2321 #ifndef YY_NO_SCAN_BUFFER
2322 #ifdef YY_USE_PROTOS
2323 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2324 #else
2325 YY_BUFFER_STATE yy_scan_buffer( base, size )
2326 char *base;
2327 yy_size_t size;
2328 #endif
2329         {
2330         YY_BUFFER_STATE b;
2331
2332         if ( size < 2 ||
2333              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2334              base[size-1] != YY_END_OF_BUFFER_CHAR )
2335                 /* They forgot to leave room for the EOB's. */
2336                 return 0;
2337
2338         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2339         if ( ! b )
2340                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2341
2342         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2343         b->yy_buf_pos = b->yy_ch_buf = base;
2344         b->yy_is_our_buffer = 0;
2345         b->yy_input_file = 0;
2346         b->yy_n_chars = b->yy_buf_size;
2347         b->yy_is_interactive = 0;
2348         b->yy_at_bol = 1;
2349         b->yy_fill_buffer = 0;
2350         b->yy_buffer_status = YY_BUFFER_NEW;
2351
2352         yy_switch_to_buffer( b );
2353
2354         return b;
2355         }
2356 #endif
2357
2358
2359 #ifndef YY_NO_SCAN_STRING
2360 #ifdef YY_USE_PROTOS
2361 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2362 #else
2363 YY_BUFFER_STATE yy_scan_string( yy_str )
2364 yyconst char *yy_str;
2365 #endif
2366         {
2367         int len;
2368         for ( len = 0; yy_str[len]; ++len )
2369                 ;
2370
2371         return yy_scan_bytes( yy_str, len );
2372         }
2373 #endif
2374
2375
2376 #ifndef YY_NO_SCAN_BYTES
2377 #ifdef YY_USE_PROTOS
2378 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2379 #else
2380 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2381 yyconst char *bytes;
2382 int len;
2383 #endif
2384         {
2385         YY_BUFFER_STATE b;
2386         char *buf;
2387         yy_size_t n;
2388         int i;
2389
2390         /* Get memory for full buffer, including space for trailing EOB's. */
2391         n = len + 2;
2392         buf = (char *) yy_flex_alloc( n );
2393         if ( ! buf )
2394                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2395
2396         for ( i = 0; i < len; ++i )
2397                 buf[i] = bytes[i];
2398
2399         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2400
2401         b = yy_scan_buffer( buf, n );
2402         if ( ! b )
2403                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2404
2405         /* It's okay to grow etc. this buffer, and we should throw it
2406          * away when we're done.
2407          */
2408         b->yy_is_our_buffer = 1;
2409
2410         return b;
2411         }
2412 #endif
2413
2414
2415 #ifndef YY_NO_PUSH_STATE
2416 #ifdef YY_USE_PROTOS
2417 static void yy_push_state( int new_state )
2418 #else
2419 static void yy_push_state( new_state )
2420 int new_state;
2421 #endif
2422         {
2423         if ( yy_start_stack_ptr >= yy_start_stack_depth )
2424                 {
2425                 yy_size_t new_size;
2426
2427                 yy_start_stack_depth += YY_START_STACK_INCR;
2428                 new_size = yy_start_stack_depth * sizeof( int );
2429
2430                 if ( ! yy_start_stack )
2431                         yy_start_stack = (int *) yy_flex_alloc( new_size );
2432
2433                 else
2434                         yy_start_stack = (int *) yy_flex_realloc(
2435                                         (void *) yy_start_stack, new_size );
2436
2437                 if ( ! yy_start_stack )
2438                         YY_FATAL_ERROR(
2439                         "out of memory expanding start-condition stack" );
2440                 }
2441
2442         yy_start_stack[yy_start_stack_ptr++] = YY_START;
2443
2444         BEGIN(new_state);
2445         }
2446 #endif
2447
2448
2449 #ifndef YY_NO_POP_STATE
2450 static void yy_pop_state()
2451         {
2452         if ( --yy_start_stack_ptr < 0 )
2453                 YY_FATAL_ERROR( "start-condition stack underflow" );
2454
2455         BEGIN(yy_start_stack[yy_start_stack_ptr]);
2456         }
2457 #endif
2458
2459
2460 #ifndef YY_NO_TOP_STATE
2461 static int yy_top_state()
2462         {
2463         return yy_start_stack[yy_start_stack_ptr - 1];
2464         }
2465 #endif
2466
2467 #ifndef YY_EXIT_FAILURE
2468 #define YY_EXIT_FAILURE 2
2469 #endif
2470
2471 #ifdef YY_USE_PROTOS
2472 static void yy_fatal_error( yyconst char msg[] )
2473 #else
2474 static void yy_fatal_error( msg )
2475 char msg[];
2476 #endif
2477         {
2478         (void) fprintf( stderr, "%s\n", msg );
2479         exit( YY_EXIT_FAILURE );
2480         }
2481
2482
2483
2484 /* Redefine yyless() so it works in section 3 code. */
2485
2486 #undef yyless
2487 #define yyless(n) \
2488         do \
2489                 { \
2490                 /* Undo effects of setting up yytext. */ \
2491                 yytext[yyleng] = yy_hold_char; \
2492                 yy_c_buf_p = yytext + n; \
2493                 yy_hold_char = *yy_c_buf_p; \
2494                 *yy_c_buf_p = '\0'; \
2495                 yyleng = n; \
2496                 } \
2497         while ( 0 )
2498
2499
2500 /* Internal utility routines. */
2501
2502 #ifndef yytext_ptr
2503 #ifdef YY_USE_PROTOS
2504 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2505 #else
2506 static void yy_flex_strncpy( s1, s2, n )
2507 char *s1;
2508 yyconst char *s2;
2509 int n;
2510 #endif
2511         {
2512         register int i;
2513         for ( i = 0; i < n; ++i )
2514                 s1[i] = s2[i];
2515         }
2516 #endif
2517
2518 #ifdef YY_NEED_STRLEN
2519 #ifdef YY_USE_PROTOS
2520 static int yy_flex_strlen( yyconst char *s )
2521 #else
2522 static int yy_flex_strlen( s )
2523 yyconst char *s;
2524 #endif
2525         {
2526         register int n;
2527         for ( n = 0; s[n]; ++n )
2528                 ;
2529
2530         return n;
2531         }
2532 #endif
2533
2534
2535 #ifdef YY_USE_PROTOS
2536 static void *yy_flex_alloc( yy_size_t size )
2537 #else
2538 static void *yy_flex_alloc( size )
2539 yy_size_t size;
2540 #endif
2541         {
2542         return (void *) malloc( size );
2543         }
2544
2545 #ifdef YY_USE_PROTOS
2546 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2547 #else
2548 static void *yy_flex_realloc( ptr, size )
2549 void *ptr;
2550 yy_size_t size;
2551 #endif
2552         {
2553         /* The cast to (char *) in the following accommodates both
2554          * implementations that use char* generic pointers, and those
2555          * that use void* generic pointers.  It works with the latter
2556          * because both ANSI C and C++ allow castless assignment from
2557          * any pointer type to void*, and deal with argument conversions
2558          * as though doing an assignment.
2559          */
2560         return (void *) realloc( (char *) ptr, size );
2561         }
2562
2563 #ifdef YY_USE_PROTOS
2564 static void yy_flex_free( void *ptr )
2565 #else
2566 static void yy_flex_free( ptr )
2567 void *ptr;
2568 #endif
2569         {
2570         free( ptr );
2571         }
2572
2573 #if YY_MAIN
2574 int main()
2575         {
2576         yylex();
2577         return 0;
2578         }
2579 #endif
2580 #line 285 "lexer.l"
2581
2582
2583 const char *const builtinservicehelpstrings[]= {
2584   "environment",
2585   "parameter <parameter>",
2586   "version",
2587   "toplevel",
2588   "override",
2589   "shutdown",
2590   "reset",
2591   "execute",
2592   "help",
2593    0
2594 };
2595
2596 #include "parser.c"
2597