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