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