Imported Upstream version 1.8.5p2
[debian/sudo] / plugins / sudoers / toke.c
1 #include <config.h>
2 /*      $OpenBSD: flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $     */
3
4 /* A lexical scanner generated by flex */
5
6 /* Scanner skeleton version:
7  * $Header: /cvs/src/usr.bin/lex/flex.skl,v 1.11 2010/08/04 18:24:50 millert Exp $
8  */
9
10 #define FLEX_SCANNER
11 #define YY_FLEX_MAJOR_VERSION 2
12 #define YY_FLEX_MINOR_VERSION 5
13
14 #include <stdio.h>
15 #include <errno.h>
16
17
18 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
19 #ifdef c_plusplus
20 #ifndef __cplusplus
21 #define __cplusplus
22 #endif
23 #endif
24
25
26 #ifdef __cplusplus
27
28 #include <stdlib.h>
29 #include <unistd.h>
30
31 /* Use prototypes in function declarations. */
32 #define YY_USE_PROTOS
33
34 /* The "const" storage-class-modifier is valid. */
35 #define YY_USE_CONST
36
37 #else   /* ! __cplusplus */
38
39 #ifdef __STDC__
40
41 #define YY_USE_PROTOS
42 #define YY_USE_CONST
43
44 #endif  /* __STDC__ */
45 #endif  /* ! __cplusplus */
46
47 #ifdef __TURBOC__
48  #pragma warn -rch
49  #pragma warn -use
50 #include <io.h>
51 #include <stdlib.h>
52 #define YY_USE_CONST
53 #define YY_USE_PROTOS
54 #endif
55
56 #ifdef YY_USE_CONST
57 #define yyconst const
58 #else
59 #define yyconst
60 #endif
61
62
63 #ifdef YY_USE_PROTOS
64 #define YY_PROTO(proto) proto
65 #else
66 #define YY_PROTO(proto) ()
67 #endif
68
69 /* Returned upon end-of-file. */
70 #define YY_NULL 0
71
72 /* Promotes a possibly negative, possibly signed char to an unsigned
73  * integer for use as an array index.  If the signed char is negative,
74  * we want to instead treat it as an 8-bit unsigned char, hence the
75  * double cast.
76  */
77 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
78
79 /* Enter a start condition.  This macro really ought to take a parameter,
80  * but we do it the disgusting crufty way forced on us by the ()-less
81  * definition of BEGIN.
82  */
83 #define BEGIN yy_start = 1 + 2 *
84
85 /* Translate the current start state into a value that can be later handed
86  * to BEGIN to return to the state.  The YYSTATE alias is for lex
87  * compatibility.
88  */
89 #define YY_START ((yy_start - 1) / 2)
90 #define YYSTATE YY_START
91
92 /* Action number for EOF rule of a given start state. */
93 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
94
95 /* Special action meaning "start processing a new file". */
96 #define YY_NEW_FILE yyrestart( yyin )
97
98 #define YY_END_OF_BUFFER_CHAR 0
99
100 /* Size of default input buffer. */
101 #define YY_BUF_SIZE 16384
102
103 typedef struct yy_buffer_state *YY_BUFFER_STATE;
104
105 extern int yyleng;
106 extern FILE *yyin, *yyout;
107
108 #define EOB_ACT_CONTINUE_SCAN 0
109 #define EOB_ACT_END_OF_FILE 1
110 #define EOB_ACT_LAST_MATCH 2
111
112 /* The funky do-while in the following #define is used to turn the definition
113  * int a single C statement (which needs a semi-colon terminator).  This
114  * avoids problems with code like:
115  *
116  *      if ( condition_holds )
117  *              yyless( 5 );
118  *      else
119  *              do_something_else();
120  *
121  * Prior to using the do-while the compiler would get upset at the
122  * "else" because it interpreted the "if" statement as being all
123  * done when it reached the ';' after the yyless() call.
124  */
125
126 /* Return all but the first 'n' matched characters back to the input stream. */
127
128 #define yyless(n) \
129         do \
130                 { \
131                 /* Undo effects of setting up yytext. */ \
132                 *yy_cp = yy_hold_char; \
133                 YY_RESTORE_YY_MORE_OFFSET \
134                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
135                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136                 } \
137         while ( 0 )
138
139 #define unput(c) yyunput( c, yytext_ptr )
140
141 /* The following is because we cannot portably get our hands on size_t
142  * (without autoconf's help, which isn't available because we want
143  * flex-generated scanners to compile on their own).
144  */
145 typedef unsigned int yy_size_t;
146
147
148 struct yy_buffer_state
149         {
150         FILE *yy_input_file;
151
152         char *yy_ch_buf;                /* input buffer */
153         char *yy_buf_pos;               /* current position in input buffer */
154
155         /* Size of input buffer in bytes, not including room for EOB
156          * characters.
157          */
158         yy_size_t yy_buf_size;
159
160         /* Number of characters read into yy_ch_buf, not including EOB
161          * characters.
162          */
163         int yy_n_chars;
164
165         /* Whether we "own" the buffer - i.e., we know we created it,
166          * and can realloc() it to grow it, and should free() it to
167          * delete it.
168          */
169         int yy_is_our_buffer;
170
171         /* Whether this is an "interactive" input source; if so, and
172          * if we're using stdio for input, then we want to use getc()
173          * instead of fread(), to make sure we stop fetching input after
174          * each newline.
175          */
176         int yy_is_interactive;
177
178         /* Whether we're considered to be at the beginning of a line.
179          * If so, '^' rules will be active on the next match, otherwise
180          * not.
181          */
182         int yy_at_bol;
183
184         /* Whether to try to fill the input buffer when we reach the
185          * end of it.
186          */
187         int yy_fill_buffer;
188
189         int yy_buffer_status;
190 #define YY_BUFFER_NEW 0
191 #define YY_BUFFER_NORMAL 1
192         /* When an EOF's been seen but there's still some text to process
193          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
194          * shouldn't try reading from the input source any more.  We might
195          * still have a bunch of tokens to match, though, because of
196          * possible backing-up.
197          *
198          * When we actually see the EOF, we change the status to "new"
199          * (via yyrestart()), so that the user can continue scanning by
200          * just pointing yyin at a new input file.
201          */
202 #define YY_BUFFER_EOF_PENDING 2
203         };
204
205 static YY_BUFFER_STATE yy_current_buffer = 0;
206
207 /* We provide macros for accessing buffer states in case in the
208  * future we want to put the buffer states in a more general
209  * "scanner state".
210  */
211 #define YY_CURRENT_BUFFER yy_current_buffer
212
213
214 /* yy_hold_char holds the character lost when yytext is formed. */
215 static char yy_hold_char;
216
217 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
218
219
220 int yyleng;
221
222 /* Points to current character in buffer. */
223 static char *yy_c_buf_p = (char *) 0;
224 static int yy_init = 1;         /* whether we need to initialize */
225 static int yy_start = 0;        /* start state number */
226
227 /* Flag which is used to allow yywrap()'s to do buffer switches
228  * instead of setting up a fresh yyin.  A bit of a hack ...
229  */
230 static int yy_did_buffer_switch_on_eof;
231
232 void yyrestart YY_PROTO(( FILE *input_file ));
233
234 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
235 void yy_load_buffer_state YY_PROTO(( void ));
236 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
237 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
238 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
239 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
240 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
241
242 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
243 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
244 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
245
246 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
247 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
248 static void yy_flex_free YY_PROTO(( void * ));
249
250 #define yy_new_buffer yy_create_buffer
251
252 #define yy_set_interactive(is_interactive) \
253         { \
254         if ( ! yy_current_buffer ) \
255                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
256         yy_current_buffer->yy_is_interactive = is_interactive; \
257         }
258
259 #define yy_set_bol(at_bol) \
260         { \
261         if ( ! yy_current_buffer ) \
262                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
263         yy_current_buffer->yy_at_bol = at_bol; \
264         }
265
266 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267
268
269 #define yywrap() 1
270 #define YY_SKIP_YYWRAP
271 typedef unsigned char YY_CHAR;
272 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
273 typedef int yy_state_type;
274 extern char *yytext;
275 #define yytext_ptr yytext
276
277 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
278 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
279 static int yy_get_next_buffer YY_PROTO(( void ));
280 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
281
282 /* Done after the current pattern has been matched and before the
283  * corresponding action - sets up yytext.
284  */
285 #define YY_DO_BEFORE_ACTION \
286         yytext_ptr = yy_bp; \
287         yyleng = (int) (yy_cp - yy_bp); \
288         yy_hold_char = *yy_cp; \
289         *yy_cp = '\0'; \
290         yy_c_buf_p = yy_cp;
291
292 #define YY_NUM_RULES 59
293 #define YY_END_OF_BUFFER 60
294 static yyconst short int yy_accept[607] =
295     {   0,
296         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
297         0,    0,   60,   47,   55,   54,   53,   46,   58,   32,
298        48,   49,   32,   50,   47,   47,   47,   47,   52,   51,
299        58,   42,   42,   42,   42,   42,   42,   42,   42,   42,
300        42,   58,   47,   47,   55,   58,   42,   42,   42,   42,
301        42,    2,   58,    1,   47,   47,   17,   16,   17,   16,
302        16,   58,   58,   58,    3,    9,    8,    9,    4,    9,
303         5,   58,   13,   13,   13,   11,   12,   47,    0,   55,
304        53,    0,   57,    0,   47,   34,    0,   32,    0,   33,
305         0,   45,   45,    0,   47,   47,    0,   47,   47,   47,
306
307        47,    0,   37,   42,   42,   42,   42,   42,   42,   42,
308        42,   42,   42,   47,   56,   47,   55,    0,    0,    0,
309         0,    0,    0,   47,   47,   47,   47,   47,    2,    1,
310         0,    1,   43,   43,    0,   47,   17,   17,   15,   14,
311        15,    0,    0,    3,    9,    0,    6,    7,    9,    9,
312        13,    0,   13,   13,    0,   10,    0,    0,    0,   34,
313        34,    0,    0,   47,   47,   47,   47,   47,    0,    0,
314        37,   37,   42,   39,   42,   42,   42,   42,   42,   42,
315        42,   42,   42,   42,   47,    0,    0,    0,    0,    0,
316         0,   47,   47,   47,   47,   47,    0,   47,   10,    0,
317
318        47,   47,   47,   47,   47,   47,    0,   38,   38,   38,
319         0,    0,   37,   37,   37,   37,   37,   37,   37,   42,
320        42,   42,   42,   42,   42,   42,   42,   40,   42,   41,
321        47,    0,    0,    0,    0,    0,    0,   47,   47,   47,
322        47,   47,   47,   47,    0,    0,   38,   38,   38,    0,
323        37,   37,    0,   37,   37,   37,   37,   37,   37,   37,
324        37,   37,   37,   37,    0,   25,   42,   42,   42,   42,
325        42,   42,   42,   42,   47,    0,    0,    0,    0,   47,
326        47,   47,   47,   47,   47,   47,   47,    0,   38,    0,
327        37,   37,   37,    0,    0,    0,   37,   37,   37,   37,
328
329        37,   37,   37,   37,   37,   37,   37,   37,   37,   42,
330        42,   42,   42,   42,   42,   42,   42,   47,    0,    0,
331         0,   47,   47,   47,   35,   35,   35,    0,    0,   37,
332        37,   37,   37,   37,   37,   37,    0,    0,    0,    0,
333         0,   37,   37,   37,   37,   37,   37,   37,   37,   37,
334        37,   37,   37,   37,   37,   42,   42,    0,   24,   42,
335        42,   42,   42,    0,   23,    0,   26,   47,    0,    0,
336         0,   47,   47,   47,   47,   35,   35,   35,   35,    0,
337        37,    0,   37,   37,   37,   37,   37,   37,   37,   37,
338        37,   37,   37,    0,    0,    0,   37,   37,   37,   37,
339
340        37,   37,   37,   37,   37,   37,   37,   37,   37,   42,
341        42,   42,   42,   42,   42,   44,    0,    0,    0,   47,
342        20,   43,   36,   36,   36,   36,   37,    0,    0,    0,
343        37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
344        37,   37,   37,    0,    0,    0,    0,    0,   37,   37,
345        37,   37,   37,   37,   37,   37,   42,   42,   42,   42,
346         0,   22,    0,   27,    0,   20,    0,    0,   47,    0,
347        47,   47,   47,   36,   36,   36,   36,    0,    0,    0,
348         0,    0,   37,   37,   37,   37,   37,   37,   37,   37,
349        37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
350
351        37,   37,    0,   30,   42,   42,   42,    0,    0,    0,
352        18,    0,   21,   20,    0,    0,    0,    0,    0,   20,
353         0,   47,   47,   47,    0,    0,    0,   37,   37,   37,
354        37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
355        37,   37,   37,   37,   37,    0,   28,   42,   42,   21,
356         0,    0,   20,   47,   47,   47,   47,   47,    0,    0,
357         0,    0,    0,   37,   37,   37,   37,   37,   37,   37,
358        37,    0,   31,   42,    0,   47,   47,   47,   37,   37,
359        37,   37,   37,   37,    0,   29,    0,    0,   19,   47,
360        47,   47,   47,   47,   37,   37,   37,   37,   37,   35,
361
362        35,   35,   35,   35,   35,    0
363     } ;
364
365 static yyconst int yy_ec[256] =
366     {   0,
367         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
368         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
369         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
370         1,    2,    4,    5,    6,    1,    7,    1,    1,    8,
371         9,   10,   11,   12,   13,   14,   15,   16,   17,   18,
372        19,   20,   21,   22,   22,   22,   23,   24,    1,    1,
373        25,   26,   10,   27,   28,   29,   30,   31,   32,   29,
374        33,   34,   35,   36,   36,   37,   36,   38,   39,   40,
375        36,   41,   42,   43,   44,   45,   46,   47,   48,   36,
376        10,   49,   10,    1,   50,    1,   51,   52,   53,   54,
377
378        55,   56,   57,   57,   58,   57,   57,   59,   60,   61,
379        62,   57,   57,   63,   64,   65,   66,   57,   57,   57,
380        57,   57,    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,    1,    1,    1,    1,    1,
386         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
387         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
388
389         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
390         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
391         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
392         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
394         1,    1,    1,    1,    1
395     } ;
396
397 static yyconst int yy_meta[67] =
398     {   0,
399         1,    2,    3,    4,    5,    6,    1,    7,    7,    1,
400         1,    8,    1,    9,   10,   11,   11,   11,   11,   11,
401        11,   11,   11,   12,   13,    7,    1,   11,   11,   11,
402        11,   11,    1,    1,    1,    1,    1,    1,    1,    1,
403         1,    1,    1,    1,    1,    1,    1,    1,   14,   15,
404        16,   16,   16,   16,   16,   16,   15,   15,   15,   15,
405        15,   15,   15,   15,   15,   15
406     } ;
407
408 static yyconst short int yy_base[671] =
409     {   0,
410         0,   65,   67,   72,   99,  114,  162,  227,  292,  340,
411        86,  125, 2840, 2790, 2836, 3665, 2833, 3665,  387,   70,
412      3665, 3665, 2771, 3665,  136,  397,  133,  159, 2795, 3665,
413      3665,  453, 2781,   33,  504, 2770, 2767, 2777, 2765, 2771,
414      2754,  559,  170,   19,  165,  583,   38,   49, 2739,   68,
415      2727,   81,  219, 2771,  305,   48,    0, 3665, 2761, 3665,
416         0,  250,  639,  119,    0, 2709, 3665,  108, 3665,  112,
417      3665,  140, 2699,   98,  121, 3665,  195, 2693,  661, 2739,
418      2736, 2736, 3665,  227,  247,  300,  316,  152,  354, 2681,
419       686,  373, 2670,  711,  352,  722, 2692, 2669,  375,  414,
420
421       302, 2656,   57,  763,    0, 2628, 2625, 2614,  505, 2602,
422      2606, 2599, 2601,  202, 3665,  153,  546, 2572, 2565, 2549,
423      2537, 2524,  200,  110,  244,   28,  111,  252,  171, 2578,
424       422, 2577,  565, 2529,  818,  262,    0, 2573,  179, 3665,
425      3665,  599,  269,    0, 2513,  453, 3665, 3665, 2512,  548,
426      2490, 2533,  206,  253,  323, 2535, 2524, 2513,  607,  615,
427       306,  722,  586,  831,  867,  903,  939, 2499, 2456,  980,
428       333, 1022, 1063,    0, 2430, 2394, 2363, 2364, 2374, 2369,
429      2327, 2330, 2329, 2328,  266, 2289, 2283, 2272, 2274, 2279,
430       409,  334, 2279,  145,  335,   83,  672,  278, 2327, 2325,
431
432       627,  259, 1106, 1142,  741,  210, 2293, 2279,  683,  513,
433      2275, 2271,  352,  747, 1178,  780,  788, 1220,  815, 2270,
434       400,  325, 2261, 2258, 2248, 2246, 2242,    0, 2240,    0,
435       489, 2223, 2213, 2198, 2211, 2198,  420,  407,  529,  490,
436       491, 1263, 1299, 1335, 2235, 2234,  839, 2234, 2232, 2228,
437      2226,  528,  848,  657,  856,  665, 1371,    0,  877, 1382,
438       886,  894, 1424,  913,  570, 3665, 2208, 2197, 2201, 2178,
439      2185, 2194, 2194, 2176,  558, 2169, 2152, 2150,  648,  626,
440       530,  559,  923,  336, 1467, 1503,  964, 2171, 2140, 2139,
441      2138, 1537,  551, 1000, 1041, 1082,  653,  694,  797, 1049,
442
443       923, 1580,    0, 1116, 1591, 1090, 1008, 1633, 1125, 2121,
444      2082,  747,  686, 2064, 2071,  786,  926,  905, 2080, 2033,
445       679,  634,  544,  915, 1675, 1710, 1745, 2052, 2043, 2033,
446      1150, 1781, 1158, 1133, 1822, 1197, 1166, 2028, 1239, 1273,
447      1207,  950,  951,  962,  991, 1247, 1073, 1865,    0, 1283,
448      1876, 1307, 1315, 1918, 1323, 1987, 1968, 1188, 3665, 1967,
449      1951, 1929, 1913, 1286, 3665, 1336, 3665,  707, 1897, 1889,
450       786,  930,  764, 1298, 1358, 1041, 1960, 1995, 1400, 1927,
451      1879, 1348,  708, 1406, 1348, 2031,    0,  559, 2042, 1441,
452      1449, 2083, 1477, 1487, 1513, 1523, 1230, 1290, 1458, 1548,
453
454      1557, 1602, 2126,    0, 1613, 2137, 1650, 1565, 1660, 1806,
455      1779, 1680, 1675, 1359, 1406, 1626, 1601, 1577,  897,  938,
456      1695, 1589, 2180, 2216, 2252, 2288, 1611, 1686, 1720, 1731,
457      1563, 1478, 1504, 1694, 1524, 2324,    0,  617, 2335, 1753,
458      1761, 2376, 1769, 1798, 1550, 1808, 1841, 1851, 1335, 1358,
459      1887,  714,  825, 2419,    0,  926, 1407, 1468, 1430, 1431,
460      1547, 3665, 1616, 3665, 1381, 1731, 1045, 1512, 1575, 1908,
461      1913, 1970, 1498, 2429, 2465, 1947, 1611, 1981, 1264, 2006,
462      2016, 2061, 1198, 1181, 1732, 1782, 2067, 1842, 2501,    0,
463      1181, 2512, 2100, 1904, 2553, 2110, 2155, 2164, 2189, 1769,
464
465      1142, 1232, 1634, 3665, 1699, 1095, 1077, 1025, 1046, 1306,
466      3665,  384,  981, 2211, 2218, 2238, 2243, 2263, 2288, 2249,
467      2307, 2596, 2632, 2668, 2304, 2354, 2395,  983,  894, 1902,
468      1928, 2362, 1929, 2704,    0, 1428, 2715, 2403, 2437, 2445,
469       867, 2454, 2474, 2483,  831, 1982, 3665, 1983,  782, 3665,
470      1511, 2489, 2529, 2537, 1895, 2758, 2794, 2573, 2579,  650,
471      2607, 2617, 2642,  629,  525, 1931,  447,  347, 2650,    0,
472      1528, 2019, 3665, 2044, 1805, 2830, 2866, 2902, 2676, 2684,
473      2692,  323,    0,  316, 2067, 3665,  166, 1845, 3665, 2733,
474      1945, 2938, 2974, 2743, 3665, 2767, 2777, 2658, 3665, 2805,
475
476      2813, 2847,   63, 2855, 2881, 3665, 3023, 3039, 3055, 3071,
477      3087, 3103, 3119, 3135, 3151, 3157, 3173, 3189, 2025, 3205,
478      3221, 3237, 3253, 3269, 3285, 3301, 3307, 3314, 3330, 3346,
479      3352, 3359, 3365, 3371, 3377, 3384, 3390, 3396, 3402, 3409,
480      3417, 3423, 3429, 3435, 3442, 3450, 3456, 3462, 3469, 3477,
481      3483, 3491, 3498, 3506, 3512, 3520, 3527, 3535, 3551, 3567,
482      3583, 3589, 3597, 3604, 3610, 3618, 3624, 3632, 3648, 1295
483     } ;
484
485 static yyconst short int yy_def[671] =
486     {   0,
487       606,    1,    1,    1,  607,  607,  608,  608,  609,  609,
488       610,  610,  606,  611,  606,  606,  606,  606,  612,  613,
489       606,  606,  614,  606,  615,  611,   26,   26,  616,  606,
490       606,  606,   32,   32,   32,   35,   35,   35,   35,   35,
491        35,  611,   26,  611,  606,  612,   32,   32,   35,   35,
492        35,  606,  606,  606,  617,  611,  618,  606,  618,  606,
493       618,  606,  612,  606,  619,  620,  606,  620,  606,  620,
494       606,  621,  622,  622,  622,  606,  606,  611,  611,  606,
495       606,  623,  606,  624,  606,  613,  606,  625,  613,  614,
496       614,  615,  626,  611,  611,   26,  616,   96,   96,   96,
497
498        96,  627,  628,   35,   35,   35,   35,   35,   35,   35,
499        35,   35,   35,  611,  606,  611,  606,  606,  606,  606,
500       606,  606,  623,  611,   96,  611,  611,  611,  606,  606,
501       606,  606,  617,  629,  611,  611,  618,  618,  606,  606,
502       606,  624,  606,  619,  620,  620,  606,  606,  620,  620,
503       622,  606,  622,  622,  606,  606,  623,  630,  606,  606,
504       625,  625,  606,  611,  611,  611,   96,  167,  631,  606,
505       632,  606,  104,   35,   35,   35,   35,   35,   35,   35,
506        35,   35,   35,   35,  611,  606,  606,  606,  606,  606,
507       623,  611,  167,  611,  611,  611,  606,  611,  606,  630,
508
509       611,  611,  611,  611,  611,  611,  633,  634,  634,  209,
510       635,  634,  636,  172,  606,  215,  215,  606,  215,   35,
511        35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
512       611,  606,  606,  606,  606,  606,  623,  611,  611,  611,
513       611,  611,  611,  611,  606,  637,  637,  247,  637,  638,
514       639,  640,  606,  641,  218,  641,  641,  257,  641,  606,
515       260,  260,  606,  260,  606,  606,   35,   35,   35,   35,
516        35,   35,   35,   35,  611,  606,  606,  606,  623,  611,
517       611,  611,  611,  611,  611,  611,  611,  642,  642,  643,
518       644,  606,  606,  606,  606,  606,  645,  645,  646,  263,
519
520       646,  646,  302,  646,  606,  305,  305,  606,  305,   35,
521        35,   35,   35,   35,   35,   35,   35,  611,  606,  606,
522       623,  611,  611,  611,  611,  611,  611,  606,  647,  648,
523       292,  606,  332,  332,  606,  332,  606,  606,  606,  606,
524       606,  606,  649,  649,  650,  308,  650,  650,  348,  650,
525       606,  351,  351,  606,  351,   35,   35,  606,  606,   35,
526        35,   35,   35,  606,  606,  606,  606,  611,  606,  606,
527       623,  611,  611,  611,  611,  611,  611,  611,  611,  606,
528       651,  606,  652,  335,  652,  652,  386,  386,  606,  389,
529       389,  606,  389,  606,  606,  606,  606,  653,  653,  654,
530
531       354,  654,  654,  403,  654,  606,  406,  406,  406,   35,
532        35,   35,   35,   35,   35,  611,  606,  606,  623,  611,
533       611,  611,  611,  611,  611,  611,  606,  606,  606,  606,
534       655,  655,  656,  392,  656,  656,  436,  436,  606,  439,
535       439,  606,  439,  606,  606,  606,  606,  606,  606,  657,
536       657,  658,  658,  658,  454,  454,   35,   35,   35,   35,
537       606,  606,  606,  606,  606,  606,  659,  623,  611,  660,
538       661,  611,  611,  611,  611,  611,  611,  606,  606,  606,
539       606,  606,  606,  662,  662,  663,  442,  663,  663,  489,
540       489,  606,  492,  492,  606,  492,  606,  606,  606,  606,
541
542       664,  664,  606,  606,   35,   35,   35,  606,  659,  659,
543       606,  623,  611,  660,  660,  660,  660,  606,  660,  661,
544       661,  611,  611,  611,  606,  606,  606,  606,  665,  665,
545       666,  495,  666,  666,  534,  534,  606,  537,  537,  537,
546       606,  606,  606,  606,  606,  606,  606,   35,   35,  606,
547       623,  606,  606,  611,  611,  611,  611,  611,  606,  606,
548       606,  606,  606,  606,  667,  667,  668,  668,  668,  569,
549       569,  606,  606,   35,  669,  611,  611,  611,  606,  606,
550       606,  606,  670,  670,  606,  606,  669,  669,  606,  611,
551       611,  611,  611,  611,  606,  606,  606,  606,  606,  611,
552
553       611,  611,  611,  611,  611,    0,  606,  606,  606,  606,
554       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
555       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
556       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
557       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
558       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
559       606,  606,  606,  606,  606,  606,  606,  606,  606,  606
560     } ;
561
562 static yyconst short int yy_nxt[3732] =
563     {   0,
564        14,   15,   16,   17,   18,   19,   20,   21,   22,   14,
565        23,   24,   14,   14,   25,   26,   27,   28,   26,   26,
566        26,   26,   26,   29,   30,   31,   14,   32,   33,   33,
567        33,   34,   35,   35,   35,   35,   36,   37,   35,   38,
568        39,   40,   41,   35,   35,   35,   35,   35,   42,   14,
569        43,   43,   43,   43,   43,   43,   14,   14,   14,   14,
570        14,   14,   14,   44,   14,   14,   45,   79,   52,  105,
571        46,  170,   53,   52,  105,   87,   79,   53,   54,  107,
572       172,   55,  129,   54,  116,  105,   55,   74,   16,   75,
573        76,  194,  130,   88,   47,   48,   79,  124,   49,  153,
574
575        15,   58,   59,  125,   60,   50,  111,   35,   51,   35,
576        60,   79,   35,  136,   35,   15,   58,   59,   89,   60,
577       143,  115,   60,   61,  154,   60,   74,   16,   75,   76,
578        56,   79,  147,  127,   77,   56,  148,   60,   61,   93,
579        93,  150,  115,   93,   93,  238,  152,   62,   99,   99,
580        99,   99,   99,   99,   99,   99,  146,   87,   79,   79,
581       146,   93,   62,   15,   16,   17,  117,   63,  589,  152,
582       192,  195,  129,   77,  100,  100,  100,  100,  100,  101,
583       143,  115,  130,   78,   94,   98,   98,   98,   98,   98,
584        98,   98,   98,   79,  118,  119,  155,  156,  120,  151,
585
586       162,   79,   83,  143,  115,  121,  185,  153,  122,  238,
587        64,   65,   65,   65,   65,   65,   65,   65,   65,   65,
588        65,   65,   65,   65,   65,   65,   65,   65,   15,   16,
589        17,  131,   63,   97,   85,   85,   85,   85,   85,   85,
590        85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
591        79,  139,  115,  140,  152,  141,  154,   78,   79,  140,
592       191,  141,   85,   85,   85,   85,   85,   85,   85,   85,
593       143,  115,  201,  141,  141,   64,   65,   65,   65,   65,
594        65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
595        65,   65,   65,   15,   16,   17,   67,   63,  141,  193,
596
597        79,  152,   68,   69,   70,  606,  196,   79,  134,  134,
598        79,  606,  134,  134,   79,  198,   71,  168,  168,  168,
599       168,  168,  168,  606,  155,  156,   79,  231,  159,  382,
600       134,  160,  160,  160,  160,  160,  160,  160,  160,  241,
601        72,   15,   16,   17,   67,   63,  532,  170,   89,  283,
602        68,   69,   70,  135,  162,   86,  214,   86,   86,  267,
603       606,   86,   86,  268,   71,   86,  170,  164,  165,  166,
604       164,  164,  164,  164,  164,  214,   93,   93,   86,   86,
605        93,   93,   79,   79,   79,  240,   83,  238,   72,   83,
606       168,  168,  168,  168,  168,  168,  168,  168,   93,   84,
607
608        79,  265,   85,   85,   85,   85,   85,   85,   85,   85,
609        95,   83,   96,   96,   96,   96,   96,   96,   96,   96,
610        97,   94,   83,  266,   98,   98,   98,   98,   98,  168,
611       168,  168,  168,  168,  168,  168,  168,   85,   85,   85,
612        85,   85,   85,   85,   85,   79,  551,   98,   98,   98,
613        98,   98,   98,   78,  145,   79,  280,  145,  145,   78,
614       382,  237,   78,   78,  145,   78,   78,   78,  104,  104,
615       104,  104,  104,  104,  104,  104,   97,  145,  279,   78,
616       104,  104,  104,  104,  104,  105,  105,  105,  105,  106,
617       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
618
619       105,   79,  105,   98,   98,   98,   98,   98,   98,   78,
620        78,   78,   78,   78,   78,   78,   78,   78,   78,  105,
621       105,  105,  105,  105,  105,  105,  105,  606,  249,  249,
622       249,  105,  105,  105,  105,  105,  177,   79,   79,   79,
623       105,  178,  170,  275,  179,  282,  180,  117,  532,  143,
624       115,  214,   97,  238,   78,   78,   78,   78,   78,   78,
625       114,  115,   78,   78,   78,  170,   78,   78,  134,  134,
626        78,  265,  134,  134,  214,  118,  119,   79,   79,  120,
627       431,  431,   78,   78,   78,   83,  121,   93,  323,  122,
628       134,   93,   79,  266,  281,   84,  146,   93,   85,   85,
629
630        85,   85,   85,   85,   85,   85,   79,   79,  373,   93,
631        93,  318,  324,  135,  606,  606,  606,  606,  606,  606,
632       606,  606,  160,  160,  160,  160,  160,  160,  160,  160,
633       160,  160,  160,  160,  160,  160,  160,  160,  484,  484,
634       123,   83,  242,  243,  244,  242,  242,  242,  242,  242,
635        83,  142,  487,  322,  606,  606,  606,  606,  606,  606,
636       606,  606,   78,  559,   78,   78,   78,  170,   78,   78,
637       253,  170,   78,  134,   79,   79,  255,  134,  606,  170,
638       255,   83,   79,  134,   78,   78,   78,   90,  255,   90,
639        90,   90,  372,   90,   90,  134,  134,   90,  247,  247,
640
641       248,  249,  249,  249,  249,  249,  211,  253,  170,   90,
642        90,   90,   92,  321,   78,   78,   92,  255,   78,   78,
643       360,  382,   92,  161,  361,  161,  161,  253,  170,  161,
644       161,  384,  371,  161,   92,   92,   78,  167,  167,  167,
645       167,  167,  167,  167,  167,  161,  161,  161,  358,  167,
646       167,  167,  167,  167,  201,   79,  202,  202,  202,  202,
647       202,  202,  219,  219,  219,  219,  219,  219,  219,  219,
648       359,  416,  167,  167,  167,  167,  167,  167,  173,  173,
649       173,  173,  173,  173,  173,  173,   97,  364,   83,   79,
650       173,  173,  173,  173,  173,  257,  257,  257,  257,  257,
651
652       257,  257,  257,  258,  258,  258,  258,  258,  259,  365,
653       253,  170,   79,  167,  167,  167,  167,  167,  167,  133,
654       300,   78,   78,  133,  574,   78,   78,  421,  606,  133,
655       256,  256,  256,  256,  256,  256,  256,  256,  606,  170,
656       419,  133,  133,   78,  201,  170,  202,  202,  202,  202,
657       202,  202,  202,  202,  289,  289,  289,  289,  289,  289,
658       289,  289,  211,  294,  295,  296,  294,  294,  294,  294,
659       294,  264,  264,  264,  264,  264,  264,  264,  264,   79,
660       201,  170,  203,  203,  203,  203,  203,  203,  203,  203,
661       253,  170,  298,  298,  298,  298,  298,  298,  467,   83,
662
663       255,  302,  302,  302,  302,  302,  302,  302,  302,  303,
664       303,  303,  303,  303,  304,   79,  201,  487,  204,  204,
665       204,  204,  204,  205,  202,  202,  606,  366,  301,  301,
666       301,  301,  301,  301,  301,  301,  606,  170,  325,  326,
667       327,  325,  325,  325,  325,  325,  300,  501,  501,  367,
668       468,   79,   78,   79,  206,  206,  206,  206,  206,  206,
669       206,  206,  368,   79,  170,  170,  206,  206,  206,  206,
670       206,   79,  374,  255,  300,  253,  170,  283,   79,  284,
671       284,  284,  284,  284,  284,  300,   79,  420,  469,  206,
672       206,  206,  206,  206,  206,  208,  209,  210,  210,  210,
673
674       210,  210,  210,  211,  253,  170,  434,  212,  212,  212,
675       212,  212,   79,  337,  346,  338,  338,  338,  338,  338,
676       338,  338,  338,  349,  349,  349,  349,  349,  350,   79,
677       212,  212,  212,  212,  212,  212,  170,  215,  216,  217,
678       215,  215,  215,  215,  215,  218,  510,  511,  511,  219,
679       219,  219,  219,  219,  337,  375,  339,  339,  339,  339,
680       339,  339,  339,  339,  309,  309,  309,  309,  309,  309,
681       309,  309,  219,  219,  219,  219,  219,  219,  220,  220,
682       220,  220,  220,  220,  220,  220,  606,  170,  550,   79,
683       220,  220,  220,  220,  220,  337,  346,  340,  340,  340,
684
685       340,  340,  341,  338,  338,  348,  348,  348,  348,  348,
686       348,  348,  348,  206,  206,  206,  206,  206,  206,  201,
687       549,  202,  202,  202,  202,  202,  202,  202,  202,  253,
688       170,  344,  344,  344,  344,  344,  344,  548,  606,  300,
689       347,  347,  347,  347,  347,  347,  347,  347,  387,  387,
690       387,  387,  387,  388,   79,  201,  170,  202,  202,  202,
691       202,  202,  202,  202,  202,  336,  336,  336,  336,  336,
692       336,  336,  336,  386,  386,  386,  386,  386,  386,  386,
693       386,  394,  395,  396,  394,  394,  394,  394,  394,  358,
694        79,  253,  170,  254,  254,  254,  254,  254,  254,  254,
695
696       254,  255,  529,  529,  434,  256,  256,  256,  256,  256,
697       606,  359,  385,  385,  385,  385,  385,  385,  385,  385,
698       337,  384,  338,  338,  338,  338,  338,  338,  256,  256,
699       256,  256,  256,  256,  170,  260,  261,  262,  260,  260,
700       260,  260,  260,  263,  170,  253,  170,  264,  264,  264,
701       264,  264,  337,  300,  338,  338,  338,  338,  338,  338,
702       338,  338,  355,  355,  355,  355,  355,  355,  355,  355,
703       264,  264,  264,  264,  264,  264,  283,  478,  284,  284,
704       284,  284,  284,  284,  284,  284,  337,  364,  338,  338,
705       338,  338,  338,  338,  338,  338,  253,  170,  399,  399,
706
707       399,  399,  399,  399,  170,  599,  346,  510,  511,  365,
708       599,   79,  283,  346,  285,  285,  285,  285,  285,  285,
709       285,  285,  403,  403,  403,  403,  403,  403,  403,  403,
710       404,  404,  404,  404,  404,  405,  606,  366,  402,  402,
711       402,  402,  402,  402,  402,  402,   79,   79,  283,  170,
712       286,  286,  286,  286,  286,  287,  284,  284,  346,  367,
713       461,  606,  422,  428,  429,  430,  428,  428,  428,  428,
714       428,  384,  170,  423,  424,  425,  426,  423,  423,  423,
715       423,  401,  462,   79,  253,  170,  298,  298,  298,  298,
716       298,  298,  298,  298,  255,  253,  170,  299,  299,  299,
717
718       299,  299,  299,  299,  299,  300,   79,  463,  503,  301,
719       301,  301,  301,  301,  375,  376,  376,  376,  376,  376,
720       376,  393,  393,  393,  393,  393,  393,  393,  393,  464,
721       504,  508,  301,  301,  301,  301,  301,  301,  170,  305,
722       306,  307,  305,  305,  305,  305,  305,  308,   79,  565,
723       565,  309,  309,  309,  309,  309,  436,  436,  436,  436,
724       436,  436,  436,  436,  437,  437,  437,  437,  437,  438,
725       507,  253,  170,  506,  309,  309,  309,  309,  309,  309,
726       283,  346,  284,  284,  284,  284,  284,  284,  284,  284,
727       606,  382,  435,  435,  435,  435,  435,  435,  435,  435,
728
729       444,  384,  445,  445,  445,  445,  445,  445,  445,  445,
730       505,  472,  575,   83,   83,   79,  283,  382,  284,  284,
731       284,  284,  284,  284,  284,  284,  444,  434,  446,  446,
732       446,  446,  446,  446,  446,  446,  444,  606,  447,  447,
733       447,  447,  447,  448,  445,  445,   79,  434,  461,  583,
734       583,   79,  332,  333,  334,  332,  332,  332,  332,  332,
735       335,  253,  170,  444,  336,  336,  336,  336,  336,  512,
736       462,  401,  409,  409,  409,  409,  409,  409,  409,  409,
737       455,  455,  455,  455,  455,  456,  384,  336,  336,  336,
738       336,  336,  336,  253,  170,  344,  344,  344,  344,  344,
739
740       344,  344,  344,  300,  253,  170,  345,  345,  345,  345,
741       345,  345,  345,  345,  346,  606,  170,  463,  347,  347,
742       347,  347,  347,   79,  472,  401,  253,  170,  451,  451,
743       451,  451,  451,  451,  331,  503,  401,   79,  513,  464,
744       466,  347,  347,  347,  347,  347,  347,  170,  351,  352,
745       353,  351,  351,  351,  351,  351,  354,  504,  465,   79,
746       355,  355,  355,  355,  355,  454,  454,  454,  454,  454,
747       454,  454,  454,  606,   79,  453,  453,  453,  453,  453,
748       453,  453,  453,  355,  355,  355,  355,  355,  355,  375,
749       376,  376,  376,  376,  376,  376,  376,  376,  470,  478,
750
751       546,  479,  479,  479,  479,  479,  479,  479,  479,  443,
752       443,  443,  443,  443,  443,  443,  443,  460,  470,  459,
753       470,  471,  547,   79,  375,  377,  377,  377,  377,  377,
754       377,  377,  377,  478,  470,  480,  480,  480,  480,  480,
755       480,  480,  480,   79,  478,  382,  481,  481,  481,  481,
756       481,  482,  479,  479,  470,  434,  470,  470,   79,  375,
757       378,  378,  378,  378,  378,  379,  376,  376,  489,  489,
758       489,  489,  489,  489,  489,  489,  490,  490,  490,  490,
759       490,  491,  606,  170,  488,  488,  488,  488,  488,  488,
760       488,  488,  401,   79,  382,  382,  383,  383,  383,  383,
761
762       383,  383,  383,  383,  384,  487,  588,  589,  385,  385,
763       385,  385,  385,  497,  498,  499,  497,  497,  497,  497,
764       497,  444,  458,  445,  445,  445,  445,  445,  445,  445,
765       445,  385,  385,  385,  385,  385,  385,  389,  390,  391,
766       389,  389,  389,  389,  389,  392,  588,  589,  457,  393,
767       393,  393,  393,  393,  444,  606,  445,  445,  445,  445,
768       445,  445,  445,  445,  444,  487,  445,  445,  445,  445,
769       445,  445,  393,  393,  393,  393,  393,  393,  253,  170,
770       399,  399,  399,  399,  399,  399,  399,  399,  346,  253,
771       170,  400,  400,  400,  400,  400,  400,  400,  400,  401,
772
773       253,  170,  331,  402,  402,  402,  402,  402,  554,  515,
774       401,  516,  517,  518,  515,  382,  516,  517,  518,  535,
775       535,  535,  535,  535,  536,  487,  402,  402,  402,  402,
776       402,  402,  170,  406,  407,  408,  406,  406,  406,  406,
777       406,  382,  606,   79,  382,  409,  409,  409,  409,  409,
778       251,  532,  532,  418,  532,  417,  519,  415,  590,  414,
779       472,  521,  473,  473,  473,  473,  473,  473,  409,  409,
780       409,  409,  409,  409,  375,  376,  376,  376,  376,  376,
781       376,  376,  376,  546,  572,  522,  523,  524,  522,  522,
782       522,  522,  522,   79,  413,   79,  525,  526,  527,  525,
783
784       525,  525,  525,  525,  412,  547,  573,  411,   79,  375,
785       376,  376,  376,  376,  376,  376,  376,  376,   79,  478,
786       572,  479,  479,  479,  479,  479,  479,  479,  479,  478,
787       410,  479,  479,  479,  479,  479,  479,  479,  479,  144,
788       144,  337,  573,   79,  382,  585,  432,  432,  432,  432,
789       432,  432,  432,  432,  384,  382,  331,  433,  433,  433,
790       433,  433,  433,  433,  433,  434,  251,  586,  585,  435,
791       435,  435,  435,  435,  478,  211,  479,  479,  479,  479,
792       479,  479,  496,  496,  496,  496,  496,  496,  496,  496,
793       586,  370,  435,  435,  435,  435,  435,  435,  439,  440,
794
795       441,  439,  439,  439,  439,  439,  442,  369,  363,  362,
796       443,  443,  443,  443,  443,  534,  534,  534,  534,  534,
797       534,  534,  534,  606,  357,  533,  533,  533,  533,  533,
798       533,  533,  533,  443,  443,  443,  443,  443,  443,  253,
799       170,  451,  451,  451,  451,  451,  451,  451,  451,  401,
800       253,  170,  452,  452,  452,  452,  452,  452,  452,  452,
801       356,  331,  251,  211,  453,  453,  453,  453,  453,  170,
802       541,  541,  541,  541,  541,  541,  541,  541,  170,  542,
803       542,  542,  542,  542,  542,  542,  542,  453,  453,  453,
804       453,  453,  453,  472,  211,  473,  473,  473,  473,  473,
805
806       473,  473,  473,  170,  543,  543,  543,  543,  543,  544,
807       541,  541,  606,  276,  606,  606,  606,  320,  319,  515,
808       317,  516,  517,  518,  316,  315,  314,  313,   79,  472,
809       312,  474,  474,  474,  474,  474,  474,  474,  474,  606,
810       311,  516,  517,  518,  606,  310,  606,  606,  518,  292,
811       606,  251,  606,  606,  606,  211,  288,  211,  103,  519,
812       276,  278,  276,  277,   79,  472,  519,  475,  475,  475,
813       475,  475,  476,  477,  477,  552,  276,  274,  553,  553,
814       553,  553,  553,  553,  553,  553,  519,  273,  272,  271,
815       270,  519,  269,   97,  211,  514,  514,  521,  251,  514,
816
817        79,  472,  211,  477,  477,  477,  473,  473,  473,  473,
818       473,  514,  514,  514,  520,  520,  103,  559,  520,  560,
819       560,  560,  560,  560,  560,  560,  560,   83,  199,  239,
820       520,  520,  520,  236,  235,  234,   79,  382,  233,  485,
821       485,  485,  485,  485,  485,  485,  485,  434,  382,  232,
822       486,  486,  486,  486,  486,  486,  486,  486,  487,  230,
823       229,  228,  488,  488,  488,  488,  488,  559,  227,  561,
824       561,  561,  561,  561,  561,  561,  561,  540,  540,  540,
825       540,  540,  540,  540,  540,  488,  488,  488,  488,  488,
826       488,  492,  493,  494,  492,  492,  492,  492,  492,  495,
827
828       226,  225,  224,  496,  496,  496,  496,  496,  559,  223,
829       562,  562,  562,  562,  562,  563,  560,  560,  569,  569,
830       569,  569,  569,  569,  569,  569,  496,  496,  496,  496,
831       496,  496,  253,  170,  502,  502,  502,  502,  502,  502,
832       502,  502,  472,  222,  473,  473,  473,  473,  473,  473,
833       473,  473,  570,  570,  570,  570,  570,  571,  606,  221,
834       568,  568,  568,  568,  568,  568,  568,  568,  170,  541,
835       541,  541,  541,  541,  541,  541,  541,   79,  472,  103,
836       473,  473,  473,  473,  473,  473,  473,  473,  170,  541,
837       541,  541,  541,  541,  541,  541,  541,  170,  541,  541,
838
839       541,  541,  541,  541,  553,  553,  553,  553,  553,  553,
840       553,  553,   95,   79,  382,   83,  530,  530,  530,  530,
841       530,  530,  530,  530,  487,  382,   83,  531,  531,  531,
842       531,  531,  531,  531,  531,  532,  199,  151,  152,  533,
843       533,  533,  533,  533,  553,  553,  553,  553,  553,  553,
844       553,  553,  576,  577,  578,  576,  576,  576,  576,  576,
845       146,  146,  533,  533,  533,  533,  533,  533,  537,  538,
846       539,  537,  537,  537,  537,  537,  138,  197,  132,  132,
847       540,  540,  540,  540,  540,   79,  554,  190,  555,  555,
848       555,  555,  555,  555,  579,  580,  581,  579,  579,  579,
849
850       579,  579,  189,  540,  540,  540,  540,  540,  540,  554,
851       188,  555,  555,  555,  555,  555,  555,  555,  555,  187,
852       559,   79,  560,  560,  560,  560,  560,  560,  560,  560,
853       559,  186,  560,  560,  560,  560,  560,  560,  560,  560,
854       184,  183,  182,  181,   79,  554,  176,  556,  556,  556,
855       556,  556,  556,  556,  556,  559,  175,  560,  560,  560,
856       560,  560,  560,  382,  174,  584,  584,  584,  584,  584,
857       584,  584,  584,  595,  595,  595,  595,  595,  595,  103,
858        79,  554,   78,  557,  557,  557,  557,  557,  558,  555,
859       555,  595,  595,  595,  595,  595,  595,  595,  595,  596,
860
861       596,  596,  596,  596,  596,  596,  596,  597,  597,  597,
862       597,  597,  598,  595,  595,  103,   79,  382,  163,  566,
863       566,  566,  566,  566,  566,  566,  566,  532,  382,   91,
864       567,  567,  567,  567,  567,  567,  567,  567,   83,   81,
865        80,   79,  568,  568,  568,  568,  568,  152,  600,  601,
866       602,  600,  600,  600,  600,  600,  590,  146,  591,  591,
867       591,  591,  591,  591,  138,  568,  568,  568,  568,  568,
868       568,  554,  132,  555,  555,  555,  555,  555,  555,  555,
869       555,   79,  595,  595,  595,  595,  595,  595,  595,  595,
870       128,   79,  595,  595,  595,  595,  595,  595,  595,  595,
871
872       126,  113,  112,  111,  110,  109,   79,  554,  108,  555,
873       555,  555,  555,  555,  555,  555,  555,  105,  103,   91,
874       603,  603,  603,  603,  603,  603,  603,  603,  600,  600,
875       600,  600,  600,  600,  600,  600,   81,   80,   79,  606,
876       606,  606,   79,  590,  606,  591,  591,  591,  591,  591,
877       591,  591,  591,   79,  606,  606,  606,  606,  606,  606,
878       606,   79,  604,  604,  604,  604,  604,  605,  603,  603,
879       603,  603,  603,  603,  603,  603,  603,  603,   79,  590,
880       606,  592,  592,  592,  592,  592,  592,  592,  592,  606,
881       606,  606,  606,  606,  606,   79,  603,  603,  603,  603,
882
883       603,  603,  606,   79,  606,  606,  606,  606,  606,  606,
884       606,  606,  606,  606,   79,  590,  606,  593,  593,  593,
885       593,  593,  594,  591,  591,  606,  606,  606,  606,   79,
886       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
887       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
888        79,  590,  606,  591,  591,  591,  591,  591,  591,  591,
889       591,  606,  606,  606,  606,  606,  606,  606,  606,  606,
890       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
891       606,  606,  606,  606,  606,  606,   79,  590,  606,  591,
892       591,  591,  591,  591,  591,  591,  591,  606,  606,  606,
893
894       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
895       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
896       606,  606,   79,   57,   57,   57,   57,   57,   57,   57,
897        57,   57,   57,   57,   57,   57,   57,   57,   57,   31,
898        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
899        31,   31,   31,   31,   31,   66,   66,   66,   66,   66,
900        66,   66,   66,   66,   66,   66,   66,   66,   66,   66,
901        66,   73,   73,   73,   73,   73,   73,   73,   73,   73,
902        73,   73,   73,   73,   73,   73,   73,   78,  606,  606,
903       606,  606,  606,  606,  606,   78,   78,   78,  606,  606,
904
905        78,   78,   78,   82,   82,   82,   82,   82,   82,   82,
906        82,   82,   82,   82,   82,   82,   82,   82,   82,   86,
907       606,  606,  606,  606,   86,  606,  606,   86,   86,   86,
908        86,  606,   86,   86,   86,   90,  606,  606,  606,  606,
909       606,  606,  606,   90,   90,   90,  606,  606,   90,   90,
910        90,   92,  606,  606,   92,   92,  606,   92,  606,   92,
911        92,   92,  606,  606,   92,   92,   92,  102,  102,  606,
912       606,  606,  102,  133,  606,  606,  133,  133,  606,  133,
913       606,  133,  133,  133,  606,  606,  133,  133,  133,  137,
914       606,  606,  137,  137,  606,  137,  606,  137,  137,  137,
915
916       606,  137,  606,  137,  137,  145,  606,  606,  145,  606,
917       606,  145,  606,  145,  145,  145,  145,  606,  145,  145,
918       145,  149,  149,  149,  149,  149,  149,  149,  149,  149,
919       149,  149,  149,  149,  149,  149,  149,  151,  151,  606,
920       151,  606,  151,  151,  151,  151,  151,  151,  151,  151,
921       151,  151,  151,  157,  157,  157,  157,  157,  157,  157,
922       157,  157,  157,  157,  157,  157,  157,  157,  157,  158,
923       158,  606,  158,  158,  158,  158,  158,  158,  158,  158,
924       158,  158,  158,  158,  158,  161,  606,  606,  606,  606,
925       161,  606,  606,  161,  161,  161,  606,  606,  161,  161,
926
927       161,   93,  606,  606,   93,   93,  606,   93,  606,   93,
928        93,   93,  606,  606,   93,   93,   93,  169,  169,  606,
929       606,  606,  169,  171,  171,  171,  606,  606,  606,  171,
930       134,  606,  606,  134,  134,  606,  134,  606,  134,  134,
931       134,  606,  606,  134,  134,  134,  200,  200,  200,  200,
932       200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
933       200,  200,  207,  207,  606,  606,  606,  207,  213,  213,
934       213,  606,  606,  606,  213,  245,  245,  606,  606,  606,
935       245,  246,  246,  606,  606,  606,  246,  250,  250,  606,
936       606,  606,  250,  252,  252,  252,  606,  606,  606,  252,
937
938       288,  288,  606,  606,  606,  288,  290,  290,  606,  606,
939       606,  290,  291,  291,  606,  606,  606,  291,  293,  293,
940       293,  606,  606,  606,  293,  297,  297,  297,  297,  606,
941       606,  606,  297,  328,  328,  606,  606,  606,  328,  329,
942       329,  606,  606,  606,  329,  330,  330,  606,  606,  606,
943       330,  342,  342,  342,  606,  606,  606,  342,  343,  343,
944       343,  343,  606,  606,  606,  343,  380,  380,  606,  606,
945       606,  380,  381,  381,  606,  606,  606,  381,  397,  397,
946       397,  606,  606,  606,  397,  398,  398,  398,  398,  606,
947       606,  606,  398,  427,  427,  606,  606,  606,  427,  431,
948
949       606,  431,  431,  606,  606,  606,  431,  449,  449,  449,
950       606,  606,  606,  449,  450,  450,  450,  450,  606,  606,
951       606,  450,  483,  483,  606,  606,  606,  483,  484,  606,
952       484,  484,  606,  606,  606,  484,  500,  500,  500,  606,
953       606,  606,  500,  501,  501,  501,  606,  606,  606,  606,
954       501,  509,  509,  509,  509,  509,  509,  509,  509,  509,
955       509,  509,  509,  509,  509,  509,  509,  514,  514,  606,
956       514,  514,  514,  606,  606,  514,  514,  514,  606,  606,
957       514,  514,  514,  520,  520,  606,  520,  520,  520,  606,
958       606,  520,  520,  520,  606,  606,  520,  520,  520,  528,
959
960       528,  606,  606,  606,  528,  529,  606,  529,  529,  606,
961       606,  606,  529,  545,  545,  606,  606,  606,  606,  545,
962       564,  564,  606,  606,  606,  564,  565,  606,  565,  565,
963       606,  606,  606,  565,  582,  582,  606,  606,  606,  582,
964       583,  606,  583,  606,  606,  606,  606,  583,  587,  587,
965       587,  587,  587,  587,  587,  587,  587,  587,  587,  587,
966       587,  587,  587,  587,   13,  606,  606,  606,  606,  606,
967       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
968       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
969       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
970
971       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
972       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
973       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
974       606
975     } ;
976
977 static yyconst short int yy_chk[3732] =
978     {   0,
979         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
980         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
981         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
982         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
983         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
984         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
985         1,    1,    1,    1,    1,    1,    2,   44,    3,   34,
986         2,  103,    3,    4,   47,   20,  126,    4,    3,   34,
987       103,    3,   52,    4,   44,   48,    4,   11,   11,   11,
988        11,  126,   52,   20,    2,    2,   56,   47,    2,   74,
989
990         5,    5,    5,   48,    5,    2,   50,    3,    2,    3,
991         5,  603,    4,   56,    4,    6,    6,    6,   20,    6,
992        64,   64,    5,    5,   75,    6,   12,   12,   12,   12,
993         3,  196,   68,   50,   11,    4,   70,    6,    6,   25,
994        25,   72,   72,   25,   25,  196,   74,    5,   27,   27,
995        27,   27,   27,   27,   27,   27,   68,   88,  124,  127,
996        70,   25,    6,    7,    7,    7,   45,    7,  587,   75,
997       124,  127,  129,   12,   28,   28,   28,   28,   28,   28,
998       139,  139,  129,   43,   25,   43,   43,   43,   43,   43,
999        43,   43,   43,  194,   45,   45,   77,   77,   45,   77,
1000
1001        88,  116,  123,  114,  114,   45,  116,  153,   45,  194,
1002         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1003         7,    7,    7,    7,    7,    7,    7,    7,    8,    8,
1004         8,   53,    8,  206,   53,   53,   53,   53,   53,   53,
1005        53,   53,   84,   84,   84,   84,   84,   84,   84,   84,
1006       114,   62,   62,   62,  153,   62,  154,  125,  206,   62,
1007       123,   62,   85,   85,   85,   85,   85,   85,   85,   85,
1008       143,  143,  202,   62,   62,    8,    8,    8,    8,    8,
1009         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
1010         8,    8,    8,    9,    9,    9,    9,    9,   62,  125,
1011
1012       128,  154,    9,    9,    9,   86,  128,  202,   55,   55,
1013       136,  161,   55,   55,  185,  136,    9,  101,  101,  101,
1014       101,  101,  101,   86,  155,  155,  198,  185,   87,  584,
1015        55,   87,   87,   87,   87,   87,   87,   87,   87,  198,
1016         9,   10,   10,   10,   10,   10,  582,  171,   86,  284,
1017        10,   10,   10,   55,  161,   89,  171,   89,   89,  222,
1018       568,   89,   89,  222,   10,   89,  213,   95,   95,   95,
1019        95,   95,   95,   95,   95,  213,   92,   92,   89,   89,
1020        92,   92,  192,  195,  284,  195,  512,  192,   10,   19,
1021        99,   99,   99,   99,   99,   99,   99,   99,   92,   19,
1022
1023        95,  221,   19,   19,   19,   19,   19,   19,   19,   19,
1024        26,  191,   26,   26,   26,   26,   26,   26,   26,   26,
1025        26,   92,  237,  221,   26,   26,   26,   26,   26,  100,
1026       100,  100,  100,  100,  100,  100,  100,  131,  131,  131,
1027       131,  131,  131,  131,  131,   26,  512,   26,   26,   26,
1028        26,   26,   26,   32,  146,  238,  238,  146,  146,   32,
1029       567,  191,   32,   32,  146,   32,   32,   32,   32,   32,
1030        32,   32,   32,   32,   32,   32,   32,  146,  237,   32,
1031        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
1032        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
1033
1034        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
1035        32,   32,   32,   32,   32,   32,   32,   32,   32,   35,
1036        35,   35,   35,   35,   35,   35,   35,   35,  210,  210,
1037       210,   35,   35,   35,   35,   35,  109,  231,  240,  241,
1038        35,  109,  252,  231,  109,  241,  109,  117,  565,  150,
1039       150,  252,  239,  240,   35,   35,   35,   35,   35,   35,
1040        42,   42,   42,   42,   42,  293,   42,   42,  133,  133,
1041        42,  265,  133,  133,  293,  117,  117,  239,  281,  117,
1042       388,  388,   42,   42,   42,   46,  117,  163,  281,  117,
1043       133,  163,  323,  265,  239,   46,  150,  163,   46,   46,
1044
1045        46,   46,   46,   46,   46,   46,  275,  282,  323,  163,
1046       163,  275,  282,  133,  142,  142,  142,  142,  142,  142,
1047       142,  142,  159,  159,  159,  159,  159,  159,  159,  159,
1048       160,  160,  160,  160,  160,  160,  160,  160,  438,  438,
1049        46,   63,  201,  201,  201,  201,  201,  201,  201,  201,
1050       279,   63,  564,  280,   63,   63,   63,   63,   63,   63,
1051        63,   63,   79,  560,   79,   79,   79,  297,   79,   79,
1052       254,  254,   79,  197,  280,  201,  297,  197,  256,  256,
1053       254,  321,  322,  197,   79,   79,   79,   91,  256,   91,
1054        91,   91,  322,   91,   91,  197,  197,   91,  209,  209,
1055
1056       209,  209,  209,  209,  209,  209,  209,  298,  298,   91,
1057        91,   91,   94,  279,   94,   94,   94,  298,   94,   94,
1058       313,  383,   94,  162,  313,  162,  162,  452,  452,  162,
1059       162,  383,  321,  162,   94,   94,   94,   96,   96,   96,
1060        96,   96,   96,   96,   96,  162,  162,  162,  312,   96,
1061        96,   96,   96,   96,  205,  368,  205,  205,  205,  205,
1062       205,  205,  214,  214,  214,  214,  214,  214,  214,  214,
1063       312,  368,   96,   96,   96,   96,   96,   96,  104,  104,
1064       104,  104,  104,  104,  104,  104,  104,  316,  371,  205,
1065       104,  104,  104,  104,  104,  216,  216,  216,  216,  216,
1066
1067       216,  216,  216,  217,  217,  217,  217,  217,  217,  316,
1068       299,  299,  373,  104,  104,  104,  104,  104,  104,  135,
1069       299,  135,  135,  135,  549,  135,  135,  373,  219,  135,
1070       219,  219,  219,  219,  219,  219,  219,  219,  453,  453,
1071       371,  135,  135,  135,  164,  545,  164,  164,  164,  164,
1072       164,  164,  164,  164,  247,  247,  247,  247,  247,  247,
1073       247,  247,  247,  253,  253,  253,  253,  253,  253,  253,
1074       253,  255,  255,  255,  255,  255,  255,  255,  255,  164,
1075       165,  541,  165,  165,  165,  165,  165,  165,  165,  165,
1076       259,  259,  259,  259,  259,  259,  259,  259,  419,  419,
1077
1078       259,  261,  261,  261,  261,  261,  261,  261,  261,  262,
1079       262,  262,  262,  262,  262,  165,  166,  529,  166,  166,
1080       166,  166,  166,  166,  166,  166,  264,  317,  264,  264,
1081       264,  264,  264,  264,  264,  264,  301,  301,  283,  283,
1082       283,  283,  283,  283,  283,  283,  301,  456,  456,  317,
1083       419,  166,  167,  318,  167,  167,  167,  167,  167,  167,
1084       167,  167,  318,  324,  342,  343,  167,  167,  167,  167,
1085       167,  283,  324,  342,  343,  344,  344,  287,  372,  287,
1086       287,  287,  287,  287,  287,  344,  420,  372,  420,  167,
1087       167,  167,  167,  167,  167,  170,  170,  170,  170,  170,
1088
1089       170,  170,  170,  170,  345,  345,  528,  170,  170,  170,
1090       170,  170,  287,  294,  345,  294,  294,  294,  294,  294,
1091       294,  294,  294,  307,  307,  307,  307,  307,  307,  513,
1092       170,  170,  170,  170,  170,  170,  172,  172,  172,  172,
1093       172,  172,  172,  172,  172,  172,  467,  467,  509,  172,
1094       172,  172,  172,  172,  295,  376,  295,  295,  295,  295,
1095       295,  295,  295,  295,  300,  300,  300,  300,  300,  300,
1096       300,  300,  172,  172,  172,  172,  172,  172,  173,  173,
1097       173,  173,  173,  173,  173,  173,  347,  347,  508,  376,
1098       173,  173,  173,  173,  173,  296,  347,  296,  296,  296,
1099
1100       296,  296,  296,  296,  296,  306,  306,  306,  306,  306,
1101       306,  306,  306,  173,  173,  173,  173,  173,  173,  203,
1102       507,  203,  203,  203,  203,  203,  203,  203,  203,  304,
1103       304,  304,  304,  304,  304,  304,  304,  506,  309,  304,
1104       309,  309,  309,  309,  309,  309,  309,  309,  334,  334,
1105       334,  334,  334,  334,  203,  204,  501,  204,  204,  204,
1106       204,  204,  204,  204,  204,  331,  331,  331,  331,  331,
1107       331,  331,  331,  333,  333,  333,  333,  333,  333,  333,
1108       333,  337,  337,  337,  337,  337,  337,  337,  337,  358,
1109       204,  215,  215,  215,  215,  215,  215,  215,  215,  215,
1110
1111       215,  215,  491,  491,  484,  215,  215,  215,  215,  215,
1112       336,  358,  336,  336,  336,  336,  336,  336,  336,  336,
1113       341,  483,  341,  341,  341,  341,  341,  341,  215,  215,
1114       215,  215,  215,  215,  218,  218,  218,  218,  218,  218,
1115       218,  218,  218,  218,  397,  502,  502,  218,  218,  218,
1116       218,  218,  339,  397,  339,  339,  339,  339,  339,  339,
1117       339,  339,  346,  346,  346,  346,  346,  346,  346,  346,
1118       218,  218,  218,  218,  218,  218,  242,  479,  242,  242,
1119       242,  242,  242,  242,  242,  242,  340,  364,  340,  340,
1120       340,  340,  340,  340,  340,  340,  350,  350,  350,  350,
1121
1122       350,  350,  350,  350,  398,  670,  350,  510,  510,  364,
1123       670,  242,  243,  398,  243,  243,  243,  243,  243,  243,
1124       243,  243,  352,  352,  352,  352,  352,  352,  352,  352,
1125       353,  353,  353,  353,  353,  353,  355,  366,  355,  355,
1126       355,  355,  355,  355,  355,  355,  374,  243,  244,  449,
1127       244,  244,  244,  244,  244,  244,  244,  244,  449,  366,
1128       414,  385,  374,  382,  382,  382,  382,  382,  382,  382,
1129       382,  385,  450,  375,  375,  375,  375,  375,  375,  375,
1130       375,  450,  414,  244,  257,  257,  257,  257,  257,  257,
1131       257,  257,  257,  257,  257,  260,  260,  260,  260,  260,
1132
1133       260,  260,  260,  260,  260,  260,  375,  415,  457,  260,
1134       260,  260,  260,  260,  379,  379,  379,  379,  379,  379,
1135       379,  384,  384,  384,  384,  384,  384,  384,  384,  415,
1136       457,  465,  260,  260,  260,  260,  260,  260,  263,  263,
1137       263,  263,  263,  263,  263,  263,  263,  263,  379,  536,
1138       536,  263,  263,  263,  263,  263,  390,  390,  390,  390,
1139       390,  390,  390,  390,  391,  391,  391,  391,  391,  391,
1140       460,  399,  399,  459,  263,  263,  263,  263,  263,  263,
1141       285,  399,  285,  285,  285,  285,  285,  285,  285,  285,
1142       393,  432,  393,  393,  393,  393,  393,  393,  393,  393,
1143
1144       394,  432,  394,  394,  394,  394,  394,  394,  394,  394,
1145       458,  473,  551,  551,  468,  285,  286,  433,  286,  286,
1146       286,  286,  286,  286,  286,  286,  395,  433,  395,  395,
1147       395,  395,  395,  395,  395,  395,  396,  435,  396,  396,
1148       396,  396,  396,  396,  396,  396,  473,  435,  461,  571,
1149       571,  286,  292,  292,  292,  292,  292,  292,  292,  292,
1150       292,  400,  400,  445,  292,  292,  292,  292,  292,  468,
1151       461,  400,  401,  401,  401,  401,  401,  401,  401,  401,
1152       408,  408,  408,  408,  408,  408,  431,  292,  292,  292,
1153       292,  292,  292,  302,  302,  302,  302,  302,  302,  302,
1154
1155       302,  302,  302,  302,  305,  305,  305,  305,  305,  305,
1156       305,  305,  305,  305,  305,  402,  402,  463,  305,  305,
1157       305,  305,  305,  469,  477,  402,  405,  405,  405,  405,
1158       405,  405,  405,  405,  427,  503,  405,  422,  469,  463,
1159       418,  305,  305,  305,  305,  305,  305,  308,  308,  308,
1160       308,  308,  308,  308,  308,  308,  308,  503,  417,  477,
1161       308,  308,  308,  308,  308,  407,  407,  407,  407,  407,
1162       407,  407,  407,  409,  416,  409,  409,  409,  409,  409,
1163       409,  409,  409,  308,  308,  308,  308,  308,  308,  325,
1164       325,  325,  325,  325,  325,  325,  325,  325,  421,  428,
1165
1166       505,  428,  428,  428,  428,  428,  428,  428,  428,  434,
1167       434,  434,  434,  434,  434,  434,  434,  413,  421,  412,
1168       421,  421,  505,  325,  326,  326,  326,  326,  326,  326,
1169       326,  326,  326,  429,  466,  429,  429,  429,  429,  429,
1170       429,  429,  429,  421,  430,  485,  430,  430,  430,  430,
1171       430,  430,  430,  430,  466,  485,  466,  466,  326,  327,
1172       327,  327,  327,  327,  327,  327,  327,  327,  440,  440,
1173       440,  440,  440,  440,  440,  440,  441,  441,  441,  441,
1174       441,  441,  443,  500,  443,  443,  443,  443,  443,  443,
1175       443,  443,  500,  327,  332,  486,  332,  332,  332,  332,
1176
1177       332,  332,  332,  332,  332,  486,  575,  575,  332,  332,
1178       332,  332,  332,  444,  444,  444,  444,  444,  444,  444,
1179       444,  446,  411,  446,  446,  446,  446,  446,  446,  446,
1180       446,  332,  332,  332,  332,  332,  332,  335,  335,  335,
1181       335,  335,  335,  335,  335,  335,  588,  588,  410,  335,
1182       335,  335,  335,  335,  447,  488,  447,  447,  447,  447,
1183       447,  447,  447,  447,  448,  488,  448,  448,  448,  448,
1184       448,  448,  335,  335,  335,  335,  335,  335,  348,  348,
1185       348,  348,  348,  348,  348,  348,  348,  348,  348,  351,
1186       351,  351,  351,  351,  351,  351,  351,  351,  351,  351,
1187
1188       451,  451,  381,  351,  351,  351,  351,  351,  555,  470,
1189       451,  470,  470,  470,  471,  530,  471,  471,  471,  494,
1190       494,  494,  494,  494,  494,  530,  351,  351,  351,  351,
1191       351,  351,  354,  354,  354,  354,  354,  354,  354,  354,
1192       354,  531,  533,  555,  566,  354,  354,  354,  354,  354,
1193       380,  531,  533,  370,  566,  369,  470,  363,  591,  362,
1194       476,  471,  476,  476,  476,  476,  476,  476,  354,  354,
1195       354,  354,  354,  354,  377,  377,  377,  377,  377,  377,
1196       377,  377,  377,  546,  548,  472,  472,  472,  472,  472,
1197       472,  472,  472,  591,  361,  476,  478,  478,  478,  478,
1198
1199       478,  478,  478,  478,  360,  546,  548,  357,  377,  378,
1200       378,  378,  378,  378,  378,  378,  378,  378,  472,  480,
1201       572,  480,  480,  480,  480,  480,  480,  480,  480,  481,
1202       356,  481,  481,  481,  481,  481,  481,  481,  481,  619,
1203       619,  338,  572,  378,  386,  574,  386,  386,  386,  386,
1204       386,  386,  386,  386,  386,  389,  330,  389,  389,  389,
1205       389,  389,  389,  389,  389,  389,  329,  574,  585,  389,
1206       389,  389,  389,  389,  482,  328,  482,  482,  482,  482,
1207       482,  482,  487,  487,  487,  487,  487,  487,  487,  487,
1208       585,  320,  389,  389,  389,  389,  389,  389,  392,  392,
1209
1210       392,  392,  392,  392,  392,  392,  392,  319,  315,  314,
1211       392,  392,  392,  392,  392,  493,  493,  493,  493,  493,
1212       493,  493,  493,  496,  311,  496,  496,  496,  496,  496,
1213       496,  496,  496,  392,  392,  392,  392,  392,  392,  403,
1214       403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
1215       406,  406,  406,  406,  406,  406,  406,  406,  406,  406,
1216       310,  291,  290,  289,  406,  406,  406,  406,  406,  497,
1217       497,  497,  497,  497,  497,  497,  497,  497,  498,  498,
1218       498,  498,  498,  498,  498,  498,  498,  406,  406,  406,
1219       406,  406,  406,  423,  288,  423,  423,  423,  423,  423,
1220
1221       423,  423,  423,  499,  499,  499,  499,  499,  499,  499,
1222       499,  499,  514,  278,  514,  514,  514,  277,  276,  515,
1223       274,  515,  515,  515,  273,  272,  271,  270,  423,  424,
1224       269,  424,  424,  424,  424,  424,  424,  424,  424,  516,
1225       268,  516,  516,  516,  517,  267,  517,  517,  517,  251,
1226       520,  250,  520,  520,  520,  249,  248,  246,  245,  514,
1227       236,  235,  234,  233,  424,  425,  515,  425,  425,  425,
1228       425,  425,  425,  425,  425,  518,  232,  229,  518,  518,
1229       518,  518,  518,  518,  518,  518,  516,  227,  226,  225,
1230       224,  517,  223,  220,  212,  519,  519,  520,  211,  519,
1231
1232       425,  426,  208,  426,  426,  426,  426,  426,  426,  426,
1233       426,  519,  519,  519,  521,  521,  207,  525,  521,  525,
1234       525,  525,  525,  525,  525,  525,  525,  200,  199,  193,
1235       521,  521,  521,  190,  189,  188,  426,  436,  187,  436,
1236       436,  436,  436,  436,  436,  436,  436,  436,  439,  186,
1237       439,  439,  439,  439,  439,  439,  439,  439,  439,  184,
1238       183,  182,  439,  439,  439,  439,  439,  526,  181,  526,
1239       526,  526,  526,  526,  526,  526,  526,  532,  532,  532,
1240       532,  532,  532,  532,  532,  439,  439,  439,  439,  439,
1241       439,  442,  442,  442,  442,  442,  442,  442,  442,  442,
1242
1243       180,  179,  178,  442,  442,  442,  442,  442,  527,  177,
1244       527,  527,  527,  527,  527,  527,  527,  527,  538,  538,
1245       538,  538,  538,  538,  538,  538,  442,  442,  442,  442,
1246       442,  442,  454,  454,  454,  454,  454,  454,  454,  454,
1247       454,  454,  474,  176,  474,  474,  474,  474,  474,  474,
1248       474,  474,  539,  539,  539,  539,  539,  539,  540,  175,
1249       540,  540,  540,  540,  540,  540,  540,  540,  542,  542,
1250       542,  542,  542,  542,  542,  542,  542,  474,  475,  169,
1251       475,  475,  475,  475,  475,  475,  475,  475,  543,  543,
1252       543,  543,  543,  543,  543,  543,  543,  544,  544,  544,
1253
1254       544,  544,  544,  544,  552,  552,  552,  552,  552,  552,
1255       552,  552,  168,  475,  489,  158,  489,  489,  489,  489,
1256       489,  489,  489,  489,  489,  492,  157,  492,  492,  492,
1257       492,  492,  492,  492,  492,  492,  156,  152,  151,  492,
1258       492,  492,  492,  492,  553,  553,  553,  553,  553,  553,
1259       553,  553,  554,  554,  554,  554,  554,  554,  554,  554,
1260       149,  145,  492,  492,  492,  492,  492,  492,  495,  495,
1261       495,  495,  495,  495,  495,  495,  138,  134,  132,  130,
1262       495,  495,  495,  495,  495,  554,  558,  122,  558,  558,
1263       558,  558,  558,  558,  559,  559,  559,  559,  559,  559,
1264
1265       559,  559,  121,  495,  495,  495,  495,  495,  495,  522,
1266       120,  522,  522,  522,  522,  522,  522,  522,  522,  119,
1267       561,  558,  561,  561,  561,  561,  561,  561,  561,  561,
1268       562,  118,  562,  562,  562,  562,  562,  562,  562,  562,
1269       113,  112,  111,  110,  522,  523,  108,  523,  523,  523,
1270       523,  523,  523,  523,  523,  563,  107,  563,  563,  563,
1271       563,  563,  563,  569,  106,  569,  569,  569,  569,  569,
1272       569,  569,  569,  598,  598,  598,  598,  598,  598,  102,
1273       523,  524,   98,  524,  524,  524,  524,  524,  524,  524,
1274       524,  579,  579,  579,  579,  579,  579,  579,  579,  580,
1275
1276       580,  580,  580,  580,  580,  580,  580,  581,  581,  581,
1277       581,  581,  581,  581,  581,   97,  524,  534,   93,  534,
1278       534,  534,  534,  534,  534,  534,  534,  534,  537,   90,
1279       537,  537,  537,  537,  537,  537,  537,  537,   82,   81,
1280        80,   78,  537,  537,  537,  537,  537,   73,  590,  590,
1281       590,  590,  590,  590,  590,  590,  594,   66,  594,  594,
1282       594,  594,  594,  594,   59,  537,  537,  537,  537,  537,
1283       537,  556,   54,  556,  556,  556,  556,  556,  556,  556,
1284       556,  590,  596,  596,  596,  596,  596,  596,  596,  596,
1285        51,  594,  597,  597,  597,  597,  597,  597,  597,  597,
1286
1287        49,   41,   40,   39,   38,   37,  556,  557,   36,  557,
1288       557,  557,  557,  557,  557,  557,  557,   33,   29,   23,
1289       600,  600,  600,  600,  600,  600,  600,  600,  601,  601,
1290       601,  601,  601,  601,  601,  601,   17,   15,   14,   13,
1291         0,    0,  557,  576,    0,  576,  576,  576,  576,  576,
1292       576,  576,  576,  600,    0,    0,    0,    0,    0,    0,
1293         0,  601,  602,  602,  602,  602,  602,  602,  602,  602,
1294       604,  604,  604,  604,  604,  604,  604,  604,  576,  577,
1295         0,  577,  577,  577,  577,  577,  577,  577,  577,    0,
1296         0,    0,    0,    0,    0,  602,  605,  605,  605,  605,
1297
1298       605,  605,    0,  604,    0,    0,    0,    0,    0,    0,
1299         0,    0,    0,    0,  577,  578,    0,  578,  578,  578,
1300       578,  578,  578,  578,  578,    0,    0,    0,    0,  605,
1301         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1302         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1303       578,  592,    0,  592,  592,  592,  592,  592,  592,  592,
1304       592,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1305         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1306         0,    0,    0,    0,    0,    0,  592,  593,    0,  593,
1307       593,  593,  593,  593,  593,  593,  593,    0,    0,    0,
1308
1309         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1310         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1311         0,    0,  593,  607,  607,  607,  607,  607,  607,  607,
1312       607,  607,  607,  607,  607,  607,  607,  607,  607,  608,
1313       608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
1314       608,  608,  608,  608,  608,  609,  609,  609,  609,  609,
1315       609,  609,  609,  609,  609,  609,  609,  609,  609,  609,
1316       609,  610,  610,  610,  610,  610,  610,  610,  610,  610,
1317       610,  610,  610,  610,  610,  610,  610,  611,    0,    0,
1318         0,    0,    0,    0,    0,  611,  611,  611,    0,    0,
1319
1320       611,  611,  611,  612,  612,  612,  612,  612,  612,  612,
1321       612,  612,  612,  612,  612,  612,  612,  612,  612,  613,
1322         0,    0,    0,    0,  613,    0,    0,  613,  613,  613,
1323       613,    0,  613,  613,  613,  614,    0,    0,    0,    0,
1324         0,    0,    0,  614,  614,  614,    0,    0,  614,  614,
1325       614,  615,    0,    0,  615,  615,    0,  615,    0,  615,
1326       615,  615,    0,    0,  615,  615,  615,  616,  616,    0,
1327         0,    0,  616,  617,    0,    0,  617,  617,    0,  617,
1328         0,  617,  617,  617,    0,    0,  617,  617,  617,  618,
1329         0,    0,  618,  618,    0,  618,    0,  618,  618,  618,
1330
1331         0,  618,    0,  618,  618,  620,    0,    0,  620,    0,
1332         0,  620,    0,  620,  620,  620,  620,    0,  620,  620,
1333       620,  621,  621,  621,  621,  621,  621,  621,  621,  621,
1334       621,  621,  621,  621,  621,  621,  621,  622,  622,    0,
1335       622,    0,  622,  622,  622,  622,  622,  622,  622,  622,
1336       622,  622,  622,  623,  623,  623,  623,  623,  623,  623,
1337       623,  623,  623,  623,  623,  623,  623,  623,  623,  624,
1338       624,    0,  624,  624,  624,  624,  624,  624,  624,  624,
1339       624,  624,  624,  624,  624,  625,    0,    0,    0,    0,
1340       625,    0,    0,  625,  625,  625,    0,    0,  625,  625,
1341
1342       625,  626,    0,    0,  626,  626,    0,  626,    0,  626,
1343       626,  626,    0,    0,  626,  626,  626,  627,  627,    0,
1344         0,    0,  627,  628,  628,  628,    0,    0,    0,  628,
1345       629,    0,    0,  629,  629,    0,  629,    0,  629,  629,
1346       629,    0,    0,  629,  629,  629,  630,  630,  630,  630,
1347       630,  630,  630,  630,  630,  630,  630,  630,  630,  630,
1348       630,  630,  631,  631,    0,    0,    0,  631,  632,  632,
1349       632,    0,    0,    0,  632,  633,  633,    0,    0,    0,
1350       633,  634,  634,    0,    0,    0,  634,  635,  635,    0,
1351         0,    0,  635,  636,  636,  636,    0,    0,    0,  636,
1352
1353       637,  637,    0,    0,    0,  637,  638,  638,    0,    0,
1354         0,  638,  639,  639,    0,    0,    0,  639,  640,  640,
1355       640,    0,    0,    0,  640,  641,  641,  641,  641,    0,
1356         0,    0,  641,  642,  642,    0,    0,    0,  642,  643,
1357       643,    0,    0,    0,  643,  644,  644,    0,    0,    0,
1358       644,  645,  645,  645,    0,    0,    0,  645,  646,  646,
1359       646,  646,    0,    0,    0,  646,  647,  647,    0,    0,
1360         0,  647,  648,  648,    0,    0,    0,  648,  649,  649,
1361       649,    0,    0,    0,  649,  650,  650,  650,  650,    0,
1362         0,    0,  650,  651,  651,    0,    0,    0,  651,  652,
1363
1364         0,  652,  652,    0,    0,    0,  652,  653,  653,  653,
1365         0,    0,    0,  653,  654,  654,  654,  654,    0,    0,
1366         0,  654,  655,  655,    0,    0,    0,  655,  656,    0,
1367       656,  656,    0,    0,    0,  656,  657,  657,  657,    0,
1368         0,    0,  657,  658,  658,  658,    0,    0,    0,    0,
1369       658,  659,  659,  659,  659,  659,  659,  659,  659,  659,
1370       659,  659,  659,  659,  659,  659,  659,  660,  660,    0,
1371       660,  660,  660,    0,    0,  660,  660,  660,    0,    0,
1372       660,  660,  660,  661,  661,    0,  661,  661,  661,    0,
1373         0,  661,  661,  661,    0,    0,  661,  661,  661,  662,
1374
1375       662,    0,    0,    0,  662,  663,    0,  663,  663,    0,
1376         0,    0,  663,  664,  664,    0,    0,    0,    0,  664,
1377       665,  665,    0,    0,    0,  665,  666,    0,  666,  666,
1378         0,    0,    0,  666,  667,  667,    0,    0,    0,  667,
1379       668,    0,  668,    0,    0,    0,    0,  668,  669,  669,
1380       669,  669,  669,  669,  669,  669,  669,  669,  669,  669,
1381       669,  669,  669,  669,  606,  606,  606,  606,  606,  606,
1382       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1383       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1384       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1385
1386       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1387       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1388       606,  606,  606,  606,  606,  606,  606,  606,  606,  606,
1389       606
1390     } ;
1391
1392 static yy_state_type yy_last_accepting_state;
1393 static char *yy_last_accepting_cpos;
1394
1395 /* The intent behind this definition is that it'll catch
1396  * any uses of REJECT which flex missed.
1397  */
1398 #define REJECT reject_used_but_not_detected
1399 #define yymore() yymore_used_but_not_detected
1400 #define YY_MORE_ADJ 0
1401 #define YY_RESTORE_YY_MORE_OFFSET
1402 char *yytext;
1403 #line 1 "toke.l"
1404 #define INITIAL 0
1405 #line 2 "toke.l"
1406 /*
1407  * Copyright (c) 1996, 1998-2005, 2007-2012
1408  *      Todd C. Miller <Todd.Miller@courtesan.com>
1409  *
1410  * Permission to use, copy, modify, and distribute this software for any
1411  * purpose with or without fee is hereby granted, provided that the above
1412  * copyright notice and this permission notice appear in all copies.
1413  *
1414  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1415  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1416  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1417  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1418  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1419  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1420  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1421  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
1422  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
1423  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1424  *
1425  * Sponsored in part by the Defense Advanced Research Projects
1426  * Agency (DARPA) and Air Force Research Laboratory, Air Force
1427  * Materiel Command, USAF, under agreement number F39502-99-1-0512.
1428  */
1429
1430 #include <config.h>
1431
1432 #include <sys/types.h>
1433 #include <sys/param.h>
1434 #include <sys/stat.h>
1435 #include <stdio.h>
1436 #ifdef STDC_HEADERS
1437 # include <stdlib.h>
1438 # include <stddef.h>
1439 #else
1440 # ifdef HAVE_STDLIB_H
1441 #  include <stdlib.h>
1442 # endif
1443 #endif /* STDC_HEADERS */
1444 #ifdef HAVE_STRING_H
1445 # include <string.h>
1446 #endif /* HAVE_STRING_H */
1447 #ifdef HAVE_STRINGS_H
1448 # include <strings.h>
1449 #endif /* HAVE_STRINGS_H */
1450 #ifdef HAVE_UNISTD_H
1451 # include <unistd.h>
1452 #endif /* HAVE_UNISTD_H */
1453 #if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
1454 # include <malloc.h>
1455 #endif /* HAVE_MALLOC_H && !STDC_HEADERS */
1456 #ifdef HAVE_DIRENT_H
1457 # include <dirent.h>
1458 # define NAMLEN(dirent) strlen((dirent)->d_name)
1459 #else
1460 # define dirent direct
1461 # define NAMLEN(dirent) (dirent)->d_namlen
1462 # ifdef HAVE_SYS_NDIR_H
1463 #  include <sys/ndir.h>
1464 # endif
1465 # ifdef HAVE_SYS_DIR_H
1466 #  include <sys/dir.h>
1467 # endif
1468 # ifdef HAVE_NDIR_H
1469 #  include <ndir.h>
1470 # endif
1471 #endif
1472 #include <errno.h>
1473 #include <ctype.h>
1474 #include "sudoers.h"
1475 #include "parse.h"
1476 #include "toke.h"
1477 #include <gram.h>
1478 #include "lbuf.h"
1479 #include "secure_path.h"
1480
1481 extern YYSTYPE yylval;
1482 extern bool parse_error;
1483 extern bool sudoers_warnings;
1484 int sudolineno;
1485 int last_token;
1486 char *sudoers;
1487
1488 /* Default sudoers path, mode and owner (may be set via sudo.conf) */
1489 const char *sudoers_file = _PATH_SUDOERS;
1490 mode_t sudoers_mode = SUDOERS_MODE;
1491 uid_t sudoers_uid = SUDOERS_UID;
1492 gid_t sudoers_gid = SUDOERS_GID;
1493
1494 static bool continued, sawspace;
1495 static int prev_state;
1496
1497 static bool _push_include(char *, bool);
1498 static bool pop_include(void);
1499 static char *parse_include(char *);
1500
1501 static int sudoers_trace_print(const char *msg);
1502 int (*trace_print)(const char *msg) = sudoers_trace_print;
1503
1504 #define LEXRETURN(n)    do {    \
1505         last_token = (n);       \
1506         return (n);             \
1507 } while (0)
1508
1509 #define ECHO    ignore_result(fwrite(yytext, yyleng, 1, yyout))
1510
1511 #define push_include(_p)        (_push_include((_p), false))
1512 #define push_includedir(_p)     (_push_include((_p), true))
1513 #define YY_NO_INPUT 1
1514 #define YY_NO_UNPUT 1
1515 #define GOTDEFS 1
1516
1517 #define GOTCMND 2
1518
1519 #define STARTDEFS 3
1520
1521 #define INDEFS 4
1522
1523 #define INSTR 5
1524
1525 #line 1525 "lex.yy.c"
1526
1527 /* Macros after this point can all be overridden by user definitions in
1528  * section 1.
1529  */
1530
1531 #ifndef YY_SKIP_YYWRAP
1532 #ifdef __cplusplus
1533 extern "C" int yywrap YY_PROTO(( void ));
1534 #else
1535 extern int yywrap YY_PROTO(( void ));
1536 #endif
1537 #endif
1538
1539 #ifndef YY_NO_UNPUT
1540 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1541 #endif
1542
1543 #ifndef yytext_ptr
1544 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1545 #endif
1546
1547 #ifdef YY_NEED_STRLEN
1548 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1549 #endif
1550
1551 #ifndef YY_NO_INPUT
1552 #ifdef __cplusplus
1553 static int yyinput YY_PROTO(( void ));
1554 #else
1555 static int input YY_PROTO(( void ));
1556 #endif
1557 #endif
1558
1559 #if defined(YY_STACK_USED) && YY_STACK_USED
1560 static int yy_start_stack_ptr = 0;
1561 static int yy_start_stack_depth = 0;
1562 static int *yy_start_stack = 0;
1563 #ifndef YY_NO_PUSH_STATE
1564 static void yy_push_state YY_PROTO(( int new_state ));
1565 #endif
1566 #ifndef YY_NO_POP_STATE
1567 static void yy_pop_state YY_PROTO(( void ));
1568 #endif
1569 #ifndef YY_NO_TOP_STATE
1570 static int yy_top_state YY_PROTO(( void ));
1571 #endif
1572
1573 #else
1574 #define YY_NO_PUSH_STATE 1
1575 #define YY_NO_POP_STATE 1
1576 #define YY_NO_TOP_STATE 1
1577 #endif
1578
1579 #ifdef YY_MALLOC_DECL
1580 YY_MALLOC_DECL
1581 #else
1582 #ifdef __STDC__
1583 #ifndef __cplusplus
1584 #include <stdlib.h>
1585 #endif
1586 #else
1587 /* Just try to get by without declaring the routines.  This will fail
1588  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1589  * or sizeof(void*) != sizeof(int).
1590  */
1591 #endif
1592 #endif
1593
1594 /* Amount of stuff to slurp up with each read. */
1595 #ifndef YY_READ_BUF_SIZE
1596 #define YY_READ_BUF_SIZE 8192
1597 #endif
1598
1599 /* Copy whatever the last rule matched to the standard output. */
1600
1601 #ifndef ECHO
1602 /* This used to be an fputs(), but since the string might contain NUL's,
1603  * we now use fwrite().
1604  */
1605 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1606 #endif
1607
1608 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1609  * is returned in "result".
1610  */
1611 #ifndef YY_INPUT
1612 #define YY_INPUT(buf,result,max_size) \
1613         if ( yy_current_buffer->yy_is_interactive ) \
1614                 { \
1615                 int c = '*', n; \
1616                 for ( n = 0; n < max_size && \
1617                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1618                         buf[n] = (char) c; \
1619                 if ( c == '\n' ) \
1620                         buf[n++] = (char) c; \
1621                 if ( c == EOF && ferror( yyin ) ) \
1622                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1623                 result = n; \
1624                 } \
1625         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1626                   && ferror( yyin ) ) \
1627                 YY_FATAL_ERROR( "input in flex scanner failed" );
1628 #endif
1629
1630 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1631  * we don't want an extra ';' after the "return" because that will cause
1632  * some compilers to complain about unreachable statements.
1633  */
1634 #ifndef yyterminate
1635 #define yyterminate() return YY_NULL
1636 #endif
1637
1638 /* Number of entries by which start-condition stack grows. */
1639 #ifndef YY_START_STACK_INCR
1640 #define YY_START_STACK_INCR 25
1641 #endif
1642
1643 /* Report a fatal error. */
1644 #ifndef YY_FATAL_ERROR
1645 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1646 #endif
1647
1648 /* Default declaration of generated scanner - a define so the user can
1649  * easily add parameters.
1650  */
1651 #ifndef YY_DECL
1652 #define YY_DECL int yylex YY_PROTO(( void ))
1653 #endif
1654
1655 /* Code executed at the beginning of each rule, after yytext and yyleng
1656  * have been set up.
1657  */
1658 #ifndef YY_USER_ACTION
1659 #define YY_USER_ACTION
1660 #endif
1661
1662 /* Code executed at the end of each rule. */
1663 #ifndef YY_BREAK
1664 #define YY_BREAK break;
1665 #endif
1666
1667 #define YY_RULE_SETUP \
1668         if ( yyleng > 0 ) \
1669                 yy_current_buffer->yy_at_bol = \
1670                                 (yytext[yyleng - 1] == '\n'); \
1671         YY_USER_ACTION
1672
1673 YY_DECL
1674         {
1675         register yy_state_type yy_current_state;
1676         register char *yy_cp, *yy_bp;
1677         register int yy_act;
1678
1679 #line 133 "toke.l"
1680
1681 #line 1681 "lex.yy.c"
1682
1683         if ( yy_init )
1684                 {
1685                 yy_init = 0;
1686
1687 #ifdef YY_USER_INIT
1688                 YY_USER_INIT;
1689 #endif
1690
1691                 if ( ! yy_start )
1692                         yy_start = 1;   /* first start state */
1693
1694                 if ( ! yyin )
1695                         yyin = stdin;
1696
1697                 if ( ! yyout )
1698                         yyout = stdout;
1699
1700                 if ( ! yy_current_buffer )
1701                         yy_current_buffer =
1702                                 yy_create_buffer( yyin, YY_BUF_SIZE );
1703
1704                 yy_load_buffer_state();
1705                 }
1706
1707         while ( 1 )             /* loops until end-of-file is reached */
1708                 {
1709                 yy_cp = yy_c_buf_p;
1710
1711                 /* Support of yytext. */
1712                 *yy_cp = yy_hold_char;
1713
1714                 /* yy_bp points to the position in yy_ch_buf of the start of
1715                  * the current run.
1716                  */
1717                 yy_bp = yy_cp;
1718
1719                 yy_current_state = yy_start;
1720                 yy_current_state += YY_AT_BOL();
1721 yy_match:
1722                 do
1723                         {
1724                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1725                         if ( yy_accept[yy_current_state] )
1726                                 {
1727                                 yy_last_accepting_state = yy_current_state;
1728                                 yy_last_accepting_cpos = yy_cp;
1729                                 }
1730                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1731                                 {
1732                                 yy_current_state = (int) yy_def[yy_current_state];
1733                                 if ( yy_current_state >= 607 )
1734                                         yy_c = yy_meta[(unsigned int) yy_c];
1735                                 }
1736                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1737                         ++yy_cp;
1738                         }
1739                 while ( yy_base[yy_current_state] != 3665 );
1740
1741 yy_find_action:
1742                 yy_act = yy_accept[yy_current_state];
1743                 if ( yy_act == 0 )
1744                         { /* have to back up */
1745                         yy_cp = yy_last_accepting_cpos;
1746                         yy_current_state = yy_last_accepting_state;
1747                         yy_act = yy_accept[yy_current_state];
1748                         }
1749
1750                 YY_DO_BEFORE_ACTION;
1751
1752
1753 do_action:      /* This label is used only to access EOF actions. */
1754
1755
1756                 switch ( yy_act )
1757         { /* beginning of action switch */
1758                         case 0: /* must back up */
1759                         /* undo the effects of YY_DO_BEFORE_ACTION */
1760                         *yy_cp = yy_hold_char;
1761                         yy_cp = yy_last_accepting_cpos;
1762                         yy_current_state = yy_last_accepting_state;
1763                         goto yy_find_action;
1764
1765 case 1:
1766 YY_RULE_SETUP
1767 #line 134 "toke.l"
1768 {
1769                             LEXTRACE(", ");
1770                             LEXRETURN(',');
1771                         }                       /* return ',' */
1772         YY_BREAK
1773 case 2:
1774 YY_RULE_SETUP
1775 #line 139 "toke.l"
1776 BEGIN STARTDEFS;
1777         YY_BREAK
1778 case 3:
1779 YY_RULE_SETUP
1780 #line 141 "toke.l"
1781 {
1782                             BEGIN INDEFS;
1783                             LEXTRACE("DEFVAR ");
1784                             if (!fill(yytext, yyleng))
1785                                 yyterminate();
1786                             LEXRETURN(DEFVAR);
1787                         }
1788         YY_BREAK
1789
1790 case 4:
1791 YY_RULE_SETUP
1792 #line 150 "toke.l"
1793 {
1794                             BEGIN STARTDEFS;
1795                             LEXTRACE(", ");
1796                             LEXRETURN(',');
1797                         }                       /* return ',' */
1798         YY_BREAK
1799 case 5:
1800 YY_RULE_SETUP
1801 #line 156 "toke.l"
1802 {
1803                             LEXTRACE("= ");
1804                             LEXRETURN('=');
1805                         }                       /* return '=' */
1806         YY_BREAK
1807 case 6:
1808 YY_RULE_SETUP
1809 #line 161 "toke.l"
1810 {
1811                             LEXTRACE("+= ");
1812                             LEXRETURN('+');
1813                         }                       /* return '+' */
1814         YY_BREAK
1815 case 7:
1816 YY_RULE_SETUP
1817 #line 166 "toke.l"
1818 {
1819                             LEXTRACE("-= ");
1820                             LEXRETURN('-');
1821                         }                       /* return '-' */
1822         YY_BREAK
1823 case 8:
1824 YY_RULE_SETUP
1825 #line 171 "toke.l"
1826 {
1827                             LEXTRACE("BEGINSTR ");
1828                             yylval.string = NULL;
1829                             prev_state = YY_START;
1830                             BEGIN INSTR;
1831                         }
1832         YY_BREAK
1833 case 9:
1834 YY_RULE_SETUP
1835 #line 178 "toke.l"
1836 {
1837                             LEXTRACE("WORD(2) ");
1838                             if (!fill(yytext, yyleng))
1839                                 yyterminate();
1840                             LEXRETURN(WORD);
1841                         }
1842         YY_BREAK
1843
1844
1845 case 10:
1846 YY_RULE_SETUP
1847 #line 187 "toke.l"
1848 {
1849                             /* Line continuation char followed by newline. */
1850                             sudolineno++;
1851                             continued = true;
1852                         }
1853         YY_BREAK
1854 case 11:
1855 YY_RULE_SETUP
1856 #line 193 "toke.l"
1857 {
1858                             LEXTRACE("ENDSTR ");
1859                             BEGIN prev_state;
1860
1861                             if (yylval.string == NULL) {
1862                                 LEXTRACE("ERROR "); /* empty string */
1863                                 LEXRETURN(ERROR);
1864                             }
1865                             if (prev_state == INITIAL) {
1866                                 switch (yylval.string[0]) {
1867                                 case '%':
1868                                     if (yylval.string[1] == '\0' ||
1869                                         (yylval.string[1] == ':' &&
1870                                         yylval.string[2] == '\0')) {
1871                                         LEXTRACE("ERROR "); /* empty group */
1872                                         LEXRETURN(ERROR);
1873                                     }
1874                                     LEXTRACE("USERGROUP ");
1875                                     LEXRETURN(USERGROUP);
1876                                 case '+':
1877                                     if (yylval.string[1] == '\0') {
1878                                         LEXTRACE("ERROR "); /* empty netgroup */
1879                                         LEXRETURN(ERROR);
1880                                     }
1881                                     LEXTRACE("NETGROUP ");
1882                                     LEXRETURN(NETGROUP);
1883                                 }
1884                             }
1885                             LEXTRACE("WORD(4) ");
1886                             LEXRETURN(WORD);
1887                         }
1888         YY_BREAK
1889 case 12:
1890 YY_RULE_SETUP
1891 #line 225 "toke.l"
1892 {
1893                             LEXTRACE("BACKSLASH ");
1894                             if (!append(yytext, yyleng))
1895                                 yyterminate();
1896                         }
1897         YY_BREAK
1898 case 13:
1899 YY_RULE_SETUP
1900 #line 231 "toke.l"
1901 {
1902                             LEXTRACE("STRBODY ");
1903                             if (!append(yytext, yyleng))
1904                                 yyterminate();
1905                         }
1906         YY_BREAK
1907
1908
1909 case 14:
1910 YY_RULE_SETUP
1911 #line 239 "toke.l"
1912 {
1913                             /* quoted fnmatch glob char, pass verbatim */
1914                             LEXTRACE("QUOTEDCHAR ");
1915                             if (!fill_args(yytext, 2, sawspace))
1916                                 yyterminate();
1917                             sawspace = false;
1918                         }
1919         YY_BREAK
1920 case 15:
1921 YY_RULE_SETUP
1922 #line 247 "toke.l"
1923 {
1924                             /* quoted sudoers special char, strip backslash */
1925                             LEXTRACE("QUOTEDCHAR ");
1926                             if (!fill_args(yytext + 1, 1, sawspace))
1927                                 yyterminate();
1928                             sawspace = false;
1929                         }
1930         YY_BREAK
1931 case 16:
1932 YY_RULE_SETUP
1933 #line 255 "toke.l"
1934 {
1935                             BEGIN INITIAL;
1936                             yyless(0);
1937                             LEXRETURN(COMMAND);
1938                         }                       /* end of command line args */
1939         YY_BREAK
1940 case 17:
1941 YY_RULE_SETUP
1942 #line 261 "toke.l"
1943 {
1944                             LEXTRACE("ARG ");
1945                             if (!fill_args(yytext, yyleng, sawspace))
1946                                 yyterminate();
1947                             sawspace = false;
1948                         }                       /* a command line arg */
1949         YY_BREAK
1950
1951 case 18:
1952 YY_RULE_SETUP
1953 #line 269 "toke.l"
1954 {
1955                             char *path;
1956
1957                             if (continued) {
1958                                 LEXTRACE("ERROR ");
1959                                 LEXRETURN(ERROR);
1960                             }
1961
1962                             if ((path = parse_include(yytext)) == NULL)
1963                                 yyterminate();
1964
1965                             LEXTRACE("INCLUDE\n");
1966
1967                             /* Push current buffer and switch to include file */
1968                             if (!push_include(path))
1969                                 yyterminate();
1970                         }
1971         YY_BREAK
1972 case 19:
1973 YY_RULE_SETUP
1974 #line 287 "toke.l"
1975 {
1976                             char *path;
1977
1978                             if (continued) {
1979                                 LEXTRACE("ERROR ");
1980                                 LEXRETURN(ERROR);
1981                             }
1982
1983                             if ((path = parse_include(yytext)) == NULL)
1984                                 yyterminate();
1985
1986                             LEXTRACE("INCLUDEDIR\n");
1987
1988                             /*
1989                              * Push current buffer and switch to include file.
1990                              * We simply ignore empty directories.
1991                              */
1992                             if (!push_includedir(path) && parse_error)
1993                                 yyterminate();
1994                         }
1995         YY_BREAK
1996 case 20:
1997 YY_RULE_SETUP
1998 #line 308 "toke.l"
1999 {
2000                             char deftype;
2001                             int n;
2002
2003                             if (continued) {
2004                                 LEXTRACE("ERROR ");
2005                                 LEXRETURN(ERROR);
2006                             }
2007
2008                             for (n = 0; isblank((unsigned char)yytext[n]); n++)
2009                                 continue;
2010                             n += sizeof("Defaults") - 1;
2011                             if ((deftype = yytext[n++]) != '\0') {
2012                                 while (isblank((unsigned char)yytext[n]))
2013                                     n++;
2014                             }
2015                             BEGIN GOTDEFS;
2016                             switch (deftype) {
2017                                 case ':':
2018                                     yyless(n);
2019                                     LEXTRACE("DEFAULTS_USER ");
2020                                     LEXRETURN(DEFAULTS_USER);
2021                                 case '>':
2022                                     yyless(n);
2023                                     LEXTRACE("DEFAULTS_RUNAS ");
2024                                     LEXRETURN(DEFAULTS_RUNAS);
2025                                 case '@':
2026                                     yyless(n);
2027                                     LEXTRACE("DEFAULTS_HOST ");
2028                                     LEXRETURN(DEFAULTS_HOST);
2029                                 case '!':
2030                                     yyless(n);
2031                                     LEXTRACE("DEFAULTS_CMND ");
2032                                     LEXRETURN(DEFAULTS_CMND);
2033                                 default:
2034                                     LEXTRACE("DEFAULTS ");
2035                                     LEXRETURN(DEFAULTS);
2036                             }
2037                         }
2038         YY_BREAK
2039 case 21:
2040 YY_RULE_SETUP
2041 #line 348 "toke.l"
2042 {
2043                             int n;
2044
2045                             if (continued) {
2046                                 LEXTRACE("ERROR ");
2047                                 LEXRETURN(ERROR);
2048                             }
2049
2050                             for (n = 0; isblank((unsigned char)yytext[n]); n++)
2051                                 continue;
2052                             switch (yytext[n]) {
2053                                 case 'H':
2054                                     LEXTRACE("HOSTALIAS ");
2055                                     LEXRETURN(HOSTALIAS);
2056                                 case 'C':
2057                                     LEXTRACE("CMNDALIAS ");
2058                                     LEXRETURN(CMNDALIAS);
2059                                 case 'U':
2060                                     LEXTRACE("USERALIAS ");
2061                                     LEXRETURN(USERALIAS);
2062                                 case 'R':
2063                                     LEXTRACE("RUNASALIAS ");
2064                                     LEXRETURN(RUNASALIAS);
2065                             }
2066                         }
2067         YY_BREAK
2068 case 22:
2069 YY_RULE_SETUP
2070 #line 374 "toke.l"
2071 {
2072                                 /* cmnd does not require passwd for this user */
2073                                 LEXTRACE("NOPASSWD ");
2074                                 LEXRETURN(NOPASSWD);
2075                         }
2076         YY_BREAK
2077 case 23:
2078 YY_RULE_SETUP
2079 #line 380 "toke.l"
2080 {
2081                                 /* cmnd requires passwd for this user */
2082                                 LEXTRACE("PASSWD ");
2083                                 LEXRETURN(PASSWD);
2084                         }
2085         YY_BREAK
2086 case 24:
2087 YY_RULE_SETUP
2088 #line 386 "toke.l"
2089 {
2090                                 LEXTRACE("NOEXEC ");
2091                                 LEXRETURN(NOEXEC);
2092                         }
2093         YY_BREAK
2094 case 25:
2095 YY_RULE_SETUP
2096 #line 391 "toke.l"
2097 {
2098                                 LEXTRACE("EXEC ");
2099                                 LEXRETURN(EXEC);
2100                         }
2101         YY_BREAK
2102 case 26:
2103 YY_RULE_SETUP
2104 #line 396 "toke.l"
2105 {
2106                                 LEXTRACE("SETENV ");
2107                                 LEXRETURN(SETENV);
2108                         }
2109         YY_BREAK
2110 case 27:
2111 YY_RULE_SETUP
2112 #line 401 "toke.l"
2113 {
2114                                 LEXTRACE("NOSETENV ");
2115                                 LEXRETURN(NOSETENV);
2116                         }
2117         YY_BREAK
2118 case 28:
2119 YY_RULE_SETUP
2120 #line 406 "toke.l"
2121 {
2122                                 LEXTRACE("LOG_OUTPUT ");
2123                                 LEXRETURN(LOG_OUTPUT);
2124                         }
2125         YY_BREAK
2126 case 29:
2127 YY_RULE_SETUP
2128 #line 411 "toke.l"
2129 {
2130                                 LEXTRACE("NOLOG_OUTPUT ");
2131                                 LEXRETURN(NOLOG_OUTPUT);
2132                         }
2133         YY_BREAK
2134 case 30:
2135 YY_RULE_SETUP
2136 #line 416 "toke.l"
2137 {
2138                                 LEXTRACE("LOG_INPUT ");
2139                                 LEXRETURN(LOG_INPUT);
2140                         }
2141         YY_BREAK
2142 case 31:
2143 YY_RULE_SETUP
2144 #line 421 "toke.l"
2145 {
2146                                 LEXTRACE("NOLOG_INPUT ");
2147                                 LEXRETURN(NOLOG_INPUT);
2148                         }
2149         YY_BREAK
2150 case 32:
2151 YY_RULE_SETUP
2152 #line 426 "toke.l"
2153 {
2154                             /* empty group or netgroup */
2155                             LEXTRACE("ERROR ");
2156                             LEXRETURN(ERROR);
2157                         }
2158         YY_BREAK
2159 case 33:
2160 YY_RULE_SETUP
2161 #line 432 "toke.l"
2162 {
2163                             /* netgroup */
2164                             if (!fill(yytext, yyleng))
2165                                 yyterminate();
2166                             LEXTRACE("NETGROUP ");
2167                             LEXRETURN(NETGROUP);
2168                         }
2169         YY_BREAK
2170 case 34:
2171 YY_RULE_SETUP
2172 #line 440 "toke.l"
2173 {
2174                             /* group */
2175                             if (!fill(yytext, yyleng))
2176                                 yyterminate();
2177                             LEXTRACE("USERGROUP ");
2178                             LEXRETURN(USERGROUP);
2179                         }
2180         YY_BREAK
2181 case 35:
2182 YY_RULE_SETUP
2183 #line 448 "toke.l"
2184 {
2185                             if (!fill(yytext, yyleng))
2186                                 yyterminate();
2187                             LEXTRACE("NTWKADDR ");
2188                             LEXRETURN(NTWKADDR);
2189                         }
2190         YY_BREAK
2191 case 36:
2192 YY_RULE_SETUP
2193 #line 455 "toke.l"
2194 {
2195                             if (!fill(yytext, yyleng))
2196                                 yyterminate();
2197                             LEXTRACE("NTWKADDR ");
2198                             LEXRETURN(NTWKADDR);
2199                         }
2200         YY_BREAK
2201 case 37:
2202 YY_RULE_SETUP
2203 #line 462 "toke.l"
2204 {
2205                             if (!ipv6_valid(yytext)) {
2206                                 LEXTRACE("ERROR ");
2207                                 LEXRETURN(ERROR);
2208                             }
2209                             if (!fill(yytext, yyleng))
2210                                 yyterminate();
2211                             LEXTRACE("NTWKADDR ");
2212                             LEXRETURN(NTWKADDR);
2213                         }
2214         YY_BREAK
2215 case 38:
2216 YY_RULE_SETUP
2217 #line 473 "toke.l"
2218 {
2219                             if (!ipv6_valid(yytext)) {
2220                                 LEXTRACE("ERROR ");
2221                                 LEXRETURN(ERROR);
2222                             }
2223                             if (!fill(yytext, yyleng))
2224                                 yyterminate();
2225                             LEXTRACE("NTWKADDR ");
2226                             LEXRETURN(NTWKADDR);
2227                         }
2228         YY_BREAK
2229 case 39:
2230 YY_RULE_SETUP
2231 #line 484 "toke.l"
2232 {
2233                             LEXTRACE("ALL ");
2234                             LEXRETURN(ALL);
2235
2236                         }
2237         YY_BREAK
2238 case 40:
2239 YY_RULE_SETUP
2240 #line 490 "toke.l"
2241 {
2242 #ifdef HAVE_SELINUX
2243                             LEXTRACE("ROLE ");
2244                             LEXRETURN(ROLE);
2245 #else
2246                             goto got_alias;
2247 #endif
2248                         }
2249         YY_BREAK
2250 case 41:
2251 YY_RULE_SETUP
2252 #line 499 "toke.l"
2253 {
2254 #ifdef HAVE_SELINUX
2255                             LEXTRACE("TYPE ");
2256                             LEXRETURN(TYPE);
2257 #else
2258                             goto got_alias;
2259 #endif
2260                         }
2261         YY_BREAK
2262 case 42:
2263 YY_RULE_SETUP
2264 #line 508 "toke.l"
2265 {
2266 #ifndef HAVE_SELINUX
2267                         got_alias:
2268 #endif
2269                             if (!fill(yytext, yyleng))
2270                                 yyterminate();
2271                             LEXTRACE("ALIAS ");
2272                             LEXRETURN(ALIAS);
2273                         }
2274         YY_BREAK
2275 case 43:
2276 YY_RULE_SETUP
2277 #line 518 "toke.l"
2278 {
2279                             /* no command args allowed for Defaults!/path */
2280                             if (!fill_cmnd(yytext, yyleng))
2281                                 yyterminate();
2282                             LEXTRACE("COMMAND ");
2283                             LEXRETURN(COMMAND);
2284                         }
2285         YY_BREAK
2286 case 44:
2287 YY_RULE_SETUP
2288 #line 526 "toke.l"
2289 {
2290                             BEGIN GOTCMND;
2291                             LEXTRACE("COMMAND ");
2292                             if (!fill_cmnd(yytext, yyleng))
2293                                 yyterminate();
2294                         }                       /* sudo -e */
2295         YY_BREAK
2296 case 45:
2297 YY_RULE_SETUP
2298 #line 533 "toke.l"
2299 {
2300                             /* directories can't have args... */
2301                             if (yytext[yyleng - 1] == '/') {
2302                                 LEXTRACE("COMMAND ");
2303                                 if (!fill_cmnd(yytext, yyleng))
2304                                     yyterminate();
2305                                 LEXRETURN(COMMAND);
2306                             } else {
2307                                 BEGIN GOTCMND;
2308                                 LEXTRACE("COMMAND ");
2309                                 if (!fill_cmnd(yytext, yyleng))
2310                                     yyterminate();
2311                             }
2312                         }                       /* a pathname */
2313         YY_BREAK
2314 case 46:
2315 YY_RULE_SETUP
2316 #line 548 "toke.l"
2317 {
2318                             LEXTRACE("BEGINSTR ");
2319                             yylval.string = NULL;
2320                             prev_state = YY_START;
2321                             BEGIN INSTR;
2322                         }
2323         YY_BREAK
2324 case 47:
2325 YY_RULE_SETUP
2326 #line 555 "toke.l"
2327 {
2328                             /* a word */
2329                             if (!fill(yytext, yyleng))
2330                                 yyterminate();
2331                             LEXTRACE("WORD(5) ");
2332                             LEXRETURN(WORD);
2333                         }
2334         YY_BREAK
2335 case 48:
2336 YY_RULE_SETUP
2337 #line 563 "toke.l"
2338 {
2339                             LEXTRACE("( ");
2340                             LEXRETURN('(');
2341                         }
2342         YY_BREAK
2343 case 49:
2344 YY_RULE_SETUP
2345 #line 568 "toke.l"
2346 {
2347                             LEXTRACE(") ");
2348                             LEXRETURN(')');
2349                         }
2350         YY_BREAK
2351 case 50:
2352 YY_RULE_SETUP
2353 #line 573 "toke.l"
2354 {
2355                             LEXTRACE(", ");
2356                             LEXRETURN(',');
2357                         }                       /* return ',' */
2358         YY_BREAK
2359 case 51:
2360 YY_RULE_SETUP
2361 #line 578 "toke.l"
2362 {
2363                             LEXTRACE("= ");
2364                             LEXRETURN('=');
2365                         }                       /* return '=' */
2366         YY_BREAK
2367 case 52:
2368 YY_RULE_SETUP
2369 #line 583 "toke.l"
2370 {
2371                             LEXTRACE(": ");
2372                             LEXRETURN(':');
2373                         }                       /* return ':' */
2374         YY_BREAK
2375 case 53:
2376 YY_RULE_SETUP
2377 #line 588 "toke.l"
2378 {
2379                             if (yyleng & 1) {
2380                                 LEXTRACE("!");
2381                                 LEXRETURN('!'); /* return '!' */
2382                             }
2383                         }
2384         YY_BREAK
2385 case 54:
2386 YY_RULE_SETUP
2387 #line 595 "toke.l"
2388 {
2389                             if (YY_START == INSTR) {
2390                                 LEXTRACE("ERROR ");
2391                                 LEXRETURN(ERROR);       /* line break in string */
2392                             }
2393                             BEGIN INITIAL;
2394                             sudolineno++;
2395                             continued = false;
2396                             LEXTRACE("\n");
2397                             LEXRETURN(COMMENT);
2398                         }                       /* return newline */
2399         YY_BREAK
2400 case 55:
2401 YY_RULE_SETUP
2402 #line 607 "toke.l"
2403 {                       /* throw away space/tabs */
2404                             sawspace = true;    /* but remember for fill_args */
2405                         }
2406         YY_BREAK
2407 case 56:
2408 YY_RULE_SETUP
2409 #line 611 "toke.l"
2410 {
2411                             sawspace = true;    /* remember for fill_args */
2412                             sudolineno++;
2413                             continued = true;
2414                         }                       /* throw away EOL after \ */
2415         YY_BREAK
2416 case 57:
2417 YY_RULE_SETUP
2418 #line 617 "toke.l"
2419 {
2420                             BEGIN INITIAL;
2421                             sudolineno++;
2422                             continued = false;
2423                             LEXTRACE("#\n");
2424                             LEXRETURN(COMMENT);
2425                         }                       /* comment, not uid/gid */
2426         YY_BREAK
2427 case 58:
2428 YY_RULE_SETUP
2429 #line 625 "toke.l"
2430 {
2431                             LEXTRACE("ERROR ");
2432                             LEXRETURN(ERROR);
2433                         }       /* parse error */
2434         YY_BREAK
2435 case YY_STATE_EOF(INITIAL):
2436 case YY_STATE_EOF(GOTDEFS):
2437 case YY_STATE_EOF(GOTCMND):
2438 case YY_STATE_EOF(STARTDEFS):
2439 case YY_STATE_EOF(INDEFS):
2440 case YY_STATE_EOF(INSTR):
2441 #line 630 "toke.l"
2442 {
2443                             if (YY_START != INITIAL) {
2444                                 BEGIN INITIAL;
2445                                 LEXTRACE("ERROR ");
2446                                 LEXRETURN(ERROR);
2447                             }
2448                             if (!pop_include())
2449                                 yyterminate();
2450                         }
2451         YY_BREAK
2452 case 59:
2453 YY_RULE_SETUP
2454 #line 640 "toke.l"
2455 ECHO;
2456         YY_BREAK
2457 #line 2457 "lex.yy.c"
2458
2459         case YY_END_OF_BUFFER:
2460                 {
2461                 /* Amount of text matched not including the EOB char. */
2462                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
2463
2464                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2465                 *yy_cp = yy_hold_char;
2466                 YY_RESTORE_YY_MORE_OFFSET
2467
2468                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
2469                         {
2470                         /* We're scanning a new file or input source.  It's
2471                          * possible that this happened because the user
2472                          * just pointed yyin at a new source and called
2473                          * yylex().  If so, then we have to assure
2474                          * consistency between yy_current_buffer and our
2475                          * globals.  Here is the right place to do so, because
2476                          * this is the first action (other than possibly a
2477                          * back-up) that will match for the new input source.
2478                          */
2479                         yy_n_chars = yy_current_buffer->yy_n_chars;
2480                         yy_current_buffer->yy_input_file = yyin;
2481                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
2482                         }
2483
2484                 /* Note that here we test for yy_c_buf_p "<=" to the position
2485                  * of the first EOB in the buffer, since yy_c_buf_p will
2486                  * already have been incremented past the NUL character
2487                  * (since all states make transitions on EOB to the
2488                  * end-of-buffer state).  Contrast this with the test
2489                  * in input().
2490                  */
2491                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2492                         { /* This was really a NUL. */
2493                         yy_state_type yy_next_state;
2494
2495                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
2496
2497                         yy_current_state = yy_get_previous_state();
2498
2499                         /* Okay, we're now positioned to make the NUL
2500                          * transition.  We couldn't have
2501                          * yy_get_previous_state() go ahead and do it
2502                          * for us because it doesn't know how to deal
2503                          * with the possibility of jamming (and we don't
2504                          * want to build jamming into it because then it
2505                          * will run more slowly).
2506                          */
2507
2508                         yy_next_state = yy_try_NUL_trans( yy_current_state );
2509
2510                         yy_bp = yytext_ptr + YY_MORE_ADJ;
2511
2512                         if ( yy_next_state )
2513                                 {
2514                                 /* Consume the NUL. */
2515                                 yy_cp = ++yy_c_buf_p;
2516                                 yy_current_state = yy_next_state;
2517                                 goto yy_match;
2518                                 }
2519
2520                         else
2521                                 {
2522                                 yy_cp = yy_c_buf_p;
2523                                 goto yy_find_action;
2524                                 }
2525                         }
2526
2527                 else switch ( yy_get_next_buffer() )
2528                         {
2529                         case EOB_ACT_END_OF_FILE:
2530                                 {
2531                                 yy_did_buffer_switch_on_eof = 0;
2532
2533                                 if ( yywrap() )
2534                                         {
2535                                         /* Note: because we've taken care in
2536                                          * yy_get_next_buffer() to have set up
2537                                          * yytext, we can now set up
2538                                          * yy_c_buf_p so that if some total
2539                                          * hoser (like flex itself) wants to
2540                                          * call the scanner after we return the
2541                                          * YY_NULL, it'll still work - another
2542                                          * YY_NULL will get returned.
2543                                          */
2544                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
2545
2546                                         yy_act = YY_STATE_EOF(YY_START);
2547                                         goto do_action;
2548                                         }
2549
2550                                 else
2551                                         {
2552                                         if ( ! yy_did_buffer_switch_on_eof )
2553                                                 YY_NEW_FILE;
2554                                         }
2555                                 break;
2556                                 }
2557
2558                         case EOB_ACT_CONTINUE_SCAN:
2559                                 yy_c_buf_p =
2560                                         yytext_ptr + yy_amount_of_matched_text;
2561
2562                                 yy_current_state = yy_get_previous_state();
2563
2564                                 yy_cp = yy_c_buf_p;
2565                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
2566                                 goto yy_match;
2567
2568                         case EOB_ACT_LAST_MATCH:
2569                                 yy_c_buf_p =
2570                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
2571
2572                                 yy_current_state = yy_get_previous_state();
2573
2574                                 yy_cp = yy_c_buf_p;
2575                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
2576                                 goto yy_find_action;
2577                         }
2578                 break;
2579                 }
2580
2581         default:
2582                 YY_FATAL_ERROR(
2583                         "fatal flex scanner internal error--no action found" );
2584         } /* end of action switch */
2585                 } /* end of scanning one token */
2586         } /* end of yylex */
2587
2588
2589 /* yy_get_next_buffer - try to read in a new buffer
2590  *
2591  * Returns a code representing an action:
2592  *      EOB_ACT_LAST_MATCH -
2593  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2594  *      EOB_ACT_END_OF_FILE - end of file
2595  */
2596
2597 static int yy_get_next_buffer()
2598         {
2599         register char *dest = yy_current_buffer->yy_ch_buf;
2600         register char *source = yytext_ptr;
2601         register int number_to_move, i;
2602         int ret_val;
2603
2604         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2605                 YY_FATAL_ERROR(
2606                 "fatal flex scanner internal error--end of buffer missed" );
2607
2608         if ( yy_current_buffer->yy_fill_buffer == 0 )
2609                 { /* Don't try to fill the buffer, so this is an EOF. */
2610                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2611                         {
2612                         /* We matched a single character, the EOB, so
2613                          * treat this as a final EOF.
2614                          */
2615                         return EOB_ACT_END_OF_FILE;
2616                         }
2617
2618                 else
2619                         {
2620                         /* We matched some text prior to the EOB, first
2621                          * process it.
2622                          */
2623                         return EOB_ACT_LAST_MATCH;
2624                         }
2625                 }
2626
2627         /* Try to read more data. */
2628
2629         /* First move last chars to start of buffer. */
2630         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2631
2632         for ( i = 0; i < number_to_move; ++i )
2633                 *(dest++) = *(source++);
2634
2635         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2636                 /* don't do the read, it's not guaranteed to return an EOF,
2637                  * just force an EOF
2638                  */
2639                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2640
2641         else
2642                 {
2643                 int num_to_read =
2644                         yy_current_buffer->yy_buf_size - number_to_move - 1;
2645
2646                 while ( num_to_read <= 0 )
2647                         { /* Not enough room in the buffer - grow it. */
2648 #ifdef YY_USES_REJECT
2649                         YY_FATAL_ERROR(
2650 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2651 #else
2652
2653                         /* just a shorter name for the current buffer */
2654                         YY_BUFFER_STATE b = yy_current_buffer;
2655
2656                         int yy_c_buf_p_offset =
2657                                 (int) (yy_c_buf_p - b->yy_ch_buf);
2658
2659                         if ( b->yy_is_our_buffer )
2660                                 {
2661                                 int new_size = b->yy_buf_size * 2;
2662
2663                                 if ( new_size <= 0 )
2664                                         b->yy_buf_size += b->yy_buf_size / 8;
2665                                 else
2666                                         b->yy_buf_size *= 2;
2667
2668                                 b->yy_ch_buf = (char *)
2669                                         /* Include room in for 2 EOB chars. */
2670                                         yy_flex_realloc( (void *) b->yy_ch_buf,
2671                                                          b->yy_buf_size + 2 );
2672                                 }
2673                         else
2674                                 /* Can't grow it, we don't own it. */
2675                                 b->yy_ch_buf = 0;
2676
2677                         if ( ! b->yy_ch_buf )
2678                                 YY_FATAL_ERROR(
2679                                 "fatal error - scanner input buffer overflow" );
2680
2681                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2682
2683                         num_to_read = yy_current_buffer->yy_buf_size -
2684                                                 number_to_move - 1;
2685 #endif
2686                         }
2687
2688                 if ( num_to_read > YY_READ_BUF_SIZE )
2689                         num_to_read = YY_READ_BUF_SIZE;
2690
2691                 /* Read in more data. */
2692                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2693                         yy_n_chars, num_to_read );
2694
2695                 yy_current_buffer->yy_n_chars = yy_n_chars;
2696                 }
2697
2698         if ( yy_n_chars == 0 )
2699                 {
2700                 if ( number_to_move == YY_MORE_ADJ )
2701                         {
2702                         ret_val = EOB_ACT_END_OF_FILE;
2703                         yyrestart( yyin );
2704                         }
2705
2706                 else
2707                         {
2708                         ret_val = EOB_ACT_LAST_MATCH;
2709                         yy_current_buffer->yy_buffer_status =
2710                                 YY_BUFFER_EOF_PENDING;
2711                         }
2712                 }
2713
2714         else
2715                 ret_val = EOB_ACT_CONTINUE_SCAN;
2716
2717         yy_n_chars += number_to_move;
2718         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2719         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2720
2721         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2722
2723         return ret_val;
2724         }
2725
2726
2727 /* yy_get_previous_state - get the state just before the EOB char was reached */
2728
2729 static yy_state_type yy_get_previous_state()
2730         {
2731         register yy_state_type yy_current_state;
2732         register char *yy_cp;
2733
2734         yy_current_state = yy_start;
2735         yy_current_state += YY_AT_BOL();
2736
2737         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2738                 {
2739                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2740                 if ( yy_accept[yy_current_state] )
2741                         {
2742                         yy_last_accepting_state = yy_current_state;
2743                         yy_last_accepting_cpos = yy_cp;
2744                         }
2745                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2746                         {
2747                         yy_current_state = (int) yy_def[yy_current_state];
2748                         if ( yy_current_state >= 607 )
2749                                 yy_c = yy_meta[(unsigned int) yy_c];
2750                         }
2751                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2752                 }
2753
2754         return yy_current_state;
2755         }
2756
2757
2758 /* yy_try_NUL_trans - try to make a transition on the NUL character
2759  *
2760  * synopsis
2761  *      next_state = yy_try_NUL_trans( current_state );
2762  */
2763
2764 #ifdef YY_USE_PROTOS
2765 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2766 #else
2767 static yy_state_type yy_try_NUL_trans( yy_current_state )
2768 yy_state_type yy_current_state;
2769 #endif
2770         {
2771         register int yy_is_jam;
2772         register char *yy_cp = yy_c_buf_p;
2773
2774         register YY_CHAR yy_c = 1;
2775         if ( yy_accept[yy_current_state] )
2776                 {
2777                 yy_last_accepting_state = yy_current_state;
2778                 yy_last_accepting_cpos = yy_cp;
2779                 }
2780         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2781                 {
2782                 yy_current_state = (int) yy_def[yy_current_state];
2783                 if ( yy_current_state >= 607 )
2784                         yy_c = yy_meta[(unsigned int) yy_c];
2785                 }
2786         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2787         yy_is_jam = (yy_current_state == 606);
2788
2789         return yy_is_jam ? 0 : yy_current_state;
2790         }
2791
2792
2793 #ifndef YY_NO_UNPUT
2794 #ifdef YY_USE_PROTOS
2795 static void yyunput( int c, register char *yy_bp )
2796 #else
2797 static void yyunput( c, yy_bp )
2798 int c;
2799 register char *yy_bp;
2800 #endif
2801         {
2802         register char *yy_cp = yy_c_buf_p;
2803
2804         /* undo effects of setting up yytext */
2805         *yy_cp = yy_hold_char;
2806
2807         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2808                 { /* need to shift things up to make room */
2809                 /* +2 for EOB chars. */
2810                 register int number_to_move = yy_n_chars + 2;
2811                 register char *dest = &yy_current_buffer->yy_ch_buf[
2812                                         yy_current_buffer->yy_buf_size + 2];
2813                 register char *source =
2814                                 &yy_current_buffer->yy_ch_buf[number_to_move];
2815
2816                 while ( source > yy_current_buffer->yy_ch_buf )
2817                         *--dest = *--source;
2818
2819                 yy_cp += (int) (dest - source);
2820                 yy_bp += (int) (dest - source);
2821                 yy_current_buffer->yy_n_chars =
2822                         yy_n_chars = yy_current_buffer->yy_buf_size;
2823
2824                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2825                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2826                 }
2827
2828         *--yy_cp = (char) c;
2829
2830
2831         yytext_ptr = yy_bp;
2832         yy_hold_char = *yy_cp;
2833         yy_c_buf_p = yy_cp;
2834         }
2835 #endif  /* ifndef YY_NO_UNPUT */
2836
2837
2838 #ifndef YY_NO_INPUT
2839 #ifdef __cplusplus
2840 static int yyinput()
2841 #else
2842 static int input()
2843 #endif
2844         {
2845         int c;
2846
2847         *yy_c_buf_p = yy_hold_char;
2848
2849         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2850                 {
2851                 /* yy_c_buf_p now points to the character we want to return.
2852                  * If this occurs *before* the EOB characters, then it's a
2853                  * valid NUL; if not, then we've hit the end of the buffer.
2854                  */
2855                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2856                         /* This was really a NUL. */
2857                         *yy_c_buf_p = '\0';
2858
2859                 else
2860                         { /* need more input */
2861                         int offset = yy_c_buf_p - yytext_ptr;
2862                         ++yy_c_buf_p;
2863
2864                         switch ( yy_get_next_buffer() )
2865                                 {
2866                                 case EOB_ACT_LAST_MATCH:
2867                                         /* This happens because yy_g_n_b()
2868                                          * sees that we've accumulated a
2869                                          * token and flags that we need to
2870                                          * try matching the token before
2871                                          * proceeding.  But for input(),
2872                                          * there's no matching to consider.
2873                                          * So convert the EOB_ACT_LAST_MATCH
2874                                          * to EOB_ACT_END_OF_FILE.
2875                                          */
2876
2877                                         /* Reset buffer status. */
2878                                         yyrestart( yyin );
2879
2880                                         /* fall through */
2881
2882                                 case EOB_ACT_END_OF_FILE:
2883                                         {
2884                                         if ( yywrap() )
2885                                                 return EOF;
2886
2887                                         if ( ! yy_did_buffer_switch_on_eof )
2888                                                 YY_NEW_FILE;
2889 #ifdef __cplusplus
2890                                         return yyinput();
2891 #else
2892                                         return input();
2893 #endif
2894                                         }
2895
2896                                 case EOB_ACT_CONTINUE_SCAN:
2897                                         yy_c_buf_p = yytext_ptr + offset;
2898                                         break;
2899                                 }
2900                         }
2901                 }
2902
2903         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
2904         *yy_c_buf_p = '\0';     /* preserve yytext */
2905         yy_hold_char = *++yy_c_buf_p;
2906
2907         yy_current_buffer->yy_at_bol = (c == '\n');
2908
2909         return c;
2910         }
2911 #endif  /* ifndef YY_NO_INPUT */
2912
2913
2914 #ifdef YY_USE_PROTOS
2915 void yyrestart( FILE *input_file )
2916 #else
2917 void yyrestart( input_file )
2918 FILE *input_file;
2919 #endif
2920         {
2921         if ( ! yy_current_buffer )
2922                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2923
2924         yy_init_buffer( yy_current_buffer, input_file );
2925         yy_load_buffer_state();
2926         }
2927
2928
2929 #ifdef YY_USE_PROTOS
2930 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2931 #else
2932 void yy_switch_to_buffer( new_buffer )
2933 YY_BUFFER_STATE new_buffer;
2934 #endif
2935         {
2936         if ( yy_current_buffer == new_buffer )
2937                 return;
2938
2939         if ( yy_current_buffer )
2940                 {
2941                 /* Flush out information for old buffer. */
2942                 *yy_c_buf_p = yy_hold_char;
2943                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2944                 yy_current_buffer->yy_n_chars = yy_n_chars;
2945                 }
2946
2947         yy_current_buffer = new_buffer;
2948         yy_load_buffer_state();
2949
2950         /* We don't actually know whether we did this switch during
2951          * EOF (yywrap()) processing, but the only time this flag
2952          * is looked at is after yywrap() is called, so it's safe
2953          * to go ahead and always set it.
2954          */
2955         yy_did_buffer_switch_on_eof = 1;
2956         }
2957
2958
2959 #ifdef YY_USE_PROTOS
2960 void yy_load_buffer_state( void )
2961 #else
2962 void yy_load_buffer_state()
2963 #endif
2964         {
2965         yy_n_chars = yy_current_buffer->yy_n_chars;
2966         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2967         yyin = yy_current_buffer->yy_input_file;
2968         yy_hold_char = *yy_c_buf_p;
2969         }
2970
2971
2972 #ifdef YY_USE_PROTOS
2973 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2974 #else
2975 YY_BUFFER_STATE yy_create_buffer( file, size )
2976 FILE *file;
2977 int size;
2978 #endif
2979         {
2980         YY_BUFFER_STATE b;
2981
2982         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2983         if ( ! b )
2984                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2985
2986         b->yy_buf_size = size;
2987
2988         /* yy_ch_buf has to be 2 characters longer than the size given because
2989          * we need to put in 2 end-of-buffer characters.
2990          */
2991         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2992         if ( ! b->yy_ch_buf )
2993                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2994
2995         b->yy_is_our_buffer = 1;
2996
2997         yy_init_buffer( b, file );
2998
2999         return b;
3000         }
3001
3002
3003 #ifdef YY_USE_PROTOS
3004 void yy_delete_buffer( YY_BUFFER_STATE b )
3005 #else
3006 void yy_delete_buffer( b )
3007 YY_BUFFER_STATE b;
3008 #endif
3009         {
3010         if ( ! b )
3011                 return;
3012
3013         if ( b == yy_current_buffer )
3014                 yy_current_buffer = (YY_BUFFER_STATE) 0;
3015
3016         if ( b->yy_is_our_buffer )
3017                 yy_flex_free( (void *) b->yy_ch_buf );
3018
3019         yy_flex_free( (void *) b );
3020         }
3021
3022
3023 #ifndef YY_ALWAYS_INTERACTIVE
3024 #ifndef YY_NEVER_INTERACTIVE
3025 #include <unistd.h>
3026 #endif
3027 #endif
3028
3029 #ifdef YY_USE_PROTOS
3030 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3031 #else
3032 void yy_init_buffer( b, file )
3033 YY_BUFFER_STATE b;
3034 FILE *file;
3035 #endif
3036
3037
3038         {
3039         int oerrno = errno;
3040
3041         yy_flush_buffer( b );
3042
3043         b->yy_input_file = file;
3044         b->yy_fill_buffer = 1;
3045
3046 #if defined(YY_ALWAYS_INTERACTIVE) && YY_ALWAYS_INTERACTIVE
3047         b->yy_is_interactive = 1;
3048 #else
3049 #if defined(YY_NEVER_INTERACTIVE) && YY_NEVER_INTERACTIVE
3050         b->yy_is_interactive = 0;
3051 #else
3052         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3053 #endif
3054 #endif
3055         errno = oerrno;
3056         }
3057
3058
3059 #ifdef YY_USE_PROTOS
3060 void yy_flush_buffer( YY_BUFFER_STATE b )
3061 #else
3062 void yy_flush_buffer( b )
3063 YY_BUFFER_STATE b;
3064 #endif
3065
3066         {
3067         if ( ! b )
3068                 return;
3069
3070         b->yy_n_chars = 0;
3071
3072         /* We always need two end-of-buffer characters.  The first causes
3073          * a transition to the end-of-buffer state.  The second causes
3074          * a jam in that state.
3075          */
3076         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3077         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3078
3079         b->yy_buf_pos = &b->yy_ch_buf[0];
3080
3081         b->yy_at_bol = 1;
3082         b->yy_buffer_status = YY_BUFFER_NEW;
3083
3084         if ( b == yy_current_buffer )
3085                 yy_load_buffer_state();
3086         }
3087
3088
3089 #ifndef YY_NO_SCAN_BUFFER
3090 #ifdef YY_USE_PROTOS
3091 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3092 #else
3093 YY_BUFFER_STATE yy_scan_buffer( base, size )
3094 char *base;
3095 yy_size_t size;
3096 #endif
3097         {
3098         YY_BUFFER_STATE b;
3099
3100         if ( size < 2 ||
3101              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3102              base[size-1] != YY_END_OF_BUFFER_CHAR )
3103                 /* They forgot to leave room for the EOB's. */
3104                 return 0;
3105
3106         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3107         if ( ! b )
3108                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3109
3110         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3111         b->yy_buf_pos = b->yy_ch_buf = base;
3112         b->yy_is_our_buffer = 0;
3113         b->yy_input_file = 0;
3114         b->yy_n_chars = b->yy_buf_size;
3115         b->yy_is_interactive = 0;
3116         b->yy_at_bol = 1;
3117         b->yy_fill_buffer = 0;
3118         b->yy_buffer_status = YY_BUFFER_NEW;
3119
3120         yy_switch_to_buffer( b );
3121
3122         return b;
3123         }
3124 #endif
3125
3126
3127 #ifndef YY_NO_SCAN_STRING
3128 #ifdef YY_USE_PROTOS
3129 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
3130 #else
3131 YY_BUFFER_STATE yy_scan_string( yy_str )
3132 yyconst char *yy_str;
3133 #endif
3134         {
3135         int len;
3136         for ( len = 0; yy_str[len]; ++len )
3137                 ;
3138
3139         return yy_scan_bytes( yy_str, len );
3140         }
3141 #endif
3142
3143
3144 #ifndef YY_NO_SCAN_BYTES
3145 #ifdef YY_USE_PROTOS
3146 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3147 #else
3148 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3149 yyconst char *bytes;
3150 int len;
3151 #endif
3152         {
3153         YY_BUFFER_STATE b;
3154         char *buf;
3155         yy_size_t n;
3156         int i;
3157
3158         /* Get memory for full buffer, including space for trailing EOB's. */
3159         n = len + 2;
3160         buf = (char *) yy_flex_alloc( n );
3161         if ( ! buf )
3162                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3163
3164         for ( i = 0; i < len; ++i )
3165                 buf[i] = bytes[i];
3166
3167         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3168
3169         b = yy_scan_buffer( buf, n );
3170         if ( ! b )
3171                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3172
3173         /* It's okay to grow etc. this buffer, and we should throw it
3174          * away when we're done.
3175          */
3176         b->yy_is_our_buffer = 1;
3177
3178         return b;
3179         }
3180 #endif
3181
3182
3183 #ifndef YY_NO_PUSH_STATE
3184 #ifdef YY_USE_PROTOS
3185 static void yy_push_state( int new_state )
3186 #else
3187 static void yy_push_state( new_state )
3188 int new_state;
3189 #endif
3190         {
3191         if ( yy_start_stack_ptr >= yy_start_stack_depth )
3192                 {
3193                 yy_size_t new_size;
3194
3195                 yy_start_stack_depth += YY_START_STACK_INCR;
3196                 new_size = yy_start_stack_depth * sizeof( int );
3197
3198                 if ( ! yy_start_stack )
3199                         yy_start_stack = (int *) yy_flex_alloc( new_size );
3200
3201                 else
3202                         yy_start_stack = (int *) yy_flex_realloc(
3203                                         (void *) yy_start_stack, new_size );
3204
3205                 if ( ! yy_start_stack )
3206                         YY_FATAL_ERROR(
3207                         "out of memory expanding start-condition stack" );
3208                 }
3209
3210         yy_start_stack[yy_start_stack_ptr++] = YY_START;
3211
3212         BEGIN(new_state);
3213         }
3214 #endif
3215
3216
3217 #ifndef YY_NO_POP_STATE
3218 static void yy_pop_state()
3219         {
3220         if ( --yy_start_stack_ptr < 0 )
3221                 YY_FATAL_ERROR( "start-condition stack underflow" );
3222
3223         BEGIN(yy_start_stack[yy_start_stack_ptr]);
3224         }
3225 #endif
3226
3227
3228 #ifndef YY_NO_TOP_STATE
3229 static int yy_top_state()
3230         {
3231         return yy_start_stack[yy_start_stack_ptr - 1];
3232         }
3233 #endif
3234
3235 #ifndef YY_EXIT_FAILURE
3236 #define YY_EXIT_FAILURE 2
3237 #endif
3238
3239 #ifdef YY_USE_PROTOS
3240 static void yy_fatal_error( yyconst char msg[] )
3241 #else
3242 static void yy_fatal_error( msg )
3243 char msg[];
3244 #endif
3245         {
3246         (void) fprintf( stderr, "%s\n", msg );
3247         exit( YY_EXIT_FAILURE );
3248         }
3249
3250
3251
3252 /* Redefine yyless() so it works in section 3 code. */
3253
3254 #undef yyless
3255 #define yyless(n) \
3256         do \
3257                 { \
3258                 /* Undo effects of setting up yytext. */ \
3259                 yytext[yyleng] = yy_hold_char; \
3260                 yy_c_buf_p = yytext + n; \
3261                 yy_hold_char = *yy_c_buf_p; \
3262                 *yy_c_buf_p = '\0'; \
3263                 yyleng = n; \
3264                 } \
3265         while ( 0 )
3266
3267
3268 /* Internal utility routines. */
3269
3270 #ifndef yytext_ptr
3271 #ifdef YY_USE_PROTOS
3272 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3273 #else
3274 static void yy_flex_strncpy( s1, s2, n )
3275 char *s1;
3276 yyconst char *s2;
3277 int n;
3278 #endif
3279         {
3280         register int i;
3281         for ( i = 0; i < n; ++i )
3282                 s1[i] = s2[i];
3283         }
3284 #endif
3285
3286 #ifdef YY_NEED_STRLEN
3287 #ifdef YY_USE_PROTOS
3288 static int yy_flex_strlen( yyconst char *s )
3289 #else
3290 static int yy_flex_strlen( s )
3291 yyconst char *s;
3292 #endif
3293         {
3294         register int n;
3295         for ( n = 0; s[n]; ++n )
3296                 ;
3297
3298         return n;
3299         }
3300 #endif
3301
3302
3303 #ifdef YY_USE_PROTOS
3304 static void *yy_flex_alloc( yy_size_t size )
3305 #else
3306 static void *yy_flex_alloc( size )
3307 yy_size_t size;
3308 #endif
3309         {
3310         return (void *) malloc( size );
3311         }
3312
3313 #ifdef YY_USE_PROTOS
3314 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3315 #else
3316 static void *yy_flex_realloc( ptr, size )
3317 void *ptr;
3318 yy_size_t size;
3319 #endif
3320         {
3321         /* The cast to (char *) in the following accommodates both
3322          * implementations that use char* generic pointers, and those
3323          * that use void* generic pointers.  It works with the latter
3324          * because both ANSI C and C++ allow castless assignment from
3325          * any pointer type to void*, and deal with argument conversions
3326          * as though doing an assignment.
3327          */
3328         return (void *) realloc( (char *) ptr, size );
3329         }
3330
3331 #ifdef YY_USE_PROTOS
3332 static void yy_flex_free( void *ptr )
3333 #else
3334 static void yy_flex_free( ptr )
3335 void *ptr;
3336 #endif
3337         {
3338         free( ptr );
3339         }
3340
3341 #if defined(YY_MAIN) && YY_MAIN
3342 int main()
3343         {
3344         yylex();
3345         return 0;
3346         }
3347 #endif
3348 #line 640 "toke.l"
3349
3350 struct path_list {
3351     char *path;
3352     struct path_list *next;
3353 };
3354
3355 struct include_stack {
3356     YY_BUFFER_STATE bs;
3357     char *path;
3358     struct path_list *more; /* more files in case of includedir */
3359     int lineno;
3360     bool keepopen;
3361 };
3362
3363 static int
3364 pl_compare(const void *v1, const void *v2)
3365 {
3366     const struct path_list * const *p1 = v1;
3367     const struct path_list * const *p2 = v2;
3368
3369     return strcmp((*p1)->path, (*p2)->path);
3370 }
3371
3372 static char *
3373 switch_dir(struct include_stack *stack, char *dirpath)
3374 {
3375     DIR *dir;
3376     int i, count = 0;
3377     char *path = NULL;
3378     struct dirent *dent;
3379     struct stat sb;
3380     struct path_list *pl, *first = NULL;
3381     struct path_list **sorted = NULL;
3382     debug_decl(switch_dir, SUDO_DEBUG_PARSER)
3383
3384     if (!(dir = opendir(dirpath))) {
3385         if (errno != ENOENT) {
3386             char *errbuf;
3387             if (asprintf(&errbuf, _("%s: %s"), dirpath, strerror(errno)) != -1) {
3388                 yyerror(errbuf);
3389                 free(errbuf);
3390             } else {
3391                 yyerror(_("unable to allocate memory"));
3392             }
3393         }
3394         goto done;
3395     }
3396     while ((dent = readdir(dir))) {
3397         /* Ignore files that end in '~' or have a '.' in them. */
3398         if (dent->d_name[0] == '\0' || dent->d_name[NAMLEN(dent) - 1] == '~'
3399             || strchr(dent->d_name, '.') != NULL) {
3400             continue;
3401         }
3402         if (asprintf(&path, "%s/%s", dirpath, dent->d_name) == -1) {
3403             closedir(dir);
3404             goto bad;
3405         }
3406         if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) {
3407             efree(path);
3408             path = NULL;
3409             continue;
3410         }
3411         pl = malloc(sizeof(*pl));
3412         if (pl == NULL)
3413             goto bad;
3414         pl->path = path;
3415         pl->next = first;
3416         first = pl;
3417         count++;
3418     }
3419     closedir(dir);
3420
3421     if (count == 0)
3422         goto done;
3423
3424     /* Sort the list as an array. */
3425     sorted = malloc(sizeof(*sorted) * count);
3426     if (sorted == NULL)
3427         goto bad;
3428     pl = first;
3429     for (i = 0; i < count; i++) {
3430         sorted[i] = pl;
3431         pl = pl->next;
3432     }
3433     qsort(sorted, count, sizeof(*sorted), pl_compare);
3434
3435     /* Apply sorting to the list. */
3436     first = sorted[0];
3437     sorted[count - 1]->next = NULL;
3438     for (i = 1; i < count; i++)
3439         sorted[i - 1]->next = sorted[i];
3440     efree(sorted);
3441
3442     /* Pull out the first element for parsing, leave the rest for later. */
3443     if (count) {
3444         path = first->path;
3445         pl = first->next;
3446         efree(first);
3447         stack->more = pl;
3448     } else {
3449         path = NULL;
3450     }
3451 done:
3452     efree(dirpath);
3453     debug_return_str(path);
3454 bad:
3455     while (first != NULL) {
3456         pl = first;
3457         first = pl->next;
3458         free(pl->path);
3459         free(pl);
3460     }
3461     efree(sorted);
3462     efree(dirpath);
3463     efree(path);
3464     debug_return_str(NULL);
3465 }
3466
3467 #define MAX_SUDOERS_DEPTH       128
3468 #define SUDOERS_STACK_INCREMENT 16
3469
3470 static size_t istacksize, idepth;
3471 static struct include_stack *istack;
3472 static bool keepopen;
3473
3474 void
3475 init_lexer(void)
3476 {
3477     struct path_list *pl;
3478     debug_decl(init_lexer, SUDO_DEBUG_PARSER)
3479
3480     while (idepth) {
3481         idepth--;
3482         while ((pl = istack[idepth].more) != NULL) {
3483             istack[idepth].more = pl->next;
3484             efree(pl->path);
3485             efree(pl);
3486         }
3487         efree(istack[idepth].path);
3488         if (idepth && !istack[idepth].keepopen)
3489             fclose(istack[idepth].bs->yy_input_file);
3490         yy_delete_buffer(istack[idepth].bs);
3491     }
3492     efree(istack);
3493     istack = NULL;
3494     istacksize = idepth = 0;
3495     sudolineno = 1;
3496     keepopen = false;
3497     sawspace = false;
3498     continued = false;
3499     prev_state = INITIAL;
3500
3501     debug_return;
3502 }
3503
3504 static bool
3505 _push_include(char *path, bool isdir)
3506 {
3507     struct path_list *pl;
3508     FILE *fp;
3509     debug_decl(_push_include, SUDO_DEBUG_PARSER)
3510
3511     /* push current state onto stack */
3512     if (idepth >= istacksize) {
3513         if (idepth > MAX_SUDOERS_DEPTH) {
3514             yyerror(_("too many levels of includes"));
3515             debug_return_bool(false);
3516         }
3517         istacksize += SUDOERS_STACK_INCREMENT;
3518         istack = (struct include_stack *) realloc(istack,
3519             sizeof(*istack) * istacksize);
3520         if (istack == NULL) {
3521             yyerror(_("unable to allocate memory"));
3522             debug_return_bool(false);
3523         }
3524     }
3525     if (isdir) {
3526         struct stat sb;
3527         switch (sudo_secure_dir(path, sudoers_uid, sudoers_gid, &sb)) {
3528             case SUDO_PATH_SECURE:
3529                 break;
3530             case SUDO_PATH_MISSING:
3531                 debug_return_bool(false);
3532             case SUDO_PATH_BAD_TYPE:
3533                 errno = ENOTDIR;
3534                 if (sudoers_warnings) {
3535                     warning("%s", path);
3536                 }
3537                 debug_return_bool(false);
3538             case SUDO_PATH_WRONG_OWNER:
3539                 if (sudoers_warnings) {
3540                     warningx(_("%s is owned by uid %u, should be %u"),   
3541                         path, (unsigned int) sb.st_uid,
3542                         (unsigned int) sudoers_uid);
3543                 }
3544                 debug_return_bool(false);
3545             case SUDO_PATH_WORLD_WRITABLE:
3546                 if (sudoers_warnings) {
3547                     warningx(_("%s is world writable"), path);
3548                 }
3549                 debug_return_bool(false);
3550             case SUDO_PATH_GROUP_WRITABLE:
3551                 if (sudoers_warnings) {
3552                     warningx(_("%s is owned by gid %u, should be %u"),
3553                         path, (unsigned int) sb.st_gid,
3554                         (unsigned int) sudoers_gid);
3555                 }
3556                 debug_return_bool(false);
3557             default:
3558                 /* NOTREACHED */
3559                 debug_return_bool(false);
3560         }
3561         if (!(path = switch_dir(&istack[idepth], path))) {
3562             /* switch_dir() called yyerror() for us */
3563             debug_return_bool(false);
3564         }
3565         while ((fp = open_sudoers(path, false, &keepopen)) == NULL) {
3566             /* Unable to open path in includedir, go to next one, if any. */
3567             efree(path);
3568             if ((pl = istack[idepth].more) == NULL)
3569                 debug_return_bool(false);
3570             path = pl->path;
3571             istack[idepth].more = pl->next;
3572             efree(pl);
3573         }
3574     } else {
3575         if ((fp = open_sudoers(path, true, &keepopen)) == NULL) {
3576             char *errbuf;
3577             if (asprintf(&errbuf, _("%s: %s"), path, strerror(errno)) != -1) {
3578                 yyerror(errbuf);
3579                 free(errbuf);
3580             } else {
3581                 yyerror(_("unable to allocate memory"));
3582             }
3583             debug_return_bool(false);
3584         }
3585         istack[idepth].more = NULL;
3586     }
3587     /* Push the old (current) file and open the new one. */
3588     istack[idepth].path = sudoers; /* push old path */
3589     istack[idepth].bs = YY_CURRENT_BUFFER;
3590     istack[idepth].lineno = sudolineno;
3591     istack[idepth].keepopen = keepopen;
3592     idepth++;
3593     sudolineno = 1;
3594     sudoers = path;
3595     yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
3596
3597     debug_return_bool(true);
3598 }
3599
3600 static bool
3601 pop_include(void)
3602 {
3603     struct path_list *pl;
3604     FILE *fp;
3605     debug_decl(pop_include, SUDO_DEBUG_PARSER)
3606
3607     if (idepth == 0)
3608         debug_return_bool(false);
3609
3610     if (!keepopen)
3611         fclose(YY_CURRENT_BUFFER->yy_input_file);
3612     yy_delete_buffer(YY_CURRENT_BUFFER);
3613     /* If we are in an include dir, move to the next file. */
3614     while ((pl = istack[idepth - 1].more) != NULL) {
3615         fp = open_sudoers(pl->path, false, &keepopen);
3616         if (fp != NULL) {
3617             istack[idepth - 1].more = pl->next;
3618             efree(sudoers);
3619             sudoers = pl->path;
3620             sudolineno = 1;
3621             yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
3622             efree(pl);
3623             break;
3624         }
3625         /* Unable to open path in include dir, go to next one. */
3626         istack[idepth - 1].more = pl->next;
3627         efree(pl->path);
3628         efree(pl);
3629     }
3630     /* If no path list, just pop the last dir on the stack. */
3631     if (pl == NULL) {
3632         idepth--;
3633         yy_switch_to_buffer(istack[idepth].bs);
3634         efree(sudoers);
3635         sudoers = istack[idepth].path;
3636         sudolineno = istack[idepth].lineno;
3637         keepopen = istack[idepth].keepopen;
3638     }
3639     debug_return_bool(true);
3640 }
3641
3642 static char *
3643 parse_include(char *base)
3644 {
3645     char *cp, *ep, *path, *pp;
3646     int dirlen = 0, len = 0, subst = 0;
3647     size_t shost_len = 0;
3648     debug_decl(parse_include, SUDO_DEBUG_PARSER)
3649
3650     /* Pull out path from #include line. */
3651     cp = base + sizeof("#include");
3652     if (*cp == 'i')
3653         cp += 3; /* includedir */
3654     while (isblank((unsigned char) *cp))
3655         cp++;
3656     ep = cp;
3657     while (*ep != '\0' && !isspace((unsigned char) *ep)) {
3658         if (ep[0] == '%' && ep[1] == 'h') {
3659             shost_len = strlen(user_shost);
3660             len += shost_len - 2;
3661             subst = 1;
3662         }
3663         ep++;
3664     }
3665
3666     /* Relative paths are located in the same dir as the sudoers file. */
3667     if (*cp != '/') {
3668         char *dirend = strrchr(sudoers, '/');
3669         if (dirend != NULL)
3670             dirlen = (int)(dirend - sudoers) + 1;
3671     }
3672
3673     /* Make a copy of the fully-qualified path and return it. */
3674     len += (int)(ep - cp);
3675     path = pp = malloc(len + dirlen + 1);
3676     if (path == NULL) {
3677         yyerror(_("unable to allocate memory"));
3678         debug_return_str(NULL);
3679     }
3680     if (dirlen) {
3681         memcpy(path, sudoers, dirlen);
3682         pp += dirlen;
3683     }
3684     if (subst) {
3685         /* substitute for %h */
3686         while (cp < ep) {
3687             if (cp[0] == '%' && cp[1] == 'h') {
3688                 memcpy(pp, user_shost, shost_len);
3689                 pp += shost_len;
3690                 cp += 2;
3691                 continue;
3692             }
3693             *pp++ = *cp++;
3694         }
3695         *pp = '\0';
3696     } else {
3697         memcpy(pp, cp, len);
3698         pp[len] = '\0';
3699     }
3700
3701     /* Push any excess characters (e.g. comment, newline) back to the lexer */
3702     if (*ep != '\0')
3703         yyless((int)(ep - base));
3704
3705     debug_return_str(path);
3706 }
3707
3708 #ifdef TRACELEXER
3709 static int
3710 sudoers_trace_print(const char *msg)
3711 {
3712     return fputs(msg, stderr);
3713 }
3714 #else
3715 static int
3716 sudoers_trace_print(const char *msg)
3717 {
3718     static bool initialized;
3719     static struct lbuf lbuf;
3720
3721     if (!initialized) {
3722         initialized = true;
3723         lbuf_init(&lbuf, NULL, 0, NULL, 0);
3724     }
3725
3726     lbuf_append(&lbuf, "%s", msg);
3727     /* XXX - assumes a final newline */
3728     if (strchr(msg, '\n') != NULL)
3729     {
3730         sudo_debug_printf2(NULL, NULL, 0, SUDO_DEBUG_PARSER|SUDO_DEBUG_DEBUG,
3731             "%s:%d %s", sudoers, sudolineno, lbuf.buf);
3732         lbuf.len = 0;
3733     }
3734     return 0;
3735 }
3736 #endif /* TRACELEXER */