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