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