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