/* $OpenBSD: flex.skl,v 1.10 2007/01/26 14:38:19 tsi 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 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* 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 #include #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 45 #define YY_END_OF_BUFFER 46 static yyconst short int yy_accept[456] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 35, 41, 40, 39, 44, 35, 28, 44, 35, 36, 35, 35, 35, 35, 38, 37, 29, 29, 29, 29, 29, 29, 44, 35, 41, 44, 29, 29, 29, 29, 29, 30, 44, 30, 31, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 44, 30, 1, 35, 35, 12, 11, 12, 11, 11, 44, 44, 2, 8, 8, 8, 3, 8, 4, 44, 35, 0, 41, 39, 0, 43, 25, 0, 24, 0, 34, 34, 0, 35, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, 35, 42, 35, 41, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, 30, 0, 30, 25, 0, 24, 0, 30, 0, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 30, 30, 1, 32, 32, 0, 35, 12, 12, 10, 9, 10, 0, 2, 8, 0, 8, 0, 0, 5, 6, 8, 8, 0, 35, 35, 35, 29, 29, 29, 29, 29, 29, 29, 29, 35, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 30, 0, 35, 7, 7, 0, 7, 8, 35, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, 29, 29, 35, 0, 0, 0, 0, 0, 0, 35, 35, 35, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 29, 30, 35, 7, 35, 35, 35, 0, 19, 29, 29, 29, 29, 29, 29, 29, 35, 0, 0, 0, 0, 35, 35, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 30, 35, 35, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, 29, 35, 0, 0, 0, 35, 35, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29, 29, 29, 30, 35, 26, 26, 26, 29, 0, 18, 29, 29, 29, 0, 17, 0, 20, 35, 0, 0, 0, 35, 35, 26, 26, 26, 29, 29, 29, 29, 30, 35, 35, 26, 26, 26, 26, 0, 23, 29, 29, 29, 33, 0, 0, 0, 35, 14, 30, 26, 26, 26, 26, 29, 29, 29, 30, 32, 35, 27, 27, 27, 29, 0, 16, 0, 21, 0, 14, 0, 35, 0, 35, 30, 27, 27, 27, 29, 35, 35, 27, 27, 27, 27, 27, 0, 22, 0, 0, 15, 14, 0, 14, 0, 30, 30, 27, 27, 27, 27, 27, 35, 35, 35, 27, 27, 15, 0, 13, 30, 30, 30, 27, 27, 35, 35, 35, 35, 35, 30, 30, 30, 30, 30, 35, 35, 35, 30, 30, 30, 35, 35, 35, 35, 35, 30, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 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, 42, 43, 44, 28, 28, 10, 45, 10, 1, 46, 1, 47, 48, 49, 50, 51, 52, 48, 48, 53, 48, 48, 54, 55, 56, 57, 48, 48, 58, 59, 60, 61, 48, 48, 48, 48, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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[62] = { 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, 1, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 } ; static yyconst short int yy_base[480] = { 0, 0, 60, 101, 0, 161, 162, 169, 182, 226, 286, 346, 390, 1666, 1620, 1662, 2162, 1659, 1659, 1615, 2162, 2162, 1614, 2162, 170, 51, 217, 277, 2162, 2162, 435, 1606, 1613, 1612, 1620, 1615, 495, 18, 178, 187, 1574, 1568, 1561, 1556, 1557, 1570, 64, 1568, 2162, 1567, 352, 362, 399, 492, 537, 1567, 1574, 1573, 1574, 1551, 597, 30, 1579, 360, 33, 0, 2162, 1576, 0, 2162, 613, 85, 0, 1534, 626, 50, 2162, 52, 2162, 97, 1533, 240, 1575, 1563, 1563, 2162, 1520, 300, 1519, 537, 363, 1518, 637, 180, 168, 656, 665, 413, 0, 1531, 1517, 216, 1512, 1510, 209, 2162, 159, 625, 1494, 1497, 1490, 1476, 1477, 162, 200, 172, 144, 212, 215, 1490, 688, 297, 1489, 712, 1488, 721, 643, 745, 686, 177, 742, 757, 772, 0, 1501, 1487, 490, 1482, 1480, 256, 255, 1517, 776, 1473, 801, 276, 0, 1513, 267, 2162, 2162, 325, 0, 1462, 398, 792, 178, 599, 2162, 2162, 1461, 396, 806, 822, 831, 840, 1476, 1471, 1459, 1466, 1467, 1457, 1448, 1447, 308, 1421, 1422, 1413, 1412, 1413, 258, 361, 196, 329, 328, 367, 852, 861, 870, 1434, 1424, 1412, 1419, 1426, 1421, 1408, 1414, 309, 893, 381, 1393, 2162, 455, 898, 906, 907, 341, 917, 928, 939, 164, 1397, 1398, 1373, 1368, 1366, 1352, 1359, 392, 1343, 1342, 1315, 1303, 1267, 308, 284, 206, 364, 947, 414, 958, 969, 979, 500, 1284, 1265, 1260, 1255, 1253, 1221, 1227, 471, 480, 603, 988, 999, 1009, 503, 2162, 1225, 1231, 1226, 1219, 1225, 1225, 1212, 483, 1199, 1174, 1165, 604, 490, 579, 1018, 1029, 1039, 1169, 1145, 1110, 1093, 1100, 1082, 1059, 568, 585, 1048, 597, 1059, 1069, 1078, 1062, 513, 1032, 1009, 977, 657, 696, 394, 944, 916, 688, 672, 683, 1089, 650, 1099, 1108, 1119, 916, 732, 892, 878, 878, 797, 804, 487, 581, 1130, 1139, 1150, 809, 812, 2162, 871, 872, 822, 832, 2162, 891, 2162, 705, 774, 763, 664, 687, 707, 1161, 1170, 1181, 896, 786, 753, 730, 722, 736, 1191, 595, 1201, 1212, 1222, 918, 2162, 710, 938, 999, 694, 669, 650, 739, 567, 1240, 1231, 654, 1253, 1262, 1271, 655, 1039, 1080, 644, 611, 1283, 1292, 1301, 1313, 1139, 1140, 2162, 1171, 2162, 606, 1322, 979, 774, 489, 485, 1322, 1335, 1352, 1365, 1191, 1343, 786, 1382, 1395, 1404, 1414, 1425, 1202, 2162, 365, 387, 342, 318, 1442, 275, 1467, 1464, 801, 1479, 1494, 1509, 1524, 1444, 1539, 1554, 1569, 1576, 1360, 2162, 300, 2162, 1586, 1606, 1616, 1623, 1374, 1636, 849, 1653, 1666, 1675, 1683, 851, 1696, 1705, 1715, 1726, 1735, 1745, 1756, 1765, 1775, 1786, 997, 1795, 1805, 1816, 1825, 1057, 1835, 1846, 1855, 1865, 1876, 1885, 1895, 1906, 1915, 181, 1925, 1936, 48, 1945, 1955, 2162, 2000, 2007, 2014, 2021, 2028, 2035, 2042, 2049, 2056, 2063, 2070, 2077, 2084, 2091, 57, 2098, 2105, 2112, 2119, 2126, 2133, 2140, 2147, 2154 } ; static yyconst short int yy_def[480] = { 0, 455, 1, 455, 3, 1, 1, 456, 456, 457, 457, 458, 458, 455, 459, 455, 455, 455, 460, 461, 455, 455, 462, 455, 463, 459, 459, 459, 455, 455, 455, 30, 30, 30, 30, 30, 459, 459, 455, 460, 30, 30, 30, 30, 30, 464, 455, 465, 455, 466, 467, 464, 464, 464, 455, 54, 54, 54, 54, 54, 464, 464, 455, 468, 459, 469, 455, 469, 469, 455, 455, 455, 470, 471, 472, 471, 455, 471, 455, 473, 459, 459, 455, 455, 460, 455, 461, 461, 462, 462, 463, 474, 459, 459, 459, 459, 459, 459, 30, 30, 30, 30, 30, 30, 459, 455, 459, 455, 455, 455, 455, 455, 455, 460, 459, 459, 459, 459, 459, 464, 464, 455, 465, 465, 466, 466, 467, 464, 464, 464, 464, 464, 464, 54, 54, 54, 54, 54, 54, 464, 464, 455, 468, 475, 459, 459, 469, 469, 455, 455, 455, 455, 470, 471, 471, 472, 476, 472, 455, 455, 471, 471, 455, 459, 459, 459, 30, 30, 30, 30, 30, 30, 30, 30, 459, 455, 455, 455, 455, 455, 460, 459, 459, 459, 459, 459, 464, 464, 464, 54, 54, 54, 54, 54, 54, 54, 54, 464, 455, 459, 471, 455, 476, 472, 472, 459, 459, 459, 459, 459, 30, 30, 30, 30, 30, 30, 30, 30, 459, 455, 455, 455, 455, 455, 460, 459, 459, 459, 464, 464, 464, 464, 464, 54, 54, 54, 54, 54, 54, 54, 54, 464, 459, 476, 459, 459, 459, 455, 455, 30, 30, 30, 30, 30, 30, 30, 459, 455, 455, 455, 460, 459, 459, 464, 464, 464, 54, 54, 54, 54, 54, 54, 54, 464, 459, 459, 459, 459, 459, 459, 30, 30, 30, 30, 30, 30, 30, 459, 455, 455, 460, 459, 459, 464, 464, 464, 464, 464, 54, 54, 54, 54, 54, 54, 54, 464, 459, 459, 459, 459, 30, 455, 455, 30, 30, 30, 455, 455, 455, 455, 459, 455, 455, 460, 459, 459, 464, 464, 464, 54, 54, 54, 54, 464, 459, 459, 459, 459, 459, 459, 455, 455, 30, 30, 30, 459, 455, 455, 460, 459, 459, 464, 464, 464, 464, 464, 54, 54, 54, 464, 459, 459, 459, 459, 459, 30, 455, 455, 455, 455, 455, 455, 460, 459, 477, 478, 464, 464, 464, 464, 54, 459, 459, 459, 459, 459, 459, 459, 455, 455, 455, 479, 459, 477, 477, 478, 478, 464, 464, 464, 464, 464, 464, 464, 459, 459, 459, 459, 459, 455, 479, 455, 464, 464, 464, 464, 464, 459, 459, 459, 459, 459, 464, 464, 464, 464, 464, 459, 459, 459, 464, 464, 464, 459, 459, 459, 459, 459, 464, 464, 464, 464, 464, 459, 459, 459, 464, 464, 464, 459, 459, 459, 464, 464, 464, 0, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; static yyconst short int yy_nxt[2224] = { 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, 35, 30, 30, 30, 30, 30, 36, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 37, 14, 14, 38, 81, 152, 93, 39, 94, 94, 94, 94, 94, 94, 94, 158, 120, 159, 121, 81, 106, 121, 121, 121, 121, 121, 121, 121, 151, 105, 40, 41, 140, 42, 120, 145, 154, 81, 154, 43, 161, 105, 44, 45, 15, 16, 17, 45, 46, 47, 21, 48, 45, 49, 23, 45, 45, 50, 51, 52, 53, 51, 51, 51, 51, 28, 29, 21, 45, 54, 54, 54, 54, 55, 54, 54, 56, 57, 54, 58, 54, 59, 54, 54, 54, 54, 54, 60, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 45, 45, 62, 62, 85, 247, 21, 21, 21, 21, 15, 66, 67, 91, 68, 63, 63, 91, 91, 107, 69, 93, 201, 15, 66, 67, 248, 68, 81, 85, 128, 69, 68, 69, 91, 163, 164, 165, 163, 163, 163, 163, 183, 81, 69, 68, 108, 109, 174, 110, 151, 105, 81, 70, 92, 111, 81, 180, 112, 64, 64, 120, 202, 182, 81, 81, 70, 15, 16, 17, 93, 18, 95, 95, 95, 95, 95, 95, 95, 113, 81, 80, 226, 80, 81, 80, 168, 80, 80, 169, 81, 80, 170, 81, 171, 181, 81, 151, 105, 81, 85, 81, 80, 80, 80, 185, 262, 184, 151, 105, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 15, 16, 17, 93, 18, 96, 96, 96, 96, 96, 97, 94, 120, 120, 86, 411, 86, 197, 86, 224, 86, 86, 121, 85, 86, 121, 121, 121, 121, 121, 121, 121, 396, 81, 81, 86, 86, 86, 199, 151, 105, 81, 261, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 15, 16, 17, 74, 18, 81, 120, 205, 91, 75, 76, 77, 91, 91, 260, 394, 143, 218, 241, 91, 143, 143, 78, 91, 91, 81, 81, 227, 128, 91, 129, 129, 129, 129, 129, 129, 129, 143, 81, 81, 91, 225, 411, 79, 15, 16, 17, 74, 18, 127, 151, 105, 153, 75, 76, 77, 153, 144, 81, 120, 92, 81, 153, 225, 81, 128, 78, 130, 130, 130, 130, 130, 130, 130, 153, 225, 409, 225, 81, 93, 228, 94, 94, 94, 94, 94, 94, 79, 80, 81, 242, 81, 80, 154, 80, 256, 120, 80, 80, 320, 80, 80, 80, 98, 98, 98, 98, 98, 98, 98, 81, 120, 243, 80, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 81, 98, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 104, 105, 80, 202, 80, 247, 80, 80, 247, 128, 80, 131, 131, 131, 131, 131, 132, 129, 311, 120, 291, 80, 80, 80, 191, 273, 248, 192, 81, 248, 193, 81, 194, 396, 274, 120, 287, 394, 81, 312, 120, 119, 88, 333, 88, 119, 88, 119, 88, 88, 119, 119, 88, 119, 119, 119, 133, 133, 133, 133, 133, 133, 133, 88, 88, 88, 119, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 120, 133, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 139, 105, 119, 156, 119, 203, 119, 119, 85, 201, 119, 335, 275, 81, 120, 373, 148, 105, 149, 305, 150, 119, 119, 119, 149, 81, 150, 81, 107, 156, 156, 81, 153, 156, 292, 334, 306, 150, 150, 156, 90, 81, 80, 81, 90, 204, 80, 80, 91, 202, 90, 156, 91, 91, 390, 108, 109, 81, 110, 150, 316, 90, 90, 80, 111, 293, 290, 112, 85, 91, 351, 93, 157, 94, 94, 94, 94, 94, 94, 94, 93, 317, 94, 94, 94, 94, 94, 94, 94, 127, 120, 119, 85, 119, 380, 119, 120, 119, 119, 318, 120, 119, 81, 186, 187, 188, 186, 186, 186, 186, 371, 81, 119, 119, 119, 122, 348, 122, 81, 122, 319, 122, 122, 370, 124, 122, 124, 324, 124, 81, 124, 124, 120, 81, 124, 311, 122, 122, 122, 323, 81, 349, 372, 85, 325, 124, 124, 124, 126, 365, 119, 81, 126, 81, 119, 119, 312, 128, 126, 129, 129, 129, 129, 129, 129, 129, 345, 350, 120, 126, 126, 119, 128, 358, 129, 129, 129, 129, 129, 129, 129, 143, 81, 359, 357, 143, 143, 128, 120, 129, 129, 129, 129, 129, 129, 156, 156, 360, 200, 156, 316, 381, 143, 120, 142, 156, 80, 318, 142, 91, 80, 80, 340, 91, 142, 311, 397, 156, 120, 91, 81, 317, 144, 356, 347, 142, 142, 80, 319, 346, 91, 91, 81, 341, 392, 316, 312, 205, 157, 206, 206, 206, 206, 206, 206, 206, 205, 120, 207, 207, 207, 207, 207, 207, 207, 205, 317, 208, 208, 208, 208, 208, 209, 206, 417, 344, 422, 228, 81, 229, 229, 229, 229, 229, 229, 229, 228, 81, 230, 230, 230, 230, 230, 230, 230, 228, 81, 231, 231, 231, 231, 231, 232, 229, 318, 81, 143, 120, 120, 340, 143, 156, 156, 343, 200, 156, 143, 120, 342, 156, 156, 156, 203, 156, 332, 319, 120, 143, 143, 156, 341, 340, 331, 156, 244, 245, 246, 244, 244, 244, 244, 156, 205, 330, 206, 206, 206, 206, 206, 206, 206, 366, 341, 205, 157, 206, 206, 206, 206, 206, 206, 206, 157, 81, 205, 329, 206, 206, 206, 206, 206, 206, 367, 81, 263, 264, 265, 263, 263, 263, 263, 322, 321, 228, 81, 229, 229, 229, 229, 229, 229, 229, 372, 85, 228, 81, 229, 229, 229, 229, 229, 229, 229, 120, 228, 391, 229, 229, 229, 229, 229, 229, 368, 275, 120, 276, 276, 276, 276, 276, 276, 276, 433, 315, 275, 120, 277, 277, 277, 277, 277, 277, 277, 369, 275, 120, 278, 278, 278, 278, 278, 279, 276, 293, 81, 294, 294, 294, 294, 294, 294, 294, 366, 81, 293, 81, 295, 295, 295, 295, 295, 295, 295, 314, 293, 81, 296, 296, 296, 296, 296, 297, 294, 367, 120, 307, 308, 309, 307, 307, 307, 307, 438, 313, 275, 120, 276, 276, 276, 276, 276, 276, 276, 368, 275, 120, 276, 276, 276, 276, 276, 276, 276, 275, 81, 276, 276, 276, 276, 276, 276, 310, 304, 120, 369, 81, 326, 327, 328, 326, 326, 326, 326, 303, 293, 81, 294, 294, 294, 294, 294, 294, 294, 293, 81, 294, 294, 294, 294, 294, 294, 294, 302, 301, 293, 120, 294, 294, 294, 294, 294, 294, 388, 366, 300, 120, 335, 336, 336, 336, 336, 336, 336, 336, 120, 335, 337, 337, 337, 337, 337, 337, 337, 389, 367, 120, 335, 338, 338, 338, 338, 338, 339, 336, 368, 299, 81, 351, 352, 352, 352, 352, 352, 352, 352, 81, 351, 353, 353, 353, 353, 353, 353, 353, 388, 369, 81, 351, 354, 354, 354, 354, 354, 355, 352, 388, 298, 120, 361, 362, 363, 364, 361, 361, 361, 389, 120, 335, 336, 336, 336, 336, 336, 336, 336, 257, 389, 120, 335, 336, 336, 336, 336, 336, 336, 336, 289, 81, 335, 336, 336, 336, 336, 336, 336, 374, 288, 81, 376, 377, 378, 379, 376, 376, 376, 286, 285, 284, 81, 283, 282, 281, 280, 272, 374, 271, 374, 375, 81, 351, 352, 352, 352, 352, 352, 352, 352, 120, 351, 352, 352, 352, 352, 352, 352, 352, 81, 351, 352, 352, 352, 352, 352, 352, 270, 269, 268, 267, 381, 120, 382, 382, 382, 382, 382, 382, 382, 381, 120, 383, 383, 383, 383, 383, 383, 383, 381, 120, 384, 384, 384, 384, 384, 385, 386, 266, 257, 374, 381, 81, 387, 387, 387, 382, 382, 382, 382, 397, 81, 398, 398, 398, 398, 398, 398, 398, 374, 81, 374, 374, 397, 259, 399, 399, 399, 399, 399, 399, 399, 81, 404, 405, 406, 404, 404, 404, 404, 397, 120, 400, 400, 400, 400, 400, 401, 402, 257, 408, 408, 408, 397, 120, 403, 403, 403, 398, 398, 398, 398, 81, 258, 416, 416, 416, 257, 255, 254, 381, 120, 386, 386, 386, 386, 386, 386, 386, 81, 253, 252, 251, 381, 120, 386, 386, 386, 386, 386, 386, 386, 381, 120, 386, 386, 386, 386, 386, 386, 407, 81, 381, 250, 407, 407, 407, 407, 407, 407, 407, 249, 154, 381, 81, 408, 408, 408, 393, 240, 393, 239, 393, 81, 393, 393, 238, 237, 393, 236, 235, 234, 397, 81, 416, 416, 416, 233, 223, 393, 393, 393, 222, 395, 81, 395, 221, 395, 220, 395, 395, 219, 217, 395, 412, 413, 414, 412, 412, 412, 412, 216, 215, 120, 395, 395, 395, 397, 214, 402, 402, 402, 402, 402, 402, 402, 213, 212, 211, 210, 154, 154, 397, 120, 402, 402, 402, 402, 402, 402, 402, 147, 198, 141, 196, 195, 190, 397, 120, 402, 402, 402, 402, 402, 402, 415, 189, 125, 123, 120, 179, 178, 397, 120, 415, 415, 415, 415, 415, 415, 415, 177, 176, 175, 173, 172, 167, 417, 120, 418, 418, 418, 418, 418, 418, 418, 166, 162, 89, 87, 85, 83, 417, 120, 419, 419, 419, 419, 419, 419, 419, 82, 81, 154, 147, 141, 138, 417, 81, 420, 420, 420, 420, 420, 421, 418, 407, 407, 407, 407, 407, 407, 407, 81, 422, 137, 423, 423, 423, 423, 423, 423, 423, 136, 135, 134, 125, 123, 81, 120, 118, 117, 116, 115, 422, 81, 424, 424, 424, 424, 424, 424, 424, 114, 422, 120, 425, 425, 425, 425, 425, 426, 423, 415, 415, 415, 415, 415, 415, 415, 103, 102, 101, 100, 99, 120, 427, 428, 429, 427, 427, 427, 427, 89, 87, 120, 85, 83, 82, 81, 455, 417, 120, 418, 418, 418, 418, 418, 418, 418, 455, 455, 455, 455, 417, 81, 418, 418, 418, 418, 418, 418, 418, 417, 455, 418, 418, 418, 418, 418, 418, 455, 81, 430, 431, 432, 430, 430, 430, 430, 455, 455, 455, 455, 422, 81, 423, 423, 423, 423, 423, 423, 423, 422, 81, 423, 423, 423, 423, 423, 423, 423, 120, 422, 455, 423, 423, 423, 423, 423, 423, 455, 455, 455, 433, 120, 434, 434, 434, 434, 434, 434, 434, 433, 120, 435, 435, 435, 435, 435, 435, 435, 455, 433, 120, 436, 436, 436, 436, 436, 437, 434, 455, 455, 438, 81, 439, 439, 439, 439, 439, 439, 439, 438, 81, 440, 440, 440, 440, 440, 440, 440, 455, 438, 81, 441, 441, 441, 441, 441, 442, 439, 455, 455, 455, 120, 443, 444, 445, 443, 443, 443, 443, 433, 120, 434, 434, 434, 434, 434, 434, 434, 455, 433, 120, 434, 434, 434, 434, 434, 434, 434, 455, 455, 433, 81, 434, 434, 434, 434, 434, 434, 455, 455, 81, 446, 447, 448, 446, 446, 446, 446, 455, 438, 81, 439, 439, 439, 439, 439, 439, 439, 455, 455, 438, 81, 439, 439, 439, 439, 439, 439, 439, 438, 120, 439, 439, 439, 439, 439, 439, 455, 455, 455, 120, 449, 449, 449, 449, 449, 449, 449, 455, 455, 455, 120, 443, 443, 443, 443, 443, 443, 443, 455, 120, 450, 450, 450, 450, 450, 451, 449, 455, 455, 81, 452, 452, 452, 452, 452, 452, 452, 455, 455, 455, 81, 446, 446, 446, 446, 446, 446, 446, 455, 81, 453, 453, 453, 453, 453, 454, 452, 455, 455, 120, 449, 449, 449, 449, 449, 449, 449, 455, 455, 455, 120, 449, 449, 449, 449, 449, 449, 455, 455, 120, 452, 452, 452, 452, 452, 452, 452, 455, 455, 81, 452, 452, 452, 452, 452, 452, 455, 455, 455, 455, 81, 455, 455, 455, 455, 455, 455, 455, 455, 120, 455, 455, 455, 455, 455, 455, 455, 455, 455, 120, 65, 65, 65, 65, 65, 65, 65, 21, 21, 21, 21, 21, 21, 21, 73, 73, 73, 73, 73, 73, 73, 80, 455, 455, 455, 455, 80, 80, 84, 84, 84, 84, 84, 84, 84, 86, 455, 455, 455, 455, 86, 86, 88, 455, 455, 455, 455, 88, 88, 90, 455, 90, 455, 455, 90, 90, 119, 455, 455, 455, 455, 119, 119, 122, 455, 455, 455, 455, 122, 122, 124, 455, 455, 455, 455, 124, 124, 126, 455, 126, 455, 455, 126, 126, 142, 455, 142, 455, 455, 142, 142, 146, 455, 146, 146, 455, 455, 146, 153, 455, 153, 455, 153, 153, 153, 155, 155, 155, 155, 155, 155, 155, 160, 160, 160, 160, 160, 160, 160, 91, 455, 91, 455, 455, 91, 91, 143, 455, 143, 455, 455, 143, 143, 156, 156, 156, 156, 156, 156, 156, 393, 455, 455, 455, 455, 393, 393, 395, 455, 455, 455, 455, 395, 395, 410, 410, 410, 410, 410, 410, 410, 13, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; static yyconst short int yy_chk[2224] = { 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, 1, 2, 37, 470, 25, 2, 25, 25, 25, 25, 25, 25, 25, 75, 61, 77, 46, 64, 37, 46, 46, 46, 46, 46, 46, 46, 71, 71, 2, 2, 61, 2, 452, 64, 75, 25, 77, 2, 79, 79, 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, 3, 5, 6, 113, 210, 5, 6, 5, 6, 7, 7, 7, 24, 7, 5, 6, 24, 24, 38, 7, 94, 156, 8, 8, 8, 210, 8, 116, 39, 129, 7, 7, 8, 24, 93, 93, 93, 93, 93, 93, 93, 116, 106, 8, 8, 38, 38, 106, 38, 104, 104, 94, 7, 24, 38, 115, 113, 38, 5, 6, 129, 156, 115, 93, 449, 8, 9, 9, 9, 26, 9, 26, 26, 26, 26, 26, 26, 26, 39, 182, 81, 182, 81, 114, 81, 101, 81, 81, 101, 226, 81, 101, 104, 101, 114, 117, 139, 139, 118, 180, 26, 81, 81, 81, 118, 226, 117, 148, 148, 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, 140, 139, 87, 410, 87, 140, 87, 180, 87, 87, 121, 224, 87, 121, 121, 121, 121, 121, 121, 121, 395, 145, 27, 87, 87, 87, 145, 151, 151, 225, 225, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 174, 197, 206, 50, 11, 11, 11, 50, 50, 224, 393, 63, 174, 197, 90, 63, 63, 11, 90, 90, 184, 183, 184, 51, 50, 51, 51, 51, 51, 51, 51, 51, 63, 206, 392, 90, 183, 391, 11, 12, 12, 12, 12, 12, 50, 161, 161, 154, 12, 12, 12, 154, 63, 181, 51, 90, 227, 154, 181, 185, 52, 12, 52, 52, 52, 52, 52, 52, 52, 154, 227, 390, 185, 199, 97, 229, 97, 97, 97, 97, 97, 97, 12, 30, 218, 199, 287, 30, 161, 30, 218, 52, 30, 30, 287, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 97, 229, 202, 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, 30, 36, 36, 36, 202, 36, 233, 36, 36, 247, 53, 36, 53, 53, 53, 53, 53, 53, 53, 281, 241, 261, 36, 36, 36, 136, 241, 233, 136, 242, 247, 136, 256, 136, 375, 242, 305, 256, 374, 261, 281, 53, 54, 89, 305, 89, 54, 89, 54, 89, 89, 54, 54, 89, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 89, 89, 89, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 60, 60, 60, 157, 60, 157, 60, 60, 260, 243, 60, 336, 276, 349, 273, 349, 70, 70, 70, 273, 70, 60, 60, 60, 70, 262, 70, 306, 107, 74, 74, 274, 74, 74, 262, 306, 274, 70, 70, 74, 92, 336, 92, 276, 92, 157, 92, 92, 126, 243, 92, 74, 126, 126, 370, 107, 107, 360, 107, 70, 285, 92, 92, 92, 107, 294, 260, 107, 323, 126, 352, 95, 74, 95, 95, 95, 95, 95, 95, 95, 96, 285, 96, 96, 96, 96, 96, 96, 96, 126, 359, 120, 290, 120, 356, 120, 294, 120, 120, 286, 352, 120, 95, 128, 128, 128, 128, 128, 128, 128, 347, 96, 120, 120, 120, 123, 323, 123, 291, 123, 286, 123, 123, 346, 125, 123, 125, 291, 125, 292, 125, 125, 128, 324, 125, 299, 123, 123, 123, 290, 345, 324, 348, 348, 292, 125, 125, 125, 127, 342, 127, 320, 127, 325, 127, 127, 299, 130, 127, 130, 130, 130, 130, 130, 130, 130, 320, 325, 333, 127, 127, 127, 131, 332, 131, 131, 131, 131, 131, 131, 131, 142, 334, 333, 331, 142, 142, 132, 130, 132, 132, 132, 132, 132, 132, 155, 155, 334, 155, 155, 303, 382, 142, 131, 144, 155, 144, 304, 144, 162, 144, 144, 310, 162, 144, 311, 398, 155, 132, 162, 373, 303, 142, 330, 322, 144, 144, 144, 304, 321, 162, 162, 382, 310, 373, 316, 311, 163, 155, 163, 163, 163, 163, 163, 163, 163, 164, 398, 164, 164, 164, 164, 164, 164, 164, 165, 316, 165, 165, 165, 165, 165, 165, 165, 418, 315, 423, 186, 163, 186, 186, 186, 186, 186, 186, 186, 187, 164, 187, 187, 187, 187, 187, 187, 187, 188, 165, 188, 188, 188, 188, 188, 188, 188, 318, 418, 198, 423, 186, 329, 198, 203, 203, 314, 203, 203, 198, 187, 313, 204, 204, 203, 204, 204, 302, 318, 188, 198, 198, 204, 329, 340, 301, 203, 205, 205, 205, 205, 205, 205, 205, 204, 207, 300, 207, 207, 207, 207, 207, 207, 207, 343, 340, 208, 203, 208, 208, 208, 208, 208, 208, 208, 204, 205, 209, 298, 209, 209, 209, 209, 209, 209, 343, 207, 228, 228, 228, 228, 228, 228, 228, 289, 288, 230, 208, 230, 230, 230, 230, 230, 230, 230, 372, 372, 231, 209, 231, 231, 231, 231, 231, 231, 231, 228, 232, 372, 232, 232, 232, 232, 232, 232, 344, 244, 230, 244, 244, 244, 244, 244, 244, 244, 434, 284, 245, 231, 245, 245, 245, 245, 245, 245, 245, 344, 246, 232, 246, 246, 246, 246, 246, 246, 246, 263, 244, 263, 263, 263, 263, 263, 263, 263, 357, 434, 264, 245, 264, 264, 264, 264, 264, 264, 264, 283, 265, 246, 265, 265, 265, 265, 265, 265, 265, 357, 263, 275, 275, 275, 275, 275, 275, 275, 439, 282, 277, 264, 277, 277, 277, 277, 277, 277, 277, 358, 278, 265, 278, 278, 278, 278, 278, 278, 278, 279, 275, 279, 279, 279, 279, 279, 279, 280, 272, 439, 358, 277, 293, 293, 293, 293, 293, 293, 293, 271, 295, 278, 295, 295, 295, 295, 295, 295, 295, 296, 279, 296, 296, 296, 296, 296, 296, 296, 270, 269, 297, 293, 297, 297, 297, 297, 297, 297, 365, 366, 268, 295, 307, 307, 307, 307, 307, 307, 307, 307, 296, 308, 308, 308, 308, 308, 308, 308, 308, 365, 366, 297, 309, 309, 309, 309, 309, 309, 309, 309, 368, 267, 307, 326, 326, 326, 326, 326, 326, 326, 326, 308, 327, 327, 327, 327, 327, 327, 327, 327, 380, 368, 309, 328, 328, 328, 328, 328, 328, 328, 328, 388, 266, 326, 335, 335, 335, 335, 335, 335, 335, 380, 327, 337, 337, 337, 337, 337, 337, 337, 337, 259, 388, 328, 338, 338, 338, 338, 338, 338, 338, 338, 258, 335, 339, 339, 339, 339, 339, 339, 339, 350, 257, 337, 351, 351, 351, 351, 351, 351, 351, 255, 254, 253, 338, 252, 251, 250, 249, 240, 350, 239, 350, 350, 339, 353, 353, 353, 353, 353, 353, 353, 353, 351, 354, 354, 354, 354, 354, 354, 354, 354, 350, 355, 355, 355, 355, 355, 355, 355, 238, 237, 236, 235, 361, 353, 361, 361, 361, 361, 361, 361, 361, 362, 354, 362, 362, 362, 362, 362, 362, 362, 363, 355, 363, 363, 363, 363, 363, 363, 363, 234, 223, 371, 364, 361, 364, 364, 364, 364, 364, 364, 364, 376, 362, 376, 376, 376, 376, 376, 376, 376, 371, 363, 371, 371, 377, 222, 377, 377, 377, 377, 377, 377, 377, 364, 381, 381, 381, 381, 381, 381, 381, 378, 376, 378, 378, 378, 378, 378, 378, 378, 221, 408, 408, 408, 379, 377, 379, 379, 379, 379, 379, 379, 379, 381, 220, 416, 416, 416, 219, 217, 216, 383, 378, 383, 383, 383, 383, 383, 383, 383, 408, 215, 214, 213, 384, 379, 384, 384, 384, 384, 384, 384, 384, 385, 416, 385, 385, 385, 385, 385, 385, 385, 383, 386, 212, 386, 386, 386, 386, 386, 386, 386, 211, 200, 387, 384, 387, 387, 387, 394, 196, 394, 195, 394, 385, 394, 394, 194, 193, 394, 192, 191, 190, 403, 386, 403, 403, 403, 189, 179, 394, 394, 394, 178, 396, 387, 396, 177, 396, 176, 396, 396, 175, 173, 396, 397, 397, 397, 397, 397, 397, 397, 172, 171, 403, 396, 396, 396, 399, 170, 399, 399, 399, 399, 399, 399, 399, 169, 168, 167, 166, 160, 153, 400, 397, 400, 400, 400, 400, 400, 400, 400, 147, 143, 141, 138, 137, 135, 401, 399, 401, 401, 401, 401, 401, 401, 401, 134, 124, 122, 119, 112, 111, 402, 400, 402, 402, 402, 402, 402, 402, 402, 110, 109, 108, 103, 102, 100, 404, 401, 404, 404, 404, 404, 404, 404, 404, 99, 91, 88, 86, 84, 83, 405, 402, 405, 405, 405, 405, 405, 405, 405, 82, 80, 73, 67, 62, 59, 406, 404, 406, 406, 406, 406, 406, 406, 406, 407, 407, 407, 407, 407, 407, 407, 405, 412, 58, 412, 412, 412, 412, 412, 412, 412, 57, 56, 55, 49, 47, 406, 45, 44, 43, 42, 41, 413, 407, 413, 413, 413, 413, 413, 413, 413, 40, 414, 412, 414, 414, 414, 414, 414, 414, 414, 415, 415, 415, 415, 415, 415, 415, 35, 34, 33, 32, 31, 413, 417, 417, 417, 417, 417, 417, 417, 22, 19, 414, 18, 17, 15, 14, 13, 419, 415, 419, 419, 419, 419, 419, 419, 419, 0, 0, 0, 0, 420, 417, 420, 420, 420, 420, 420, 420, 420, 421, 0, 421, 421, 421, 421, 421, 421, 0, 419, 422, 422, 422, 422, 422, 422, 422, 0, 0, 0, 0, 424, 420, 424, 424, 424, 424, 424, 424, 424, 425, 421, 425, 425, 425, 425, 425, 425, 425, 422, 426, 0, 426, 426, 426, 426, 426, 426, 0, 0, 0, 427, 424, 427, 427, 427, 427, 427, 427, 427, 428, 425, 428, 428, 428, 428, 428, 428, 428, 0, 429, 426, 429, 429, 429, 429, 429, 429, 429, 0, 0, 430, 427, 430, 430, 430, 430, 430, 430, 430, 431, 428, 431, 431, 431, 431, 431, 431, 431, 0, 432, 429, 432, 432, 432, 432, 432, 432, 432, 0, 0, 0, 430, 433, 433, 433, 433, 433, 433, 433, 435, 431, 435, 435, 435, 435, 435, 435, 435, 0, 436, 432, 436, 436, 436, 436, 436, 436, 436, 0, 0, 437, 433, 437, 437, 437, 437, 437, 437, 0, 0, 435, 438, 438, 438, 438, 438, 438, 438, 0, 440, 436, 440, 440, 440, 440, 440, 440, 440, 0, 0, 441, 437, 441, 441, 441, 441, 441, 441, 441, 442, 438, 442, 442, 442, 442, 442, 442, 0, 0, 0, 440, 443, 443, 443, 443, 443, 443, 443, 0, 0, 0, 441, 444, 444, 444, 444, 444, 444, 444, 0, 442, 445, 445, 445, 445, 445, 445, 445, 0, 0, 443, 446, 446, 446, 446, 446, 446, 446, 0, 0, 0, 444, 447, 447, 447, 447, 447, 447, 447, 0, 445, 448, 448, 448, 448, 448, 448, 448, 0, 0, 446, 450, 450, 450, 450, 450, 450, 450, 0, 0, 0, 447, 451, 451, 451, 451, 451, 451, 0, 0, 448, 453, 453, 453, 453, 453, 453, 453, 0, 0, 450, 454, 454, 454, 454, 454, 454, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, 456, 456, 456, 456, 456, 456, 456, 457, 457, 457, 457, 457, 457, 457, 458, 458, 458, 458, 458, 458, 458, 459, 0, 0, 0, 0, 459, 459, 460, 460, 460, 460, 460, 460, 460, 461, 0, 0, 0, 0, 461, 461, 462, 0, 0, 0, 0, 462, 462, 463, 0, 463, 0, 0, 463, 463, 464, 0, 0, 0, 0, 464, 464, 465, 0, 0, 0, 0, 465, 465, 466, 0, 0, 0, 0, 466, 466, 467, 0, 467, 0, 0, 467, 467, 468, 0, 468, 0, 0, 468, 468, 469, 0, 469, 469, 0, 0, 469, 471, 0, 471, 0, 471, 471, 471, 472, 472, 472, 472, 472, 472, 472, 473, 473, 473, 473, 473, 473, 473, 474, 0, 474, 0, 0, 474, 474, 475, 0, 475, 0, 0, 475, 475, 476, 476, 476, 476, 476, 476, 476, 477, 0, 0, 0, 0, 477, 477, 478, 0, 0, 0, 0, 478, 478, 479, 479, 479, 479, 479, 479, 479, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; 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, 2007 * Todd C. Miller * * 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 #include #include #include #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif /* STDC_HEADERS */ #ifdef HAVE_STRING_H # include #else # ifdef HAVE_STRINGS_H # include # endif #endif /* HAVE_STRING_H */ #ifdef HAVE_UNISTD_H # include #endif /* HAVE_UNISTD_H */ #if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS) # include #endif /* HAVE_MALLOC_H && !STDC_HEADERS */ #include #include "sudo.h" #include "parse.h" #include #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 1110 "lex.yy.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 defined(YY_STACK_USED) && 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 #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 105 "toke.l" #line 1266 "lex.yy.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 >= 456 ) 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] != 2162 ); 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 106 "toke.l" BEGIN STARTDEFS; YY_BREAK case 2: YY_RULE_SETUP #line 108 "toke.l" { BEGIN INDEFS; LEXTRACE("DEFVAR "); if (!fill(yytext, yyleng)) yyterminate(); return(DEFVAR); } YY_BREAK case 3: YY_RULE_SETUP #line 117 "toke.l" { BEGIN STARTDEFS; LEXTRACE(", "); return(','); } /* return ',' */ YY_BREAK case 4: YY_RULE_SETUP #line 123 "toke.l" { LEXTRACE("= "); return('='); } /* return '=' */ YY_BREAK case 5: YY_RULE_SETUP #line 128 "toke.l" { LEXTRACE("+= "); return('+'); } /* return '+' */ YY_BREAK case 6: YY_RULE_SETUP #line 133 "toke.l" { LEXTRACE("-= "); return('-'); } /* return '-' */ YY_BREAK case 7: YY_RULE_SETUP #line 138 "toke.l" { LEXTRACE("WORD(1) "); if (!fill(yytext + 1, yyleng - 2)) yyterminate(); return(WORD); } YY_BREAK case 8: YY_RULE_SETUP #line 145 "toke.l" { LEXTRACE("WORD(2) "); if (!fill(yytext, yyleng)) yyterminate(); return(WORD); } YY_BREAK case 9: YY_RULE_SETUP #line 154 "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 162 "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 170 "toke.l" { BEGIN INITIAL; yyless(0); return(COMMAND); } /* end of command line args */ YY_BREAK case 12: YY_RULE_SETUP #line 176 "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 184 "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 202 "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 231 "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 254 "toke.l" { /* cmnd does not require passwd for this user */ LEXTRACE("NOPASSWD "); return(NOPASSWD); } YY_BREAK case 17: YY_RULE_SETUP #line 260 "toke.l" { /* cmnd requires passwd for this user */ LEXTRACE("PASSWD "); return(PASSWD); } YY_BREAK case 18: YY_RULE_SETUP #line 266 "toke.l" { LEXTRACE("NOEXEC "); return(NOEXEC); } YY_BREAK case 19: YY_RULE_SETUP #line 271 "toke.l" { LEXTRACE("EXEC "); return(EXEC); } YY_BREAK case 20: YY_RULE_SETUP #line 276 "toke.l" { LEXTRACE("SETENV "); return(SETENV); } YY_BREAK case 21: YY_RULE_SETUP #line 281 "toke.l" { LEXTRACE("NOSETENV "); return(NOSETENV); } YY_BREAK case 22: YY_RULE_SETUP #line 286 "toke.l" { LEXTRACE("NOMONITOR "); return(NOMONITOR); } YY_BREAK case 23: YY_RULE_SETUP #line 291 "toke.l" { LEXTRACE("MONITOR "); return(MONITOR); } YY_BREAK case 24: YY_RULE_SETUP #line 296 "toke.l" { /* netgroup */ if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("NETGROUP "); return(NETGROUP); } YY_BREAK case 25: YY_RULE_SETUP #line 304 "toke.l" { /* UN*X group */ if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("USERGROUP "); return(USERGROUP); } YY_BREAK case 26: YY_RULE_SETUP #line 312 "toke.l" { if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("NTWKADDR "); return(NTWKADDR); } YY_BREAK case 27: YY_RULE_SETUP #line 319 "toke.l" { if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("NTWKADDR "); return(NTWKADDR); } YY_BREAK case 28: YY_RULE_SETUP #line 326 "toke.l" { BEGIN GOTRUNAS; LEXTRACE("RUNAS "); return (RUNAS); } YY_BREAK case 29: YY_RULE_SETUP #line 332 "toke.l" { if (strcmp(yytext, "ALL") == 0) { LEXTRACE("ALL "); return(ALL); } else { if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("ALIAS "); return(ALIAS); } } YY_BREAK case 30: YY_RULE_SETUP #line 344 "toke.l" { /* username/uid that user can run command as */ if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("WORD(3) "); return(WORD); } YY_BREAK case 31: YY_RULE_SETUP #line 352 "toke.l" { BEGIN INITIAL; } YY_BREAK case 32: YY_RULE_SETUP #line 356 "toke.l" { /* no command args allowed for Defaults!/path */ if (!fill_cmnd(yytext, yyleng)) yyterminate(); LEXTRACE("COMMAND "); return(COMMAND); } YY_BREAK case 33: YY_RULE_SETUP #line 364 "toke.l" { BEGIN GOTCMND; LEXTRACE("COMMAND "); if (!fill_cmnd(yytext, yyleng)) yyterminate(); } /* sudo -e */ YY_BREAK case 34: YY_RULE_SETUP #line 371 "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 35: YY_RULE_SETUP #line 386 "toke.l" { /* a word */ if (!fill(yytext, yyleng)) yyterminate(); LEXTRACE("WORD(4) "); return(WORD); } YY_BREAK case 36: YY_RULE_SETUP #line 394 "toke.l" { LEXTRACE(", "); return(','); } /* return ',' */ YY_BREAK case 37: YY_RULE_SETUP #line 399 "toke.l" { LEXTRACE("= "); return('='); } /* return '=' */ YY_BREAK case 38: YY_RULE_SETUP #line 404 "toke.l" { LEXTRACE(": "); return(':'); } /* return ':' */ YY_BREAK case 39: YY_RULE_SETUP #line 409 "toke.l" { if (yyleng % 2 == 1) return('!'); /* return '!' */ } YY_BREAK case 40: YY_RULE_SETUP #line 414 "toke.l" { BEGIN INITIAL; ++sudolineno; LEXTRACE("\n"); return(COMMENT); } /* return newline */ YY_BREAK case 41: YY_RULE_SETUP #line 421 "toke.l" { /* throw away space/tabs */ sawspace = TRUE; /* but remember for fill_args */ } YY_BREAK case 42: YY_RULE_SETUP #line 425 "toke.l" { sawspace = TRUE; /* remember for fill_args */ ++sudolineno; LEXTRACE("\n\t"); } /* throw away EOL after \ */ YY_BREAK case 43: YY_RULE_SETUP #line 431 "toke.l" { BEGIN INITIAL; ++sudolineno; LEXTRACE("\n"); return(COMMENT); } /* return comments */ YY_BREAK case 44: YY_RULE_SETUP #line 438 "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 443 "toke.l" { if (YY_START != INITIAL) { BEGIN INITIAL; LEXTRACE("ERROR "); return(ERROR); } if (!pop_include()) yyterminate(); } YY_BREAK case 45: YY_RULE_SETUP #line 453 "toke.l" ECHO; YY_BREAK #line 1841 "lex.yy.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 >= 456 ) 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 >= 456 ) 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 == 455); 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 #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 defined(YY_ALWAYS_INTERACTIVE) && YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if defined(YY_NEVER_INTERACTIVE) && 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 defined(YY_MAIN) && YY_MAIN int main() { yylex(); return 0; } #endif #line 453 "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); }