1 /* $OpenBSD: flex.skl,v 1.6 2001/01/05 18:26:23 millert Exp $ */
3 /* A lexical scanner generated by flex */
5 /* Scanner skeleton version:
6 * $Header: /home/cvs-sudo/sudo/lex.yy.c,v 1.37 2002/03/16 00:45:21 millert Exp $
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
17 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
30 /* Use prototypes in function declarations. */
33 /* The "const" storage-class-modifier is valid. */
36 #else /* ! __cplusplus */
44 #endif /* ! __cplusplus */
63 #define YY_PROTO(proto) proto
65 #define YY_PROTO(proto) ()
68 /* Returned upon end-of-file. */
71 /* Promotes a possibly negative, possibly signed char to an unsigned
72 * integer for use as an array index. If the signed char is negative,
73 * we want to instead treat it as an 8-bit unsigned char, hence the
76 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
78 /* Enter a start condition. This macro really ought to take a parameter,
79 * but we do it the disgusting crufty way forced on us by the ()-less
80 * definition of BEGIN.
82 #define BEGIN yy_start = 1 + 2 *
84 /* Translate the current start state into a value that can be later handed
85 * to BEGIN to return to the state. The YYSTATE alias is for lex
88 #define YY_START ((yy_start - 1) / 2)
89 #define YYSTATE YY_START
91 /* Action number for EOF rule of a given start state. */
92 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
94 /* Special action meaning "start processing a new file". */
95 #define YY_NEW_FILE yyrestart( yyin )
97 #define YY_END_OF_BUFFER_CHAR 0
99 /* Size of default input buffer. */
100 #define YY_BUF_SIZE 16384
102 typedef struct yy_buffer_state *YY_BUFFER_STATE;
105 extern FILE *yyin, *yyout;
107 #define EOB_ACT_CONTINUE_SCAN 0
108 #define EOB_ACT_END_OF_FILE 1
109 #define EOB_ACT_LAST_MATCH 2
111 /* The funky do-while in the following #define is used to turn the definition
112 * int a single C statement (which needs a semi-colon terminator). This
113 * avoids problems with code like:
115 * if ( condition_holds )
118 * do_something_else();
120 * Prior to using the do-while the compiler would get upset at the
121 * "else" because it interpreted the "if" statement as being all
122 * done when it reached the ';' after the yyless() call.
125 /* Return all but the first 'n' matched characters back to the input stream. */
130 /* Undo effects of setting up yytext. */ \
131 *yy_cp = yy_hold_char; \
132 YY_RESTORE_YY_MORE_OFFSET \
133 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
134 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
138 #define unput(c) yyunput( c, yytext_ptr )
140 /* The following is because we cannot portably get our hands on size_t
141 * (without autoconf's help, which isn't available because we want
142 * flex-generated scanners to compile on their own).
144 typedef unsigned int yy_size_t;
147 struct yy_buffer_state
151 char *yy_ch_buf; /* input buffer */
152 char *yy_buf_pos; /* current position in input buffer */
154 /* Size of input buffer in bytes, not including room for EOB
157 yy_size_t yy_buf_size;
159 /* Number of characters read into yy_ch_buf, not including EOB
164 /* Whether we "own" the buffer - i.e., we know we created it,
165 * and can realloc() it to grow it, and should free() it to
168 int yy_is_our_buffer;
170 /* Whether this is an "interactive" input source; if so, and
171 * if we're using stdio for input, then we want to use getc()
172 * instead of fread(), to make sure we stop fetching input after
175 int yy_is_interactive;
177 /* Whether we're considered to be at the beginning of a line.
178 * If so, '^' rules will be active on the next match, otherwise
183 /* Whether to try to fill the input buffer when we reach the
188 int yy_buffer_status;
189 #define YY_BUFFER_NEW 0
190 #define YY_BUFFER_NORMAL 1
191 /* When an EOF's been seen but there's still some text to process
192 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
193 * shouldn't try reading from the input source any more. We might
194 * still have a bunch of tokens to match, though, because of
195 * possible backing-up.
197 * When we actually see the EOF, we change the status to "new"
198 * (via yyrestart()), so that the user can continue scanning by
199 * just pointing yyin at a new input file.
201 #define YY_BUFFER_EOF_PENDING 2
204 static YY_BUFFER_STATE yy_current_buffer = 0;
206 /* We provide macros for accessing buffer states in case in the
207 * future we want to put the buffer states in a more general
210 #define YY_CURRENT_BUFFER yy_current_buffer
213 /* yy_hold_char holds the character lost when yytext is formed. */
214 static char yy_hold_char;
216 static int yy_n_chars; /* number of characters read into yy_ch_buf */
221 /* Points to current character in buffer. */
222 static char *yy_c_buf_p = (char *) 0;
223 static int yy_init = 1; /* whether we need to initialize */
224 static int yy_start = 0; /* start state number */
226 /* Flag which is used to allow yywrap()'s to do buffer switches
227 * instead of setting up a fresh yyin. A bit of a hack ...
229 static int yy_did_buffer_switch_on_eof;
231 void yyrestart YY_PROTO(( FILE *input_file ));
233 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
234 void yy_load_buffer_state YY_PROTO(( void ));
235 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
236 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
238 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
239 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
241 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
242 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
243 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
245 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
246 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
247 static void yy_flex_free YY_PROTO(( void * ));
249 #define yy_new_buffer yy_create_buffer
251 #define yy_set_interactive(is_interactive) \
253 if ( ! yy_current_buffer ) \
254 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
255 yy_current_buffer->yy_is_interactive = is_interactive; \
258 #define yy_set_bol(at_bol) \
260 if ( ! yy_current_buffer ) \
261 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
262 yy_current_buffer->yy_at_bol = at_bol; \
265 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267 typedef unsigned char YY_CHAR;
268 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269 typedef int yy_state_type;
271 #define yytext_ptr yytext
273 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275 static int yy_get_next_buffer YY_PROTO(( void ));
276 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278 /* Done after the current pattern has been matched and before the
279 * corresponding action - sets up yytext.
281 #define YY_DO_BEFORE_ACTION \
282 yytext_ptr = yy_bp; \
283 yyleng = (int) (yy_cp - yy_bp); \
284 yy_hold_char = *yy_cp; \
288 #define YY_NUM_RULES 35
289 #define YY_END_OF_BUFFER 36
290 static yyconst short int yy_accept[299] =
292 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
293 0, 0, 36, 25, 31, 30, 29, 34, 25, 20,
294 34, 25, 26, 25, 25, 25, 25, 28, 27, 21,
295 21, 21, 34, 21, 21, 21, 21, 21, 22, 34,
296 22, 23, 22, 22, 22, 22, 22, 21, 21, 21,
297 34, 1, 11, 10, 11, 10, 10, 34, 34, 2,
298 8, 8, 8, 3, 8, 4, 34, 25, 0, 31,
299 29, 0, 33, 17, 0, 16, 0, 24, 24, 0,
300 25, 25, 25, 25, 25, 21, 21, 21, 25, 32,
301 25, 25, 25, 25, 25, 22, 0, 22, 17, 0,
303 16, 0, 22, 0, 22, 22, 22, 22, 22, 21,
304 21, 21, 22, 1, 11, 11, 9, 9, 0, 2,
305 8, 0, 8, 0, 0, 5, 6, 8, 8, 0,
306 25, 25, 25, 21, 21, 25, 25, 25, 25, 25,
307 22, 22, 22, 21, 21, 7, 7, 0, 7, 8,
308 25, 25, 25, 25, 25, 21, 21, 25, 25, 25,
309 22, 22, 22, 22, 22, 21, 21, 7, 25, 25,
310 25, 21, 21, 25, 25, 22, 22, 22, 21, 21,
311 25, 25, 25, 25, 25, 21, 21, 25, 25, 22,
312 22, 22, 22, 22, 21, 21, 18, 18, 18, 21,
314 0, 15, 25, 25, 18, 18, 18, 21, 25, 18,
315 18, 18, 18, 21, 25, 12, 22, 18, 18, 18,
316 18, 21, 25, 19, 19, 19, 0, 14, 25, 12,
317 22, 19, 19, 19, 25, 25, 19, 19, 19, 19,
318 19, 13, 22, 22, 19, 19, 19, 19, 19, 25,
319 25, 25, 19, 19, 22, 22, 22, 19, 19, 25,
320 25, 25, 25, 25, 22, 22, 22, 22, 22, 25,
321 25, 25, 22, 22, 22, 25, 25, 25, 25, 25,
322 22, 22, 22, 22, 22, 18, 18, 18, 18, 18,
323 18, 18, 18, 18, 18, 18, 18, 0
327 static yyconst int yy_ec[256] =
329 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 2, 4, 5, 6, 1, 7, 1, 1, 8,
333 9, 1, 10, 11, 12, 13, 14, 15, 16, 17,
334 18, 19, 20, 21, 21, 21, 21, 22, 1, 1,
335 23, 1, 1, 24, 25, 26, 27, 28, 26, 26,
336 26, 29, 26, 26, 26, 26, 26, 30, 31, 32,
337 26, 33, 34, 26, 35, 26, 36, 26, 26, 26,
338 1, 37, 1, 1, 38, 1, 39, 40, 40, 41,
340 42, 43, 40, 40, 44, 40, 40, 45, 46, 47,
341 48, 40, 40, 49, 50, 51, 52, 40, 40, 40,
342 40, 40, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 static yyconst int yy_meta[53] =
361 1, 2, 2, 3, 1, 4, 1, 3, 3, 1,
362 2, 5, 1, 1, 5, 5, 5, 5, 5, 5,
363 5, 6, 4, 3, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 7, 8, 8, 8,
365 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
369 static yyconst short int yy_base[319] =
371 0, 26, 61, 0, 112, 113, 120, 156, 192, 243,
372 294, 330, 627, 589, 623, 1808, 619, 619, 584, 1808,
373 1808, 583, 1808, 124, 355, 119, 134, 1808, 1808, 380,
374 586, 579, 417, 557, 558, 551, 546, 545, 556, 0,
375 553, 1808, 551, 160, 429, 155, 170, 454, 555, 545,
376 491, 565, 0, 1808, 561, 0, 1808, 307, 54, 0,
377 526, 343, 93, 1808, 104, 1808, 142, 521, 514, 555,
378 552, 544, 1808, 507, 537, 505, 560, 315, 503, 583,
379 593, 143, 0, 0, 503, 0, 489, 485, 144, 1808,
380 118, 140, 154, 145, 163, 480, 629, 0, 475, 652,
382 474, 675, 353, 698, 708, 186, 0, 0, 489, 0,
383 477, 467, 211, 496, 0, 492, 199, 1808, 204, 0,
384 431, 248, 380, 214, 215, 1808, 1808, 427, 219, 251,
385 733, 742, 751, 438, 428, 88, 21, 166, 171, 175,
386 760, 769, 778, 436, 421, 416, 1808, 221, 454, 613,
387 785, 242, 810, 819, 828, 409, 386, 178, 223, 226,
388 837, 264, 846, 855, 864, 360, 345, 265, 873, 882,
389 891, 335, 328, 241, 224, 900, 909, 918, 321, 323,
390 925, 290, 950, 959, 968, 311, 306, 227, 174, 977,
391 301, 986, 995, 1004, 285, 341, 1012, 414, 488, 288,
393 356, 1808, 278, 270, 1037, 511, 534, 283, 1044, 323,
394 0, 0, 247, 357, 228, 365, 1068, 351, 0, 0,
395 207, 362, 1077, 1086, 1095, 1104, 402, 1808, 275, 1808,
396 1113, 1122, 1131, 1140, 1147, 313, 1172, 1181, 1190, 1199,
397 559, 190, 1208, 414, 1217, 1226, 1235, 1244, 564, 1253,
398 1262, 1271, 1280, 421, 1289, 1298, 1307, 1316, 518, 1323,
399 439, 1348, 1357, 1366, 1373, 441, 1398, 1407, 1416, 1425,
400 1434, 1443, 1452, 1461, 1470, 1479, 560, 1488, 1497, 1506,
401 1515, 565, 1524, 1533, 1542, 1551, 1560, 1569, 1578, 1587,
402 1596, 172, 1603, 627, 129, 1626, 650, 1808, 1663, 1671,
404 1679, 1687, 1695, 1703, 1711, 1719, 1727, 158, 1735, 1743,
405 1751, 1759, 109, 1767, 1775, 1783, 1791, 1799
408 static yyconst short int yy_def[319] =
410 298, 1, 298, 3, 1, 1, 299, 299, 300, 300,
411 301, 301, 298, 302, 298, 298, 298, 303, 304, 298,
412 298, 305, 298, 306, 302, 25, 25, 298, 298, 25,
413 30, 30, 302, 30, 30, 30, 30, 30, 307, 308,
414 309, 298, 310, 311, 307, 45, 45, 45, 48, 48,
415 307, 298, 312, 298, 312, 312, 298, 298, 298, 313,
416 314, 315, 314, 298, 314, 298, 316, 302, 302, 298,
417 298, 303, 298, 304, 304, 305, 305, 306, 317, 302,
418 302, 302, 25, 25, 25, 30, 30, 30, 302, 298,
419 302, 302, 302, 302, 302, 307, 307, 308, 309, 309,
421 310, 310, 311, 307, 307, 307, 45, 45, 45, 48,
422 48, 48, 307, 298, 312, 312, 298, 298, 298, 313,
423 314, 314, 315, 318, 315, 298, 298, 314, 314, 298,
424 25, 25, 25, 30, 30, 302, 302, 302, 302, 302,
425 45, 45, 45, 48, 48, 314, 298, 318, 315, 315,
426 302, 302, 25, 25, 25, 30, 30, 302, 302, 302,
427 45, 307, 45, 45, 45, 48, 48, 318, 25, 25,
428 25, 30, 30, 302, 302, 45, 45, 45, 48, 48,
429 302, 302, 25, 25, 25, 30, 30, 302, 302, 45,
430 307, 45, 45, 45, 48, 48, 302, 197, 197, 30,
432 298, 298, 302, 302, 45, 205, 205, 48, 302, 302,
433 197, 197, 197, 30, 302, 302, 205, 307, 205, 205,
434 205, 48, 25, 25, 25, 25, 298, 298, 302, 298,
435 45, 45, 45, 45, 302, 302, 25, 25, 25, 25,
436 302, 302, 45, 307, 45, 45, 45, 45, 307, 25,
437 25, 25, 25, 302, 45, 45, 45, 45, 307, 302,
438 302, 25, 25, 25, 307, 307, 45, 45, 45, 25,
439 25, 25, 45, 45, 45, 25, 302, 25, 25, 25,
440 45, 307, 45, 45, 45, 25, 25, 25, 45, 45,
441 45, 302, 302, 302, 307, 307, 307, 0, 298, 298,
443 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
444 298, 298, 298, 298, 298, 298, 298, 298
447 static yyconst short int yy_nxt[1861] =
449 14, 15, 16, 17, 14, 18, 19, 20, 21, 22,
450 23, 14, 14, 24, 25, 26, 27, 25, 25, 25,
451 25, 28, 29, 21, 30, 30, 30, 30, 30, 31,
452 30, 32, 30, 30, 30, 30, 33, 14, 14, 14,
453 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
454 14, 14, 34, 35, 36, 119, 90, 69, 37, 159,
455 38, 39, 15, 16, 17, 39, 40, 41, 21, 42,
456 43, 23, 39, 39, 44, 45, 46, 47, 45, 45,
457 45, 45, 28, 29, 21, 48, 48, 48, 48, 48,
458 49, 48, 50, 48, 48, 48, 48, 51, 39, 39,
460 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
461 39, 39, 39, 52, 52, 126, 120, 21, 21, 21,
462 21, 15, 54, 55, 69, 56, 127, 79, 158, 122,
463 57, 79, 79, 83, 83, 83, 83, 83, 83, 83,
464 122, 57, 56, 129, 90, 119, 90, 79, 84, 84,
465 84, 84, 84, 85, 69, 81, 58, 15, 54, 55,
466 80, 56, 98, 79, 136, 97, 57, 79, 79, 107,
467 107, 107, 107, 107, 107, 107, 69, 57, 56, 69,
468 69, 69, 137, 79, 108, 108, 108, 108, 108, 109,
469 69, 139, 58, 15, 16, 17, 104, 18, 105, 69,
471 119, 90, 69, 138, 140, 119, 90, 69, 69, 160,
472 69, 69, 119, 90, 69, 174, 158, 124, 147, 149,
473 119, 90, 97, 158, 204, 168, 69, 96, 59, 60,
474 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
475 60, 60, 60, 60, 15, 16, 17, 97, 18, 121,
476 148, 150, 79, 121, 151, 122, 79, 148, 121, 69,
477 69, 79, 69, 69, 69, 188, 229, 68, 189, 147,
478 121, 203, 79, 79, 175, 158, 161, 69, 69, 59,
479 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
480 60, 60, 60, 60, 60, 15, 16, 17, 62, 18,
482 97, 148, 181, 63, 64, 65, 69, 201, 117, 90,
483 222, 69, 118, 190, 69, 214, 66, 118, 79, 216,
484 208, 215, 79, 79, 242, 235, 69, 202, 118, 118,
485 67, 15, 16, 17, 62, 18, 209, 97, 79, 63,
486 64, 65, 201, 118, 124, 124, 200, 121, 124, 69,
487 196, 80, 66, 124, 195, 187, 79, 201, 227, 69,
488 79, 79, 202, 227, 217, 124, 67, 81, 186, 82,
489 82, 82, 82, 82, 82, 82, 79, 202, 228, 125,
490 180, 124, 124, 228, 146, 124, 230, 97, 230, 104,
491 124, 69, 68, 179, 86, 86, 86, 86, 86, 86,
493 86, 69, 124, 227, 86, 86, 86, 86, 86, 86,
494 86, 86, 86, 86, 86, 86, 125, 86, 89, 90,
495 68, 173, 68, 228, 68, 68, 243, 68, 211, 211,
496 211, 211, 211, 211, 211, 254, 254, 254, 68, 68,
497 68, 105, 172, 106, 106, 106, 106, 106, 106, 106,
498 97, 260, 122, 265, 167, 124, 124, 69, 146, 124,
499 166, 157, 156, 122, 124, 97, 96, 122, 110, 110,
500 110, 110, 110, 110, 110, 69, 124, 97, 110, 110,
501 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
502 125, 110, 113, 90, 96, 116, 96, 114, 96, 96,
504 145, 96, 212, 212, 212, 212, 212, 213, 144, 96,
505 102, 100, 96, 96, 96, 68, 97, 68, 135, 68,
506 134, 68, 68, 68, 68, 219, 219, 219, 219, 219,
507 219, 219, 259, 259, 259, 68, 68, 68, 74, 130,
508 74, 77, 74, 75, 74, 74, 73, 74, 220, 220,
509 220, 220, 220, 221, 97, 71, 70, 69, 74, 74,
510 74, 76, 122, 76, 116, 76, 114, 76, 76, 112,
511 76, 235, 276, 254, 254, 254, 243, 281, 259, 259,
512 259, 76, 76, 76, 78, 111, 68, 102, 78, 100,
513 68, 68, 97, 78, 95, 69, 69, 94, 93, 92,
515 97, 97, 91, 88, 78, 78, 68, 131, 132, 133,
516 131, 131, 131, 131, 124, 124, 87, 149, 124, 77,
517 75, 73, 71, 124, 70, 69, 298, 298, 298, 69,
518 96, 298, 96, 298, 96, 124, 96, 96, 298, 96,
519 298, 292, 292, 292, 292, 292, 292, 298, 298, 125,
520 96, 96, 96, 99, 298, 99, 298, 99, 298, 99,
521 99, 298, 99, 69, 295, 295, 295, 295, 295, 295,
522 298, 298, 298, 99, 99, 99, 101, 298, 101, 298,
523 101, 298, 101, 101, 298, 101, 97, 298, 298, 298,
524 298, 298, 298, 298, 298, 298, 101, 101, 101, 103,
526 298, 96, 298, 103, 298, 96, 96, 298, 103, 298,
527 298, 298, 298, 298, 298, 298, 298, 298, 298, 103,
528 103, 96, 141, 142, 143, 141, 141, 141, 141, 298,
529 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
530 298, 298, 298, 298, 97, 151, 298, 152, 152, 152,
531 152, 152, 152, 152, 151, 298, 153, 153, 153, 153,
532 153, 153, 153, 151, 298, 154, 154, 154, 154, 154,
533 155, 152, 161, 298, 162, 162, 162, 162, 162, 162,
534 162, 161, 298, 163, 163, 163, 163, 163, 163, 163,
535 161, 298, 164, 164, 164, 164, 164, 165, 162, 169,
537 170, 171, 169, 169, 169, 169, 298, 298, 298, 298,
538 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
539 298, 69, 151, 298, 152, 152, 152, 152, 152, 152,
540 152, 151, 298, 152, 152, 152, 152, 152, 152, 152,
541 151, 298, 152, 152, 152, 152, 152, 152, 68, 96,
542 298, 176, 177, 178, 176, 176, 176, 176, 161, 298,
543 162, 162, 162, 162, 162, 162, 162, 161, 298, 162,
544 162, 162, 162, 162, 162, 162, 161, 298, 162, 162,
545 162, 162, 162, 162, 96, 181, 298, 182, 182, 182,
546 182, 182, 182, 182, 181, 298, 183, 183, 183, 183,
548 183, 183, 183, 181, 298, 184, 184, 184, 184, 184,
549 185, 182, 190, 298, 191, 191, 191, 191, 191, 191,
550 191, 190, 298, 192, 192, 192, 192, 192, 192, 192,
551 190, 298, 193, 193, 193, 193, 193, 194, 191, 197,
552 198, 199, 197, 197, 197, 197, 298, 298, 298, 298,
553 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
554 298, 69, 181, 298, 182, 182, 182, 182, 182, 182,
555 182, 181, 298, 182, 182, 182, 182, 182, 182, 182,
556 181, 298, 182, 182, 182, 182, 182, 182, 68, 96,
557 298, 205, 206, 207, 205, 205, 205, 205, 190, 298,
559 191, 191, 191, 191, 191, 191, 191, 190, 298, 191,
560 191, 191, 191, 191, 191, 191, 190, 298, 191, 191,
561 191, 191, 191, 191, 96, 209, 210, 210, 210, 210,
562 210, 210, 210, 298, 298, 298, 298, 298, 298, 298,
563 298, 298, 298, 298, 298, 298, 298, 298, 69, 96,
564 217, 218, 218, 218, 218, 218, 218, 218, 223, 224,
565 225, 226, 223, 223, 223, 298, 298, 298, 298, 298,
566 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
567 69, 96, 231, 232, 233, 234, 231, 231, 231, 235,
568 298, 236, 236, 236, 236, 236, 236, 236, 235, 298,
570 237, 237, 237, 237, 237, 237, 237, 235, 298, 238,
571 238, 238, 238, 238, 239, 240, 235, 298, 241, 241,
572 241, 236, 236, 236, 236, 243, 298, 244, 244, 244,
573 244, 244, 244, 244, 243, 298, 245, 245, 245, 245,
574 245, 245, 245, 243, 298, 246, 246, 246, 246, 246,
575 247, 248, 243, 298, 249, 249, 249, 244, 244, 244,
576 244, 250, 251, 252, 250, 250, 250, 250, 298, 298,
577 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
578 298, 298, 298, 69, 235, 298, 240, 240, 240, 240,
579 240, 240, 240, 235, 298, 240, 240, 240, 240, 240,
581 240, 240, 235, 298, 240, 240, 240, 240, 240, 240,
582 253, 235, 298, 253, 253, 253, 253, 253, 253, 253,
583 96, 298, 255, 256, 257, 255, 255, 255, 255, 243,
584 298, 248, 248, 248, 248, 248, 248, 248, 243, 298,
585 248, 248, 248, 248, 248, 248, 248, 243, 298, 248,
586 248, 248, 248, 248, 248, 258, 243, 298, 258, 258,
587 258, 258, 258, 258, 258, 260, 298, 261, 261, 261,
588 261, 261, 261, 261, 260, 298, 262, 262, 262, 262,
589 262, 262, 262, 260, 298, 263, 263, 263, 263, 263,
590 264, 261, 68, 298, 253, 253, 253, 253, 253, 253,
592 253, 265, 298, 266, 266, 266, 266, 266, 266, 266,
593 265, 298, 267, 267, 267, 267, 267, 267, 267, 265,
594 298, 268, 268, 268, 268, 268, 269, 266, 96, 298,
595 258, 258, 258, 258, 258, 258, 258, 270, 271, 272,
596 270, 270, 270, 270, 298, 298, 298, 298, 298, 298,
597 298, 298, 298, 298, 298, 298, 298, 298, 298, 69,
598 260, 298, 261, 261, 261, 261, 261, 261, 261, 260,
599 298, 261, 261, 261, 261, 261, 261, 261, 260, 298,
600 261, 261, 261, 261, 261, 261, 68, 273, 274, 275,
601 273, 273, 273, 273, 298, 298, 298, 298, 298, 298,
603 298, 298, 298, 298, 298, 298, 298, 298, 298, 97,
604 265, 298, 266, 266, 266, 266, 266, 266, 266, 265,
605 298, 266, 266, 266, 266, 266, 266, 266, 265, 298,
606 266, 266, 266, 266, 266, 266, 96, 276, 298, 277,
607 277, 277, 277, 277, 277, 277, 276, 298, 278, 278,
608 278, 278, 278, 278, 278, 276, 298, 279, 279, 279,
609 279, 279, 280, 277, 281, 298, 282, 282, 282, 282,
610 282, 282, 282, 281, 298, 283, 283, 283, 283, 283,
611 283, 283, 281, 298, 284, 284, 284, 284, 284, 285,
612 282, 68, 298, 286, 287, 288, 286, 286, 286, 286,
614 276, 298, 277, 277, 277, 277, 277, 277, 277, 276,
615 298, 277, 277, 277, 277, 277, 277, 277, 276, 298,
616 277, 277, 277, 277, 277, 277, 68, 96, 298, 289,
617 290, 291, 289, 289, 289, 289, 281, 298, 282, 282,
618 282, 282, 282, 282, 282, 281, 298, 282, 282, 282,
619 282, 282, 282, 282, 281, 298, 282, 282, 282, 282,
620 282, 282, 96, 68, 298, 292, 292, 292, 292, 292,
621 292, 292, 68, 298, 286, 286, 286, 286, 286, 286,
622 286, 68, 298, 293, 293, 293, 293, 293, 294, 292,
623 96, 298, 295, 295, 295, 295, 295, 295, 295, 96,
625 298, 289, 289, 289, 289, 289, 289, 289, 96, 298,
626 296, 296, 296, 296, 296, 297, 295, 292, 292, 292,
627 292, 292, 292, 292, 298, 298, 298, 298, 298, 298,
628 298, 298, 298, 298, 298, 298, 298, 298, 298, 69,
629 295, 295, 295, 295, 295, 295, 295, 298, 298, 298,
630 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
631 298, 298, 97, 53, 53, 53, 53, 53, 53, 53,
632 53, 21, 21, 21, 21, 21, 21, 21, 21, 61,
633 61, 61, 61, 61, 61, 61, 61, 68, 298, 298,
634 298, 68, 298, 68, 68, 72, 72, 72, 72, 72,
636 72, 72, 72, 74, 298, 298, 298, 74, 298, 74,
637 74, 76, 298, 298, 298, 76, 298, 76, 76, 78,
638 298, 78, 298, 78, 298, 78, 78, 96, 298, 298,
639 298, 96, 298, 96, 96, 99, 298, 298, 298, 99,
640 298, 99, 99, 101, 298, 298, 298, 101, 298, 101,
641 101, 103, 298, 103, 298, 103, 298, 103, 103, 115,
642 298, 115, 115, 115, 298, 298, 115, 121, 298, 121,
643 298, 121, 121, 121, 121, 123, 123, 123, 123, 123,
644 123, 123, 123, 128, 128, 128, 128, 128, 128, 128,
645 128, 79, 298, 79, 298, 79, 298, 79, 79, 124,
647 124, 124, 124, 124, 124, 124, 124, 13, 298, 298,
648 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
649 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
650 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
651 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
652 298, 298, 298, 298, 298, 298, 298, 298, 298, 298
655 static yyconst short int yy_chk[1861] =
657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
662 1, 1, 2, 2, 2, 59, 59, 137, 2, 137,
663 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
664 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
665 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
666 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
668 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
669 3, 3, 3, 5, 6, 63, 313, 5, 6, 5,
670 6, 7, 7, 7, 136, 7, 65, 24, 136, 63,
671 7, 24, 24, 26, 26, 26, 26, 26, 26, 26,
672 65, 7, 7, 67, 67, 89, 89, 24, 27, 27,
673 27, 27, 27, 27, 91, 82, 7, 8, 8, 8,
674 24, 8, 308, 44, 91, 295, 8, 44, 44, 46,
675 46, 46, 46, 46, 46, 46, 92, 8, 8, 82,
676 89, 94, 92, 44, 47, 47, 47, 47, 47, 47,
677 93, 94, 8, 9, 9, 9, 44, 9, 106, 95,
679 117, 117, 138, 93, 95, 119, 119, 139, 292, 139,
680 189, 140, 113, 113, 158, 158, 138, 125, 124, 125,
681 129, 129, 106, 140, 189, 148, 242, 221, 9, 9,
682 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
683 9, 9, 9, 9, 10, 10, 10, 113, 10, 122,
684 124, 125, 130, 122, 152, 129, 130, 148, 122, 159,
685 175, 130, 160, 188, 215, 174, 215, 213, 175, 168,
686 122, 188, 130, 130, 159, 160, 162, 174, 152, 10,
687 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
688 10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
690 162, 168, 182, 11, 11, 11, 204, 187, 58, 58,
691 208, 229, 58, 191, 203, 200, 11, 58, 78, 204,
692 195, 203, 78, 78, 229, 236, 182, 187, 58, 58,
693 11, 12, 12, 12, 12, 12, 210, 191, 78, 12,
694 12, 12, 196, 58, 62, 62, 186, 62, 62, 236,
695 180, 78, 12, 62, 179, 173, 103, 201, 214, 210,
696 103, 103, 196, 222, 218, 62, 12, 25, 172, 25,
697 25, 25, 25, 25, 25, 25, 103, 201, 214, 62,
698 167, 123, 123, 222, 123, 123, 216, 218, 216, 103,
699 123, 25, 30, 166, 30, 30, 30, 30, 30, 30,
701 30, 216, 123, 227, 30, 30, 30, 30, 30, 30,
702 30, 30, 30, 30, 30, 30, 123, 30, 33, 33,
703 33, 157, 33, 227, 33, 33, 244, 33, 198, 198,
704 198, 198, 198, 198, 198, 254, 254, 254, 33, 33,
705 33, 45, 156, 45, 45, 45, 45, 45, 45, 45,
706 244, 261, 146, 266, 145, 149, 149, 254, 149, 149,
707 144, 135, 134, 128, 149, 45, 48, 121, 48, 48,
708 48, 48, 48, 48, 48, 261, 149, 266, 48, 48,
709 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
710 149, 48, 51, 51, 51, 116, 51, 114, 51, 51,
712 112, 51, 199, 199, 199, 199, 199, 199, 111, 109,
713 101, 99, 51, 51, 51, 69, 96, 69, 88, 69,
714 87, 69, 69, 85, 69, 206, 206, 206, 206, 206,
715 206, 206, 259, 259, 259, 69, 69, 69, 75, 79,
716 75, 76, 75, 74, 75, 75, 72, 75, 207, 207,
717 207, 207, 207, 207, 259, 71, 70, 68, 75, 75,
718 75, 77, 61, 77, 55, 77, 52, 77, 77, 50,
719 77, 241, 277, 241, 241, 241, 249, 282, 249, 249,
720 249, 77, 77, 77, 80, 49, 80, 43, 80, 41,
721 80, 80, 39, 80, 38, 241, 277, 37, 36, 35,
723 249, 282, 34, 32, 80, 80, 80, 81, 81, 81,
724 81, 81, 81, 81, 150, 150, 31, 150, 150, 22,
725 19, 18, 17, 150, 15, 14, 13, 0, 0, 81,
726 97, 0, 97, 0, 97, 150, 97, 97, 0, 97,
727 0, 294, 294, 294, 294, 294, 294, 0, 0, 150,
728 97, 97, 97, 100, 0, 100, 0, 100, 0, 100,
729 100, 0, 100, 294, 297, 297, 297, 297, 297, 297,
730 0, 0, 0, 100, 100, 100, 102, 0, 102, 0,
731 102, 0, 102, 102, 0, 102, 297, 0, 0, 0,
732 0, 0, 0, 0, 0, 0, 102, 102, 102, 104,
734 0, 104, 0, 104, 0, 104, 104, 0, 104, 0,
735 0, 0, 0, 0, 0, 0, 0, 0, 0, 104,
736 104, 104, 105, 105, 105, 105, 105, 105, 105, 0,
737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
738 0, 0, 0, 0, 105, 131, 0, 131, 131, 131,
739 131, 131, 131, 131, 132, 0, 132, 132, 132, 132,
740 132, 132, 132, 133, 0, 133, 133, 133, 133, 133,
741 133, 133, 141, 0, 141, 141, 141, 141, 141, 141,
742 141, 142, 0, 142, 142, 142, 142, 142, 142, 142,
743 143, 0, 143, 143, 143, 143, 143, 143, 143, 151,
745 151, 151, 151, 151, 151, 151, 0, 0, 0, 0,
746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
747 0, 151, 153, 0, 153, 153, 153, 153, 153, 153,
748 153, 154, 0, 154, 154, 154, 154, 154, 154, 154,
749 155, 0, 155, 155, 155, 155, 155, 155, 155, 161,
750 0, 161, 161, 161, 161, 161, 161, 161, 163, 0,
751 163, 163, 163, 163, 163, 163, 163, 164, 0, 164,
752 164, 164, 164, 164, 164, 164, 165, 0, 165, 165,
753 165, 165, 165, 165, 165, 169, 0, 169, 169, 169,
754 169, 169, 169, 169, 170, 0, 170, 170, 170, 170,
756 170, 170, 170, 171, 0, 171, 171, 171, 171, 171,
757 171, 171, 176, 0, 176, 176, 176, 176, 176, 176,
758 176, 177, 0, 177, 177, 177, 177, 177, 177, 177,
759 178, 0, 178, 178, 178, 178, 178, 178, 178, 181,
760 181, 181, 181, 181, 181, 181, 0, 0, 0, 0,
761 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
762 0, 181, 183, 0, 183, 183, 183, 183, 183, 183,
763 183, 184, 0, 184, 184, 184, 184, 184, 184, 184,
764 185, 0, 185, 185, 185, 185, 185, 185, 185, 190,
765 0, 190, 190, 190, 190, 190, 190, 190, 192, 0,
767 192, 192, 192, 192, 192, 192, 192, 193, 0, 193,
768 193, 193, 193, 193, 193, 193, 194, 0, 194, 194,
769 194, 194, 194, 194, 194, 197, 197, 197, 197, 197,
770 197, 197, 197, 0, 0, 0, 0, 0, 0, 0,
771 0, 0, 0, 0, 0, 0, 0, 0, 197, 205,
772 205, 205, 205, 205, 205, 205, 205, 205, 209, 209,
773 209, 209, 209, 209, 209, 0, 0, 0, 0, 0,
774 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
775 209, 217, 217, 217, 217, 217, 217, 217, 217, 223,
776 0, 223, 223, 223, 223, 223, 223, 223, 224, 0,
778 224, 224, 224, 224, 224, 224, 224, 225, 0, 225,
779 225, 225, 225, 225, 225, 225, 226, 0, 226, 226,
780 226, 226, 226, 226, 226, 231, 0, 231, 231, 231,
781 231, 231, 231, 231, 232, 0, 232, 232, 232, 232,
782 232, 232, 232, 233, 0, 233, 233, 233, 233, 233,
783 233, 233, 234, 0, 234, 234, 234, 234, 234, 234,
784 234, 235, 235, 235, 235, 235, 235, 235, 0, 0,
785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
786 0, 0, 0, 235, 237, 0, 237, 237, 237, 237,
787 237, 237, 237, 238, 0, 238, 238, 238, 238, 238,
789 238, 238, 239, 0, 239, 239, 239, 239, 239, 239,
790 239, 240, 0, 240, 240, 240, 240, 240, 240, 240,
791 243, 0, 243, 243, 243, 243, 243, 243, 243, 245,
792 0, 245, 245, 245, 245, 245, 245, 245, 246, 0,
793 246, 246, 246, 246, 246, 246, 246, 247, 0, 247,
794 247, 247, 247, 247, 247, 247, 248, 0, 248, 248,
795 248, 248, 248, 248, 248, 250, 0, 250, 250, 250,
796 250, 250, 250, 250, 251, 0, 251, 251, 251, 251,
797 251, 251, 251, 252, 0, 252, 252, 252, 252, 252,
798 252, 252, 253, 0, 253, 253, 253, 253, 253, 253,
800 253, 255, 0, 255, 255, 255, 255, 255, 255, 255,
801 256, 0, 256, 256, 256, 256, 256, 256, 256, 257,
802 0, 257, 257, 257, 257, 257, 257, 257, 258, 0,
803 258, 258, 258, 258, 258, 258, 258, 260, 260, 260,
804 260, 260, 260, 260, 0, 0, 0, 0, 0, 0,
805 0, 0, 0, 0, 0, 0, 0, 0, 0, 260,
806 262, 0, 262, 262, 262, 262, 262, 262, 262, 263,
807 0, 263, 263, 263, 263, 263, 263, 263, 264, 0,
808 264, 264, 264, 264, 264, 264, 264, 265, 265, 265,
809 265, 265, 265, 265, 0, 0, 0, 0, 0, 0,
811 0, 0, 0, 0, 0, 0, 0, 0, 0, 265,
812 267, 0, 267, 267, 267, 267, 267, 267, 267, 268,
813 0, 268, 268, 268, 268, 268, 268, 268, 269, 0,
814 269, 269, 269, 269, 269, 269, 269, 270, 0, 270,
815 270, 270, 270, 270, 270, 270, 271, 0, 271, 271,
816 271, 271, 271, 271, 271, 272, 0, 272, 272, 272,
817 272, 272, 272, 272, 273, 0, 273, 273, 273, 273,
818 273, 273, 273, 274, 0, 274, 274, 274, 274, 274,
819 274, 274, 275, 0, 275, 275, 275, 275, 275, 275,
820 275, 276, 0, 276, 276, 276, 276, 276, 276, 276,
822 278, 0, 278, 278, 278, 278, 278, 278, 278, 279,
823 0, 279, 279, 279, 279, 279, 279, 279, 280, 0,
824 280, 280, 280, 280, 280, 280, 280, 281, 0, 281,
825 281, 281, 281, 281, 281, 281, 283, 0, 283, 283,
826 283, 283, 283, 283, 283, 284, 0, 284, 284, 284,
827 284, 284, 284, 284, 285, 0, 285, 285, 285, 285,
828 285, 285, 285, 286, 0, 286, 286, 286, 286, 286,
829 286, 286, 287, 0, 287, 287, 287, 287, 287, 287,
830 287, 288, 0, 288, 288, 288, 288, 288, 288, 288,
831 289, 0, 289, 289, 289, 289, 289, 289, 289, 290,
833 0, 290, 290, 290, 290, 290, 290, 290, 291, 0,
834 291, 291, 291, 291, 291, 291, 291, 293, 293, 293,
835 293, 293, 293, 293, 0, 0, 0, 0, 0, 0,
836 0, 0, 0, 0, 0, 0, 0, 0, 0, 293,
837 296, 296, 296, 296, 296, 296, 296, 0, 0, 0,
838 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
839 0, 0, 296, 299, 299, 299, 299, 299, 299, 299,
840 299, 300, 300, 300, 300, 300, 300, 300, 300, 301,
841 301, 301, 301, 301, 301, 301, 301, 302, 0, 0,
842 0, 302, 0, 302, 302, 303, 303, 303, 303, 303,
844 303, 303, 303, 304, 0, 0, 0, 304, 0, 304,
845 304, 305, 0, 0, 0, 305, 0, 305, 305, 306,
846 0, 306, 0, 306, 0, 306, 306, 307, 0, 0,
847 0, 307, 0, 307, 307, 309, 0, 0, 0, 309,
848 0, 309, 309, 310, 0, 0, 0, 310, 0, 310,
849 310, 311, 0, 311, 0, 311, 0, 311, 311, 312,
850 0, 312, 312, 312, 0, 0, 312, 314, 0, 314,
851 0, 314, 314, 314, 314, 315, 315, 315, 315, 315,
852 315, 315, 315, 316, 316, 316, 316, 316, 316, 316,
853 316, 317, 0, 317, 0, 317, 0, 317, 317, 318,
855 318, 318, 318, 318, 318, 318, 318, 298, 298, 298,
856 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
857 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
858 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
859 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
860 298, 298, 298, 298, 298, 298, 298, 298, 298, 298
863 static yy_state_type yy_last_accepting_state;
864 static char *yy_last_accepting_cpos;
866 /* The intent behind this definition is that it'll catch
867 * any uses of REJECT which flex missed.
869 #define REJECT reject_used_but_not_detected
870 #define yymore() yymore_used_but_not_detected
871 #define YY_MORE_ADJ 0
872 #define YY_RESTORE_YY_MORE_OFFSET
878 * Copyright (c) 1996, 1998-2001 Todd C. Miller <Todd.Miller@courtesan.com>
879 * All rights reserved.
881 * This code is derived from software contributed by Chris Jepeway.
883 * This code is derived from software contributed by Chris Jepeway
884 * Redistribution and use in source and binary forms, with or without
885 * modification, are permitted provided that the following conditions
888 * 1. Redistributions of source code must retain the above copyright
889 * notice, this list of conditions and the following disclaimer.
891 * 2. Redistributions in binary form must reproduce the above copyright
892 * notice, this list of conditions and the following disclaimer in the
893 * documentation and/or other materials provided with the distribution.
895 * 3. The name of the author may not be used to endorse or promote products
896 * derived from this software without specific prior written permission.
898 * 4. Products derived from this software may not be called "Sudo" nor
899 * may "Sudo" appear in their names without specific prior written
900 * permission from the author.
902 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
903 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
904 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
905 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
906 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
907 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
908 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
909 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
910 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
911 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
916 #include <sys/types.h>
917 #include <sys/param.h>
923 # ifdef HAVE_STDLIB_H
926 #endif /* STDC_HEADERS */
930 # ifdef HAVE_STRINGS_H
931 # include <strings.h>
933 #endif /* HAVE_STRING_H */
936 #endif /* HAVE_UNISTD_H */
937 #if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
939 #endif /* HAVE_MALLOC_H && !STDC_HEADERS */
943 #include <sudo.tab.h>
946 static const char rcsid[] = "$Sudo: lex.yy.c,v 1.37 2002/03/16 00:45:21 millert Exp $";
949 #undef yywrap /* guard against a yywrap macro */
951 extern YYSTYPE yylval;
952 extern int clearaliases;
954 static int sawspace = 0;
955 static int arg_len = 0;
956 static int arg_size = 0;
958 static void fill __P((char *, int));
959 static void fill_cmnd __P((char *, int));
960 static void fill_args __P((char *, int, int));
961 extern void reset_aliases __P((void));
962 extern void yyerror __P((char *));
964 /* realloc() to size + COMMANDARGINC to make room for command args */
965 #define COMMANDARGINC 64
968 #define LEXTRACE(msg) fputs(msg, stderr)
970 #define LEXTRACE(msg)
972 /* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */
985 /* Macros after this point can all be overridden by user definitions in
989 #ifndef YY_SKIP_YYWRAP
991 extern "C" int yywrap YY_PROTO(( void ));
993 extern int yywrap YY_PROTO(( void ));
998 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1002 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1005 #ifdef YY_NEED_STRLEN
1006 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1011 static int yyinput YY_PROTO(( void ));
1013 static int input YY_PROTO(( void ));
1018 static int yy_start_stack_ptr = 0;
1019 static int yy_start_stack_depth = 0;
1020 static int *yy_start_stack = 0;
1021 #ifndef YY_NO_PUSH_STATE
1022 static void yy_push_state YY_PROTO(( int new_state ));
1024 #ifndef YY_NO_POP_STATE
1025 static void yy_pop_state YY_PROTO(( void ));
1027 #ifndef YY_NO_TOP_STATE
1028 static int yy_top_state YY_PROTO(( void ));
1032 #define YY_NO_PUSH_STATE 1
1033 #define YY_NO_POP_STATE 1
1034 #define YY_NO_TOP_STATE 1
1037 #ifdef YY_MALLOC_DECL
1045 /* Just try to get by without declaring the routines. This will fail
1046 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1047 * or sizeof(void*) != sizeof(int).
1052 /* Amount of stuff to slurp up with each read. */
1053 #ifndef YY_READ_BUF_SIZE
1054 #define YY_READ_BUF_SIZE 8192
1057 /* Copy whatever the last rule matched to the standard output. */
1060 /* This used to be an fputs(), but since the string might contain NUL's,
1061 * we now use fwrite().
1063 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1066 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1067 * is returned in "result".
1070 #define YY_INPUT(buf,result,max_size) \
1071 if ( yy_current_buffer->yy_is_interactive ) \
1074 for ( n = 0; n < max_size && \
1075 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1076 buf[n] = (char) c; \
1078 buf[n++] = (char) c; \
1079 if ( c == EOF && ferror( yyin ) ) \
1080 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1083 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1084 && ferror( yyin ) ) \
1085 YY_FATAL_ERROR( "input in flex scanner failed" );
1088 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1089 * we don't want an extra ';' after the "return" because that will cause
1090 * some compilers to complain about unreachable statements.
1093 #define yyterminate() return YY_NULL
1096 /* Number of entries by which start-condition stack grows. */
1097 #ifndef YY_START_STACK_INCR
1098 #define YY_START_STACK_INCR 25
1101 /* Report a fatal error. */
1102 #ifndef YY_FATAL_ERROR
1103 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1106 /* Default declaration of generated scanner - a define so the user can
1107 * easily add parameters.
1110 #define YY_DECL int yylex YY_PROTO(( void ))
1113 /* Code executed at the beginning of each rule, after yytext and yyleng
1116 #ifndef YY_USER_ACTION
1117 #define YY_USER_ACTION
1120 /* Code executed at the end of each rule. */
1122 #define YY_BREAK break;
1125 #define YY_RULE_SETUP \
1127 yy_current_buffer->yy_at_bol = \
1128 (yytext[yyleng - 1] == '\n'); \
1133 register yy_state_type yy_current_state;
1134 register char *yy_cp, *yy_bp;
1135 register int yy_act;
1137 #line 113 "parse.lex"
1139 #line 1140 "lex.yy.c"
1150 yy_start = 1; /* first start state */
1158 if ( ! yy_current_buffer )
1160 yy_create_buffer( yyin, YY_BUF_SIZE );
1162 yy_load_buffer_state();
1165 while ( 1 ) /* loops until end-of-file is reached */
1169 /* Support of yytext. */
1170 *yy_cp = yy_hold_char;
1172 /* yy_bp points to the position in yy_ch_buf of the start of
1177 yy_current_state = yy_start;
1178 yy_current_state += YY_AT_BOL();
1182 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1183 if ( yy_accept[yy_current_state] )
1185 yy_last_accepting_state = yy_current_state;
1186 yy_last_accepting_cpos = yy_cp;
1188 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1190 yy_current_state = (int) yy_def[yy_current_state];
1191 if ( yy_current_state >= 299 )
1192 yy_c = yy_meta[(unsigned int) yy_c];
1194 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1197 while ( yy_base[yy_current_state] != 1808 );
1200 yy_act = yy_accept[yy_current_state];
1202 { /* have to back up */
1203 yy_cp = yy_last_accepting_cpos;
1204 yy_current_state = yy_last_accepting_state;
1205 yy_act = yy_accept[yy_current_state];
1208 YY_DO_BEFORE_ACTION;
1211 do_action: /* This label is used only to access EOF actions. */
1215 { /* beginning of action switch */
1216 case 0: /* must back up */
1217 /* undo the effects of YY_DO_BEFORE_ACTION */
1218 *yy_cp = yy_hold_char;
1219 yy_cp = yy_last_accepting_cpos;
1220 yy_current_state = yy_last_accepting_state;
1221 goto yy_find_action;
1225 #line 114 "parse.lex"
1230 #line 116 "parse.lex"
1233 LEXTRACE("DEFVAR ");
1234 fill(yytext, yyleng);
1241 #line 124 "parse.lex"
1250 #line 130 "parse.lex"
1258 #line 135 "parse.lex"
1266 #line 140 "parse.lex"
1274 #line 145 "parse.lex"
1276 LEXTRACE("WORD(1) ");
1277 fill(yytext + 1, yyleng - 2);
1283 #line 151 "parse.lex"
1285 LEXTRACE("WORD(2) ");
1286 fill(yytext, yyleng);
1294 #line 159 "parse.lex"
1296 LEXTRACE("QUOTEDCHAR ");
1297 fill_args(yytext + 1, 1, sawspace);
1303 #line 165 "parse.lex"
1308 } /* end of command line args */
1312 #line 171 "parse.lex"
1315 fill_args(yytext, yyleng, sawspace);
1317 } /* a command line arg */
1322 #line 178 "parse.lex"
1325 switch (yytext[8]) {
1327 LEXTRACE("DEFAULTS_USER ");
1328 return(DEFAULTS_USER);
1330 LEXTRACE("DEFAULTS_HOST ");
1331 return(DEFAULTS_HOST);
1333 LEXTRACE("DEFAULTS ");
1340 #line 193 "parse.lex"
1342 fill(yytext, yyleng);
1345 LEXTRACE("HOSTALIAS ");
1348 LEXTRACE("CMNDALIAS ");
1351 LEXTRACE("USERALIAS ");
1354 LEXTRACE("RUNASALIAS ");
1362 #line 212 "parse.lex"
1364 /* cmnd does not require passwd for this user */
1365 LEXTRACE("NOPASSWD ");
1371 #line 218 "parse.lex"
1373 /* cmnd requires passwd for this user */
1374 LEXTRACE("PASSWD ");
1380 #line 224 "parse.lex"
1383 fill(yytext, yyleng);
1384 LEXTRACE("NETGROUP ");
1390 #line 231 "parse.lex"
1393 fill(yytext, yyleng);
1400 #line 238 "parse.lex"
1402 fill(yytext, yyleng);
1403 LEXTRACE("NTWKADDR ");
1409 #line 244 "parse.lex"
1411 fill(yytext, yyleng);
1412 LEXTRACE("NTWKADDR ");
1418 #line 250 "parse.lex"
1427 #line 256 "parse.lex"
1429 if (strcmp(yytext, "ALL") == 0) {
1433 fill(yytext, yyleng);
1441 #line 267 "parse.lex"
1443 /* username/uid that user can run command as */
1444 fill(yytext, yyleng);
1445 LEXTRACE("WORD(3) ");
1451 #line 274 "parse.lex"
1458 #line 278 "parse.lex"
1460 /* directories can't have args... */
1461 if (yytext[yyleng - 1] == '/') {
1462 LEXTRACE("COMMAND ");
1463 fill_cmnd(yytext, yyleng);
1467 LEXTRACE("COMMAND ");
1468 fill_cmnd(yytext, yyleng);
1474 #line 291 "parse.lex"
1477 fill(yytext, yyleng);
1478 LEXTRACE("WORD(4) ");
1484 #line 298 "parse.lex"
1492 #line 303 "parse.lex"
1500 #line 308 "parse.lex"
1508 #line 313 "parse.lex"
1510 if (yyleng % 2 == 1)
1511 return('!'); /* return '!' */
1516 #line 318 "parse.lex"
1522 } /* return newline */
1526 #line 325 "parse.lex"
1527 { /* throw away space/tabs */
1528 sawspace = TRUE; /* but remember for fill_args */
1533 #line 329 "parse.lex"
1535 sawspace = TRUE; /* remember for fill_args */
1538 } /* throw away EOL after \ */
1542 #line 335 "parse.lex"
1548 } /* return comments */
1552 #line 342 "parse.lex"
1560 #line 347 "parse.lex"
1563 #line 1564 "lex.yy.c"
1564 case YY_STATE_EOF(INITIAL):
1565 case YY_STATE_EOF(GOTRUNAS):
1566 case YY_STATE_EOF(GOTDEFS):
1567 case YY_STATE_EOF(GOTCMND):
1568 case YY_STATE_EOF(STARTDEFS):
1569 case YY_STATE_EOF(INDEFS):
1572 case YY_END_OF_BUFFER:
1574 /* Amount of text matched not including the EOB char. */
1575 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1577 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1578 *yy_cp = yy_hold_char;
1579 YY_RESTORE_YY_MORE_OFFSET
1581 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1583 /* We're scanning a new file or input source. It's
1584 * possible that this happened because the user
1585 * just pointed yyin at a new source and called
1586 * yylex(). If so, then we have to assure
1587 * consistency between yy_current_buffer and our
1588 * globals. Here is the right place to do so, because
1589 * this is the first action (other than possibly a
1590 * back-up) that will match for the new input source.
1592 yy_n_chars = yy_current_buffer->yy_n_chars;
1593 yy_current_buffer->yy_input_file = yyin;
1594 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1597 /* Note that here we test for yy_c_buf_p "<=" to the position
1598 * of the first EOB in the buffer, since yy_c_buf_p will
1599 * already have been incremented past the NUL character
1600 * (since all states make transitions on EOB to the
1601 * end-of-buffer state). Contrast this with the test
1604 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1605 { /* This was really a NUL. */
1606 yy_state_type yy_next_state;
1608 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1610 yy_current_state = yy_get_previous_state();
1612 /* Okay, we're now positioned to make the NUL
1613 * transition. We couldn't have
1614 * yy_get_previous_state() go ahead and do it
1615 * for us because it doesn't know how to deal
1616 * with the possibility of jamming (and we don't
1617 * want to build jamming into it because then it
1618 * will run more slowly).
1621 yy_next_state = yy_try_NUL_trans( yy_current_state );
1623 yy_bp = yytext_ptr + YY_MORE_ADJ;
1625 if ( yy_next_state )
1627 /* Consume the NUL. */
1628 yy_cp = ++yy_c_buf_p;
1629 yy_current_state = yy_next_state;
1636 goto yy_find_action;
1640 else switch ( yy_get_next_buffer() )
1642 case EOB_ACT_END_OF_FILE:
1644 yy_did_buffer_switch_on_eof = 0;
1648 /* Note: because we've taken care in
1649 * yy_get_next_buffer() to have set up
1650 * yytext, we can now set up
1651 * yy_c_buf_p so that if some total
1652 * hoser (like flex itself) wants to
1653 * call the scanner after we return the
1654 * YY_NULL, it'll still work - another
1655 * YY_NULL will get returned.
1657 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1659 yy_act = YY_STATE_EOF(YY_START);
1665 if ( ! yy_did_buffer_switch_on_eof )
1671 case EOB_ACT_CONTINUE_SCAN:
1673 yytext_ptr + yy_amount_of_matched_text;
1675 yy_current_state = yy_get_previous_state();
1678 yy_bp = yytext_ptr + YY_MORE_ADJ;
1681 case EOB_ACT_LAST_MATCH:
1683 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1685 yy_current_state = yy_get_previous_state();
1688 yy_bp = yytext_ptr + YY_MORE_ADJ;
1689 goto yy_find_action;
1696 "fatal flex scanner internal error--no action found" );
1697 } /* end of action switch */
1698 } /* end of scanning one token */
1699 } /* end of yylex */
1702 /* yy_get_next_buffer - try to read in a new buffer
1704 * Returns a code representing an action:
1705 * EOB_ACT_LAST_MATCH -
1706 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1707 * EOB_ACT_END_OF_FILE - end of file
1710 static int yy_get_next_buffer()
1712 register char *dest = yy_current_buffer->yy_ch_buf;
1713 register char *source = yytext_ptr;
1714 register int number_to_move, i;
1717 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1719 "fatal flex scanner internal error--end of buffer missed" );
1721 if ( yy_current_buffer->yy_fill_buffer == 0 )
1722 { /* Don't try to fill the buffer, so this is an EOF. */
1723 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1725 /* We matched a single character, the EOB, so
1726 * treat this as a final EOF.
1728 return EOB_ACT_END_OF_FILE;
1733 /* We matched some text prior to the EOB, first
1736 return EOB_ACT_LAST_MATCH;
1740 /* Try to read more data. */
1742 /* First move last chars to start of buffer. */
1743 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1745 for ( i = 0; i < number_to_move; ++i )
1746 *(dest++) = *(source++);
1748 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1749 /* don't do the read, it's not guaranteed to return an EOF,
1752 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1757 yy_current_buffer->yy_buf_size - number_to_move - 1;
1759 while ( num_to_read <= 0 )
1760 { /* Not enough room in the buffer - grow it. */
1761 #ifdef YY_USES_REJECT
1763 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1766 /* just a shorter name for the current buffer */
1767 YY_BUFFER_STATE b = yy_current_buffer;
1769 int yy_c_buf_p_offset =
1770 (int) (yy_c_buf_p - b->yy_ch_buf);
1772 if ( b->yy_is_our_buffer )
1774 int new_size = b->yy_buf_size * 2;
1776 if ( new_size <= 0 )
1777 b->yy_buf_size += b->yy_buf_size / 8;
1779 b->yy_buf_size *= 2;
1781 b->yy_ch_buf = (char *)
1782 /* Include room in for 2 EOB chars. */
1783 yy_flex_realloc( (void *) b->yy_ch_buf,
1784 b->yy_buf_size + 2 );
1787 /* Can't grow it, we don't own it. */
1790 if ( ! b->yy_ch_buf )
1792 "fatal error - scanner input buffer overflow" );
1794 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1796 num_to_read = yy_current_buffer->yy_buf_size -
1801 if ( num_to_read > YY_READ_BUF_SIZE )
1802 num_to_read = YY_READ_BUF_SIZE;
1804 /* Read in more data. */
1805 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1806 yy_n_chars, num_to_read );
1808 yy_current_buffer->yy_n_chars = yy_n_chars;
1811 if ( yy_n_chars == 0 )
1813 if ( number_to_move == YY_MORE_ADJ )
1815 ret_val = EOB_ACT_END_OF_FILE;
1821 ret_val = EOB_ACT_LAST_MATCH;
1822 yy_current_buffer->yy_buffer_status =
1823 YY_BUFFER_EOF_PENDING;
1828 ret_val = EOB_ACT_CONTINUE_SCAN;
1830 yy_n_chars += number_to_move;
1831 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1832 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1834 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1840 /* yy_get_previous_state - get the state just before the EOB char was reached */
1842 static yy_state_type yy_get_previous_state()
1844 register yy_state_type yy_current_state;
1845 register char *yy_cp;
1847 yy_current_state = yy_start;
1848 yy_current_state += YY_AT_BOL();
1850 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1852 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1853 if ( yy_accept[yy_current_state] )
1855 yy_last_accepting_state = yy_current_state;
1856 yy_last_accepting_cpos = yy_cp;
1858 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1860 yy_current_state = (int) yy_def[yy_current_state];
1861 if ( yy_current_state >= 299 )
1862 yy_c = yy_meta[(unsigned int) yy_c];
1864 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1867 return yy_current_state;
1871 /* yy_try_NUL_trans - try to make a transition on the NUL character
1874 * next_state = yy_try_NUL_trans( current_state );
1877 #ifdef YY_USE_PROTOS
1878 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1880 static yy_state_type yy_try_NUL_trans( yy_current_state )
1881 yy_state_type yy_current_state;
1884 register int yy_is_jam;
1885 register char *yy_cp = yy_c_buf_p;
1887 register YY_CHAR yy_c = 1;
1888 if ( yy_accept[yy_current_state] )
1890 yy_last_accepting_state = yy_current_state;
1891 yy_last_accepting_cpos = yy_cp;
1893 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1895 yy_current_state = (int) yy_def[yy_current_state];
1896 if ( yy_current_state >= 299 )
1897 yy_c = yy_meta[(unsigned int) yy_c];
1899 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1900 yy_is_jam = (yy_current_state == 298);
1902 return yy_is_jam ? 0 : yy_current_state;
1907 #ifdef YY_USE_PROTOS
1908 static void yyunput( int c, register char *yy_bp )
1910 static void yyunput( c, yy_bp )
1912 register char *yy_bp;
1915 register char *yy_cp = yy_c_buf_p;
1917 /* undo effects of setting up yytext */
1918 *yy_cp = yy_hold_char;
1920 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1921 { /* need to shift things up to make room */
1922 /* +2 for EOB chars. */
1923 register int number_to_move = yy_n_chars + 2;
1924 register char *dest = &yy_current_buffer->yy_ch_buf[
1925 yy_current_buffer->yy_buf_size + 2];
1926 register char *source =
1927 &yy_current_buffer->yy_ch_buf[number_to_move];
1929 while ( source > yy_current_buffer->yy_ch_buf )
1930 *--dest = *--source;
1932 yy_cp += (int) (dest - source);
1933 yy_bp += (int) (dest - source);
1934 yy_current_buffer->yy_n_chars =
1935 yy_n_chars = yy_current_buffer->yy_buf_size;
1937 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1938 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1941 *--yy_cp = (char) c;
1945 yy_hold_char = *yy_cp;
1948 #endif /* ifndef YY_NO_UNPUT */
1952 static int yyinput()
1959 *yy_c_buf_p = yy_hold_char;
1961 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1963 /* yy_c_buf_p now points to the character we want to return.
1964 * If this occurs *before* the EOB characters, then it's a
1965 * valid NUL; if not, then we've hit the end of the buffer.
1967 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1968 /* This was really a NUL. */
1972 { /* need more input */
1973 int offset = yy_c_buf_p - yytext_ptr;
1976 switch ( yy_get_next_buffer() )
1978 case EOB_ACT_LAST_MATCH:
1979 /* This happens because yy_g_n_b()
1980 * sees that we've accumulated a
1981 * token and flags that we need to
1982 * try matching the token before
1983 * proceeding. But for input(),
1984 * there's no matching to consider.
1985 * So convert the EOB_ACT_LAST_MATCH
1986 * to EOB_ACT_END_OF_FILE.
1989 /* Reset buffer status. */
1994 case EOB_ACT_END_OF_FILE:
1999 if ( ! yy_did_buffer_switch_on_eof )
2008 case EOB_ACT_CONTINUE_SCAN:
2009 yy_c_buf_p = yytext_ptr + offset;
2015 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2016 *yy_c_buf_p = '\0'; /* preserve yytext */
2017 yy_hold_char = *++yy_c_buf_p;
2019 yy_current_buffer->yy_at_bol = (c == '\n');
2025 #ifdef YY_USE_PROTOS
2026 void yyrestart( FILE *input_file )
2028 void yyrestart( input_file )
2032 if ( ! yy_current_buffer )
2033 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2035 yy_init_buffer( yy_current_buffer, input_file );
2036 yy_load_buffer_state();
2040 #ifdef YY_USE_PROTOS
2041 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2043 void yy_switch_to_buffer( new_buffer )
2044 YY_BUFFER_STATE new_buffer;
2047 if ( yy_current_buffer == new_buffer )
2050 if ( yy_current_buffer )
2052 /* Flush out information for old buffer. */
2053 *yy_c_buf_p = yy_hold_char;
2054 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2055 yy_current_buffer->yy_n_chars = yy_n_chars;
2058 yy_current_buffer = new_buffer;
2059 yy_load_buffer_state();
2061 /* We don't actually know whether we did this switch during
2062 * EOF (yywrap()) processing, but the only time this flag
2063 * is looked at is after yywrap() is called, so it's safe
2064 * to go ahead and always set it.
2066 yy_did_buffer_switch_on_eof = 1;
2070 #ifdef YY_USE_PROTOS
2071 void yy_load_buffer_state( void )
2073 void yy_load_buffer_state()
2076 yy_n_chars = yy_current_buffer->yy_n_chars;
2077 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2078 yyin = yy_current_buffer->yy_input_file;
2079 yy_hold_char = *yy_c_buf_p;
2083 #ifdef YY_USE_PROTOS
2084 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2086 YY_BUFFER_STATE yy_create_buffer( file, size )
2093 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2095 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2097 b->yy_buf_size = size;
2099 /* yy_ch_buf has to be 2 characters longer than the size given because
2100 * we need to put in 2 end-of-buffer characters.
2102 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2103 if ( ! b->yy_ch_buf )
2104 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2106 b->yy_is_our_buffer = 1;
2108 yy_init_buffer( b, file );
2114 #ifdef YY_USE_PROTOS
2115 void yy_delete_buffer( YY_BUFFER_STATE b )
2117 void yy_delete_buffer( b )
2124 if ( b == yy_current_buffer )
2125 yy_current_buffer = (YY_BUFFER_STATE) 0;
2127 if ( b->yy_is_our_buffer )
2128 yy_flex_free( (void *) b->yy_ch_buf );
2130 yy_flex_free( (void *) b );
2134 #ifndef YY_ALWAYS_INTERACTIVE
2135 #ifndef YY_NEVER_INTERACTIVE
2136 extern int isatty YY_PROTO(( int ));
2140 #ifdef YY_USE_PROTOS
2141 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2143 void yy_init_buffer( b, file )
2152 yy_flush_buffer( b );
2154 b->yy_input_file = file;
2155 b->yy_fill_buffer = 1;
2157 #if YY_ALWAYS_INTERACTIVE
2158 b->yy_is_interactive = 1;
2160 #if YY_NEVER_INTERACTIVE
2161 b->yy_is_interactive = 0;
2163 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2170 #ifdef YY_USE_PROTOS
2171 void yy_flush_buffer( YY_BUFFER_STATE b )
2173 void yy_flush_buffer( b )
2183 /* We always need two end-of-buffer characters. The first causes
2184 * a transition to the end-of-buffer state. The second causes
2185 * a jam in that state.
2187 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2188 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2190 b->yy_buf_pos = &b->yy_ch_buf[0];
2193 b->yy_buffer_status = YY_BUFFER_NEW;
2195 if ( b == yy_current_buffer )
2196 yy_load_buffer_state();
2200 #ifndef YY_NO_SCAN_BUFFER
2201 #ifdef YY_USE_PROTOS
2202 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2204 YY_BUFFER_STATE yy_scan_buffer( base, size )
2212 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2213 base[size-1] != YY_END_OF_BUFFER_CHAR )
2214 /* They forgot to leave room for the EOB's. */
2217 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2219 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2221 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2222 b->yy_buf_pos = b->yy_ch_buf = base;
2223 b->yy_is_our_buffer = 0;
2224 b->yy_input_file = 0;
2225 b->yy_n_chars = b->yy_buf_size;
2226 b->yy_is_interactive = 0;
2228 b->yy_fill_buffer = 0;
2229 b->yy_buffer_status = YY_BUFFER_NEW;
2231 yy_switch_to_buffer( b );
2238 #ifndef YY_NO_SCAN_STRING
2239 #ifdef YY_USE_PROTOS
2240 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2242 YY_BUFFER_STATE yy_scan_string( yy_str )
2243 yyconst char *yy_str;
2247 for ( len = 0; yy_str[len]; ++len )
2250 return yy_scan_bytes( yy_str, len );
2255 #ifndef YY_NO_SCAN_BYTES
2256 #ifdef YY_USE_PROTOS
2257 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2259 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2260 yyconst char *bytes;
2269 /* Get memory for full buffer, including space for trailing EOB's. */
2271 buf = (char *) yy_flex_alloc( n );
2273 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2275 for ( i = 0; i < len; ++i )
2278 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2280 b = yy_scan_buffer( buf, n );
2282 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2284 /* It's okay to grow etc. this buffer, and we should throw it
2285 * away when we're done.
2287 b->yy_is_our_buffer = 1;
2294 #ifndef YY_NO_PUSH_STATE
2295 #ifdef YY_USE_PROTOS
2296 static void yy_push_state( int new_state )
2298 static void yy_push_state( new_state )
2302 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2306 yy_start_stack_depth += YY_START_STACK_INCR;
2307 new_size = yy_start_stack_depth * sizeof( int );
2309 if ( ! yy_start_stack )
2310 yy_start_stack = (int *) yy_flex_alloc( new_size );
2313 yy_start_stack = (int *) yy_flex_realloc(
2314 (void *) yy_start_stack, new_size );
2316 if ( ! yy_start_stack )
2318 "out of memory expanding start-condition stack" );
2321 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2328 #ifndef YY_NO_POP_STATE
2329 static void yy_pop_state()
2331 if ( --yy_start_stack_ptr < 0 )
2332 YY_FATAL_ERROR( "start-condition stack underflow" );
2334 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2339 #ifndef YY_NO_TOP_STATE
2340 static int yy_top_state()
2342 return yy_start_stack[yy_start_stack_ptr - 1];
2346 #ifndef YY_EXIT_FAILURE
2347 #define YY_EXIT_FAILURE 2
2350 #ifdef YY_USE_PROTOS
2351 static void yy_fatal_error( yyconst char msg[] )
2353 static void yy_fatal_error( msg )
2357 (void) fprintf( stderr, "%s\n", msg );
2358 exit( YY_EXIT_FAILURE );
2363 /* Redefine yyless() so it works in section 3 code. */
2369 /* Undo effects of setting up yytext. */ \
2370 yytext[yyleng] = yy_hold_char; \
2371 yy_c_buf_p = yytext + n; \
2372 yy_hold_char = *yy_c_buf_p; \
2373 *yy_c_buf_p = '\0'; \
2379 /* Internal utility routines. */
2382 #ifdef YY_USE_PROTOS
2383 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2385 static void yy_flex_strncpy( s1, s2, n )
2392 for ( i = 0; i < n; ++i )
2397 #ifdef YY_NEED_STRLEN
2398 #ifdef YY_USE_PROTOS
2399 static int yy_flex_strlen( yyconst char *s )
2401 static int yy_flex_strlen( s )
2406 for ( n = 0; s[n]; ++n )
2414 #ifdef YY_USE_PROTOS
2415 static void *yy_flex_alloc( yy_size_t size )
2417 static void *yy_flex_alloc( size )
2421 return (void *) malloc( size );
2424 #ifdef YY_USE_PROTOS
2425 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2427 static void *yy_flex_realloc( ptr, size )
2432 /* The cast to (char *) in the following accommodates both
2433 * implementations that use char* generic pointers, and those
2434 * that use void* generic pointers. It works with the latter
2435 * because both ANSI C and C++ allow castless assignment from
2436 * any pointer type to void*, and deal with argument conversions
2437 * as though doing an assignment.
2439 return (void *) realloc( (char *) ptr, size );
2442 #ifdef YY_USE_PROTOS
2443 static void yy_flex_free( void *ptr )
2445 static void yy_flex_free( ptr )
2459 #line 347 "parse.lex"
2468 yylval.string = (char *) malloc(len + 1);
2469 if (yylval.string == NULL)
2470 yyerror("unable to allocate memory");
2472 /* Copy the string and collapse any escaped characters. */
2473 for (i = 0, j = 0; i < len; i++, j++) {
2474 if (s[i] == '\\' && i != len - 1)
2475 yylval.string[j] = s[++i];
2477 yylval.string[j] = s[i];
2479 yylval.string[j] = '\0';
2487 arg_len = arg_size = 0;
2489 yylval.command.cmnd = (char *) malloc(len + 1);
2490 if (yylval.command.cmnd == NULL)
2491 yyerror("unable to allocate memory");
2493 /* copy the string and NULL-terminate it (escapes handled by fnmatch) */
2494 (void) strncpy(yylval.command.cmnd, s, len);
2495 yylval.command.cmnd[len] = '\0';
2497 yylval.command.args = NULL;
2501 fill_args(s, len, addspace)
2510 * If first arg, malloc() some room, else if we don't
2511 * have enough space realloc() some more.
2513 if (yylval.command.args == NULL) {
2517 while (new_len >= (arg_size += COMMANDARGINC))
2520 yylval.command.args = (char *) malloc(arg_size);
2521 if (yylval.command.args == NULL)
2522 yyerror("unable to allocate memory");
2524 new_len = arg_len + len + addspace;
2526 if (new_len >= arg_size) {
2527 /* Allocate more space than we need for subsequent args */
2528 while (new_len >= (arg_size += COMMANDARGINC))
2531 if ((p = (char *) realloc(yylval.command.args, arg_size)) == NULL) {
2532 free(yylval.command.args);
2533 yyerror("unable to allocate memory");
2535 yylval.command.args = p;
2539 /* Efficiently append the arg (with a leading space if needed). */
2540 p = yylval.command.args + arg_len;
2543 (void) strcpy(p, s);
2551 /* Free space used by the aliases unless called by testsudoers. */