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