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