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