Files
sudo/toke.c
Todd C. Miller 304dc46d7f Add efree() for consistency with emalloc() et al. Allows us to rely
on C89 behavior (free(NULL) is valid) even on K&R.
2005-03-29 14:29:47 +00:00

2842 lines
85 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 43
#define YY_END_OF_BUFFER 44
static yyconst short int yy_accept[428] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 44, 33, 39, 38, 37, 42, 33, 26,
42, 33, 34, 33, 33, 33, 33, 36, 35, 27,
27, 27, 27, 27, 42, 33, 39, 42, 27, 27,
27, 27, 27, 28, 42, 28, 29, 28, 28, 28,
28, 28, 27, 27, 27, 27, 27, 42, 28, 1,
33, 33, 12, 11, 12, 11, 11, 42, 42, 2,
8, 8, 8, 3, 8, 4, 42, 33, 0, 39,
37, 0, 41, 23, 0, 22, 0, 32, 32, 0,
33, 33, 33, 33, 33, 27, 27, 27, 27, 27,
33, 40, 33, 39, 0, 0, 0, 0, 0, 0,
33, 33, 33, 33, 33, 28, 0, 28, 23, 0,
22, 0, 28, 0, 28, 28, 28, 28, 28, 27,
27, 27, 27, 27, 28, 28, 1, 30, 30, 0,
33, 12, 12, 10, 9, 10, 0, 2, 8, 0,
8, 0, 0, 5, 6, 8, 8, 0, 33, 33,
33, 27, 27, 27, 27, 27, 27, 33, 0, 0,
0, 0, 0, 0, 33, 33, 33, 33, 33, 28,
28, 28, 27, 27, 27, 27, 27, 27, 28, 0,
33, 7, 7, 0, 7, 8, 33, 33, 33, 33,
33, 27, 27, 27, 27, 27, 27, 33, 0, 0,
0, 0, 0, 0, 33, 33, 33, 28, 28, 28,
28, 28, 27, 27, 27, 27, 27, 27, 28, 33,
7, 33, 33, 33, 0, 19, 27, 27, 27, 27,
27, 33, 0, 0, 0, 0, 33, 33, 28, 28,
28, 27, 27, 27, 27, 27, 28, 33, 33, 33,
33, 33, 33, 27, 27, 27, 27, 27, 33, 0,
0, 0, 33, 33, 28, 28, 28, 28, 28, 27,
27, 27, 27, 27, 28, 33, 24, 24, 24, 27,
0, 18, 27, 27, 0, 17, 33, 0, 0, 0,
33, 33, 24, 24, 24, 27, 27, 27, 28, 33,
33, 24, 24, 24, 24, 0, 21, 27, 27, 31,
0, 0, 0, 33, 14, 28, 24, 24, 24, 24,
27, 27, 28, 30, 33, 25, 25, 25, 27, 0,
16, 0, 14, 0, 33, 0, 33, 28, 25, 25,
25, 27, 33, 33, 25, 25, 25, 25, 25, 0,
20, 0, 0, 15, 14, 0, 14, 0, 28, 28,
25, 25, 25, 25, 25, 33, 33, 33, 25, 25,
15, 0, 13, 28, 28, 28, 25, 25, 33, 33,
33, 33, 33, 28, 28, 28, 28, 28, 33, 33,
33, 28, 28, 28, 33, 33, 33, 33, 33, 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[452] =
{ 0,
0, 59, 100, 0, 159, 160, 167, 180, 223, 282,
341, 384, 1714, 1669, 1683, 2099, 1680, 1680, 1612, 2099,
2099, 1611, 2099, 168, 50, 214, 243, 2099, 2099, 428,
1603, 1591, 1590, 1581, 487, 18, 178, 161, 1515, 1518,
1503, 1480, 1481, 1485, 63, 1484, 2099, 1483, 197, 275,
350, 359, 512, 1483, 1475, 1474, 1475, 571, 30, 1491,
396, 33, 0, 2099, 1480, 0, 2099, 407, 84, 0,
1435, 579, 51, 2099, 154, 2099, 96, 1434, 297, 1475,
1472, 1471, 2099, 1429, 512, 1428, 596, 584, 1427, 623,
339, 171, 596, 635, 644, 0, 1439, 1433, 163, 1428,
193, 2099, 165, 604, 1410, 1412, 1404, 1394, 1386, 184,
144, 194, 196, 198, 199, 1399, 666, 294, 1396, 690,
1394, 699, 672, 723, 720, 206, 735, 749, 764, 0,
1403, 1391, 381, 1376, 347, 202, 1403, 782, 1360, 790,
203, 0, 1399, 253, 2099, 2099, 315, 0, 1358, 671,
798, 158, 379, 2099, 2099, 1357, 390, 815, 814, 827,
843, 1370, 1365, 1354, 1360, 1361, 1330, 246, 1313, 1316,
1308, 1310, 1305, 218, 357, 254, 264, 370, 363, 856,
872, 885, 1325, 1320, 1309, 1315, 1301, 1280, 307, 907,
318, 1271, 2099, 393, 909, 920, 918, 388, 929, 938,
949, 221, 1264, 1245, 1240, 1205, 1183, 448, 1166, 1160,
1137, 1149, 1119, 449, 280, 578, 378, 958, 593, 967,
978, 987, 492, 1125, 1115, 1101, 1096, 1066, 453, 456,
582, 996, 1007, 1016, 574, 2099, 1071, 1077, 1072, 1039,
1047, 460, 1023, 989, 990, 583, 597, 546, 1025, 1036,
1045, 984, 990, 976, 951, 941, 595, 622, 1054, 668,
1065, 1074, 1083, 889, 683, 884, 868, 698, 137, 839,
803, 681, 606, 660, 1094, 673, 1103, 1112, 1123, 814,
772, 811, 778, 774, 666, 676, 1133, 1142, 1153, 786,
814, 2099, 776, 781, 817, 2099, 699, 736, 713, 683,
682, 701, 1163, 1172, 1183, 827, 725, 720, 716, 718,
1192, 48, 1202, 1213, 864, 894, 2099, 706, 895, 665,
641, 611, 422, 461, 1222, 1221, 586, 1234, 1252, 1243,
629, 918, 567, 545, 1263, 1272, 1281, 1292, 1143, 1303,
2099, 532, 1314, 803, 729, 464, 457, 1313, 1327, 1342,
1356, 1315, 1363, 809, 1373, 1392, 1402, 1411, 1306, 1319,
2099, 395, 424, 382, 355, 1433, 304, 1457, 1431, 810,
1469, 1478, 1487, 1498, 1507, 1516, 1527, 1536, 1545, 851,
2099, 301, 2099, 1556, 1565, 1574, 1585, 1581, 1594, 811,
1614, 1623, 1603, 1632, 884, 1643, 1652, 1661, 1672, 1681,
1690, 1701, 1710, 1719, 1730, 928, 1739, 1748, 1759, 1768,
947, 1777, 1788, 1797, 1806, 1817, 1826, 1835, 1846, 1855,
204, 1864, 1875, 52, 1884, 1893, 2099, 1937, 1944, 1951,
1958, 1965, 1972, 1979, 1986, 1993, 2000, 2007, 2014, 2021,
2028, 66, 2035, 2042, 2049, 2056, 2063, 2070, 2077, 2084,
2091
} ;
static yyconst short int yy_def[452] =
{ 0,
427, 1, 427, 3, 1, 1, 428, 428, 429, 429,
430, 430, 427, 431, 427, 427, 427, 432, 433, 427,
427, 434, 427, 435, 431, 431, 431, 427, 427, 427,
30, 30, 30, 30, 431, 431, 427, 432, 30, 30,
30, 30, 30, 436, 427, 437, 427, 438, 439, 436,
436, 436, 427, 53, 53, 53, 53, 436, 436, 427,
440, 431, 441, 427, 441, 441, 427, 427, 427, 442,
443, 444, 443, 427, 443, 427, 445, 431, 431, 427,
427, 432, 427, 433, 433, 434, 434, 435, 446, 431,
431, 431, 431, 431, 431, 30, 30, 30, 30, 30,
431, 427, 431, 427, 427, 427, 427, 427, 427, 432,
431, 431, 431, 431, 431, 436, 436, 427, 437, 437,
438, 438, 439, 436, 436, 436, 436, 436, 436, 53,
53, 53, 53, 53, 436, 436, 427, 440, 447, 431,
431, 441, 441, 427, 427, 427, 427, 442, 443, 443,
444, 448, 444, 427, 427, 443, 443, 427, 431, 431,
431, 30, 30, 30, 30, 30, 30, 431, 427, 427,
427, 427, 427, 432, 431, 431, 431, 431, 431, 436,
436, 436, 53, 53, 53, 53, 53, 53, 436, 427,
431, 443, 427, 448, 444, 444, 431, 431, 431, 431,
431, 30, 30, 30, 30, 30, 30, 431, 427, 427,
427, 427, 427, 432, 431, 431, 431, 436, 436, 436,
436, 436, 53, 53, 53, 53, 53, 53, 436, 431,
448, 431, 431, 431, 427, 427, 30, 30, 30, 30,
30, 431, 427, 427, 427, 432, 431, 431, 436, 436,
436, 53, 53, 53, 53, 53, 436, 431, 431, 431,
431, 431, 431, 30, 30, 30, 30, 30, 431, 427,
427, 432, 431, 431, 436, 436, 436, 436, 436, 53,
53, 53, 53, 53, 436, 431, 431, 431, 431, 30,
427, 427, 30, 30, 427, 427, 431, 427, 427, 432,
431, 431, 436, 436, 436, 53, 53, 53, 436, 431,
431, 431, 431, 431, 431, 427, 427, 30, 30, 431,
427, 427, 432, 431, 431, 436, 436, 436, 436, 436,
53, 53, 436, 431, 431, 431, 431, 431, 30, 427,
427, 427, 427, 432, 431, 449, 450, 436, 436, 436,
436, 53, 431, 431, 431, 431, 431, 431, 431, 427,
427, 427, 451, 431, 449, 449, 450, 450, 436, 436,
436, 436, 436, 436, 436, 431, 431, 431, 431, 431,
427, 451, 427, 436, 436, 436, 436, 436, 431, 431,
431, 431, 431, 436, 436, 436, 436, 436, 431, 431,
431, 436, 436, 436, 431, 431, 431, 431, 431, 436,
436, 436, 436, 436, 431, 431, 431, 436, 436, 436,
431, 431, 431, 436, 436, 436, 0, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427
} ;
static yyconst short int yy_nxt[2160] =
{ 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, 79, 311, 91, 38, 92, 92, 92, 92, 92,
92, 92, 148, 117, 154, 118, 79, 103, 118, 118,
118, 118, 118, 118, 118, 147, 102, 39, 40, 136,
41, 79, 141, 79, 150, 117, 42, 157, 102, 43,
44, 15, 16, 17, 44, 45, 46, 21, 47, 44,
48, 23, 44, 44, 49, 50, 51, 52, 50, 50,
50, 50, 28, 29, 21, 44, 53, 53, 53, 53,
54, 53, 53, 55, 56, 53, 57, 53, 53, 53,
53, 53, 53, 58, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 59, 44, 44,
60, 60, 193, 83, 21, 21, 21, 21, 15, 64,
65, 89, 66, 61, 61, 89, 89, 155, 67, 104,
79, 15, 64, 65, 91, 66, 83, 79, 297, 67,
66, 67, 89, 164, 147, 102, 165, 150, 175, 166,
89, 194, 67, 66, 89, 89, 105, 106, 79, 107,
68, 90, 110, 168, 79, 108, 62, 62, 109, 125,
83, 89, 235, 68, 15, 16, 17, 91, 18, 93,
93, 93, 93, 93, 93, 93, 79, 79, 174, 79,
124, 79, 79, 236, 176, 117, 79, 79, 179, 117,
189, 191, 178, 177, 147, 102, 91, 79, 94, 94,
94, 94, 94, 95, 92, 214, 69, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 15, 16, 17, 79, 18, 125, 79,
126, 126, 126, 126, 126, 126, 126, 79, 78, 216,
78, 208, 78, 383, 78, 78, 118, 79, 78, 118,
118, 118, 118, 118, 118, 118, 147, 102, 117, 78,
78, 78, 215, 79, 247, 69, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 15, 16, 17, 72, 18, 368, 147, 102,
117, 73, 74, 75, 159, 160, 161, 159, 159, 159,
159, 79, 229, 125, 76, 127, 127, 127, 127, 127,
127, 127, 125, 230, 128, 128, 128, 128, 128, 129,
126, 152, 79, 195, 77, 15, 16, 17, 72, 18,
117, 147, 102, 117, 73, 74, 75, 231, 366, 139,
79, 197, 117, 139, 139, 215, 79, 76, 144, 102,
145, 185, 146, 79, 186, 217, 145, 187, 146, 215,
139, 79, 196, 344, 83, 79, 383, 77, 78, 146,
146, 79, 78, 150, 78, 215, 194, 78, 78, 140,
78, 78, 78, 96, 96, 96, 96, 96, 96, 96,
146, 83, 381, 78, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 79, 96, 78, 78, 78, 78, 78, 78, 78,
78, 78, 78, 78, 78, 78, 78, 78, 101, 102,
78, 79, 78, 235, 78, 78, 117, 242, 78, 79,
368, 246, 257, 79, 79, 258, 345, 366, 269, 78,
78, 78, 116, 84, 236, 84, 116, 84, 116, 84,
84, 116, 116, 84, 116, 116, 116, 130, 130, 130,
130, 130, 130, 130, 84, 84, 84, 116, 130, 130,
130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
130, 130, 130, 130, 130, 117, 130, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 135, 102, 116, 235, 116, 362, 116, 116,
152, 152, 116, 149, 152, 83, 193, 89, 79, 79,
152, 89, 89, 116, 116, 116, 236, 86, 274, 86,
326, 86, 152, 86, 86, 104, 218, 86, 89, 91,
117, 92, 92, 92, 92, 92, 92, 92, 86, 86,
86, 79, 153, 273, 88, 194, 78, 90, 88, 117,
78, 78, 105, 106, 88, 107, 117, 248, 117, 79,
79, 108, 272, 285, 109, 88, 88, 78, 91, 79,
92, 92, 92, 92, 92, 92, 92, 91, 301, 92,
92, 92, 92, 92, 92, 79, 352, 116, 343, 116,
286, 116, 149, 116, 116, 89, 149, 116, 79, 89,
89, 259, 149, 83, 291, 83, 275, 79, 116, 116,
116, 119, 342, 119, 149, 119, 89, 119, 119, 295,
121, 119, 121, 79, 121, 292, 121, 121, 79, 117,
121, 79, 119, 119, 119, 124, 117, 309, 302, 79,
296, 121, 121, 121, 123, 79, 116, 310, 123, 300,
116, 116, 323, 324, 123, 180, 181, 182, 180, 180,
180, 180, 79, 339, 79, 123, 123, 116, 125, 332,
126, 126, 126, 126, 126, 126, 126, 320, 325, 117,
331, 79, 125, 117, 126, 126, 126, 126, 126, 126,
126, 322, 79, 291, 333, 295, 334, 125, 117, 126,
126, 126, 126, 126, 126, 139, 364, 316, 321, 139,
139, 138, 117, 78, 292, 138, 296, 78, 78, 152,
152, 138, 192, 152, 344, 83, 139, 117, 317, 152,
319, 318, 138, 138, 78, 291, 89, 363, 295, 308,
89, 152, 353, 369, 389, 140, 89, 197, 316, 198,
198, 198, 198, 198, 198, 198, 292, 89, 89, 296,
197, 153, 199, 199, 199, 199, 199, 199, 199, 317,
307, 306, 79, 117, 79, 299, 197, 79, 200, 200,
200, 200, 200, 201, 198, 298, 380, 380, 380, 218,
79, 219, 219, 219, 219, 219, 219, 219, 311, 312,
312, 312, 312, 312, 312, 218, 79, 220, 220, 220,
220, 220, 220, 220, 79, 316, 340, 394, 218, 117,
221, 221, 221, 221, 221, 222, 219, 79, 139, 294,
152, 152, 139, 192, 152, 117, 317, 341, 139, 340,
152, 152, 152, 293, 195, 152, 290, 117, 117, 139,
139, 152, 152, 232, 233, 234, 232, 232, 232, 232,
341, 405, 197, 152, 198, 198, 198, 198, 198, 198,
198, 197, 153, 198, 198, 198, 198, 198, 198, 198,
410, 79, 197, 153, 198, 198, 198, 198, 198, 198,
284, 79, 79, 249, 250, 251, 249, 249, 249, 249,
218, 79, 219, 219, 219, 219, 219, 219, 219, 283,
117, 218, 79, 219, 219, 219, 219, 219, 219, 219,
218, 117, 219, 219, 219, 219, 219, 219, 282, 259,
117, 260, 260, 260, 260, 260, 260, 260, 281, 280,
259, 117, 261, 261, 261, 261, 261, 261, 261, 259,
117, 262, 262, 262, 262, 262, 263, 260, 275, 79,
276, 276, 276, 276, 276, 276, 276, 243, 271, 275,
79, 277, 277, 277, 277, 277, 277, 277, 275, 79,
278, 278, 278, 278, 278, 279, 276, 270, 117, 287,
288, 289, 287, 287, 287, 287, 268, 267, 259, 117,
260, 260, 260, 260, 260, 260, 260, 259, 117, 260,
260, 260, 260, 260, 260, 260, 259, 79, 260, 260,
260, 260, 260, 260, 266, 265, 264, 256, 79, 303,
304, 305, 303, 303, 303, 303, 275, 79, 276, 276,
276, 276, 276, 276, 276, 275, 79, 276, 276, 276,
276, 276, 276, 276, 255, 254, 275, 117, 276, 276,
276, 276, 276, 276, 360, 253, 117, 311, 312, 312,
312, 312, 312, 312, 312, 117, 311, 313, 313, 313,
313, 313, 313, 313, 252, 361, 117, 311, 314, 314,
314, 314, 314, 315, 312, 243, 79, 326, 327, 327,
327, 327, 327, 327, 327, 79, 326, 328, 328, 328,
328, 328, 328, 328, 245, 243, 79, 326, 329, 329,
329, 329, 329, 330, 327, 244, 117, 335, 336, 337,
338, 335, 335, 335, 243, 117, 311, 312, 312, 312,
312, 312, 312, 312, 241, 346, 117, 311, 312, 312,
312, 312, 312, 312, 312, 79, 348, 349, 350, 351,
348, 348, 348, 240, 346, 79, 346, 347, 326, 327,
327, 327, 327, 327, 327, 327, 79, 326, 327, 327,
327, 327, 327, 327, 117, 79, 326, 327, 327, 327,
327, 327, 327, 327, 239, 238, 353, 117, 354, 354,
354, 354, 354, 354, 354, 353, 117, 355, 355, 355,
355, 355, 355, 355, 353, 117, 356, 356, 356, 356,
356, 357, 358, 237, 340, 353, 79, 359, 359, 359,
354, 354, 354, 354, 150, 79, 360, 346, 228, 353,
360, 380, 380, 380, 79, 341, 369, 227, 370, 370,
370, 370, 370, 370, 370, 79, 346, 361, 346, 346,
369, 361, 371, 371, 371, 371, 371, 371, 371, 79,
226, 225, 224, 223, 213, 369, 117, 372, 372, 372,
372, 372, 373, 374, 212, 211, 210, 209, 207, 369,
117, 375, 375, 375, 370, 370, 370, 370, 376, 377,
378, 376, 376, 376, 376, 117, 353, 206, 358, 358,
358, 358, 358, 358, 358, 205, 204, 203, 202, 117,
150, 150, 143, 190, 137, 353, 79, 358, 358, 358,
358, 358, 358, 358, 188, 353, 79, 358, 358, 358,
358, 358, 358, 379, 353, 184, 379, 379, 379, 379,
379, 379, 379, 183, 365, 79, 365, 122, 365, 120,
365, 365, 117, 173, 365, 79, 384, 385, 386, 384,
384, 384, 384, 172, 79, 365, 365, 365, 367, 171,
367, 170, 367, 169, 367, 367, 167, 163, 367, 162,
158, 87, 85, 83, 117, 81, 80, 79, 150, 367,
367, 367, 369, 143, 374, 374, 374, 374, 374, 374,
374, 369, 137, 374, 374, 374, 374, 374, 374, 374,
369, 134, 374, 374, 374, 374, 374, 374, 387, 133,
132, 369, 117, 387, 387, 387, 387, 387, 387, 387,
369, 117, 388, 388, 388, 131, 122, 120, 117, 389,
117, 390, 390, 390, 390, 390, 390, 390, 115, 114,
389, 117, 391, 391, 391, 391, 391, 391, 391, 389,
117, 392, 392, 392, 392, 392, 393, 390, 113, 79,
379, 379, 379, 379, 379, 379, 379, 112, 111, 394,
79, 395, 395, 395, 395, 395, 395, 395, 394, 79,
396, 396, 396, 396, 396, 396, 396, 394, 79, 397,
397, 397, 397, 397, 398, 395, 388, 388, 388, 117,
387, 387, 387, 387, 387, 387, 387, 100, 117, 399,
400, 401, 399, 399, 399, 399, 389, 117, 390, 390,
390, 390, 390, 390, 117, 99, 98, 389, 117, 390,
390, 390, 390, 390, 390, 390, 389, 79, 390, 390,
390, 390, 390, 390, 390, 97, 79, 402, 403, 404,
402, 402, 402, 402, 87, 85, 394, 79, 395, 395,
395, 395, 395, 395, 395, 394, 79, 395, 395, 395,
395, 395, 395, 395, 394, 117, 395, 395, 395, 395,
395, 395, 83, 81, 80, 405, 117, 406, 406, 406,
406, 406, 406, 406, 405, 117, 407, 407, 407, 407,
407, 407, 407, 405, 117, 408, 408, 408, 408, 408,
409, 406, 79, 427, 410, 79, 411, 411, 411, 411,
411, 411, 411, 410, 79, 412, 412, 412, 412, 412,
412, 412, 410, 79, 413, 413, 413, 413, 413, 414,
411, 427, 427, 427, 117, 415, 416, 417, 415, 415,
415, 415, 405, 117, 406, 406, 406, 406, 406, 406,
406, 405, 117, 406, 406, 406, 406, 406, 406, 406,
427, 427, 405, 79, 406, 406, 406, 406, 406, 406,
427, 427, 79, 418, 419, 420, 418, 418, 418, 418,
410, 79, 411, 411, 411, 411, 411, 411, 411, 427,
427, 410, 79, 411, 411, 411, 411, 411, 411, 411,
410, 117, 411, 411, 411, 411, 411, 411, 427, 427,
117, 421, 421, 421, 421, 421, 421, 421, 427, 427,
427, 117, 415, 415, 415, 415, 415, 415, 415, 427,
117, 422, 422, 422, 422, 422, 423, 421, 427, 79,
424, 424, 424, 424, 424, 424, 424, 427, 427, 427,
79, 418, 418, 418, 418, 418, 418, 418, 427, 79,
425, 425, 425, 425, 425, 426, 424, 427, 117, 421,
421, 421, 421, 421, 421, 421, 427, 427, 427, 117,
421, 421, 421, 421, 421, 421, 427, 427, 117, 424,
424, 424, 424, 424, 424, 424, 427, 79, 424, 424,
424, 424, 424, 424, 427, 427, 427, 427, 79, 427,
427, 427, 427, 427, 427, 427, 427, 117, 427, 427,
427, 427, 427, 427, 427, 427, 117, 63, 63, 63,
63, 63, 63, 63, 21, 21, 21, 21, 21, 21,
21, 71, 71, 71, 71, 71, 71, 71, 78, 427,
427, 427, 427, 78, 78, 82, 82, 82, 82, 82,
82, 82, 84, 427, 427, 427, 427, 84, 84, 86,
427, 427, 427, 427, 86, 86, 88, 427, 88, 427,
427, 88, 88, 116, 427, 427, 427, 427, 116, 116,
119, 427, 427, 427, 427, 119, 119, 121, 427, 427,
427, 427, 121, 121, 123, 427, 123, 427, 427, 123,
123, 138, 427, 138, 427, 427, 138, 138, 142, 427,
142, 142, 427, 427, 142, 149, 427, 149, 427, 149,
149, 149, 151, 151, 151, 151, 151, 151, 151, 156,
156, 156, 156, 156, 156, 156, 89, 427, 89, 427,
427, 89, 89, 139, 427, 139, 427, 427, 139, 139,
152, 152, 152, 152, 152, 152, 152, 365, 427, 427,
427, 427, 365, 365, 367, 427, 427, 427, 427, 367,
367, 382, 382, 382, 382, 382, 382, 382, 13, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427
} ;
static yyconst short int yy_chk[2160] =
{ 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, 36, 312, 25, 2, 25, 25, 25, 25, 25,
25, 25, 442, 59, 73, 45, 62, 36, 45, 45,
45, 45, 45, 45, 45, 69, 69, 2, 2, 59,
2, 312, 62, 25, 73, 424, 2, 77, 77, 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,
5, 6, 152, 38, 5, 6, 5, 6, 7, 7,
7, 24, 7, 5, 6, 24, 24, 75, 7, 37,
269, 8, 8, 8, 92, 8, 110, 111, 269, 7,
7, 8, 24, 99, 101, 101, 99, 75, 111, 99,
49, 152, 8, 8, 49, 49, 37, 37, 103, 37,
7, 24, 38, 103, 92, 37, 5, 6, 37, 126,
174, 49, 202, 8, 9, 9, 9, 26, 9, 26,
26, 26, 26, 26, 26, 26, 101, 112, 110, 113,
49, 114, 115, 202, 112, 136, 141, 421, 115, 126,
136, 141, 114, 113, 144, 144, 27, 26, 27, 27,
27, 27, 27, 27, 27, 174, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 10, 10, 10, 27, 10, 50, 168,
50, 50, 50, 50, 50, 50, 50, 176, 79, 176,
79, 168, 79, 382, 79, 79, 118, 177, 79, 118,
118, 118, 118, 118, 118, 118, 147, 147, 50, 79,
79, 79, 177, 215, 215, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 11, 11, 11, 11, 11, 367, 135, 135,
189, 11, 11, 11, 91, 91, 91, 91, 91, 91,
91, 191, 189, 51, 11, 51, 51, 51, 51, 51,
51, 51, 52, 191, 52, 52, 52, 52, 52, 52,
52, 153, 91, 153, 11, 12, 12, 12, 12, 12,
135, 157, 157, 51, 12, 12, 12, 194, 365, 61,
175, 198, 52, 61, 61, 175, 179, 12, 68, 68,
68, 133, 68, 178, 133, 178, 68, 133, 68, 179,
61, 217, 153, 323, 323, 364, 363, 12, 30, 68,
68, 198, 30, 157, 30, 217, 194, 30, 30, 61,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
68, 214, 362, 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, 208, 35, 223, 35, 35, 229, 208, 35, 230,
347, 214, 229, 242, 324, 230, 324, 346, 242, 35,
35, 35, 53, 85, 223, 85, 53, 85, 53, 85,
85, 53, 53, 85, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 85, 85, 85, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 58, 58, 58, 235, 58, 342, 58, 58,
72, 72, 58, 72, 72, 246, 231, 88, 334, 248,
72, 88, 88, 58, 58, 58, 235, 87, 248, 87,
327, 87, 72, 87, 87, 104, 219, 87, 88, 93,
333, 93, 93, 93, 93, 93, 93, 93, 87, 87,
87, 216, 72, 247, 90, 231, 90, 88, 90, 327,
90, 90, 104, 104, 90, 104, 219, 216, 257, 93,
247, 104, 246, 257, 104, 90, 90, 90, 94, 273,
94, 94, 94, 94, 94, 94, 94, 95, 273, 95,
95, 95, 95, 95, 95, 258, 331, 117, 322, 117,
258, 117, 150, 117, 117, 123, 150, 117, 94, 123,
123, 260, 150, 272, 265, 300, 276, 95, 117, 117,
117, 120, 321, 120, 150, 120, 123, 120, 120, 268,
122, 120, 122, 274, 122, 265, 122, 122, 320, 285,
122, 260, 120, 120, 120, 123, 276, 285, 274, 286,
268, 122, 122, 122, 124, 301, 124, 286, 124, 272,
124, 124, 300, 301, 124, 125, 125, 125, 125, 125,
125, 125, 297, 318, 302, 124, 124, 124, 127, 308,
127, 127, 127, 127, 127, 127, 127, 297, 302, 309,
307, 310, 128, 125, 128, 128, 128, 128, 128, 128,
128, 299, 345, 281, 309, 284, 310, 129, 127, 129,
129, 129, 129, 129, 129, 138, 345, 290, 298, 138,
138, 140, 128, 140, 281, 140, 284, 140, 140, 151,
151, 140, 151, 151, 344, 344, 138, 129, 290, 151,
294, 293, 140, 140, 140, 291, 158, 344, 295, 283,
158, 151, 354, 370, 390, 138, 158, 159, 306, 159,
159, 159, 159, 159, 159, 159, 291, 158, 158, 295,
160, 151, 160, 160, 160, 160, 160, 160, 160, 306,
282, 280, 354, 370, 390, 271, 161, 159, 161, 161,
161, 161, 161, 161, 161, 270, 380, 380, 380, 180,
160, 180, 180, 180, 180, 180, 180, 180, 315, 315,
315, 315, 315, 315, 315, 181, 161, 181, 181, 181,
181, 181, 181, 181, 380, 316, 319, 395, 182, 180,
182, 182, 182, 182, 182, 182, 182, 315, 190, 267,
195, 195, 190, 195, 195, 181, 316, 319, 190, 332,
195, 196, 196, 266, 196, 196, 264, 395, 182, 190,
190, 196, 195, 197, 197, 197, 197, 197, 197, 197,
332, 406, 199, 196, 199, 199, 199, 199, 199, 199,
199, 200, 195, 200, 200, 200, 200, 200, 200, 200,
411, 197, 201, 196, 201, 201, 201, 201, 201, 201,
256, 406, 199, 218, 218, 218, 218, 218, 218, 218,
220, 200, 220, 220, 220, 220, 220, 220, 220, 255,
411, 221, 201, 221, 221, 221, 221, 221, 221, 221,
222, 218, 222, 222, 222, 222, 222, 222, 254, 232,
220, 232, 232, 232, 232, 232, 232, 232, 253, 252,
233, 221, 233, 233, 233, 233, 233, 233, 233, 234,
222, 234, 234, 234, 234, 234, 234, 234, 249, 232,
249, 249, 249, 249, 249, 249, 249, 245, 244, 250,
233, 250, 250, 250, 250, 250, 250, 250, 251, 234,
251, 251, 251, 251, 251, 251, 251, 243, 249, 259,
259, 259, 259, 259, 259, 259, 241, 240, 261, 250,
261, 261, 261, 261, 261, 261, 261, 262, 251, 262,
262, 262, 262, 262, 262, 262, 263, 259, 263, 263,
263, 263, 263, 263, 239, 238, 237, 228, 261, 275,
275, 275, 275, 275, 275, 275, 277, 262, 277, 277,
277, 277, 277, 277, 277, 278, 263, 278, 278, 278,
278, 278, 278, 278, 227, 226, 279, 275, 279, 279,
279, 279, 279, 279, 339, 225, 277, 287, 287, 287,
287, 287, 287, 287, 287, 278, 288, 288, 288, 288,
288, 288, 288, 288, 224, 339, 279, 289, 289, 289,
289, 289, 289, 289, 289, 213, 287, 303, 303, 303,
303, 303, 303, 303, 303, 288, 304, 304, 304, 304,
304, 304, 304, 304, 212, 211, 289, 305, 305, 305,
305, 305, 305, 305, 305, 210, 303, 311, 311, 311,
311, 311, 311, 311, 209, 304, 313, 313, 313, 313,
313, 313, 313, 313, 207, 325, 305, 314, 314, 314,
314, 314, 314, 314, 314, 311, 326, 326, 326, 326,
326, 326, 326, 206, 325, 313, 325, 325, 328, 328,
328, 328, 328, 328, 328, 328, 314, 330, 330, 330,
330, 330, 330, 330, 326, 325, 329, 329, 329, 329,
329, 329, 329, 329, 205, 204, 335, 328, 335, 335,
335, 335, 335, 335, 335, 336, 330, 336, 336, 336,
336, 336, 336, 336, 337, 329, 337, 337, 337, 337,
337, 337, 337, 203, 340, 338, 335, 338, 338, 338,
338, 338, 338, 338, 192, 336, 352, 343, 188, 359,
360, 359, 359, 359, 337, 340, 348, 187, 348, 348,
348, 348, 348, 348, 348, 338, 343, 352, 343, 343,
349, 360, 349, 349, 349, 349, 349, 349, 349, 359,
186, 185, 184, 183, 173, 350, 348, 350, 350, 350,
350, 350, 350, 350, 172, 171, 170, 169, 167, 351,
349, 351, 351, 351, 351, 351, 351, 351, 353, 353,
353, 353, 353, 353, 353, 350, 355, 166, 355, 355,
355, 355, 355, 355, 355, 165, 164, 163, 162, 351,
156, 149, 143, 139, 137, 356, 353, 356, 356, 356,
356, 356, 356, 356, 134, 357, 355, 357, 357, 357,
357, 357, 357, 357, 358, 132, 358, 358, 358, 358,
358, 358, 358, 131, 366, 356, 366, 121, 366, 119,
366, 366, 116, 109, 366, 357, 369, 369, 369, 369,
369, 369, 369, 108, 358, 366, 366, 366, 368, 107,
368, 106, 368, 105, 368, 368, 100, 98, 368, 97,
89, 86, 84, 82, 369, 81, 80, 78, 71, 368,
368, 368, 371, 65, 371, 371, 371, 371, 371, 371,
371, 372, 60, 372, 372, 372, 372, 372, 372, 372,
373, 57, 373, 373, 373, 373, 373, 373, 373, 56,
55, 374, 371, 374, 374, 374, 374, 374, 374, 374,
375, 372, 375, 375, 375, 54, 48, 46, 44, 376,
373, 376, 376, 376, 376, 376, 376, 376, 43, 42,
377, 374, 377, 377, 377, 377, 377, 377, 377, 378,
375, 378, 378, 378, 378, 378, 378, 378, 41, 376,
379, 379, 379, 379, 379, 379, 379, 40, 39, 384,
377, 384, 384, 384, 384, 384, 384, 384, 385, 378,
385, 385, 385, 385, 385, 385, 385, 386, 379, 386,
386, 386, 386, 386, 386, 386, 388, 388, 388, 384,
387, 387, 387, 387, 387, 387, 387, 34, 385, 389,
389, 389, 389, 389, 389, 389, 393, 386, 393, 393,
393, 393, 393, 393, 388, 33, 32, 391, 387, 391,
391, 391, 391, 391, 391, 391, 392, 389, 392, 392,
392, 392, 392, 392, 392, 31, 393, 394, 394, 394,
394, 394, 394, 394, 22, 19, 396, 391, 396, 396,
396, 396, 396, 396, 396, 397, 392, 397, 397, 397,
397, 397, 397, 397, 398, 394, 398, 398, 398, 398,
398, 398, 18, 17, 15, 399, 396, 399, 399, 399,
399, 399, 399, 399, 400, 397, 400, 400, 400, 400,
400, 400, 400, 401, 398, 401, 401, 401, 401, 401,
401, 401, 14, 13, 402, 399, 402, 402, 402, 402,
402, 402, 402, 403, 400, 403, 403, 403, 403, 403,
403, 403, 404, 401, 404, 404, 404, 404, 404, 404,
404, 0, 0, 0, 402, 405, 405, 405, 405, 405,
405, 405, 407, 403, 407, 407, 407, 407, 407, 407,
407, 408, 404, 408, 408, 408, 408, 408, 408, 408,
0, 0, 409, 405, 409, 409, 409, 409, 409, 409,
0, 0, 407, 410, 410, 410, 410, 410, 410, 410,
412, 408, 412, 412, 412, 412, 412, 412, 412, 0,
0, 413, 409, 413, 413, 413, 413, 413, 413, 413,
414, 410, 414, 414, 414, 414, 414, 414, 0, 0,
412, 415, 415, 415, 415, 415, 415, 415, 0, 0,
0, 413, 416, 416, 416, 416, 416, 416, 416, 0,
414, 417, 417, 417, 417, 417, 417, 417, 0, 415,
418, 418, 418, 418, 418, 418, 418, 0, 0, 0,
416, 419, 419, 419, 419, 419, 419, 419, 0, 417,
420, 420, 420, 420, 420, 420, 420, 0, 418, 422,
422, 422, 422, 422, 422, 422, 0, 0, 0, 419,
423, 423, 423, 423, 423, 423, 0, 0, 420, 425,
425, 425, 425, 425, 425, 425, 0, 422, 426, 426,
426, 426, 426, 426, 0, 0, 0, 0, 423, 0,
0, 0, 0, 0, 0, 0, 0, 425, 0, 0,
0, 0, 0, 0, 0, 0, 426, 428, 428, 428,
428, 428, 428, 428, 429, 429, 429, 429, 429, 429,
429, 430, 430, 430, 430, 430, 430, 430, 431, 0,
0, 0, 0, 431, 431, 432, 432, 432, 432, 432,
432, 432, 433, 0, 0, 0, 0, 433, 433, 434,
0, 0, 0, 0, 434, 434, 435, 0, 435, 0,
0, 435, 435, 436, 0, 0, 0, 0, 436, 436,
437, 0, 0, 0, 0, 437, 437, 438, 0, 0,
0, 0, 438, 438, 439, 0, 439, 0, 0, 439,
439, 440, 0, 440, 0, 0, 440, 440, 441, 0,
441, 441, 0, 0, 441, 443, 0, 443, 0, 443,
443, 443, 444, 444, 444, 444, 444, 444, 444, 445,
445, 445, 445, 445, 445, 445, 446, 0, 446, 0,
0, 446, 446, 447, 0, 447, 0, 0, 447, 447,
448, 448, 448, 448, 448, 448, 448, 449, 0, 0,
0, 0, 449, 449, 450, 0, 0, 0, 0, 450,
450, 451, 451, 451, 451, 451, 451, 451, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
427, 427, 427, 427, 427, 427, 427, 427, 427
} ;
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-2005 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
__unused 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 1086 "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 104 "toke.l"
#line 1242 "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 >= 428 )
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] != 2099 );
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 105 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 2:
YY_RULE_SETUP
#line 107 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
if (!fill(yytext, yyleng))
yyterminate();
return(DEFVAR);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 116 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 4:
YY_RULE_SETUP
#line 122 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 5:
YY_RULE_SETUP
#line 127 "toke.l"
{
LEXTRACE("+= ");
return('+');
} /* return '+' */
YY_BREAK
case 6:
YY_RULE_SETUP
#line 132 "toke.l"
{
LEXTRACE("-= ");
return('-');
} /* return '-' */
YY_BREAK
case 7:
YY_RULE_SETUP
#line 137 "toke.l"
{
LEXTRACE("WORD(1) ");
if (!fill(yytext + 1, yyleng - 2))
yyterminate();
return(WORD);
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 144 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(yytext, yyleng))
yyterminate();
return(WORD);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 153 "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 161 "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 169 "toke.l"
{
BEGIN INITIAL;
yyless(0);
return(COMMAND);
} /* end of command line args */
YY_BREAK
case 12:
YY_RULE_SETUP
#line 175 "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 183 "toke.l"
{
char *cp, *ep;
++sudolineno;
/* pull out path from #include line */
cp = yytext + 9;
while (isblank((unsigned char) *cp))
cp++;
ep = cp;
while (*ep != '\0' && !isspace((unsigned char) *ep))
ep++;
*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 201 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
continue;
n += 8;
BEGIN GOTDEFS;
switch (yytext[n++]) {
case ':':
yyless(n);
LEXTRACE("DEFAULTS_USER ");
return(DEFAULTS_USER);
case '>':
yyless(n);
LEXTRACE("DEFAULTS_RUNAS ");
return(DEFAULTS_RUNAS);
case '@':
yyless(n);
LEXTRACE("DEFAULTS_HOST ");
return(DEFAULTS_HOST);
case '!':
yyless(n);
LEXTRACE("DEFAULTS_CMND ");
return(DEFAULTS_CMND);
default:
LEXTRACE("DEFAULTS ");
return(DEFAULTS);
}
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 230 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
continue;
if (!fill(yytext + n, yyleng - n))
yyterminate();
switch (yytext[n]) {
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 253 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
return(NOPASSWD);
}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 259 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
return(PASSWD);
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 265 "toke.l"
{
LEXTRACE("NOEXEC ");
return(NOEXEC);
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 270 "toke.l"
{
LEXTRACE("EXEC ");
return(EXEC);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 275 "toke.l"
{
LEXTRACE("NOMONITOR ");
return(NOMONITOR);
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 280 "toke.l"
{
LEXTRACE("MONITOR ");
return(MONITOR);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 285 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NETGROUP ");
return(NETGROUP);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 293 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("USERGROUP ");
return(USERGROUP);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 301 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 308 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 315 "toke.l"
{
BEGIN GOTRUNAS;
LEXTRACE("RUNAS ");
return (RUNAS);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 321 "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 333 "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 341 "toke.l"
{
BEGIN INITIAL;
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 345 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
yyterminate();
LEXTRACE("COMMAND ");
return(COMMAND);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 353 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(yytext, yyleng))
yyterminate();
} /* sudo -e */
YY_BREAK
case 32:
YY_RULE_SETUP
#line 360 "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 33:
YY_RULE_SETUP
#line 375 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("WORD(4) ");
return(WORD);
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 383 "toke.l"
{
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 35:
YY_RULE_SETUP
#line 388 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 36:
YY_RULE_SETUP
#line 393 "toke.l"
{
LEXTRACE(": ");
return(':');
} /* return ':' */
YY_BREAK
case 37:
YY_RULE_SETUP
#line 398 "toke.l"
{
if (yyleng % 2 == 1)
return('!'); /* return '!' */
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 403 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* return newline */
YY_BREAK
case 39:
YY_RULE_SETUP
#line 410 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 414 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
LEXTRACE("\n\t");
} /* throw away EOL after \ */
YY_BREAK
case 41:
YY_RULE_SETUP
#line 420 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* return comments */
YY_BREAK
case 42:
YY_RULE_SETUP
#line 427 "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 432 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
LEXTRACE("ERROR ");
return(ERROR);
}
if (!pop_include())
yyterminate();
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 442 "toke.l"
ECHO;
YY_BREAK
#line 1801 "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 >= 428 )
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 >= 428 )
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 == 427);
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 442 "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) {
efree(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);
efree(sudoers);
sudoers = state[depth].path;
sudolineno = state[depth].lineno;
keepopen = FALSE;
}
return(TRUE);
}