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