Files
sudo/toke.c
2009-04-22 20:32:08 +00:00

3534 lines
112 KiB
C

/* $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 <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 49
#define YY_END_OF_BUFFER 50
static yyconst short int yy_accept[545] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 50, 37, 45, 44, 43, 48, 37, 38,
39, 37, 40, 37, 37, 37, 37, 42, 41, 48,
33, 33, 33, 33, 33, 33, 48, 37, 37, 45,
48, 33, 33, 33, 33, 33, 1, 48, 37, 37,
16, 15, 16, 15, 15, 48, 48, 48, 2, 8,
7, 8, 3, 8, 4, 48, 12, 12, 12, 10,
11, 37, 0, 45, 43, 0, 47, 0, 37, 28,
0, 27, 0, 36, 36, 0, 37, 37, 0, 37,
37, 37, 37, 0, 31, 33, 33, 33, 33, 33,
33, 37, 46, 37, 45, 0, 0, 0, 0, 0,
0, 37, 37, 37, 37, 37, 1, 0, 34, 34,
0, 37, 16, 16, 14, 13, 14, 0, 0, 2,
8, 0, 5, 6, 8, 8, 12, 0, 12, 12,
0, 9, 0, 0, 0, 37, 37, 37, 37, 37,
0, 0, 31, 31, 33, 33, 33, 33, 33, 33,
33, 37, 0, 0, 0, 0, 0, 0, 37, 37,
37, 37, 37, 0, 37, 9, 0, 37, 37, 37,
37, 37, 37, 0, 32, 32, 32, 0, 0, 31,
31, 31, 31, 31, 31, 31, 33, 33, 33, 33,
33, 33, 33, 37, 0, 0, 0, 0, 0, 0,
37, 37, 37, 37, 37, 37, 37, 0, 0, 32,
32, 32, 0, 31, 31, 0, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 0, 24, 33,
33, 33, 33, 33, 37, 0, 0, 0, 0, 37,
37, 37, 37, 37, 37, 37, 37, 0, 32, 0,
31, 31, 31, 0, 0, 0, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 33,
33, 33, 33, 33, 37, 0, 0, 0, 37, 37,
37, 29, 29, 29, 0, 0, 31, 31, 31, 31,
31, 31, 31, 0, 0, 0, 0, 0, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 0, 23, 33, 33, 0, 22, 0, 25,
37, 0, 0, 0, 37, 37, 37, 37, 29, 29,
29, 29, 0, 31, 0, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 0, 0, 0, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 33, 33, 35, 0, 0, 0, 37, 19,
34, 37, 30, 30, 30, 31, 0, 0, 0, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 0, 0, 0, 0, 0, 31, 31, 31,
31, 31, 31, 31, 31, 0, 21, 0, 26, 0,
19, 0, 0, 37, 0, 37, 37, 37, 30, 30,
30, 30, 30, 0, 0, 0, 0, 0, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 0, 0,
0, 20, 19, 0, 19, 0, 37, 37, 37, 30,
30, 0, 0, 0, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 20, 0, 17, 0, 37, 37, 37, 37,
37, 0, 0, 0, 0, 0, 31, 31, 31, 31,
31, 31, 31, 31, 0, 37, 37, 37, 31, 31,
31, 31, 31, 31, 0, 37, 37, 37, 37, 37,
31, 31, 31, 31, 31, 0, 18, 29, 29, 29,
29, 29, 29, 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, 23, 24, 1, 1,
25, 26, 10, 27, 28, 29, 30, 31, 32, 29,
33, 34, 33, 33, 33, 33, 33, 35, 36, 37,
33, 38, 39, 40, 41, 42, 43, 44, 33, 33,
10, 45, 10, 1, 46, 1, 47, 48, 49, 50,
51, 52, 53, 53, 54, 53, 53, 55, 56, 57,
58, 53, 53, 59, 60, 61, 62, 53, 53, 53,
53, 53, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 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[63] =
{ 0,
1, 2, 3, 4, 5, 6, 1, 4, 4, 1,
1, 2, 1, 7, 8, 9, 9, 9, 9, 9,
9, 9, 9, 10, 6, 4, 1, 9, 9, 9,
9, 9, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 11, 12, 13, 13, 13, 13,
13, 13, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12
} ;
static yyconst short int yy_base[608] =
{ 0,
0, 61, 62, 63, 69, 84, 128, 189, 250, 294,
80, 101, 2372, 2325, 2367, 3392, 2360, 337, 2310, 3392,
3392, 2307, 3392, 107, 347, 119, 137, 2313, 3392, 3392,
399, 2292, 446, 2282, 2289, 2284, 497, 145, 35, 167,
521, 2250, 2244, 2234, 2229, 2230, 2261, 193, 256, 55,
0, 3392, 2256, 0, 3392, 264, 573, 110, 0, 2214,
3392, 73, 3392, 76, 3392, 117, 2213, 105, 106, 3392,
142, 2204, 306, 2229, 2224, 2224, 3392, 201, 209, 2181,
506, 2180, 543, 276, 2179, 554, 306, 581, 2185, 2185,
325, 364, 317, 2172, 55, 618, 0, 2155, 240, 2138,
2127, 125, 3392, 98, 523, 2074, 2078, 2035, 2030, 2021,
146, 115, 219, 29, 212, 149, 2068, 463, 579, 2022,
649, 154, 0, 2062, 256, 3392, 3392, 598, 284, 0,
2020, 674, 3392, 3392, 2016, 488, 2014, 2051, 271, 307,
288, 2046, 2035, 2023, 676, 688, 720, 752, 784, 1989,
1978, 821, 268, 859, 896, 1971, 1927, 1942, 1937, 1929,
1935, 236, 1885, 1887, 1833, 1833, 1811, 300, 157, 1814,
259, 79, 329, 691, 344, 1857, 1840, 701, 348, 935,
967, 711, 366, 1818, 1817, 731, 455, 1801, 1800, 487,
741, 999, 760, 768, 1037, 803, 1799, 401, 1790, 1767,
1765, 1751, 1748, 356, 1721, 1683, 1652, 1665, 1652, 369,
442, 503, 233, 462, 1076, 1108, 1140, 1686, 1670, 838,
1670, 1651, 1650, 1648, 502, 876, 505, 913, 557, 1172,
0, 945, 1183, 954, 774, 1221, 977, 526, 3392, 1626,
1616, 1622, 1594, 1582, 532, 1576, 1544, 1545, 581, 363,
21, 577, 987, 490, 1260, 1292, 1019, 1580, 1545, 1544,
1530, 1322, 630, 1056, 1086, 1096, 647, 670, 794, 1116,
926, 1361, 0, 1126, 1372, 1148, 884, 1410, 1158, 583,
1510, 1517, 640, 657, 618, 1494, 1465, 486, 632, 599,
638, 1448, 1479, 1510, 1480, 1430, 1428, 1200, 1542, 1238,
1208, 1579, 1270, 1278, 1437, 1302, 1312, 1341, 674, 711,
987, 1010, 1389, 1067, 1618, 0, 1429, 1629, 1456, 1246,
1667, 1466, 688, 3392, 1406, 1394, 689, 3392, 743, 3392,
766, 1380, 1337, 605, 1017, 514, 785, 1489, 501, 1705,
1736, 1498, 1373, 1325, 1519, 954, 1528, 968, 1768, 0,
603, 1779, 1559, 1347, 1816, 1598, 1648, 1686, 1715, 1096,
1158, 1677, 1725, 1725, 1746, 1855, 0, 1748, 1866, 1757,
1397, 1798, 861, 862, 1259, 1249, 1242, 1453, 820, 1895,
1203, 1927, 1959, 1991, 2023, 1223, 1835, 1886, 1909, 1222,
1261, 1293, 1935, 1467, 2055, 0, 673, 2066, 1943, 1567,
2103, 1969, 1977, 1196, 2001, 2011, 2033, 1312, 1332, 1877,
814, 833, 2142, 0, 898, 1039, 3392, 1099, 3392, 1137,
2031, 1909, 1345, 877, 1110, 1106, 2083, 1138, 2152, 2184,
2216, 2248, 2046, 2120, 1069, 2162, 2172, 2194, 1056, 1002,
1543, 1599, 2200, 1649, 2280, 0, 916, 2291, 2224, 1917,
2328, 2234, 2257, 2266, 2309, 1789, 964, 1028, 907, 939,
314, 878, 839, 2359, 821, 2384, 2397, 2429, 2461, 2381,
2317, 2411, 2439, 2449, 786, 775, 1836, 1896, 2469, 1960,
2493, 0, 1022, 2504, 2477, 2091, 2523, 781, 2542, 2551,
2420, 729, 3392, 711, 3392, 1146, 2559, 1476, 2591, 2623,
2570, 2576, 638, 2602, 2612, 2633, 599, 582, 1992, 559,
556, 2641, 0, 1186, 2351, 2655, 2687, 2719, 2663, 2671,
2695, 468, 0, 391, 310, 2703, 1478, 2751, 2783, 2733,
3392, 2739, 2763, 2128, 3392, 193, 3392, 2771, 2791, 2801,
126, 2821, 2813, 3392, 2866, 2879, 2892, 2905, 2918, 2931,
2944, 2957, 2970, 2975, 2988, 3001, 3003, 3016, 3029, 3042,
3055, 3068, 3081, 3086, 3092, 3105, 3118, 3123, 3129, 3134,
3139, 3144, 3150, 3155, 3160, 3165, 3171, 3178, 3183, 3188,
3193, 3199, 3206, 3211, 3216, 3222, 3229, 3234, 3241, 3247,
3254, 3259, 3266, 3272, 3279, 3292, 3305, 3310, 3317, 3323,
3336, 3341, 3348, 3353, 3360, 3365, 3378
} ;
static yyconst short int yy_def[608] =
{ 0,
544, 1, 1, 1, 545, 545, 546, 546, 547, 547,
548, 548, 544, 549, 544, 544, 544, 550, 551, 544,
544, 552, 544, 553, 549, 25, 25, 554, 544, 544,
544, 31, 31, 33, 33, 33, 549, 25, 549, 544,
550, 31, 31, 33, 33, 33, 544, 544, 555, 549,
556, 544, 556, 556, 544, 544, 550, 544, 557, 558,
544, 558, 544, 558, 544, 559, 560, 560, 560, 544,
544, 549, 549, 544, 544, 561, 544, 562, 544, 551,
551, 552, 552, 553, 563, 549, 549, 25, 554, 88,
88, 88, 88, 564, 565, 31, 33, 33, 33, 33,
33, 549, 544, 549, 544, 544, 544, 544, 544, 544,
561, 549, 88, 549, 549, 549, 544, 544, 555, 566,
549, 549, 556, 556, 544, 544, 544, 562, 544, 557,
558, 558, 544, 544, 558, 558, 560, 544, 560, 560,
544, 544, 561, 567, 544, 549, 549, 549, 88, 149,
568, 544, 569, 544, 31, 33, 33, 33, 33, 33,
33, 549, 544, 544, 544, 544, 544, 561, 549, 149,
549, 549, 549, 544, 549, 544, 567, 549, 549, 549,
549, 549, 549, 570, 571, 571, 186, 572, 571, 573,
154, 544, 192, 192, 544, 192, 33, 33, 33, 33,
33, 33, 33, 549, 544, 544, 544, 544, 544, 561,
549, 549, 549, 549, 549, 549, 549, 544, 574, 574,
220, 574, 575, 576, 577, 544, 578, 195, 578, 578,
230, 578, 544, 233, 233, 544, 233, 544, 544, 33,
33, 33, 33, 33, 549, 544, 544, 544, 561, 549,
549, 549, 549, 549, 549, 549, 549, 579, 579, 580,
581, 544, 544, 544, 544, 544, 582, 582, 583, 236,
583, 583, 272, 583, 544, 275, 275, 544, 275, 33,
33, 33, 33, 33, 549, 544, 544, 561, 549, 549,
549, 549, 549, 549, 544, 584, 585, 262, 544, 299,
299, 544, 299, 544, 544, 544, 544, 544, 544, 586,
586, 587, 278, 587, 587, 315, 587, 544, 318, 318,
544, 318, 544, 544, 33, 33, 544, 544, 544, 544,
549, 544, 544, 561, 549, 549, 549, 549, 549, 549,
549, 549, 544, 588, 544, 589, 302, 589, 589, 349,
349, 544, 352, 352, 544, 352, 544, 544, 544, 544,
590, 590, 591, 321, 591, 591, 366, 591, 544, 369,
369, 369, 33, 33, 549, 544, 544, 561, 549, 549,
549, 549, 549, 549, 549, 544, 544, 544, 544, 592,
592, 593, 355, 593, 593, 395, 395, 544, 398, 398,
544, 398, 544, 544, 544, 544, 544, 544, 594, 594,
595, 595, 595, 413, 413, 544, 544, 544, 544, 544,
544, 561, 561, 549, 596, 597, 549, 549, 549, 549,
549, 549, 549, 544, 544, 544, 544, 544, 544, 598,
598, 599, 401, 599, 599, 445, 445, 544, 448, 448,
544, 448, 544, 544, 544, 544, 600, 600, 544, 601,
561, 549, 596, 596, 597, 597, 549, 549, 549, 549,
549, 544, 544, 544, 544, 602, 602, 603, 451, 603,
603, 481, 481, 544, 484, 484, 484, 544, 544, 544,
544, 544, 544, 601, 544, 561, 549, 549, 549, 549,
549, 544, 544, 544, 544, 544, 544, 604, 604, 605,
605, 605, 512, 512, 561, 549, 549, 549, 544, 544,
544, 544, 606, 606, 607, 549, 549, 549, 549, 549,
544, 544, 544, 544, 544, 607, 544, 549, 549, 549,
549, 549, 549, 0, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544
} ;
static yyconst short int yy_nxt[3455] =
{ 0,
14, 15, 16, 17, 14, 18, 19, 20, 21, 14,
22, 23, 14, 14, 24, 25, 26, 27, 25, 25,
25, 25, 25, 28, 29, 30, 14, 31, 31, 31,
31, 32, 33, 33, 34, 33, 35, 33, 36, 33,
33, 33, 33, 33, 37, 14, 38, 38, 38, 38,
38, 38, 14, 14, 14, 14, 14, 14, 14, 39,
14, 14, 40, 47, 47, 73, 41, 48, 48, 152,
15, 52, 53, 73, 54, 290, 49, 49, 154, 73,
55, 68, 16, 69, 70, 15, 52, 53, 171, 54,
42, 43, 55, 54, 44, 55, 104, 133, 45, 73,
134, 46, 68, 16, 69, 70, 139, 55, 54, 140,
85, 129, 103, 56, 85, 85, 122, 132, 136, 103,
132, 50, 50, 73, 71, 213, 129, 103, 56, 15,
16, 17, 85, 57, 91, 91, 91, 91, 91, 91,
91, 91, 73, 141, 142, 71, 137, 162, 77, 138,
138, 86, 92, 92, 92, 92, 92, 93, 72, 73,
90, 90, 90, 90, 90, 90, 90, 90, 105, 73,
73, 169, 58, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
15, 16, 17, 73, 57, 537, 106, 107, 73, 173,
108, 73, 168, 175, 109, 118, 211, 110, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 72, 58, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 15, 16, 17, 61, 57, 73, 129, 103, 120,
62, 63, 64, 120, 120, 125, 103, 126, 172, 127,
170, 157, 139, 126, 65, 127, 158, 73, 159, 85,
73, 120, 152, 85, 85, 129, 103, 127, 127, 141,
142, 191, 211, 204, 66, 15, 16, 17, 61, 57,
121, 85, 77, 73, 62, 63, 64, 72, 127, 72,
140, 72, 537, 72, 72, 138, 77, 72, 65, 211,
86, 146, 147, 148, 146, 146, 146, 146, 146, 72,
72, 72, 150, 150, 150, 150, 150, 150, 66, 77,
150, 150, 150, 150, 150, 150, 150, 150, 210, 78,
73, 138, 79, 79, 79, 79, 79, 79, 79, 79,
87, 178, 88, 88, 88, 88, 88, 88, 88, 88,
89, 77, 496, 73, 90, 90, 90, 90, 90, 150,
150, 150, 150, 150, 150, 150, 150, 211, 73, 89,
289, 73, 73, 90, 90, 90, 90, 90, 90, 72,
73, 214, 238, 72, 345, 72, 245, 73, 72, 72,
73, 72, 72, 72, 96, 96, 96, 96, 96, 96,
96, 96, 89, 249, 239, 72, 96, 96, 96, 96,
96, 97, 97, 97, 97, 97, 97, 97, 97, 97,
97, 97, 97, 73, 97, 90, 90, 90, 90, 90,
90, 72, 72, 72, 72, 72, 72, 72, 72, 72,
72, 97, 97, 97, 97, 97, 97, 97, 97, 544,
222, 222, 222, 97, 97, 97, 97, 97, 79, 79,
79, 79, 79, 79, 79, 79, 73, 250, 77, 129,
103, 479, 72, 72, 72, 72, 72, 72, 102, 103,
72, 152, 72, 253, 72, 72, 73, 80, 72, 80,
191, 80, 252, 80, 80, 338, 152, 80, 226, 152,
72, 72, 72, 77, 105, 191, 89, 238, 228, 80,
80, 80, 132, 78, 73, 334, 79, 79, 79, 79,
79, 79, 79, 79, 82, 73, 82, 73, 82, 239,
82, 82, 106, 107, 82, 84, 108, 72, 73, 84,
109, 72, 72, 110, 251, 84, 82, 82, 82, 544,
544, 152, 345, 380, 111, 77, 73, 84, 84, 72,
228, 285, 120, 77, 323, 128, 120, 120, 544, 544,
544, 544, 544, 544, 544, 544, 149, 149, 149, 149,
149, 149, 149, 149, 120, 479, 324, 77, 149, 149,
149, 149, 149, 544, 544, 544, 544, 544, 544, 544,
544, 73, 443, 121, 390, 390, 291, 149, 149, 149,
149, 149, 149, 155, 155, 155, 155, 155, 155, 155,
155, 327, 288, 73, 152, 155, 155, 155, 155, 155,
119, 502, 72, 191, 119, 378, 72, 72, 329, 336,
119, 152, 73, 328, 149, 149, 149, 149, 149, 149,
228, 331, 119, 119, 72, 131, 73, 85, 131, 131,
330, 85, 73, 226, 152, 131, 335, 85, 152, 323,
327, 337, 120, 228, 440, 440, 120, 228, 131, 85,
85, 178, 120, 179, 179, 179, 179, 179, 179, 179,
179, 324, 328, 495, 120, 120, 215, 216, 217, 215,
215, 215, 215, 215, 178, 152, 179, 179, 179, 179,
179, 179, 73, 178, 270, 180, 180, 180, 180, 180,
180, 180, 180, 152, 329, 73, 220, 220, 221, 222,
222, 222, 222, 222, 188, 73, 196, 196, 196, 196,
196, 196, 196, 196, 73, 178, 330, 181, 181, 181,
181, 181, 182, 179, 179, 230, 230, 230, 230, 230,
230, 230, 230, 231, 231, 231, 231, 231, 232, 273,
273, 273, 273, 273, 274, 152, 73, 72, 443, 183,
183, 183, 183, 183, 183, 183, 183, 226, 152, 393,
73, 183, 183, 183, 183, 183, 544, 270, 229, 229,
229, 229, 229, 229, 229, 229, 375, 226, 152, 73,
183, 183, 183, 183, 183, 183, 185, 186, 187, 187,
187, 187, 187, 187, 188, 381, 544, 152, 189, 189,
189, 189, 189, 259, 259, 259, 259, 259, 259, 259,
259, 188, 416, 418, 73, 466, 424, 189, 189, 189,
189, 189, 189, 152, 192, 193, 194, 192, 192, 192,
192, 192, 195, 464, 417, 419, 196, 196, 196, 196,
196, 264, 265, 266, 264, 264, 264, 264, 264, 316,
316, 316, 316, 316, 317, 196, 196, 196, 196, 196,
196, 197, 197, 197, 197, 197, 197, 197, 197, 457,
457, 73, 73, 197, 197, 197, 197, 197, 237, 237,
237, 237, 237, 237, 237, 237, 462, 476, 476, 544,
152, 495, 183, 183, 183, 183, 183, 183, 178, 270,
179, 179, 179, 179, 179, 179, 179, 179, 226, 152,
268, 268, 268, 268, 268, 268, 493, 345, 228, 272,
272, 272, 272, 272, 272, 272, 272, 347, 152, 73,
178, 544, 179, 179, 179, 179, 179, 179, 179, 179,
544, 347, 271, 271, 271, 271, 271, 271, 271, 271,
226, 152, 292, 293, 294, 292, 292, 292, 292, 292,
270, 73, 226, 152, 227, 227, 227, 227, 227, 227,
227, 227, 228, 226, 152, 393, 229, 229, 229, 229,
229, 73, 253, 313, 254, 254, 254, 254, 254, 254,
416, 226, 152, 508, 508, 229, 229, 229, 229, 229,
229, 152, 233, 234, 235, 233, 233, 233, 233, 233,
236, 73, 417, 73, 237, 237, 237, 237, 237, 304,
379, 305, 305, 305, 305, 305, 305, 305, 305, 347,
544, 152, 434, 237, 237, 237, 237, 237, 237, 253,
313, 254, 254, 254, 254, 254, 254, 254, 254, 304,
418, 306, 306, 306, 306, 306, 306, 306, 306, 304,
152, 307, 307, 307, 307, 307, 308, 305, 305, 270,
73, 253, 419, 255, 255, 255, 255, 255, 255, 255,
255, 279, 279, 279, 279, 279, 279, 279, 279, 226,
152, 311, 311, 311, 311, 311, 311, 515, 77, 270,
466, 427, 73, 253, 464, 256, 256, 256, 256, 256,
257, 254, 254, 315, 315, 315, 315, 315, 315, 315,
315, 544, 152, 314, 314, 314, 314, 314, 314, 314,
314, 313, 73, 459, 73, 226, 152, 268, 268, 268,
268, 268, 268, 268, 268, 228, 226, 152, 269, 269,
269, 269, 269, 269, 269, 269, 270, 523, 523, 403,
271, 271, 271, 271, 271, 303, 303, 303, 303, 303,
303, 303, 303, 350, 350, 350, 350, 350, 351, 271,
271, 271, 271, 271, 271, 152, 275, 276, 277, 275,
275, 275, 275, 275, 278, 347, 298, 73, 279, 279,
279, 279, 279, 349, 349, 349, 349, 349, 349, 349,
349, 367, 367, 367, 367, 367, 368, 279, 279, 279,
279, 279, 279, 253, 345, 254, 254, 254, 254, 254,
254, 254, 254, 544, 347, 348, 348, 348, 348, 348,
348, 348, 348, 357, 358, 359, 357, 357, 357, 357,
357, 421, 420, 73, 73, 253, 345, 254, 254, 254,
254, 254, 254, 254, 254, 304, 393, 305, 305, 305,
305, 305, 305, 305, 305, 304, 152, 305, 305, 305,
305, 305, 305, 305, 305, 313, 73, 299, 300, 301,
299, 299, 299, 299, 299, 302, 152, 77, 298, 303,
303, 303, 303, 303, 304, 364, 305, 305, 305, 305,
305, 305, 396, 396, 396, 396, 396, 397, 303, 303,
303, 303, 303, 303, 226, 152, 311, 311, 311, 311,
311, 311, 311, 311, 270, 226, 152, 312, 312, 312,
312, 312, 312, 312, 312, 313, 224, 377, 461, 314,
314, 314, 314, 314, 322, 322, 322, 322, 322, 322,
322, 322, 414, 414, 414, 414, 414, 415, 314, 314,
314, 314, 314, 314, 152, 318, 319, 320, 318, 318,
318, 318, 318, 321, 376, 374, 373, 322, 322, 322,
322, 322, 226, 152, 362, 362, 362, 362, 362, 362,
304, 298, 313, 224, 422, 77, 322, 322, 322, 322,
322, 322, 338, 339, 339, 339, 339, 339, 339, 339,
339, 366, 366, 366, 366, 366, 366, 366, 366, 544,
544, 365, 365, 365, 365, 365, 365, 365, 365, 497,
393, 526, 73, 338, 340, 340, 340, 340, 340, 340,
340, 340, 423, 188, 382, 383, 384, 385, 382, 382,
382, 382, 338, 339, 339, 339, 339, 339, 339, 333,
73, 332, 73, 73, 338, 341, 341, 341, 341, 341,
342, 339, 339, 73, 387, 388, 389, 387, 387, 387,
387, 387, 73, 356, 356, 356, 356, 356, 356, 356,
356, 326, 325, 298, 73, 345, 345, 346, 346, 346,
346, 346, 346, 346, 346, 347, 393, 224, 188, 348,
348, 348, 348, 348, 395, 395, 395, 395, 395, 395,
395, 395, 446, 446, 446, 446, 446, 447, 348, 348,
348, 348, 348, 348, 352, 353, 354, 352, 352, 352,
352, 352, 355, 188, 246, 287, 356, 356, 356, 356,
356, 544, 345, 394, 394, 394, 394, 394, 394, 394,
394, 286, 443, 284, 283, 356, 356, 356, 356, 356,
356, 226, 152, 362, 362, 362, 362, 362, 362, 362,
362, 313, 226, 152, 363, 363, 363, 363, 363, 363,
363, 363, 364, 282, 281, 280, 365, 365, 365, 365,
365, 403, 544, 404, 404, 404, 404, 404, 404, 404,
404, 262, 443, 224, 188, 365, 365, 365, 365, 365,
365, 152, 369, 370, 371, 369, 369, 369, 369, 369,
226, 152, 258, 188, 372, 372, 372, 372, 372, 403,
313, 405, 405, 405, 405, 405, 405, 405, 405, 95,
246, 248, 246, 372, 372, 372, 372, 372, 372, 338,
339, 339, 339, 339, 339, 339, 339, 339, 403, 247,
406, 406, 406, 406, 406, 407, 404, 404, 226, 152,
372, 372, 372, 372, 372, 372, 372, 372, 364, 73,
338, 339, 339, 339, 339, 339, 339, 339, 339, 544,
152, 226, 152, 410, 410, 410, 410, 410, 410, 364,
246, 364, 413, 413, 413, 413, 413, 413, 413, 413,
73, 345, 244, 391, 391, 391, 391, 391, 391, 391,
391, 347, 345, 243, 392, 392, 392, 392, 392, 392,
392, 392, 393, 152, 242, 241, 394, 394, 394, 394,
394, 544, 364, 412, 412, 412, 412, 412, 412, 412,
412, 240, 89, 188, 224, 394, 394, 394, 394, 394,
394, 398, 399, 400, 398, 398, 398, 398, 398, 401,
188, 95, 77, 402, 402, 402, 402, 402, 434, 345,
435, 435, 435, 435, 435, 435, 435, 435, 176, 443,
212, 209, 402, 402, 402, 402, 402, 402, 226, 152,
410, 410, 410, 410, 410, 410, 410, 410, 364, 226,
152, 411, 411, 411, 411, 411, 411, 411, 411, 208,
226, 152, 207, 412, 412, 412, 412, 412, 425, 434,
364, 436, 436, 436, 436, 436, 436, 436, 436, 345,
422, 77, 412, 412, 412, 412, 412, 412, 425, 479,
425, 426, 434, 460, 437, 437, 437, 437, 437, 438,
435, 435, 482, 482, 482, 482, 482, 483, 206, 73,
427, 205, 428, 428, 428, 428, 428, 428, 428, 428,
402, 402, 402, 402, 402, 402, 402, 402, 445, 445,
445, 445, 445, 445, 445, 445, 203, 202, 201, 200,
199, 73, 427, 544, 429, 429, 429, 429, 429, 429,
429, 429, 544, 479, 444, 444, 444, 444, 444, 444,
444, 444, 453, 454, 455, 453, 453, 453, 453, 453,
198, 95, 87, 73, 427, 345, 430, 430, 430, 430,
430, 431, 432, 432, 403, 479, 404, 404, 404, 404,
404, 404, 404, 404, 403, 77, 404, 404, 404, 404,
404, 404, 404, 404, 425, 73, 427, 77, 433, 433,
433, 428, 428, 428, 428, 428, 403, 176, 404, 404,
404, 404, 404, 404, 425, 137, 425, 425, 138, 427,
132, 471, 471, 471, 132, 124, 174, 73, 345, 117,
441, 441, 441, 441, 441, 441, 441, 441, 393, 345,
167, 442, 442, 442, 442, 442, 442, 442, 442, 443,
73, 166, 165, 444, 444, 444, 444, 444, 467, 468,
469, 467, 467, 467, 467, 467, 513, 513, 513, 513,
513, 514, 444, 444, 444, 444, 444, 444, 448, 449,
450, 448, 448, 448, 448, 448, 451, 73, 164, 163,
452, 452, 452, 452, 452, 472, 473, 474, 472, 472,
472, 472, 472, 531, 531, 531, 531, 531, 531, 452,
452, 452, 452, 452, 452, 226, 152, 458, 458, 458,
458, 458, 458, 458, 458, 427, 161, 432, 432, 432,
432, 432, 432, 432, 432, 434, 160, 435, 435, 435,
435, 435, 435, 435, 435, 434, 156, 435, 435, 435,
435, 435, 435, 435, 435, 95, 73, 427, 72, 432,
432, 432, 432, 432, 432, 432, 432, 434, 95, 435,
435, 435, 435, 435, 435, 452, 452, 452, 452, 452,
452, 452, 452, 145, 83, 81, 77, 75, 73, 427,
74, 432, 432, 432, 432, 432, 432, 470, 470, 481,
481, 481, 481, 481, 481, 481, 481, 544, 73, 480,
480, 480, 480, 480, 480, 480, 480, 138, 132, 124,
73, 427, 117, 470, 470, 470, 470, 470, 470, 470,
470, 152, 488, 488, 488, 488, 488, 488, 488, 488,
152, 489, 489, 489, 489, 489, 489, 489, 489, 116,
115, 114, 73, 345, 113, 477, 477, 477, 477, 477,
477, 477, 477, 443, 345, 112, 478, 478, 478, 478,
478, 478, 478, 478, 479, 101, 100, 99, 480, 480,
480, 480, 480, 152, 490, 490, 490, 490, 490, 491,
488, 488, 471, 471, 471, 98, 95, 480, 480, 480,
480, 480, 480, 484, 485, 486, 484, 484, 484, 484,
484, 83, 515, 77, 81, 487, 487, 487, 487, 487,
463, 73, 463, 75, 463, 525, 463, 463, 74, 73,
463, 544, 544, 544, 487, 487, 487, 487, 487, 487,
544, 544, 463, 463, 463, 465, 544, 465, 544, 465,
544, 465, 465, 544, 544, 465, 470, 470, 470, 470,
470, 470, 470, 470, 544, 544, 544, 465, 465, 465,
497, 544, 498, 498, 498, 498, 498, 498, 498, 498,
544, 544, 544, 544, 502, 73, 503, 503, 503, 503,
503, 503, 503, 503, 152, 488, 488, 488, 488, 488,
488, 73, 497, 544, 499, 499, 499, 499, 499, 499,
499, 499, 502, 544, 504, 504, 504, 504, 504, 504,
504, 504, 502, 544, 505, 505, 505, 505, 505, 506,
503, 503, 544, 73, 497, 544, 500, 500, 500, 500,
500, 501, 498, 498, 487, 487, 487, 487, 487, 487,
487, 487, 512, 512, 512, 512, 512, 512, 512, 512,
544, 544, 544, 544, 544, 73, 345, 544, 509, 509,
509, 509, 509, 509, 509, 509, 479, 345, 544, 510,
510, 510, 510, 510, 510, 510, 510, 544, 544, 544,
544, 511, 511, 511, 511, 511, 544, 544, 511, 511,
511, 511, 511, 511, 511, 511, 544, 544, 544, 544,
511, 511, 511, 511, 511, 511, 152, 488, 488, 488,
488, 488, 488, 488, 488, 152, 488, 488, 488, 488,
488, 488, 488, 488, 516, 517, 518, 516, 516, 516,
516, 516, 544, 497, 544, 498, 498, 498, 498, 498,
498, 519, 520, 521, 519, 519, 519, 519, 519, 544,
544, 544, 544, 73, 497, 544, 498, 498, 498, 498,
498, 498, 498, 498, 73, 502, 544, 503, 503, 503,
503, 503, 503, 503, 503, 502, 544, 503, 503, 503,
503, 503, 503, 503, 503, 73, 497, 544, 498, 498,
498, 498, 498, 498, 498, 498, 502, 544, 503, 503,
503, 503, 503, 503, 345, 544, 524, 524, 524, 524,
524, 524, 524, 524, 544, 544, 544, 73, 526, 544,
527, 527, 527, 527, 527, 527, 527, 527, 531, 531,
531, 531, 531, 531, 531, 531, 532, 532, 532, 532,
532, 532, 532, 532, 544, 544, 544, 544, 544, 73,
526, 544, 528, 528, 528, 528, 528, 528, 528, 528,
533, 533, 533, 533, 533, 534, 531, 531, 538, 539,
540, 538, 538, 538, 538, 538, 544, 544, 544, 544,
544, 73, 526, 544, 529, 529, 529, 529, 529, 530,
527, 527, 544, 544, 544, 544, 526, 73, 527, 527,
527, 527, 527, 527, 531, 531, 531, 531, 531, 531,
531, 531, 544, 73, 526, 544, 527, 527, 527, 527,
527, 527, 527, 527, 544, 544, 544, 73, 531, 531,
531, 531, 531, 531, 531, 531, 541, 541, 541, 541,
541, 541, 541, 541, 544, 73, 526, 544, 527, 527,
527, 527, 527, 527, 527, 527, 538, 538, 538, 538,
538, 538, 538, 538, 544, 73, 542, 542, 542, 542,
542, 543, 541, 541, 544, 544, 544, 73, 541, 541,
541, 541, 541, 541, 544, 73, 541, 541, 541, 541,
541, 541, 541, 541, 544, 73, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 73, 544, 544,
544, 544, 544, 544, 544, 73, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 67, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 72, 544,
544, 544, 72, 544, 72, 72, 72, 544, 72, 72,
72, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 80, 544, 544, 544, 80, 544,
80, 80, 80, 544, 80, 80, 80, 82, 544, 544,
544, 82, 544, 82, 82, 82, 544, 82, 82, 82,
84, 544, 544, 84, 84, 544, 84, 84, 84, 544,
84, 84, 84, 94, 94, 544, 544, 94, 119, 544,
544, 119, 119, 544, 119, 119, 119, 544, 119, 119,
119, 123, 544, 544, 123, 123, 123, 123, 123, 123,
544, 544, 123, 123, 130, 130, 131, 544, 544, 131,
544, 544, 131, 131, 131, 131, 131, 131, 131, 135,
135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
135, 135, 137, 137, 544, 137, 544, 137, 137, 137,
137, 137, 137, 137, 137, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 144, 144,
544, 144, 144, 144, 144, 144, 144, 144, 144, 144,
144, 85, 544, 544, 85, 85, 544, 85, 85, 85,
544, 85, 85, 85, 151, 151, 544, 544, 151, 153,
153, 153, 544, 544, 153, 120, 544, 544, 120, 120,
544, 120, 120, 120, 544, 120, 120, 120, 177, 177,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 184, 184, 544, 544, 184, 190, 190, 190, 544,
544, 190, 218, 218, 544, 544, 218, 219, 219, 544,
544, 219, 223, 223, 544, 544, 223, 225, 225, 225,
544, 544, 225, 258, 258, 544, 544, 258, 260, 260,
544, 544, 260, 261, 261, 544, 544, 261, 263, 263,
263, 544, 544, 263, 267, 267, 267, 267, 544, 544,
267, 295, 295, 544, 544, 295, 296, 296, 544, 544,
296, 297, 297, 544, 544, 297, 309, 309, 309, 544,
544, 309, 310, 310, 310, 310, 544, 544, 310, 343,
343, 544, 544, 343, 344, 344, 544, 544, 344, 360,
360, 360, 544, 544, 360, 361, 361, 361, 361, 544,
544, 361, 386, 386, 544, 544, 386, 390, 544, 390,
390, 544, 544, 390, 408, 408, 408, 544, 544, 408,
409, 409, 409, 409, 544, 544, 409, 439, 439, 544,
544, 439, 440, 544, 440, 440, 544, 544, 440, 456,
456, 456, 544, 544, 456, 457, 457, 457, 544, 544,
544, 457, 463, 544, 544, 544, 463, 544, 463, 463,
463, 544, 463, 463, 463, 465, 544, 544, 544, 465,
544, 465, 465, 465, 544, 465, 465, 465, 475, 475,
544, 544, 475, 476, 544, 476, 476, 544, 544, 476,
492, 492, 544, 544, 544, 492, 494, 494, 494, 494,
494, 494, 494, 494, 494, 494, 494, 494, 494, 507,
507, 544, 544, 507, 508, 544, 508, 508, 544, 544,
508, 522, 522, 544, 544, 522, 523, 544, 523, 544,
544, 544, 523, 535, 544, 544, 544, 535, 536, 536,
536, 536, 536, 536, 536, 536, 536, 536, 536, 536,
536, 13, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544
} ;
static yyconst short int yy_chk[3455] =
{ 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, 1, 2, 3, 4, 251, 2, 3, 4, 95,
5, 5, 5, 114, 5, 251, 3, 4, 95, 39,
5, 11, 11, 11, 11, 6, 6, 6, 114, 6,
2, 2, 5, 5, 2, 6, 39, 62, 2, 50,
64, 2, 12, 12, 12, 12, 68, 6, 6, 69,
24, 58, 58, 5, 24, 24, 50, 62, 66, 66,
64, 3, 4, 172, 11, 172, 102, 102, 6, 7,
7, 7, 24, 7, 26, 26, 26, 26, 26, 26,
26, 26, 104, 71, 71, 12, 71, 104, 111, 68,
69, 24, 27, 27, 27, 27, 27, 27, 38, 112,
38, 38, 38, 38, 38, 38, 38, 38, 40, 102,
541, 112, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 116, 8, 536, 40, 40, 122, 116,
40, 169, 111, 122, 40, 48, 169, 40, 48, 48,
48, 48, 48, 48, 48, 48, 78, 78, 78, 78,
78, 78, 78, 78, 79, 79, 79, 79, 79, 79,
79, 79, 113, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 9, 9, 9, 9, 9, 115, 125, 125, 49,
9, 9, 9, 49, 49, 56, 56, 56, 115, 56,
113, 99, 139, 56, 9, 56, 99, 213, 99, 84,
162, 49, 153, 84, 84, 129, 129, 56, 56, 141,
141, 153, 213, 162, 9, 10, 10, 10, 10, 10,
49, 84, 168, 171, 10, 10, 10, 73, 56, 73,
140, 73, 525, 73, 73, 139, 461, 73, 10, 171,
84, 87, 87, 87, 87, 87, 87, 87, 87, 73,
73, 73, 93, 93, 93, 93, 93, 93, 10, 18,
91, 91, 91, 91, 91, 91, 91, 91, 168, 18,
87, 140, 18, 18, 18, 18, 18, 18, 18, 18,
25, 179, 25, 25, 25, 25, 25, 25, 25, 25,
25, 210, 461, 173, 25, 25, 25, 25, 25, 92,
92, 92, 92, 92, 92, 92, 92, 173, 175, 183,
250, 25, 179, 25, 25, 25, 25, 25, 25, 31,
204, 175, 198, 31, 524, 31, 204, 250, 31, 31,
183, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 210, 198, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 33, 33, 33, 33, 33, 33, 33, 33, 33,
187, 187, 187, 33, 33, 33, 33, 33, 118, 118,
118, 118, 118, 118, 118, 118, 211, 211, 288, 136,
136, 522, 33, 33, 33, 33, 33, 33, 37, 37,
37, 190, 37, 254, 37, 37, 214, 81, 37, 81,
190, 81, 214, 81, 81, 339, 225, 81, 227, 227,
37, 37, 37, 41, 105, 225, 212, 238, 227, 81,
81, 81, 136, 41, 254, 288, 41, 41, 41, 41,
41, 41, 41, 41, 83, 339, 83, 212, 83, 238,
83, 83, 105, 105, 83, 86, 105, 86, 336, 86,
105, 86, 86, 105, 212, 86, 83, 83, 83, 511,
229, 229, 510, 336, 41, 57, 245, 86, 86, 86,
229, 245, 119, 249, 280, 57, 119, 119, 57, 57,
57, 57, 57, 57, 57, 57, 88, 88, 88, 88,
88, 88, 88, 88, 119, 508, 280, 334, 88, 88,
88, 88, 88, 128, 128, 128, 128, 128, 128, 128,
128, 252, 507, 119, 351, 351, 252, 88, 88, 88,
88, 88, 88, 96, 96, 96, 96, 96, 96, 96,
96, 283, 249, 290, 263, 96, 96, 96, 96, 96,
121, 503, 121, 263, 121, 334, 121, 121, 284, 290,
121, 267, 285, 283, 96, 96, 96, 96, 96, 96,
267, 285, 121, 121, 121, 132, 289, 145, 132, 132,
284, 145, 291, 268, 268, 132, 289, 145, 309, 323,
327, 291, 174, 268, 397, 397, 174, 309, 132, 145,
145, 146, 174, 146, 146, 146, 146, 146, 146, 146,
146, 323, 327, 494, 174, 174, 178, 178, 178, 178,
178, 178, 178, 178, 182, 310, 182, 182, 182, 182,
182, 182, 146, 147, 310, 147, 147, 147, 147, 147,
147, 147, 147, 492, 329, 178, 186, 186, 186, 186,
186, 186, 186, 186, 186, 182, 191, 191, 191, 191,
191, 191, 191, 191, 147, 148, 329, 148, 148, 148,
148, 148, 148, 148, 148, 193, 193, 193, 193, 193,
193, 193, 193, 194, 194, 194, 194, 194, 194, 235,
235, 235, 235, 235, 235, 488, 148, 149, 476, 149,
149, 149, 149, 149, 149, 149, 149, 269, 269, 475,
331, 149, 149, 149, 149, 149, 196, 269, 196, 196,
196, 196, 196, 196, 196, 196, 331, 411, 411, 337,
149, 149, 149, 149, 149, 149, 152, 152, 152, 152,
152, 152, 152, 152, 152, 337, 412, 412, 152, 152,
152, 152, 152, 220, 220, 220, 220, 220, 220, 220,
220, 220, 373, 374, 379, 465, 379, 152, 152, 152,
152, 152, 152, 154, 154, 154, 154, 154, 154, 154,
154, 154, 154, 463, 373, 374, 154, 154, 154, 154,
154, 226, 226, 226, 226, 226, 226, 226, 226, 277,
277, 277, 277, 277, 277, 154, 154, 154, 154, 154,
154, 155, 155, 155, 155, 155, 155, 155, 155, 415,
415, 424, 462, 155, 155, 155, 155, 155, 228, 228,
228, 228, 228, 228, 228, 228, 424, 447, 447, 271,
271, 460, 155, 155, 155, 155, 155, 155, 180, 271,
180, 180, 180, 180, 180, 180, 180, 180, 232, 232,
232, 232, 232, 232, 232, 232, 459, 346, 232, 234,
234, 234, 234, 234, 234, 234, 234, 346, 457, 180,
181, 348, 181, 181, 181, 181, 181, 181, 181, 181,
237, 348, 237, 237, 237, 237, 237, 237, 237, 237,
311, 311, 253, 253, 253, 253, 253, 253, 253, 253,
311, 181, 192, 192, 192, 192, 192, 192, 192, 192,
192, 192, 192, 312, 312, 440, 192, 192, 192, 192,
192, 253, 257, 312, 257, 257, 257, 257, 257, 257,
416, 458, 458, 483, 483, 192, 192, 192, 192, 192,
192, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 335, 416, 257, 195, 195, 195, 195, 195, 264,
335, 264, 264, 264, 264, 264, 264, 264, 264, 439,
314, 314, 435, 195, 195, 195, 195, 195, 195, 215,
314, 215, 215, 215, 215, 215, 215, 215, 215, 265,
418, 265, 265, 265, 265, 265, 265, 265, 265, 266,
360, 266, 266, 266, 266, 266, 266, 266, 266, 360,
215, 216, 418, 216, 216, 216, 216, 216, 216, 216,
216, 270, 270, 270, 270, 270, 270, 270, 270, 274,
274, 274, 274, 274, 274, 274, 274, 496, 496, 274,
426, 428, 216, 217, 425, 217, 217, 217, 217, 217,
217, 217, 217, 276, 276, 276, 276, 276, 276, 276,
276, 279, 361, 279, 279, 279, 279, 279, 279, 279,
279, 361, 428, 420, 217, 230, 230, 230, 230, 230,
230, 230, 230, 230, 230, 230, 233, 233, 233, 233,
233, 233, 233, 233, 233, 233, 233, 514, 514, 404,
233, 233, 233, 233, 233, 298, 298, 298, 298, 298,
298, 298, 298, 301, 301, 301, 301, 301, 301, 233,
233, 233, 233, 233, 233, 236, 236, 236, 236, 236,
236, 236, 236, 236, 236, 390, 386, 381, 236, 236,
236, 236, 236, 300, 300, 300, 300, 300, 300, 300,
300, 320, 320, 320, 320, 320, 320, 236, 236, 236,
236, 236, 236, 255, 391, 255, 255, 255, 255, 255,
255, 255, 255, 303, 391, 303, 303, 303, 303, 303,
303, 303, 303, 304, 304, 304, 304, 304, 304, 304,
304, 377, 376, 375, 255, 256, 392, 256, 256, 256,
256, 256, 256, 256, 256, 306, 392, 306, 306, 306,
306, 306, 306, 306, 306, 307, 408, 307, 307, 307,
307, 307, 307, 307, 307, 408, 256, 262, 262, 262,
262, 262, 262, 262, 262, 262, 409, 423, 344, 262,
262, 262, 262, 262, 308, 409, 308, 308, 308, 308,
308, 308, 354, 354, 354, 354, 354, 354, 262, 262,
262, 262, 262, 262, 272, 272, 272, 272, 272, 272,
272, 272, 272, 272, 272, 275, 275, 275, 275, 275,
275, 275, 275, 275, 275, 275, 343, 333, 423, 275,
275, 275, 275, 275, 313, 313, 313, 313, 313, 313,
313, 313, 371, 371, 371, 371, 371, 371, 275, 275,
275, 275, 275, 275, 278, 278, 278, 278, 278, 278,
278, 278, 278, 278, 332, 326, 325, 278, 278, 278,
278, 278, 317, 317, 317, 317, 317, 317, 317, 317,
305, 297, 317, 296, 378, 378, 278, 278, 278, 278,
278, 278, 292, 292, 292, 292, 292, 292, 292, 292,
292, 319, 319, 319, 319, 319, 319, 319, 319, 322,
394, 322, 322, 322, 322, 322, 322, 322, 322, 498,
394, 527, 292, 293, 293, 293, 293, 293, 293, 293,
293, 293, 378, 295, 338, 338, 338, 338, 338, 338,
338, 338, 342, 342, 342, 342, 342, 342, 342, 287,
498, 286, 527, 293, 294, 294, 294, 294, 294, 294,
294, 294, 294, 338, 345, 345, 345, 345, 345, 345,
345, 345, 342, 347, 347, 347, 347, 347, 347, 347,
347, 282, 281, 261, 294, 299, 441, 299, 299, 299,
299, 299, 299, 299, 299, 299, 441, 260, 259, 299,
299, 299, 299, 299, 353, 353, 353, 353, 353, 353,
353, 353, 400, 400, 400, 400, 400, 400, 299, 299,
299, 299, 299, 299, 302, 302, 302, 302, 302, 302,
302, 302, 302, 258, 248, 247, 302, 302, 302, 302,
302, 356, 442, 356, 356, 356, 356, 356, 356, 356,
356, 246, 442, 244, 243, 302, 302, 302, 302, 302,
302, 315, 315, 315, 315, 315, 315, 315, 315, 315,
315, 315, 318, 318, 318, 318, 318, 318, 318, 318,
318, 318, 318, 242, 241, 240, 318, 318, 318, 318,
318, 357, 444, 357, 357, 357, 357, 357, 357, 357,
357, 224, 444, 223, 222, 318, 318, 318, 318, 318,
318, 321, 321, 321, 321, 321, 321, 321, 321, 321,
362, 362, 221, 219, 321, 321, 321, 321, 321, 358,
362, 358, 358, 358, 358, 358, 358, 358, 358, 218,
209, 208, 207, 321, 321, 321, 321, 321, 321, 340,
340, 340, 340, 340, 340, 340, 340, 340, 359, 206,
359, 359, 359, 359, 359, 359, 359, 359, 363, 363,
364, 364, 364, 364, 364, 364, 364, 364, 363, 340,
341, 341, 341, 341, 341, 341, 341, 341, 341, 365,
365, 368, 368, 368, 368, 368, 368, 368, 368, 365,
205, 368, 370, 370, 370, 370, 370, 370, 370, 370,
341, 349, 203, 349, 349, 349, 349, 349, 349, 349,
349, 349, 352, 202, 352, 352, 352, 352, 352, 352,
352, 352, 352, 456, 201, 200, 352, 352, 352, 352,
352, 372, 456, 372, 372, 372, 372, 372, 372, 372,
372, 199, 197, 189, 188, 352, 352, 352, 352, 352,
352, 355, 355, 355, 355, 355, 355, 355, 355, 355,
185, 184, 177, 355, 355, 355, 355, 355, 387, 477,
387, 387, 387, 387, 387, 387, 387, 387, 176, 477,
170, 167, 355, 355, 355, 355, 355, 355, 366, 366,
366, 366, 366, 366, 366, 366, 366, 366, 366, 369,
369, 369, 369, 369, 369, 369, 369, 369, 369, 166,
410, 410, 165, 369, 369, 369, 369, 369, 380, 388,
410, 388, 388, 388, 388, 388, 388, 388, 388, 478,
422, 422, 369, 369, 369, 369, 369, 369, 380, 478,
380, 380, 389, 422, 389, 389, 389, 389, 389, 389,
389, 389, 450, 450, 450, 450, 450, 450, 164, 380,
382, 163, 382, 382, 382, 382, 382, 382, 382, 382,
393, 393, 393, 393, 393, 393, 393, 393, 399, 399,
399, 399, 399, 399, 399, 399, 161, 160, 159, 158,
157, 382, 383, 480, 383, 383, 383, 383, 383, 383,
383, 383, 402, 480, 402, 402, 402, 402, 402, 402,
402, 402, 403, 403, 403, 403, 403, 403, 403, 403,
156, 151, 150, 383, 384, 509, 384, 384, 384, 384,
384, 384, 384, 384, 405, 509, 405, 405, 405, 405,
405, 405, 405, 405, 406, 144, 406, 406, 406, 406,
406, 406, 406, 406, 421, 384, 385, 143, 385, 385,
385, 385, 385, 385, 385, 385, 407, 142, 407, 407,
407, 407, 407, 407, 421, 138, 421, 421, 137, 433,
135, 433, 433, 433, 131, 124, 120, 385, 395, 117,
395, 395, 395, 395, 395, 395, 395, 395, 395, 398,
110, 398, 398, 398, 398, 398, 398, 398, 398, 398,
433, 109, 108, 398, 398, 398, 398, 398, 427, 427,
427, 427, 427, 427, 427, 427, 486, 486, 486, 486,
486, 486, 398, 398, 398, 398, 398, 398, 401, 401,
401, 401, 401, 401, 401, 401, 401, 427, 107, 106,
401, 401, 401, 401, 401, 434, 434, 434, 434, 434,
434, 434, 434, 534, 534, 534, 534, 534, 534, 401,
401, 401, 401, 401, 401, 413, 413, 413, 413, 413,
413, 413, 413, 413, 413, 429, 101, 429, 429, 429,
429, 429, 429, 429, 429, 436, 100, 436, 436, 436,
436, 436, 436, 436, 436, 437, 98, 437, 437, 437,
437, 437, 437, 437, 437, 94, 429, 430, 90, 430,
430, 430, 430, 430, 430, 430, 430, 438, 89, 438,
438, 438, 438, 438, 438, 443, 443, 443, 443, 443,
443, 443, 443, 85, 82, 80, 76, 75, 430, 431,
74, 431, 431, 431, 431, 431, 431, 431, 431, 449,
449, 449, 449, 449, 449, 449, 449, 452, 72, 452,
452, 452, 452, 452, 452, 452, 452, 67, 60, 53,
431, 432, 47, 432, 432, 432, 432, 432, 432, 432,
432, 453, 453, 453, 453, 453, 453, 453, 453, 453,
454, 454, 454, 454, 454, 454, 454, 454, 454, 46,
45, 44, 432, 445, 43, 445, 445, 445, 445, 445,
445, 445, 445, 445, 448, 42, 448, 448, 448, 448,
448, 448, 448, 448, 448, 36, 35, 34, 448, 448,
448, 448, 448, 455, 455, 455, 455, 455, 455, 455,
455, 455, 471, 471, 471, 32, 28, 448, 448, 448,
448, 448, 448, 451, 451, 451, 451, 451, 451, 451,
451, 22, 515, 515, 19, 451, 451, 451, 451, 451,
464, 471, 464, 17, 464, 515, 464, 464, 15, 14,
464, 13, 0, 0, 451, 451, 451, 451, 451, 451,
0, 0, 464, 464, 464, 466, 0, 466, 0, 466,
0, 466, 466, 0, 0, 466, 470, 470, 470, 470,
470, 470, 470, 470, 0, 0, 0, 466, 466, 466,
467, 0, 467, 467, 467, 467, 467, 467, 467, 467,
0, 0, 0, 0, 472, 470, 472, 472, 472, 472,
472, 472, 472, 472, 491, 491, 491, 491, 491, 491,
491, 467, 468, 0, 468, 468, 468, 468, 468, 468,
468, 468, 473, 0, 473, 473, 473, 473, 473, 473,
473, 473, 474, 0, 474, 474, 474, 474, 474, 474,
474, 474, 0, 468, 469, 0, 469, 469, 469, 469,
469, 469, 469, 469, 479, 479, 479, 479, 479, 479,
479, 479, 485, 485, 485, 485, 485, 485, 485, 485,
0, 0, 0, 0, 0, 469, 481, 0, 481, 481,
481, 481, 481, 481, 481, 481, 481, 484, 0, 484,
484, 484, 484, 484, 484, 484, 484, 0, 0, 0,
0, 484, 484, 484, 484, 484, 487, 0, 487, 487,
487, 487, 487, 487, 487, 487, 0, 0, 0, 0,
484, 484, 484, 484, 484, 484, 489, 489, 489, 489,
489, 489, 489, 489, 489, 490, 490, 490, 490, 490,
490, 490, 490, 490, 497, 497, 497, 497, 497, 497,
497, 497, 0, 501, 0, 501, 501, 501, 501, 501,
501, 502, 502, 502, 502, 502, 502, 502, 502, 0,
0, 0, 0, 497, 499, 0, 499, 499, 499, 499,
499, 499, 499, 499, 501, 504, 0, 504, 504, 504,
504, 504, 504, 504, 504, 505, 0, 505, 505, 505,
505, 505, 505, 505, 505, 499, 500, 0, 500, 500,
500, 500, 500, 500, 500, 500, 506, 0, 506, 506,
506, 506, 506, 506, 512, 0, 512, 512, 512, 512,
512, 512, 512, 512, 0, 0, 0, 500, 516, 0,
516, 516, 516, 516, 516, 516, 516, 516, 519, 519,
519, 519, 519, 519, 519, 519, 520, 520, 520, 520,
520, 520, 520, 520, 0, 0, 0, 0, 0, 516,
517, 0, 517, 517, 517, 517, 517, 517, 517, 517,
521, 521, 521, 521, 521, 521, 521, 521, 526, 526,
526, 526, 526, 526, 526, 526, 0, 0, 0, 0,
0, 517, 518, 0, 518, 518, 518, 518, 518, 518,
518, 518, 0, 0, 0, 0, 530, 526, 530, 530,
530, 530, 530, 530, 532, 532, 532, 532, 532, 532,
532, 532, 0, 518, 528, 0, 528, 528, 528, 528,
528, 528, 528, 528, 0, 0, 0, 530, 533, 533,
533, 533, 533, 533, 533, 533, 538, 538, 538, 538,
538, 538, 538, 538, 0, 528, 529, 0, 529, 529,
529, 529, 529, 529, 529, 529, 539, 539, 539, 539,
539, 539, 539, 539, 0, 538, 540, 540, 540, 540,
540, 540, 540, 540, 0, 0, 0, 529, 543, 543,
543, 543, 543, 543, 0, 539, 542, 542, 542, 542,
542, 542, 542, 542, 0, 540, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 543, 0, 0,
0, 0, 0, 0, 0, 542, 545, 545, 545, 545,
545, 545, 545, 545, 545, 545, 545, 545, 545, 546,
546, 546, 546, 546, 546, 546, 546, 546, 546, 546,
546, 546, 547, 547, 547, 547, 547, 547, 547, 547,
547, 547, 547, 547, 547, 548, 548, 548, 548, 548,
548, 548, 548, 548, 548, 548, 548, 548, 549, 0,
0, 0, 549, 0, 549, 549, 549, 0, 549, 549,
549, 550, 550, 550, 550, 550, 550, 550, 550, 550,
550, 550, 550, 550, 551, 0, 0, 0, 551, 0,
551, 551, 551, 0, 551, 551, 551, 552, 0, 0,
0, 552, 0, 552, 552, 552, 0, 552, 552, 552,
553, 0, 0, 553, 553, 0, 553, 553, 553, 0,
553, 553, 553, 554, 554, 0, 0, 554, 555, 0,
0, 555, 555, 0, 555, 555, 555, 0, 555, 555,
555, 556, 0, 0, 556, 556, 556, 556, 556, 556,
0, 0, 556, 556, 557, 557, 558, 0, 0, 558,
0, 0, 558, 558, 558, 558, 558, 558, 558, 559,
559, 559, 559, 559, 559, 559, 559, 559, 559, 559,
559, 559, 560, 560, 0, 560, 0, 560, 560, 560,
560, 560, 560, 560, 560, 561, 561, 561, 561, 561,
561, 561, 561, 561, 561, 561, 561, 561, 562, 562,
0, 562, 562, 562, 562, 562, 562, 562, 562, 562,
562, 563, 0, 0, 563, 563, 0, 563, 563, 563,
0, 563, 563, 563, 564, 564, 0, 0, 564, 565,
565, 565, 0, 0, 565, 566, 0, 0, 566, 566,
0, 566, 566, 566, 0, 566, 566, 566, 567, 567,
567, 567, 567, 567, 567, 567, 567, 567, 567, 567,
567, 568, 568, 0, 0, 568, 569, 569, 569, 0,
0, 569, 570, 570, 0, 0, 570, 571, 571, 0,
0, 571, 572, 572, 0, 0, 572, 573, 573, 573,
0, 0, 573, 574, 574, 0, 0, 574, 575, 575,
0, 0, 575, 576, 576, 0, 0, 576, 577, 577,
577, 0, 0, 577, 578, 578, 578, 578, 0, 0,
578, 579, 579, 0, 0, 579, 580, 580, 0, 0,
580, 581, 581, 0, 0, 581, 582, 582, 582, 0,
0, 582, 583, 583, 583, 583, 0, 0, 583, 584,
584, 0, 0, 584, 585, 585, 0, 0, 585, 586,
586, 586, 0, 0, 586, 587, 587, 587, 587, 0,
0, 587, 588, 588, 0, 0, 588, 589, 0, 589,
589, 0, 0, 589, 590, 590, 590, 0, 0, 590,
591, 591, 591, 591, 0, 0, 591, 592, 592, 0,
0, 592, 593, 0, 593, 593, 0, 0, 593, 594,
594, 594, 0, 0, 594, 595, 595, 595, 0, 0,
0, 595, 596, 0, 0, 0, 596, 0, 596, 596,
596, 0, 596, 596, 596, 597, 0, 0, 0, 597,
0, 597, 597, 597, 0, 597, 597, 597, 598, 598,
0, 0, 598, 599, 0, 599, 599, 0, 0, 599,
600, 600, 0, 0, 0, 600, 601, 601, 601, 601,
601, 601, 601, 601, 601, 601, 601, 601, 601, 602,
602, 0, 0, 602, 603, 0, 603, 603, 0, 0,
603, 604, 604, 0, 0, 604, 605, 0, 605, 0,
0, 0, 605, 606, 0, 0, 0, 606, 607, 607,
607, 607, 607, 607, 607, 607, 607, 607, 607, 607,
607, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544, 544, 544, 544, 544, 544, 544,
544, 544, 544, 544
} ;
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-2008
* 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 <sys/stat.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 */
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
#endif
#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 append __P((char *, int));
static int _fill __P((char *, int, int));
static int fill_cmnd __P((char *, int));
static int fill_args __P((char *, int, int));
static int _push_include __P((char *, int));
static int pop_include __P((void));
static int ipv6_valid __P((const char *s));
static char *parse_include __P((char *));
extern void yyerror __P((const char *));
#define fill(a, b) _fill(a, b, 0)
#define push_include(_p) (_push_include((_p), FALSE))
#define push_includedir(_p) (_push_include((_p), TRUE))
/* 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
#define GOTDEFS 1
#define GOTCMND 2
#define STARTDEFS 3
#define INDEFS 4
#define INSTR 5
#line 1442 "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 <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 131 "toke.l"
#line 1598 "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 >= 545 )
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] != 3392 );
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 132 "toke.l"
BEGIN STARTDEFS;
YY_BREAK
case 2:
YY_RULE_SETUP
#line 134 "toke.l"
{
BEGIN INDEFS;
LEXTRACE("DEFVAR ");
if (!fill(yytext, yyleng))
yyterminate();
return(DEFVAR);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 143 "toke.l"
{
BEGIN STARTDEFS;
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 4:
YY_RULE_SETUP
#line 149 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 5:
YY_RULE_SETUP
#line 154 "toke.l"
{
LEXTRACE("+= ");
return('+');
} /* return '+' */
YY_BREAK
case 6:
YY_RULE_SETUP
#line 159 "toke.l"
{
LEXTRACE("-= ");
return('-');
} /* return '-' */
YY_BREAK
case 7:
YY_RULE_SETUP
#line 164 "toke.l"
{
LEXTRACE("BEGINSTR ");
yylval.string = NULL;
BEGIN INSTR;
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 170 "toke.l"
{
LEXTRACE("WORD(2) ");
if (!fill(yytext, yyleng))
yyterminate();
return(WORD);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 179 "toke.l"
{
/* Line continuation char followed by newline. */
++sudolineno;
LEXTRACE("\n");
}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 185 "toke.l"
{
LEXTRACE("ENDSTR ");
BEGIN INDEFS;
return(WORD);
}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 191 "toke.l"
{
LEXTRACE("BACKSLASH ");
if (!append(yytext, yyleng))
yyterminate();
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 197 "toke.l"
{
LEXTRACE("STRBODY ");
if (!append(yytext, yyleng))
yyterminate();
}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 205 "toke.l"
{
/* quoted fnmatch glob char, pass verbatim */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(yytext, 2, sawspace))
yyterminate();
sawspace = FALSE;
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 213 "toke.l"
{
/* quoted sudoers special char, strip backslash */
LEXTRACE("QUOTEDCHAR ");
if (!fill_args(yytext + 1, 1, sawspace))
yyterminate();
sawspace = FALSE;
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 221 "toke.l"
{
BEGIN INITIAL;
yyless(0);
return(COMMAND);
} /* end of command line args */
YY_BREAK
case 16:
YY_RULE_SETUP
#line 227 "toke.l"
{
LEXTRACE("ARG ");
if (!fill_args(yytext, yyleng, sawspace))
yyterminate();
sawspace = FALSE;
} /* a command line arg */
YY_BREAK
case 17:
YY_RULE_SETUP
#line 235 "toke.l"
{
char *path;
if ((path = parse_include(yytext)) == NULL)
yyterminate();
LEXTRACE("INCLUDE\n");
/* Push current buffer and switch to include file */
if (!push_include(path))
yyterminate();
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 248 "toke.l"
{
char *path;
if ((path = parse_include(yytext)) == NULL)
yyterminate();
LEXTRACE("INCLUDEDIR\n");
/* Push current buffer and switch to include file */
if (!push_includedir(path))
yyterminate();
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 261 "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 20:
YY_RULE_SETUP
#line 290 "toke.l"
{
int n;
for (n = 0; isblank((unsigned char)yytext[n]); n++)
continue;
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 ");
return(RUNASALIAS);
}
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 310 "toke.l"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
return(NOPASSWD);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 316 "toke.l"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
return(PASSWD);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 322 "toke.l"
{
LEXTRACE("NOEXEC ");
return(NOEXEC);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 327 "toke.l"
{
LEXTRACE("EXEC ");
return(EXEC);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 332 "toke.l"
{
LEXTRACE("SETENV ");
return(SETENV);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 337 "toke.l"
{
LEXTRACE("NOSETENV ");
return(NOSETENV);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 342 "toke.l"
{
/* netgroup */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NETGROUP ");
return(NETGROUP);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 350 "toke.l"
{
/* UN*X group */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("USERGROUP ");
return(USERGROUP);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 358 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 365 "toke.l"
{
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 372 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
return(ERROR);
}
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 383 "toke.l"
{
if (!ipv6_valid(yytext)) {
LEXTRACE("ERROR ");
return(ERROR);
}
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("NTWKADDR ");
return(NTWKADDR);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 394 "toke.l"
{
if (strcmp(yytext, "ALL") == 0) {
LEXTRACE("ALL ");
return(ALL);
}
#ifdef HAVE_SELINUX
/* XXX - restrict type/role to initial state */
if (strcmp(yytext, "TYPE") == 0) {
LEXTRACE("TYPE ");
return(TYPE);
}
if (strcmp(yytext, "ROLE") == 0) {
LEXTRACE("ROLE ");
return(ROLE);
}
#endif /* HAVE_SELINUX */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("ALIAS ");
return(ALIAS);
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 416 "toke.l"
{
/* no command args allowed for Defaults!/path */
if (!fill_cmnd(yytext, yyleng))
yyterminate();
LEXTRACE("COMMAND ");
return(COMMAND);
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 424 "toke.l"
{
BEGIN GOTCMND;
LEXTRACE("COMMAND ");
if (!fill_cmnd(yytext, yyleng))
yyterminate();
} /* sudo -e */
YY_BREAK
case 36:
YY_RULE_SETUP
#line 431 "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 37:
YY_RULE_SETUP
#line 446 "toke.l"
{
/* a word */
if (!fill(yytext, yyleng))
yyterminate();
LEXTRACE("WORD(4) ");
return(WORD);
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 454 "toke.l"
{
LEXTRACE("( ");
return ('(');
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 459 "toke.l"
{
LEXTRACE(") ");
return(')');
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 464 "toke.l"
{
LEXTRACE(", ");
return(',');
} /* return ',' */
YY_BREAK
case 41:
YY_RULE_SETUP
#line 469 "toke.l"
{
LEXTRACE("= ");
return('=');
} /* return '=' */
YY_BREAK
case 42:
YY_RULE_SETUP
#line 474 "toke.l"
{
LEXTRACE(": ");
return(':');
} /* return ':' */
YY_BREAK
case 43:
YY_RULE_SETUP
#line 479 "toke.l"
{
if (yyleng % 2 == 1)
return('!'); /* return '!' */
}
YY_BREAK
case 44:
YY_RULE_SETUP
#line 484 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* return newline */
YY_BREAK
case 45:
YY_RULE_SETUP
#line 491 "toke.l"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 46:
YY_RULE_SETUP
#line 495 "toke.l"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
LEXTRACE("\n\t");
} /* throw away EOL after \ */
YY_BREAK
case 47:
YY_RULE_SETUP
#line 501 "toke.l"
{
BEGIN INITIAL;
++sudolineno;
LEXTRACE("\n");
return(COMMENT);
} /* comment, not uid/gid */
YY_BREAK
case 48:
YY_RULE_SETUP
#line 508 "toke.l"
{
LEXTRACE("ERROR ");
return(ERROR);
} /* parse error */
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(GOTDEFS):
case YY_STATE_EOF(GOTCMND):
case YY_STATE_EOF(STARTDEFS):
case YY_STATE_EOF(INDEFS):
case YY_STATE_EOF(INSTR):
#line 513 "toke.l"
{
if (YY_START != INITIAL) {
BEGIN INITIAL;
LEXTRACE("ERROR ");
return(ERROR);
}
if (!pop_include())
yyterminate();
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 523 "toke.l"
ECHO;
YY_BREAK
#line 2229 "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 >= 545 )
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 >= 545 )
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 == 544);
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 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 523 "toke.l"
static int
_fill(src, len, olen)
char *src;
int len, olen;
{
int i, j;
char *dst;
dst = olen ? realloc(yylval.string, olen + len + 1) : malloc(len + 1);
if (dst == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
yylval.string = dst;
/* Copy the string and collapse any escaped characters. */
dst += olen;
for (i = 0, j = 0; i < len; i++, j++) {
if (src[i] == '\\' && i != len - 1)
dst[j] = src[++i];
else
dst[j] = src[i];
}
dst[j] = '\0';
return(TRUE);
}
static int
append(src, len)
char *src;
int len;
{
int olen = 0;
if (yylval.string != NULL)
olen = strlen(yylval.string);
return(_fill(src, len, olen));
}
#define SPECIAL(c) \
((c) == ',' || (c) == ':' || (c) == '=' || (c) == ' ' || (c) == '\t' || (c) == '#')
static int
fill_cmnd(src, len)
char *src;
int len;
{
char *dst;
int i;
arg_len = arg_size = 0;
dst = yylval.command.cmnd = (char *) malloc(len + 1);
if (yylval.command.cmnd == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
/* Copy the string and collapse any escaped sudo-specific characters. */
for (i = 0; i < len; i++) {
if (src[i] == '\\' && i != len - 1 && SPECIAL(src[i + 1]))
*dst++ = src[++i];
else
*dst++ = src[i];
}
*dst = '\0';
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 path_list {
char *path;
struct path_list *next;
};
struct include_stack {
YY_BUFFER_STATE bs;
char *path;
struct path_list *more; /* more files in case of includedir */
int lineno;
int keepopen;
};
static int
pl_compare(v1, v2)
const void *v1;
const void *v2;
{
const struct path_list * const *p1 = v1;
const struct path_list * const *p2 = v2;
return(strcmp((*p1)->path, (*p2)->path));
}
static char *
switch_dir(stack, dirpath)
struct include_stack *stack;
char *dirpath;
{
DIR *dir;
int i, count = 0;
char *path = NULL;
struct dirent *dent;
struct stat sb;
struct path_list *pl, *first = NULL;
struct path_list **sorted = NULL;
if (!(dir = opendir(dirpath))) {
yyerror(dirpath);
return(FALSE);
}
while ((dent = readdir(dir))) {
/* Ignore files that end in '~' or have a '.' in them. */
if (dent->d_name[0] == '\0' || dent->d_name[NAMLEN(dent) - 1] == '~'
|| strchr(dent->d_name, '.') != NULL) {
continue;
}
if (asprintf(&path, "%s/%s", dirpath, dent->d_name) == -1) {
closedir(dir);
goto bad;
}
if (stat(path, &sb) != 0 || !S_ISREG(sb.st_mode)) {
efree(path);
continue;
}
pl = malloc(sizeof(*pl));
if (pl == NULL)
goto bad;
pl->path = path;
pl->next = first;
first = pl;
count++;
}
closedir(dir);
if (count == 0)
goto done;
/* Sort the list as an array. */
sorted = malloc(sizeof(*sorted) * count);
if (sorted == NULL)
goto bad;
pl = first;
for (i = 0; i < count; i++) {
sorted[i] = pl;
pl = pl->next;
}
qsort(sorted, count, sizeof(*sorted), pl_compare);
/* Apply sorting to the list. */
first = sorted[0];
sorted[count - 1]->next = NULL;
for (i = 1; i < count; i++)
sorted[i - 1]->next = sorted[i];
efree(sorted);
/* Pull out the first element for parsing, leave the rest for later. */
if (count) {
path = first->path;
pl = first->next;
efree(first);
stack->more = pl;
} else {
path = NULL;
}
done:
efree(dirpath);
return(path);
bad:
while (first != NULL) {
pl = first;
first = pl->next;
free(pl->path);
free(pl);
}
efree(sorted);
efree(dirpath);
efree(path);
return(NULL);
}
#define MAX_SUDOERS_DEPTH 128
#define SUDOERS_STACK_INCREMENT 16
static size_t istacksize, idepth;
static struct include_stack *istack;
static int keepopen;
void
init_lexer()
{
struct path_list *pl;
while (idepth) {
idepth--;
while ((pl = istack[idepth].more) != NULL) {
istack[idepth].more = pl->next;
efree(pl->path);
efree(pl);
}
efree(istack[idepth].path);
if (!istack[idepth].keepopen)
fclose(istack[idepth].bs->yy_input_file);
yy_delete_buffer(istack[idepth].bs);
}
efree(istack);
istack = NULL;
istacksize = idepth = 0;
keepopen = FALSE;
}
static int
_push_include(path, isdir)
char *path;
int isdir;
{
FILE *fp;
/* push current state onto stack */
if (idepth >= istacksize) {
if (idepth > MAX_SUDOERS_DEPTH) {
yyerror("too many levels of includes");
return(FALSE);
}
istacksize += SUDOERS_STACK_INCREMENT;
istack = (struct include_stack *) realloc(istack,
sizeof(istack) * istacksize);
if (istack == NULL) {
yyerror("unable to allocate memory");
return(FALSE);
}
}
if (isdir) {
if (!(path = switch_dir(&istack[idepth], path))) {
yyerror(path);
return(FALSE);
}
if ((fp = open_sudoers(path, FALSE, &keepopen)) == NULL) {
yyerror(path);
return(FALSE); /* XXX - just to go next one? */
}
} else {
if ((fp = open_sudoers(path, TRUE, &keepopen)) == NULL) {
yyerror(path);
return(FALSE);
}
istack[idepth].more = NULL;
}
/* Push the old (current) file and open the new one. */
istack[idepth].path = sudoers; /* push old path */
istack[idepth].bs = YY_CURRENT_BUFFER;
istack[idepth].lineno = sudolineno;
istack[idepth].keepopen = keepopen;
idepth++;
sudolineno = 1;
sudoers = path;
yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
return(TRUE);
}
static int
pop_include()
{
struct path_list *pl;
FILE *fp;
if (idepth == 0)
return(FALSE);
if (!keepopen)
fclose(YY_CURRENT_BUFFER->yy_input_file);
yy_delete_buffer(YY_CURRENT_BUFFER);
keepopen = FALSE;
if ((pl = istack[idepth - 1].more) != NULL) {
/* Move to next file in the dir. */
istack[idepth - 1].more = pl->next;
if ((fp = open_sudoers(pl->path, FALSE, &keepopen)) == NULL) {
yyerror(pl->path);
return(FALSE); /* XXX - just to go next one? */
}
efree(sudoers);
sudoers = pl->path;
sudolineno = 1;
yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
efree(pl);
} else {
idepth--;
yy_switch_to_buffer(istack[idepth].bs);
efree(sudoers);
sudoers = istack[idepth].path;
sudolineno = istack[idepth].lineno;
}
return(TRUE);
}
static char *
parse_include(base)
char *base;
{
char *cp, *ep, *path;
int len = 0, subst = 0;
size_t shost_len = 0;
/* Pull out path from #include line. */
cp = base + sizeof("#include");
if (*cp == 'i')
cp += 3; /* includedir */
while (isblank((unsigned char) *cp))
cp++;
ep = cp;
while (*ep != '\0' && !isspace((unsigned char) *ep)) {
if (ep[0] == '%' && ep[1] == 'h') {
shost_len = strlen(user_shost);
len += shost_len - 2;
subst = 1;
}
ep++;
}
/* Make a copy of path and return it. */
len += (int)(ep - cp);
if ((path = malloc(len + 1)) == NULL)
yyerror("unable to allocate memory");
if (subst) {
/* substitute for %h */
char *pp = path;
while (cp < ep) {
if (cp[0] == '%' && cp[1] == 'h') {
memcpy(pp, user_shost, shost_len);
pp += shost_len;
cp += 2;
}
*pp++ = *cp++;
}
*pp = '\0';
} else {
memcpy(path, cp, len);
path[len] = '\0';
}
/* Push any excess characters (e.g. comment, newline) back to the lexer */
if (*ep != '\0')
yyless((int)(ep - base));
return(path);
}
/*
* Check to make sure an IPv6 address does not contain multiple instances
* of the string "::". Assumes strlen(s) >= 1.
* Returns TRUE if address is valid else FALSE.
*/
static int
ipv6_valid(s)
const char *s;
{
int nmatch = 0;
for (; *s != '\0'; s++) {
if (s[0] == ':' && s[1] == ':') {
if (++nmatch > 1)
break;
}
if (s[0] == '/')
nmatch = 0; /* reset if we hit netmask */
}
return (nmatch <= 1);
}