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