Files
sudo/toke.c
2004-10-26 22:29:32 +00:00

2796 lines
83 KiB
C

#line 2 "toke.c"
/* $OpenBSD: flex.skl,v 1.8 2004/02/09 11:38:31 espie Exp $ */
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header$
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
#include <errno.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
#include <unistd.h>
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#ifdef __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the yyless() call.
*/
/* Return all but the first 'n' matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
typedef unsigned int yy_size_t;
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*/
#define YY_CURRENT_BUFFER yy_current_buffer
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 42
#define YY_END_OF_BUFFER 43
static yyconst short int yy_accept[385] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 43, 32, 38, 37, 36, 41, 32, 26,
41, 32, 33, 32, 32, 32, 32, 35, 34, 27,
27, 27, 27, 27, 41, 32, 41, 27, 27, 27,
27, 27, 28, 41, 28, 29, 28, 28, 28, 28,
28, 27, 27, 27, 27, 27, 41, 28, 1, 12,
11, 12, 11, 11, 41, 41, 2, 8, 8, 8,
3, 8, 4, 41, 32, 0, 38, 36, 0, 40,
23, 0, 22, 0, 31, 31, 0, 32, 32, 32,
32, 32, 27, 27, 27, 27, 27, 32, 39, 32,
0, 32, 32, 32, 32, 32, 28, 0, 28, 23,
0, 22, 0, 28, 0, 28, 28, 28, 28, 28,
27, 27, 27, 27, 27, 28, 28, 1, 12, 12,
10, 9, 10, 0, 2, 8, 0, 8, 0, 0,
5, 6, 8, 8, 0, 32, 32, 32, 27, 27,
27, 27, 27, 27, 32, 0, 32, 32, 32, 32,
32, 28, 28, 28, 27, 27, 27, 27, 27, 27,
28, 7, 7, 0, 7, 8, 32, 32, 32, 32,
32, 27, 27, 27, 27, 27, 27, 32, 0, 32,
32, 32, 28, 28, 28, 28, 28, 27, 27, 27,
27, 27, 27, 28, 7, 32, 32, 32, 0, 19,
27, 27, 27, 27, 27, 32, 0, 32, 32, 28,
28, 28, 27, 27, 27, 27, 27, 28, 32, 32,
32, 32, 32, 27, 27, 27, 27, 27, 32, 0,
32, 32, 28, 28, 28, 28, 28, 27, 27, 27,
27, 27, 28, 24, 24, 24, 27, 0, 18, 27,
27, 0, 17, 32, 0, 32, 32, 24, 24, 24,
27, 27, 27, 28, 32, 24, 24, 24, 24, 0,
21, 27, 27, 30, 0, 32, 14, 28, 24, 24,
24, 24, 27, 27, 28, 32, 25, 25, 25, 27,
0, 16, 0, 32, 0, 32, 28, 25, 25, 25,
27, 32, 32, 25, 25, 25, 25, 25, 0, 20,
0, 0, 13, 15, 14, 0, 14, 0, 28, 28,
25, 25, 25, 25, 25, 32, 32, 32, 25, 25,
28, 28, 28, 25, 25, 32, 32, 32, 32, 32,
28, 28, 28, 28, 28, 32, 32, 32, 28, 28,
28, 32, 32, 32, 32, 32, 28, 28, 28, 28,
28, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 0
} ;
static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 5, 6, 1, 7, 1, 1, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 22, 22, 22, 23, 1, 1,
24, 25, 10, 26, 27, 28, 29, 30, 31, 28,
28, 32, 33, 28, 28, 28, 34, 35, 36, 37,
28, 38, 39, 40, 41, 28, 42, 43, 28, 28,
10, 44, 10, 1, 45, 1, 46, 47, 48, 49,
50, 51, 47, 47, 52, 47, 47, 53, 54, 55,
56, 47, 47, 57, 58, 59, 60, 47, 47, 47,
47, 47, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst int yy_meta[61] =
{ 0,
1, 2, 2, 3, 1, 4, 1, 3, 3, 1,
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 5, 4, 3, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 6, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7
} ;
static yyconst short int yy_base[407] =
{ 0,
0, 55, 96, 0, 60, 61, 155, 160, 203, 262,
321, 364, 1480, 1435, 1476, 2057, 1473, 1473, 1431, 2057,
2057, 1421, 2057, 166, 176, 197, 253, 2057, 2057, 408,
1421, 1427, 1426, 1434, 467, 20, 170, 1397, 1400, 1393,
1388, 1389, 1392, 57, 1391, 2057, 1390, 177, 330, 339,
373, 492, 1389, 1386, 1385, 1390, 551, 21, 1402, 0,
2057, 1391, 0, 2057, 567, 69, 0, 1345, 580, 136,
2057, 144, 2057, 80, 1344, 221, 1377, 1374, 1372, 2057,
1329, 275, 1322, 492, 376, 1321, 591, 319, 157, 609,
618, 627, 0, 1328, 1323, 55, 1318, 232, 2057, 46,
173, 145, 180, 168, 188, 44, 1311, 652, 272, 1310,
661, 1305, 685, 670, 694, 704, 194, 713, 722, 733,
0, 1316, 1304, 205, 1272, 299, 133, 1308, 0, 1288,
293, 2057, 2057, 301, 0, 1238, 556, 756, 337, 359,
2057, 2057, 1237, 327, 582, 753, 765, 774, 1224, 1219,
1181, 1187, 1186, 1155, 342, 234, 329, 234, 338, 356,
355, 785, 794, 803, 1155, 1142, 1122, 1128, 1118, 1097,
360, 1091, 2057, 367, 825, 830, 839, 552, 859, 868,
877, 408, 1094, 1075, 1070, 1065, 1034, 428, 429, 361,
143, 430, 888, 558, 897, 906, 917, 585, 1035, 1043,
1038, 1006, 994, 433, 573, 926, 935, 946, 587, 2057,
999, 969, 906, 891, 872, 436, 553, 352, 442, 955,
964, 975, 865, 863, 801, 787, 768, 440, 984, 598,
993, 1004, 1013, 751, 596, 725, 714, 599, 605, 237,
565, 607, 1022, 606, 1033, 1042, 1051, 677, 657, 665,
646, 681, 638, 1063, 1072, 1081, 690, 705, 2057, 636,
625, 714, 2057, 701, 618, 711, 523, 1093, 1102, 1111,
839, 597, 577, 804, 1122, 637, 1132, 1141, 1152, 841,
2057, 523, 842, 443, 562, 655, 827, 1161, 824, 1171,
1182, 1191, 443, 843, 389, 1200, 1211, 1220, 1229, 844,
849, 2057, 709, 720, 370, 363, 1240, 1249, 1258, 1269,
1172, 1278, 732, 1287, 1298, 1307, 1316, 1327, 1338, 2057,
351, 897, 2057, 287, 284, 1344, 261, 1368, 1365, 826,
1380, 1394, 1409, 1423, 1389, 1438, 1452, 1467, 1481, 1346,
1496, 1510, 1525, 1539, 1402, 1546, 915, 1556, 1575, 1585,
1591, 944, 1604, 1620, 1633, 1641, 1651, 1662, 1672, 1682,
1691, 1701, 973, 1711, 1720, 1730, 1740, 1002, 1749, 1759,
1769, 1778, 1788, 1798, 1807, 1817, 1827, 125, 1836, 1846,
121, 1856, 1865, 2057, 1909, 1916, 1923, 1930, 1937, 1944,
1951, 1958, 1965, 1972, 1979, 1986, 1993, 84, 2000, 2007,
2014, 2021, 2028, 2035, 2042, 2049
} ;
static yyconst short int yy_def[407] =
{ 0,
384, 1, 384, 3, 1, 1, 385, 385, 386, 386,
387, 387, 384, 388, 384, 384, 384, 389, 390, 384,
384, 391, 384, 392, 388, 388, 388, 384, 384, 384,
30, 30, 30, 30, 388, 388, 389, 30, 30, 30,
30, 30, 393, 384, 394, 384, 395, 396, 393, 393,
393, 384, 52, 52, 52, 52, 393, 393, 384, 397,
384, 397, 397, 384, 384, 384, 398, 399, 400, 399,
384, 399, 384, 401, 388, 388, 384, 384, 389, 384,
390, 390, 391, 391, 392, 402, 388, 388, 388, 388,
388, 388, 30, 30, 30, 30, 30, 388, 384, 388,
389, 388, 388, 388, 388, 388, 393, 393, 384, 394,
394, 395, 395, 396, 393, 393, 393, 393, 393, 393,
52, 52, 52, 52, 52, 393, 393, 384, 397, 397,
384, 384, 384, 384, 398, 399, 399, 400, 403, 400,
384, 384, 399, 399, 384, 388, 388, 388, 30, 30,
30, 30, 30, 30, 388, 389, 388, 388, 388, 388,
388, 393, 393, 393, 52, 52, 52, 52, 52, 52,
393, 399, 384, 403, 400, 400, 388, 388, 388, 388,
388, 30, 30, 30, 30, 30, 30, 388, 389, 388,
388, 388, 393, 393, 393, 393, 393, 52, 52, 52,
52, 52, 52, 393, 403, 388, 388, 388, 384, 384,
30, 30, 30, 30, 30, 388, 389, 388, 388, 393,
393, 393, 52, 52, 52, 52, 52, 393, 388, 388,
388, 388, 388, 30, 30, 30, 30, 30, 388, 389,
388, 388, 393, 393, 393, 393, 393, 52, 52, 52,
52, 52, 393, 388, 388, 388, 30, 384, 384, 30,
30, 384, 384, 388, 389, 388, 388, 393, 393, 393,
52, 52, 52, 393, 388, 388, 388, 388, 388, 384,
384, 30, 30, 388, 389, 388, 388, 393, 393, 393,
393, 393, 52, 52, 393, 388, 388, 388, 388, 30,
384, 384, 404, 388, 405, 406, 393, 393, 393, 393,
52, 388, 388, 388, 388, 388, 388, 388, 384, 384,
404, 404, 384, 388, 405, 405, 406, 406, 393, 393,
393, 393, 393, 393, 393, 388, 388, 388, 388, 388,
393, 393, 393, 393, 393, 388, 388, 388, 388, 388,
393, 393, 393, 393, 393, 388, 388, 388, 393, 393,
393, 388, 388, 388, 388, 388, 393, 393, 393, 393,
393, 388, 388, 388, 393, 393, 393, 388, 388, 388,
393, 393, 393, 0, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384
} ;
static yyconst short int yy_nxt[2118] =
{ 0,
14, 15, 16, 17, 14, 18, 19, 20, 21, 14,
22, 23, 14, 14, 24, 25, 26, 27, 25, 25,
25, 25, 28, 29, 21, 14, 30, 30, 30, 30,
31, 30, 30, 32, 33, 30, 34, 30, 30, 30,
30, 30, 30, 35, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 36, 14, 14,
37, 59, 59, 76, 108, 21, 21, 21, 21, 109,
134, 99, 109, 109, 109, 109, 109, 109, 109, 100,
127, 144, 99, 38, 39, 151, 40, 76, 152, 76,
135, 153, 41, 161, 155, 42, 43, 15, 16, 17,
43, 44, 45, 21, 46, 43, 47, 23, 43, 43,
48, 49, 50, 51, 49, 49, 49, 49, 28, 29,
21, 43, 52, 52, 52, 52, 53, 52, 52, 54,
55, 52, 56, 52, 52, 52, 52, 52, 52, 57,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
43, 43, 43, 58, 43, 43, 15, 61, 62, 141,
63, 15, 61, 62, 108, 63, 64, 142, 76, 86,
88, 64, 80, 86, 86, 80, 108, 64, 63, 137,
86, 171, 64, 63, 86, 86, 76, 137, 76, 88,
86, 89, 89, 89, 89, 89, 89, 89, 65, 157,
76, 86, 219, 65, 15, 16, 17, 116, 18, 87,
88, 76, 90, 90, 90, 90, 90, 90, 90, 76,
115, 101, 75, 76, 75, 159, 75, 156, 75, 75,
158, 76, 75, 134, 99, 167, 80, 108, 168, 80,
76, 169, 160, 75, 75, 75, 66, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 67, 67, 15, 16, 17, 88, 18, 91, 91,
91, 91, 91, 92, 89, 76, 81, 76, 81, 191,
81, 189, 81, 81, 109, 265, 81, 109, 109, 109,
109, 109, 109, 109, 134, 99, 76, 81, 81, 81,
134, 99, 134, 99, 328, 66, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 67, 15, 16, 17, 69, 18, 326, 134, 99,
76, 70, 71, 72, 146, 147, 148, 146, 146, 146,
146, 173, 108, 116, 73, 117, 117, 117, 117, 117,
117, 117, 116, 323, 118, 118, 118, 118, 118, 118,
118, 139, 76, 175, 74, 15, 16, 17, 69, 18,
137, 205, 76, 108, 70, 71, 72, 190, 241, 86,
174, 76, 108, 86, 86, 76, 116, 73, 119, 119,
119, 119, 119, 120, 117, 76, 190, 188, 76, 76,
86, 192, 176, 108, 76, 218, 328, 74, 75, 209,
174, 190, 75, 326, 75, 204, 108, 75, 75, 87,
75, 75, 75, 93, 93, 93, 93, 93, 93, 93,
210, 80, 108, 75, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 76, 93, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 98, 99,
75, 76, 75, 76, 75, 75, 108, 216, 75, 76,
311, 217, 228, 108, 239, 76, 76, 190, 253, 75,
75, 75, 107, 83, 242, 83, 107, 83, 107, 83,
83, 107, 107, 83, 107, 107, 107, 121, 121, 121,
121, 121, 121, 121, 83, 83, 83, 107, 121, 121,
121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
121, 121, 121, 121, 121, 108, 121, 107, 107, 107,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
107, 107, 126, 99, 107, 80, 107, 136, 107, 107,
300, 136, 107, 303, 80, 177, 76, 136, 131, 99,
132, 193, 133, 107, 107, 107, 132, 173, 133, 136,
287, 139, 139, 86, 136, 139, 209, 86, 209, 133,
133, 139, 85, 86, 75, 76, 85, 258, 75, 75,
262, 108, 85, 139, 86, 86, 294, 210, 76, 210,
133, 229, 240, 85, 85, 75, 174, 266, 259, 243,
80, 263, 88, 140, 89, 89, 89, 89, 89, 89,
89, 88, 293, 89, 89, 89, 89, 89, 89, 89,
88, 76, 89, 89, 89, 89, 89, 89, 76, 108,
76, 275, 76, 107, 283, 107, 264, 107, 258, 107,
107, 76, 110, 107, 110, 267, 110, 285, 110, 110,
76, 282, 110, 86, 107, 107, 107, 86, 86, 259,
76, 108, 262, 110, 110, 110, 112, 273, 112, 274,
112, 280, 112, 112, 86, 114, 112, 107, 76, 114,
304, 107, 107, 263, 272, 114, 258, 112, 112, 112,
322, 323, 281, 115, 271, 262, 114, 114, 107, 162,
163, 164, 162, 162, 162, 162, 116, 259, 117, 117,
117, 117, 117, 117, 117, 116, 263, 117, 117, 117,
117, 117, 117, 117, 76, 312, 116, 108, 117, 117,
117, 117, 117, 117, 76, 261, 108, 139, 139, 284,
172, 139, 286, 76, 260, 108, 177, 139, 178, 178,
178, 178, 178, 178, 178, 76, 108, 324, 177, 139,
179, 179, 179, 179, 179, 179, 179, 177, 257, 180,
180, 180, 180, 180, 181, 178, 76, 252, 193, 140,
194, 194, 194, 194, 194, 194, 194, 193, 76, 195,
195, 195, 195, 195, 195, 195, 193, 76, 196, 196,
196, 196, 196, 197, 194, 251, 139, 139, 108, 172,
139, 139, 139, 250, 175, 139, 139, 108, 288, 329,
280, 139, 280, 301, 301, 319, 108, 108, 139, 305,
301, 305, 306, 139, 206, 207, 208, 206, 206, 206,
206, 281, 295, 281, 302, 302, 320, 108, 140, 108,
76, 302, 177, 140, 178, 178, 178, 178, 178, 178,
178, 177, 76, 178, 178, 178, 178, 178, 178, 178,
177, 249, 178, 178, 178, 178, 178, 178, 322, 323,
248, 238, 76, 220, 221, 222, 220, 220, 220, 220,
193, 76, 194, 194, 194, 194, 194, 194, 194, 193,
76, 194, 194, 194, 194, 194, 194, 194, 346, 237,
193, 108, 194, 194, 194, 194, 194, 194, 236, 229,
108, 230, 230, 230, 230, 230, 230, 230, 229, 108,
231, 231, 231, 231, 231, 231, 231, 351, 76, 229,
108, 232, 232, 232, 232, 232, 233, 230, 243, 76,
244, 244, 244, 244, 244, 244, 244, 243, 76, 245,
245, 245, 245, 245, 245, 245, 362, 108, 243, 76,
246, 246, 246, 246, 246, 247, 244, 235, 108, 254,
255, 256, 254, 254, 254, 254, 229, 108, 230, 230,
230, 230, 230, 230, 230, 367, 76, 229, 108, 230,
230, 230, 230, 230, 230, 230, 229, 76, 230, 230,
230, 230, 230, 230, 234, 227, 76, 268, 269, 270,
268, 268, 268, 268, 226, 108, 243, 76, 244, 244,
244, 244, 244, 244, 244, 243, 76, 244, 244, 244,
244, 244, 244, 244, 243, 108, 244, 244, 244, 244,
244, 244, 225, 224, 223, 215, 108, 275, 276, 276,
276, 276, 276, 276, 276, 108, 275, 277, 277, 277,
277, 277, 277, 277, 108, 275, 278, 278, 278, 278,
278, 279, 276, 214, 213, 212, 76, 288, 289, 289,
289, 289, 289, 289, 289, 76, 288, 290, 290, 290,
290, 290, 290, 290, 76, 288, 291, 291, 291, 291,
291, 292, 289, 211, 137, 203, 108, 296, 297, 298,
299, 296, 296, 296, 202, 108, 275, 276, 276, 276,
276, 276, 276, 276, 108, 275, 276, 276, 276, 276,
276, 276, 276, 201, 200, 76, 275, 276, 276, 276,
276, 276, 276, 319, 199, 76, 307, 308, 309, 310,
307, 307, 307, 198, 76, 288, 289, 289, 289, 289,
289, 289, 289, 187, 320, 76, 288, 289, 289, 289,
289, 289, 289, 289, 108, 288, 289, 289, 289, 289,
289, 289, 186, 312, 108, 313, 313, 313, 313, 313,
313, 313, 185, 184, 312, 108, 314, 314, 314, 314,
314, 314, 314, 312, 108, 315, 315, 315, 315, 315,
316, 317, 312, 76, 318, 318, 318, 313, 313, 313,
313, 183, 182, 329, 76, 330, 330, 330, 330, 330,
330, 330, 329, 76, 331, 331, 331, 331, 331, 331,
331, 329, 76, 332, 332, 332, 332, 332, 333, 334,
137, 137, 329, 108, 335, 335, 335, 330, 330, 330,
330, 130, 108, 336, 337, 338, 336, 336, 336, 336,
312, 108, 317, 317, 317, 317, 317, 317, 317, 128,
170, 312, 108, 317, 317, 317, 317, 317, 317, 317,
312, 76, 317, 317, 317, 317, 317, 317, 339, 312,
76, 339, 339, 339, 339, 339, 339, 339, 166, 319,
312, 76, 340, 340, 340, 325, 165, 325, 113, 325,
76, 325, 325, 111, 108, 325, 154, 150, 149, 76,
320, 340, 340, 340, 145, 84, 325, 325, 325, 327,
76, 327, 82, 327, 80, 327, 327, 78, 77, 327,
341, 342, 343, 341, 341, 341, 341, 76, 137, 76,
327, 327, 327, 329, 130, 334, 334, 334, 334, 334,
334, 334, 329, 128, 345, 345, 345, 329, 108, 334,
334, 334, 334, 334, 334, 334, 125, 345, 345, 345,
124, 123, 329, 108, 334, 334, 334, 334, 334, 334,
344, 122, 108, 113, 111, 108, 329, 108, 344, 344,
344, 344, 344, 344, 344, 108, 106, 105, 104, 103,
102, 346, 108, 347, 347, 347, 347, 347, 347, 347,
97, 96, 95, 94, 84, 346, 108, 348, 348, 348,
348, 348, 348, 348, 82, 80, 78, 77, 76, 384,
346, 76, 349, 349, 349, 349, 349, 350, 347, 384,
384, 384, 384, 384, 384, 76, 339, 339, 339, 339,
339, 339, 339, 384, 384, 384, 384, 384, 384, 351,
76, 352, 352, 352, 352, 352, 352, 352, 384, 384,
384, 384, 384, 351, 76, 353, 353, 353, 353, 353,
353, 353, 384, 384, 384, 384, 384, 384, 351, 108,
354, 354, 354, 354, 354, 355, 352, 384, 384, 384,
384, 384, 384, 108, 344, 344, 344, 344, 344, 344,
344, 356, 357, 358, 356, 356, 356, 356, 108, 346,
384, 347, 347, 347, 347, 347, 347, 347, 384, 384,
384, 384, 108, 384, 384, 384, 384, 384, 346, 76,
347, 347, 347, 347, 347, 347, 347, 384, 346, 76,
347, 347, 347, 347, 347, 347, 359, 360, 361, 359,
359, 359, 359, 384, 384, 384, 384, 351, 76, 352,
352, 352, 352, 352, 352, 352, 384, 384, 76, 384,
384, 384, 384, 351, 108, 352, 352, 352, 352, 352,
352, 352, 384, 384, 384, 384, 351, 108, 352, 352,
352, 352, 352, 352, 362, 384, 363, 363, 363, 363,
363, 363, 363, 108, 362, 384, 364, 364, 364, 364,
364, 364, 364, 384, 384, 362, 108, 365, 365, 365,
365, 365, 366, 363, 76, 367, 384, 368, 368, 368,
368, 368, 368, 368, 76, 367, 384, 369, 369, 369,
369, 369, 369, 369, 367, 76, 370, 370, 370, 370,
370, 371, 368, 384, 384, 108, 372, 373, 374, 372,
372, 372, 372, 384, 362, 108, 363, 363, 363, 363,
363, 363, 363, 362, 108, 363, 363, 363, 363, 363,
363, 363, 384, 362, 76, 363, 363, 363, 363, 363,
363, 384, 384, 384, 76, 375, 376, 377, 375, 375,
375, 375, 367, 76, 368, 368, 368, 368, 368, 368,
368, 384, 367, 76, 368, 368, 368, 368, 368, 368,
368, 384, 367, 108, 368, 368, 368, 368, 368, 368,
384, 384, 108, 378, 378, 378, 378, 378, 378, 378,
384, 384, 108, 372, 372, 372, 372, 372, 372, 372,
384, 384, 108, 379, 379, 379, 379, 379, 380, 378,
384, 76, 381, 381, 381, 381, 381, 381, 381, 384,
384, 76, 375, 375, 375, 375, 375, 375, 375, 384,
384, 76, 382, 382, 382, 382, 382, 383, 381, 384,
108, 378, 378, 378, 378, 378, 378, 378, 384, 384,
108, 378, 378, 378, 378, 378, 378, 384, 384, 384,
108, 381, 381, 381, 381, 381, 381, 381, 384, 76,
381, 381, 381, 381, 381, 381, 384, 384, 384, 76,
384, 384, 384, 384, 384, 384, 384, 384, 384, 108,
384, 384, 384, 384, 384, 384, 384, 384, 108, 60,
60, 60, 60, 60, 60, 60, 21, 21, 21, 21,
21, 21, 21, 68, 68, 68, 68, 68, 68, 68,
75, 384, 384, 384, 384, 75, 75, 79, 79, 79,
79, 79, 79, 79, 81, 384, 384, 384, 384, 81,
81, 83, 384, 384, 384, 384, 83, 83, 85, 384,
85, 384, 384, 85, 85, 107, 384, 384, 384, 384,
107, 107, 110, 384, 384, 384, 384, 110, 110, 112,
384, 384, 384, 384, 112, 112, 114, 384, 114, 384,
384, 114, 114, 129, 384, 129, 129, 384, 384, 129,
136, 384, 136, 384, 136, 136, 136, 138, 138, 138,
138, 138, 138, 138, 143, 143, 143, 143, 143, 143,
143, 86, 384, 86, 384, 384, 86, 86, 139, 139,
139, 139, 139, 139, 139, 321, 321, 321, 321, 321,
321, 321, 325, 384, 384, 384, 384, 325, 325, 327,
384, 384, 384, 384, 327, 327, 13, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384
} ;
static yyconst short int yy_chk[2118] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 5, 6, 36, 58, 5, 6, 5, 6, 44,
66, 66, 44, 44, 44, 44, 44, 44, 44, 36,
58, 74, 74, 2, 2, 96, 2, 106, 96, 100,
398, 96, 2, 106, 100, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 7, 7, 7, 70,
7, 8, 8, 8, 381, 8, 7, 72, 378, 24,
89, 8, 37, 24, 24, 101, 127, 7, 7, 70,
48, 127, 8, 8, 48, 48, 191, 72, 102, 25,
24, 25, 25, 25, 25, 25, 25, 25, 7, 102,
89, 48, 191, 8, 9, 9, 9, 117, 9, 24,
26, 104, 26, 26, 26, 26, 26, 26, 26, 25,
48, 37, 76, 103, 76, 104, 76, 101, 76, 76,
103, 105, 76, 98, 98, 124, 156, 117, 124, 240,
26, 124, 105, 76, 76, 76, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 10, 10, 10, 27, 10, 27, 27,
27, 27, 27, 27, 27, 98, 82, 158, 82, 158,
82, 156, 82, 82, 109, 240, 82, 109, 109, 109,
109, 109, 109, 109, 131, 131, 27, 82, 82, 82,
126, 126, 134, 134, 327, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 11, 11, 11, 11, 11, 325, 144, 144,
324, 11, 11, 11, 88, 88, 88, 88, 88, 88,
88, 139, 126, 49, 11, 49, 49, 49, 49, 49,
49, 49, 50, 321, 50, 50, 50, 50, 50, 50,
50, 140, 88, 140, 11, 12, 12, 12, 12, 12,
144, 174, 157, 49, 12, 12, 12, 157, 218, 85,
139, 159, 50, 85, 85, 155, 51, 12, 51, 51,
51, 51, 51, 51, 51, 218, 159, 155, 161, 160,
85, 160, 140, 171, 190, 190, 306, 12, 30, 182,
174, 161, 30, 305, 30, 171, 51, 30, 30, 85,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
182, 189, 295, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 35, 35,
35, 188, 35, 192, 35, 35, 204, 188, 35, 216,
293, 189, 204, 228, 216, 219, 284, 192, 228, 35,
35, 35, 52, 84, 219, 84, 52, 84, 52, 84,
84, 52, 52, 84, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 84, 84, 84, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 57, 57, 57, 217, 57, 137, 57, 57,
282, 137, 57, 285, 285, 178, 267, 137, 65, 65,
65, 194, 65, 57, 57, 57, 65, 205, 65, 137,
267, 69, 69, 145, 69, 69, 198, 145, 209, 65,
65, 69, 87, 145, 87, 178, 87, 235, 87, 87,
238, 194, 87, 69, 145, 145, 273, 198, 241, 209,
65, 230, 217, 87, 87, 87, 205, 241, 235, 244,
265, 238, 90, 69, 90, 90, 90, 90, 90, 90,
90, 91, 272, 91, 91, 91, 91, 91, 91, 91,
92, 230, 92, 92, 92, 92, 92, 92, 239, 244,
242, 276, 90, 108, 261, 108, 239, 108, 249, 108,
108, 91, 111, 108, 111, 242, 111, 265, 111, 111,
92, 260, 111, 114, 108, 108, 108, 114, 114, 249,
276, 253, 252, 111, 111, 111, 113, 251, 113, 253,
113, 257, 113, 113, 114, 115, 113, 115, 286, 115,
286, 115, 115, 252, 250, 115, 258, 113, 113, 113,
303, 303, 257, 114, 248, 262, 115, 115, 115, 116,
116, 116, 116, 116, 116, 116, 118, 258, 118, 118,
118, 118, 118, 118, 118, 119, 262, 119, 119, 119,
119, 119, 119, 119, 264, 313, 120, 116, 120, 120,
120, 120, 120, 120, 266, 237, 118, 138, 138, 264,
138, 138, 266, 304, 236, 119, 146, 138, 146, 146,
146, 146, 146, 146, 146, 313, 120, 304, 147, 138,
147, 147, 147, 147, 147, 147, 147, 148, 234, 148,
148, 148, 148, 148, 148, 148, 146, 227, 162, 138,
162, 162, 162, 162, 162, 162, 162, 163, 147, 163,
163, 163, 163, 163, 163, 163, 164, 148, 164, 164,
164, 164, 164, 164, 164, 226, 175, 175, 162, 175,
175, 176, 176, 225, 176, 176, 175, 163, 289, 330,
271, 176, 280, 283, 294, 300, 164, 274, 175, 287,
301, 287, 287, 176, 177, 177, 177, 177, 177, 177,
177, 271, 274, 280, 283, 294, 300, 289, 175, 330,
287, 301, 179, 176, 179, 179, 179, 179, 179, 179,
179, 180, 177, 180, 180, 180, 180, 180, 180, 180,
181, 224, 181, 181, 181, 181, 181, 181, 322, 322,
223, 215, 179, 193, 193, 193, 193, 193, 193, 193,
195, 180, 195, 195, 195, 195, 195, 195, 195, 196,
181, 196, 196, 196, 196, 196, 196, 196, 347, 214,
197, 193, 197, 197, 197, 197, 197, 197, 213, 206,
195, 206, 206, 206, 206, 206, 206, 206, 207, 196,
207, 207, 207, 207, 207, 207, 207, 352, 347, 208,
197, 208, 208, 208, 208, 208, 208, 208, 220, 206,
220, 220, 220, 220, 220, 220, 220, 221, 207, 221,
221, 221, 221, 221, 221, 221, 363, 352, 222, 208,
222, 222, 222, 222, 222, 222, 222, 212, 220, 229,
229, 229, 229, 229, 229, 229, 231, 221, 231, 231,
231, 231, 231, 231, 231, 368, 363, 232, 222, 232,
232, 232, 232, 232, 232, 232, 233, 229, 233, 233,
233, 233, 233, 233, 211, 203, 231, 243, 243, 243,
243, 243, 243, 243, 202, 368, 245, 232, 245, 245,
245, 245, 245, 245, 245, 246, 233, 246, 246, 246,
246, 246, 246, 246, 247, 243, 247, 247, 247, 247,
247, 247, 201, 200, 199, 187, 245, 254, 254, 254,
254, 254, 254, 254, 254, 246, 255, 255, 255, 255,
255, 255, 255, 255, 247, 256, 256, 256, 256, 256,
256, 256, 256, 186, 185, 184, 254, 268, 268, 268,
268, 268, 268, 268, 268, 255, 269, 269, 269, 269,
269, 269, 269, 269, 256, 270, 270, 270, 270, 270,
270, 270, 270, 183, 172, 170, 268, 275, 275, 275,
275, 275, 275, 275, 169, 269, 277, 277, 277, 277,
277, 277, 277, 277, 270, 278, 278, 278, 278, 278,
278, 278, 278, 168, 167, 275, 279, 279, 279, 279,
279, 279, 279, 311, 166, 277, 288, 288, 288, 288,
288, 288, 288, 165, 278, 290, 290, 290, 290, 290,
290, 290, 290, 154, 311, 279, 291, 291, 291, 291,
291, 291, 291, 291, 288, 292, 292, 292, 292, 292,
292, 292, 153, 296, 290, 296, 296, 296, 296, 296,
296, 296, 152, 151, 297, 291, 297, 297, 297, 297,
297, 297, 297, 298, 292, 298, 298, 298, 298, 298,
298, 298, 299, 296, 299, 299, 299, 299, 299, 299,
299, 150, 149, 307, 297, 307, 307, 307, 307, 307,
307, 307, 308, 298, 308, 308, 308, 308, 308, 308,
308, 309, 299, 309, 309, 309, 309, 309, 309, 309,
143, 136, 310, 307, 310, 310, 310, 310, 310, 310,
310, 130, 308, 312, 312, 312, 312, 312, 312, 312,
314, 309, 314, 314, 314, 314, 314, 314, 314, 128,
125, 315, 310, 315, 315, 315, 315, 315, 315, 315,
316, 312, 316, 316, 316, 316, 316, 316, 316, 317,
314, 317, 317, 317, 317, 317, 317, 317, 123, 319,
318, 315, 318, 318, 318, 326, 122, 326, 112, 326,
316, 326, 326, 110, 107, 326, 97, 95, 94, 317,
319, 340, 340, 340, 86, 83, 326, 326, 326, 328,
318, 328, 81, 328, 79, 328, 328, 78, 77, 328,
329, 329, 329, 329, 329, 329, 329, 75, 68, 340,
328, 328, 328, 331, 62, 331, 331, 331, 331, 331,
331, 331, 335, 59, 335, 335, 335, 332, 329, 332,
332, 332, 332, 332, 332, 332, 56, 345, 345, 345,
55, 54, 333, 331, 333, 333, 333, 333, 333, 333,
333, 53, 335, 47, 45, 43, 334, 332, 334, 334,
334, 334, 334, 334, 334, 345, 42, 41, 40, 39,
38, 336, 333, 336, 336, 336, 336, 336, 336, 336,
34, 33, 32, 31, 22, 337, 334, 337, 337, 337,
337, 337, 337, 337, 19, 18, 17, 15, 14, 13,
338, 336, 338, 338, 338, 338, 338, 338, 338, 0,
0, 0, 0, 0, 0, 337, 339, 339, 339, 339,
339, 339, 339, 0, 0, 0, 0, 0, 0, 341,
338, 341, 341, 341, 341, 341, 341, 341, 0, 0,
0, 0, 0, 342, 339, 342, 342, 342, 342, 342,
342, 342, 0, 0, 0, 0, 0, 0, 343, 341,
343, 343, 343, 343, 343, 343, 343, 0, 0, 0,
0, 0, 0, 342, 344, 344, 344, 344, 344, 344,
344, 346, 346, 346, 346, 346, 346, 346, 343, 348,
0, 348, 348, 348, 348, 348, 348, 348, 0, 0,
0, 0, 344, 0, 0, 0, 0, 0, 349, 346,
349, 349, 349, 349, 349, 349, 349, 0, 350, 348,
350, 350, 350, 350, 350, 350, 351, 351, 351, 351,
351, 351, 351, 0, 0, 0, 0, 353, 349, 353,
353, 353, 353, 353, 353, 353, 0, 0, 350, 0,
0, 0, 0, 354, 351, 354, 354, 354, 354, 354,
354, 354, 0, 0, 0, 0, 355, 353, 355, 355,
355, 355, 355, 355, 356, 0, 356, 356, 356, 356,
356, 356, 356, 354, 357, 0, 357, 357, 357, 357,
357, 357, 357, 0, 0, 358, 355, 358, 358, 358,
358, 358, 358, 358, 356, 359, 0, 359, 359, 359,
359, 359, 359, 359, 357, 360, 0, 360, 360, 360,
360, 360, 360, 360, 361, 358, 361, 361, 361, 361,
361, 361, 361, 0, 0, 359, 362, 362, 362, 362,
362, 362, 362, 0, 364, 360, 364, 364, 364, 364,
364, 364, 364, 365, 361, 365, 365, 365, 365, 365,
365, 365, 0, 366, 362, 366, 366, 366, 366, 366,
366, 0, 0, 0, 364, 367, 367, 367, 367, 367,
367, 367, 369, 365, 369, 369, 369, 369, 369, 369,
369, 0, 370, 366, 370, 370, 370, 370, 370, 370,
370, 0, 371, 367, 371, 371, 371, 371, 371, 371,
0, 0, 369, 372, 372, 372, 372, 372, 372, 372,
0, 0, 370, 373, 373, 373, 373, 373, 373, 373,
0, 0, 371, 374, 374, 374, 374, 374, 374, 374,
0, 372, 375, 375, 375, 375, 375, 375, 375, 0,
0, 373, 376, 376, 376, 376, 376, 376, 376, 0,
0, 374, 377, 377, 377, 377, 377, 377, 377, 0,
375, 379, 379, 379, 379, 379, 379, 379, 0, 0,
376, 380, 380, 380, 380, 380, 380, 0, 0, 0,
377, 382, 382, 382, 382, 382, 382, 382, 0, 379,
383, 383, 383, 383, 383, 383, 0, 0, 0, 380,
0, 0, 0, 0, 0, 0, 0, 0, 0, 382,
0, 0, 0, 0, 0, 0, 0, 0, 383, 385,
385, 385, 385, 385, 385, 385, 386, 386, 386, 386,
386, 386, 386, 387, 387, 387, 387, 387, 387, 387,
388, 0, 0, 0, 0, 388, 388, 389, 389, 389,
389, 389, 389, 389, 390, 0, 0, 0, 0, 390,
390, 391, 0, 0, 0, 0, 391, 391, 392, 0,
392, 0, 0, 392, 392, 393, 0, 0, 0, 0,
393, 393, 394, 0, 0, 0, 0, 394, 394, 395,
0, 0, 0, 0, 395, 395, 396, 0, 396, 0,
0, 396, 396, 397, 0, 397, 397, 0, 0, 397,
399, 0, 399, 0, 399, 399, 399, 400, 400, 400,
400, 400, 400, 400, 401, 401, 401, 401, 401, 401,
401, 402, 0, 402, 0, 0, 402, 402, 403, 403,
403, 403, 403, 403, 403, 404, 404, 404, 404, 404,
404, 404, 405, 0, 0, 0, 0, 405, 405, 406,
0, 0, 0, 0, 406, 406, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384, 384, 384, 384,
384, 384, 384, 384, 384, 384, 384
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "toke.l"
#define INITIAL 0
#line 2 "toke.l"
/*
* Copyright (c) 1996, 1998-2004 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Sponsored in part by the Defense Advanced Research Projects
* Agency (DARPA) and Air Force Research Laboratory, Air Force
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
#include "config.h"
#include <sys/types.h>
#include <sys/param.h>
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif /* HAVE_STRING_H */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
#include <ctype.h>
#include "sudo.h"
#include "parse.h"
#include "gram.h"
#ifndef lint
static const char rcsid[] = "$Sudo$";
#endif /* lint */
extern YYSTYPE yylval;
int sudolineno = 1;
char *sudoers;
static int sawspace = 0;
static int arg_len = 0;
static int arg_size = 0;
static int fill __P((char *, int));
static int fill_cmnd __P((char *, int));
static int fill_args __P((char *, int, int));
static int switch_buffer __P((char *));
extern void yyerror __P((const char *));
#define push_include(_p) (switch_buffer((_p)))
#define pop_include() (switch_buffer(NULL))
/* realloc() to size + COMMANDARGINC to make room for command args */
#define COMMANDARGINC 64
#ifdef TRACELEXER
#define LEXTRACE(msg) fputs(msg, stderr)
#else
#define LEXTRACE(msg)
#endif
#define YY_NO_UNPUT 1
/* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */
#define GOTRUNAS 1
#define GOTDEFS 2
#define GOTCMND 3
#define STARTDEFS 4
#define INDEFS 5
#line 1063 "toke.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif
#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif
#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif
#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#ifdef __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines. This will fail
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
* or sizeof(void*) != sizeof(int).
*/
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( yy_current_buffer->yy_is_interactive ) \
{ \
int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
&& ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
if ( yyleng > 0 ) \
yy_current_buffer->yy_at_bol = \
(yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 103 "toke.l"
#line 1219 "toke.c"
if ( yy_init )
{
yy_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! yy_start )
yy_start = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
if ( ! yy_current_buffer )
yy_current_buffer =
yy_create_buffer( yyin, YY_BUF_SIZE );
yy_load_buffer_state();
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = yy_c_buf_p;
/* Support of yytext. */
*yy_cp = yy_hold_char;
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = yy_start;
yy_current_state += YY_AT_BOL();
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 385 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 2057 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 104 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 2:
YY_RULE_SETUP
#line 106 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
if (!fill(yytext, yyleng))
yyterminate();
return(DEFVAR);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 115 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 4:
YY_RULE_SETUP
#line 121 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 5:
YY_RULE_SETUP
#line 126 "toke.l"
{
LEXTRACE("+= ");
return('+');
} /* return '+' */
YY_BREAK
case 6:
YY_RULE_SETUP
#line 131 "toke.l"
{
LEXTRACE("-= ");
return('-');
} /* return '-' */
YY_BREAK
case 7:
YY_RULE_SETUP
#line 136 "toke.l"
{
LEXTRACE("WORD(1) ");
if (!fill(yytext + 1, yyleng - 2))
yyterminate();
return(WORD);
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 143 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(yytext, yyleng))
yyterminate();
return(WORD);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 152 "toke.l"
{
/* quoted fnmatch glob char, pass verbatim */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(yytext, 2, sawspace))
yyterminate();
sawspace = FALSE;
}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 160 "toke.l"
{
/* quoted sudoers special char, strip backslash */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(yytext + 1, 1, sawspace))
yyterminate();
sawspace = FALSE;
}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 168 "toke.l"
{
BEGIN INITIAL;
yyless(0);
return(COMMAND);
} /* end of command line args */
YY_BREAK
case 12:
YY_RULE_SETUP
#line 174 "toke.l"
{
LEXTRACE("ARG ");
if (!fill_args(yytext, yyleng, sawspace))
yyterminate();
sawspace = FALSE;
} /* a command line arg */
YY_BREAK
case 13:
YY_RULE_SETUP
#line 182 "toke.l"
{
char *cp, *ep;
++sudolineno;
/* pull out path from #include line */
for (cp = yytext + 9; isspace(*cp); cp++)
continue;
for (ep = cp; *ep != '\0' && !isspace(*ep); ep++)
continue;
*ep = '\0';
/* push current buffer and switch to include file */
if (!push_include(cp))
yyterminate();
LEXTRACE("INCLUDE\n");
return(COMMENT);
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 198 "toke.l"
{
BEGIN GOTDEFS;
switch (yytext[8]) {
case ':':
yyless(9);
LEXTRACE("DEFAULTS_USER ");
return(DEFAULTS_USER);
case '>':
yyless(9);
LEXTRACE("DEFAULTS_RUNAS ");
return(DEFAULTS_RUNAS);
case '@':
yyless(9);
LEXTRACE("DEFAULTS_HOST ");
return(DEFAULTS_HOST);
default:
LEXTRACE("DEFAULTS ");
return(DEFAULTS);
}
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 219 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
switch (*yytext) {
case 'H':
LEXTRACE("HOSTALIAS ");
return(HOSTALIAS);
case 'C':
LEXTRACE("CMNDALIAS ");
return(CMNDALIAS);
case 'U':
LEXTRACE("USERALIAS ");
return(USERALIAS);
case 'R':
LEXTRACE("RUNASALIAS ");
BEGIN GOTRUNAS;
return(RUNASALIAS);
}
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 239 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
return(NOPASSWD);
}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 245 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
return(PASSWD);
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 251 "toke.l"
{
LEXTRACE("NOEXEC ");
return(NOEXEC);
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 256 "toke.l"
{
LEXTRACE("EXEC ");
return(EXEC);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 261 "toke.l"
{
LEXTRACE("NOMONITOR ");
return(NOMONITOR);
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 266 "toke.l"
{
LEXTRACE("MONITOR ");
return(MONITOR);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 271 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NETGROUP ");
return(NETGROUP);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 279 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("USERGROUP ");
return(USERGROUP);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 287 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 294 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 301 "toke.l"
{
BEGIN GOTRUNAS;
LEXTRACE("RUNAS ");
return (RUNAS);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 307 "toke.l"
{
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
return(ALL);
} else {
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("ALIAS ");
return(ALIAS);
}
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 319 "toke.l"
{
/* username/uid that user can run command as */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("WORD(3) ");
return(WORD);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 327 "toke.l"
{
BEGIN INITIAL;
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 331 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(yytext, yyleng))
yyterminate();
} /* sudo -e */
YY_BREAK
case 31:
YY_RULE_SETUP
#line 338 "toke.l"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
LEXTRACE("COMMAND ");
if (!fill_cmnd(yytext, yyleng))
yyterminate();
return(COMMAND);
} else {
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(yytext, yyleng))
yyterminate();
}
} /* a pathname */
YY_BREAK
case 32:
YY_RULE_SETUP
#line 353 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("WORD(4) ");
return(WORD);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 361 "toke.l"
{
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 34:
YY_RULE_SETUP
#line 366 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 35:
YY_RULE_SETUP
#line 371 "toke.l"
{
LEXTRACE(": ");
return(':');
} /* return ':' */
YY_BREAK
case 36:
YY_RULE_SETUP
#line 376 "toke.l"
{
if (yyleng % 2 == 1)
return('!'); /* return '!' */
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 381 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* return newline */
YY_BREAK
case 38:
YY_RULE_SETUP
#line 388 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 392 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
LEXTRACE("\n\t");
} /* throw away EOL after \ */
YY_BREAK
case 40:
YY_RULE_SETUP
#line 398 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* return comments */
YY_BREAK
case 41:
YY_RULE_SETUP
#line 405 "toke.l"
{
LEXTRACE("ERROR ");
return(ERROR);
} /* parse error */
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(GOTRUNAS):
case YY_STATE_EOF(GOTDEFS):
case YY_STATE_EOF(GOTCMND):
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
#line 410 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
LEXTRACE("ERROR ");
return(ERROR);
}
if (!pop_include())
yyterminate();
}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 420 "toke.l"
ECHO;
YY_BREAK
#line 1754 "toke.c"
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
* yylex(). If so, then we have to assure
* consistency between yy_current_buffer and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
yy_n_chars = yy_current_buffer->yy_n_chars;
yy_current_buffer->yy_input_file = yyin;
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = yytext_ptr + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++yy_c_buf_p;
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = yy_c_buf_p;
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
yy_did_buffer_switch_on_eof = 0;
if ( yywrap() )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p =
yytext_ptr + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
yy_c_buf_p =
&yy_current_buffer->yy_ch_buf[yy_n_chars];
yy_current_state = yy_get_previous_state();
yy_cp = yy_c_buf_p;
yy_bp = yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer()
{
register char *dest = yy_current_buffer->yy_ch_buf;
register char *source = yytext_ptr;
register int number_to_move, i;
int ret_val;
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( yy_current_buffer->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
else
{
int num_to_read =
yy_current_buffer->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = yy_current_buffer;
int yy_c_buf_p_offset =
(int) (yy_c_buf_p - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yy_flex_realloc( (void *) b->yy_ch_buf,
b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = yy_current_buffer->yy_buf_size -
number_to_move - 1;
#endif
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
yy_current_buffer->yy_n_chars = yy_n_chars;
}
if ( yy_n_chars == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
yyrestart( yyin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
yy_current_buffer->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
yy_n_chars += number_to_move;
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state()
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = yy_start;
yy_current_state += YY_AT_BOL();
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 385 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
{
register int yy_is_jam;
register char *yy_cp = yy_c_buf_p;
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 385 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 384);
return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
{
register char *yy_cp = yy_c_buf_p;
/* undo effects of setting up yytext */
*yy_cp = yy_hold_char;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yy_n_chars + 2;
register char *dest = &yy_current_buffer->yy_ch_buf[
yy_current_buffer->yy_buf_size + 2];
register char *source =
&yy_current_buffer->yy_ch_buf[number_to_move];
while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
yy_current_buffer->yy_n_chars =
yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
yytext_ptr = yy_bp;
yy_hold_char = *yy_cp;
yy_c_buf_p = yy_cp;
}
#endif /* ifndef YY_NO_UNPUT */
#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
{
int c;
*yy_c_buf_p = yy_hold_char;
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
*yy_c_buf_p = '\0';
else
{ /* need more input */
int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart( yyin );
/* fall through */
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
return EOF;
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext_ptr + offset;
break;
}
}
}
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
*yy_c_buf_p = '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;
yy_current_buffer->yy_at_bol = (c == '\n');
return c;
}
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
{
if ( ! yy_current_buffer )
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
yy_init_buffer( yy_current_buffer, input_file );
yy_load_buffer_state();
}
#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
{
if ( yy_current_buffer == new_buffer )
return;
if ( yy_current_buffer )
{
/* Flush out information for old buffer. */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}
yy_current_buffer = new_buffer;
yy_load_buffer_state();
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}
#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
{
yy_n_chars = yy_current_buffer->yy_n_chars;
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
yyin = yy_current_buffer->yy_input_file;
yy_hold_char = *yy_c_buf_p;
}
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer( b, file );
return b;
}
#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yy_flex_free( (void *) b->yy_ch_buf );
yy_flex_free( (void *) b );
}
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
#include <unistd.h>
#endif
#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
{
int oerrno = errno;
yy_flush_buffer( b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
#if YY_ALWAYS_INTERACTIVE
b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
b->yy_is_interactive = 0;
#else
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
errno = oerrno;
}
#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == yy_current_buffer )
yy_load_buffer_state();
}
#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer( b );
return b;
}
#endif
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
{
int len;
for ( len = 0; yy_str[len]; ++len )
;
return yy_scan_bytes( yy_str, len );
}
#endif
#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = len + 2;
buf = (char *) yy_flex_alloc( n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < len; ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#endif
#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
{
if ( yy_start_stack_ptr >= yy_start_stack_depth )
{
yy_size_t new_size;
yy_start_stack_depth += YY_START_STACK_INCR;
new_size = yy_start_stack_depth * sizeof( int );
if ( ! yy_start_stack )
yy_start_stack = (int *) yy_flex_alloc( new_size );
else
yy_start_stack = (int *) yy_flex_realloc(
(void *) yy_start_stack, new_size );
if ( ! yy_start_stack )
YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
}
yy_start_stack[yy_start_stack_ptr++] = YY_START;
BEGIN(new_state);
}
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state()
{
if ( --yy_start_stack_ptr < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" );
BEGIN(yy_start_stack[yy_start_stack_ptr]);
}
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state()
{
return yy_start_stack[yy_start_stack_ptr - 1];
}
#endif
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_char; \
yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = n; \
} \
while ( 0 )
/* Internal utility routines. */
#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst char *s2;
int n;
#endif
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
{
return (void *) malloc( size );
}
#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
{
free( ptr );
}
#if YY_MAIN
int main()
{
yylex();
return 0;
}
#endif
#line 420 "toke.l"
static int
fill(s, len)
char *s;
int len;
{
int i, j;
yylval.string = (char *) malloc(len + 1);
if (yylval.string == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
/* Copy the string and collapse any escaped characters. */
for (i = 0, j = 0; i < len; i++, j++) {
if (s[i] == '\\' && i != len - 1)
yylval.string[j] = s[++i];
else
yylval.string[j] = s[i];
}
yylval.string[j] = '\0';
return(TRUE);
}
static int
fill_cmnd(s, len)
char *s;
int len;
{
arg_len = arg_size = 0;
yylval.command.cmnd = (char *) malloc(++len);
if (yylval.command.cmnd == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
/* copy the string and NULL-terminate it (escapes handled by fnmatch) */
(void) strlcpy(yylval.command.cmnd, s, len);
yylval.command.args = NULL;
return(TRUE);
}
static int
fill_args(s, len, addspace)
char *s;
int len;
int addspace;
{
int new_len;
char *p;
if (yylval.command.args == NULL) {
addspace = 0;
new_len = len;
} else
new_len = arg_len + len + addspace;
if (new_len >= arg_size) {
/* Allocate more space than we need for subsequent args */
while (new_len >= (arg_size += COMMANDARGINC))
;
p = yylval.command.args ?
(char *) realloc(yylval.command.args, arg_size) :
(char *) malloc(arg_size);
if (p == NULL) {
if (yylval.command.args != NULL)
free(yylval.command.args);
yyerror("unable to allocate memory");
return(FALSE);
} else
yylval.command.args = p;
}
/* Efficiently append the arg (with a leading space if needed). */
p = yylval.command.args + arg_len;
if (addspace)
*p++ = ' ';
if (strlcpy(p, s, arg_size - (p - yylval.command.args)) != len) {
yyerror("fill_args: buffer overflow"); /* paranoia */
return(FALSE);
}
arg_len = new_len;
return(TRUE);
}
struct sudoers_state {
YY_BUFFER_STATE bs;
char *path;
int lineno;
};
#define MAX_SUDOERS_DEPTH 128
#define SUDOERS_STACK_INCREMENT 16
static int
switch_buffer(path)
char *path;
{
static size_t stacksize, depth;
static struct sudoers_state *state;
static int keepopen;
FILE *fp;
if (path != NULL) {
/* push current state */
if ((path = strdup(path)) == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
if (depth >= stacksize) {
if (depth > MAX_SUDOERS_DEPTH) {
yyerror("too many levels of includes");
return(FALSE);
}
stacksize += SUDOERS_STACK_INCREMENT;
state = (struct sudoers_state *) realloc(state,
sizeof(state) * stacksize);
if (state == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
}
if ((fp = open_sudoers(path, &keepopen)) == NULL) {
yyerror(path);
return(FALSE);
}
state[depth].bs = YY_CURRENT_BUFFER;
state[depth].path = sudoers;
state[depth].lineno = sudolineno;
depth++;
sudolineno = 1;
sudoers = path;
yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
} else {
/* pop */
if (depth == 0)
return(FALSE);
depth--;
if (!keepopen)
fclose(YY_CURRENT_BUFFER->yy_input_file);
yy_delete_buffer(YY_CURRENT_BUFFER);
yy_switch_to_buffer(state[depth].bs);
free(sudoers);
sudoers = state[depth].path;
sudolineno = state[depth].lineno;
keepopen = FALSE;
}
return(TRUE);
}