2831 lines
85 KiB
C
2831 lines
85 KiB
C
#line 2 "toke.c"
|
|
/* $OpenBSD: flex.skl,v 1.8 2004/02/09 11:38:31 espie Exp $ */
|
|
|
|
/* A lexical scanner generated by flex */
|
|
|
|
/* Scanner skeleton version:
|
|
* $Header$
|
|
*/
|
|
|
|
#define FLEX_SCANNER
|
|
#define YY_FLEX_MAJOR_VERSION 2
|
|
#define YY_FLEX_MINOR_VERSION 5
|
|
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
|
|
|
|
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
|
|
#ifdef c_plusplus
|
|
#ifndef __cplusplus
|
|
#define __cplusplus
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
/* Use prototypes in function declarations. */
|
|
#define YY_USE_PROTOS
|
|
|
|
/* The "const" storage-class-modifier is valid. */
|
|
#define YY_USE_CONST
|
|
|
|
#else /* ! __cplusplus */
|
|
|
|
#ifdef __STDC__
|
|
|
|
#define YY_USE_PROTOS
|
|
#define YY_USE_CONST
|
|
|
|
#endif /* __STDC__ */
|
|
#endif /* ! __cplusplus */
|
|
|
|
#ifdef __TURBOC__
|
|
#pragma warn -rch
|
|
#pragma warn -use
|
|
#include <io.h>
|
|
#include <stdlib.h>
|
|
#define YY_USE_CONST
|
|
#define YY_USE_PROTOS
|
|
#endif
|
|
|
|
#ifdef YY_USE_CONST
|
|
#define yyconst const
|
|
#else
|
|
#define yyconst
|
|
#endif
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
#define YY_PROTO(proto) proto
|
|
#else
|
|
#define YY_PROTO(proto) ()
|
|
#endif
|
|
|
|
/* Returned upon end-of-file. */
|
|
#define YY_NULL 0
|
|
|
|
/* Promotes a possibly negative, possibly signed char to an unsigned
|
|
* integer for use as an array index. If the signed char is negative,
|
|
* we want to instead treat it as an 8-bit unsigned char, hence the
|
|
* double cast.
|
|
*/
|
|
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
|
|
|
|
/* Enter a start condition. This macro really ought to take a parameter,
|
|
* but we do it the disgusting crufty way forced on us by the ()-less
|
|
* definition of BEGIN.
|
|
*/
|
|
#define BEGIN yy_start = 1 + 2 *
|
|
|
|
/* Translate the current start state into a value that can be later handed
|
|
* to BEGIN to return to the state. The YYSTATE alias is for lex
|
|
* compatibility.
|
|
*/
|
|
#define YY_START ((yy_start - 1) / 2)
|
|
#define YYSTATE YY_START
|
|
|
|
/* Action number for EOF rule of a given start state. */
|
|
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
|
|
|
|
/* Special action meaning "start processing a new file". */
|
|
#define YY_NEW_FILE yyrestart( yyin )
|
|
|
|
#define YY_END_OF_BUFFER_CHAR 0
|
|
|
|
/* Size of default input buffer. */
|
|
#define YY_BUF_SIZE 16384
|
|
|
|
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
|
|
|
extern int yyleng;
|
|
extern FILE *yyin, *yyout;
|
|
|
|
#define EOB_ACT_CONTINUE_SCAN 0
|
|
#define EOB_ACT_END_OF_FILE 1
|
|
#define EOB_ACT_LAST_MATCH 2
|
|
|
|
/* The funky do-while in the following #define is used to turn the definition
|
|
* int a single C statement (which needs a semi-colon terminator). This
|
|
* avoids problems with code like:
|
|
*
|
|
* if ( condition_holds )
|
|
* yyless( 5 );
|
|
* else
|
|
* do_something_else();
|
|
*
|
|
* Prior to using the do-while the compiler would get upset at the
|
|
* "else" because it interpreted the "if" statement as being all
|
|
* done when it reached the ';' after the yyless() call.
|
|
*/
|
|
|
|
/* Return all but the first 'n' matched characters back to the input stream. */
|
|
|
|
#define yyless(n) \
|
|
do \
|
|
{ \
|
|
/* Undo effects of setting up yytext. */ \
|
|
*yy_cp = yy_hold_char; \
|
|
YY_RESTORE_YY_MORE_OFFSET \
|
|
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
|
|
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
|
|
} \
|
|
while ( 0 )
|
|
|
|
#define unput(c) yyunput( c, yytext_ptr )
|
|
|
|
/* The following is because we cannot portably get our hands on size_t
|
|
* (without autoconf's help, which isn't available because we want
|
|
* flex-generated scanners to compile on their own).
|
|
*/
|
|
typedef unsigned int yy_size_t;
|
|
|
|
|
|
struct yy_buffer_state
|
|
{
|
|
FILE *yy_input_file;
|
|
|
|
char *yy_ch_buf; /* input buffer */
|
|
char *yy_buf_pos; /* current position in input buffer */
|
|
|
|
/* Size of input buffer in bytes, not including room for EOB
|
|
* characters.
|
|
*/
|
|
yy_size_t yy_buf_size;
|
|
|
|
/* Number of characters read into yy_ch_buf, not including EOB
|
|
* characters.
|
|
*/
|
|
int yy_n_chars;
|
|
|
|
/* Whether we "own" the buffer - i.e., we know we created it,
|
|
* and can realloc() it to grow it, and should free() it to
|
|
* delete it.
|
|
*/
|
|
int yy_is_our_buffer;
|
|
|
|
/* Whether this is an "interactive" input source; if so, and
|
|
* if we're using stdio for input, then we want to use getc()
|
|
* instead of fread(), to make sure we stop fetching input after
|
|
* each newline.
|
|
*/
|
|
int yy_is_interactive;
|
|
|
|
/* Whether we're considered to be at the beginning of a line.
|
|
* If so, '^' rules will be active on the next match, otherwise
|
|
* not.
|
|
*/
|
|
int yy_at_bol;
|
|
|
|
/* Whether to try to fill the input buffer when we reach the
|
|
* end of it.
|
|
*/
|
|
int yy_fill_buffer;
|
|
|
|
int yy_buffer_status;
|
|
#define YY_BUFFER_NEW 0
|
|
#define YY_BUFFER_NORMAL 1
|
|
/* When an EOF's been seen but there's still some text to process
|
|
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
|
|
* shouldn't try reading from the input source any more. We might
|
|
* still have a bunch of tokens to match, though, because of
|
|
* possible backing-up.
|
|
*
|
|
* When we actually see the EOF, we change the status to "new"
|
|
* (via yyrestart()), so that the user can continue scanning by
|
|
* just pointing yyin at a new input file.
|
|
*/
|
|
#define YY_BUFFER_EOF_PENDING 2
|
|
};
|
|
|
|
static YY_BUFFER_STATE yy_current_buffer = 0;
|
|
|
|
/* We provide macros for accessing buffer states in case in the
|
|
* future we want to put the buffer states in a more general
|
|
* "scanner state".
|
|
*/
|
|
#define YY_CURRENT_BUFFER yy_current_buffer
|
|
|
|
|
|
/* yy_hold_char holds the character lost when yytext is formed. */
|
|
static char yy_hold_char;
|
|
|
|
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
|
|
|
|
|
int yyleng;
|
|
|
|
/* Points to current character in buffer. */
|
|
static char *yy_c_buf_p = (char *) 0;
|
|
static int yy_init = 1; /* whether we need to initialize */
|
|
static int yy_start = 0; /* start state number */
|
|
|
|
/* Flag which is used to allow yywrap()'s to do buffer switches
|
|
* instead of setting up a fresh yyin. A bit of a hack ...
|
|
*/
|
|
static int yy_did_buffer_switch_on_eof;
|
|
|
|
void yyrestart YY_PROTO(( FILE *input_file ));
|
|
|
|
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
|
|
void yy_load_buffer_state YY_PROTO(( void ));
|
|
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
|
|
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
|
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
|
|
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
|
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
|
|
|
|
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
|
|
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
|
|
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
|
|
|
|
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
|
|
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
|
|
static void yy_flex_free YY_PROTO(( void * ));
|
|
|
|
#define yy_new_buffer yy_create_buffer
|
|
|
|
#define yy_set_interactive(is_interactive) \
|
|
{ \
|
|
if ( ! yy_current_buffer ) \
|
|
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
|
yy_current_buffer->yy_is_interactive = is_interactive; \
|
|
}
|
|
|
|
#define yy_set_bol(at_bol) \
|
|
{ \
|
|
if ( ! yy_current_buffer ) \
|
|
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
|
yy_current_buffer->yy_at_bol = at_bol; \
|
|
}
|
|
|
|
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
|
|
|
|
|
|
#define yywrap() 1
|
|
#define YY_SKIP_YYWRAP
|
|
typedef unsigned char YY_CHAR;
|
|
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
|
|
typedef int yy_state_type;
|
|
extern char *yytext;
|
|
#define yytext_ptr yytext
|
|
|
|
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
|
|
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
|
|
static int yy_get_next_buffer YY_PROTO(( void ));
|
|
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
|
|
|
|
/* Done after the current pattern has been matched and before the
|
|
* corresponding action - sets up yytext.
|
|
*/
|
|
#define YY_DO_BEFORE_ACTION \
|
|
yytext_ptr = yy_bp; \
|
|
yyleng = (int) (yy_cp - yy_bp); \
|
|
yy_hold_char = *yy_cp; \
|
|
*yy_cp = '\0'; \
|
|
yy_c_buf_p = yy_cp;
|
|
|
|
#define YY_NUM_RULES 43
|
|
#define YY_END_OF_BUFFER 44
|
|
static yyconst short int yy_accept[398] =
|
|
{ 0,
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 0, 44, 33, 39, 38, 37, 42, 33, 26,
|
|
42, 33, 34, 33, 33, 33, 33, 36, 35, 27,
|
|
27, 27, 27, 27, 42, 33, 42, 27, 27, 27,
|
|
27, 27, 28, 42, 28, 29, 28, 28, 28, 28,
|
|
28, 27, 27, 27, 27, 27, 42, 28, 1, 33,
|
|
33, 12, 11, 12, 11, 11, 42, 42, 2, 8,
|
|
8, 8, 3, 8, 4, 42, 33, 0, 39, 37,
|
|
0, 41, 23, 0, 22, 0, 32, 32, 0, 33,
|
|
33, 33, 33, 33, 27, 27, 27, 27, 27, 33,
|
|
|
|
40, 33, 0, 33, 33, 33, 33, 33, 28, 0,
|
|
28, 23, 0, 22, 0, 28, 0, 28, 28, 28,
|
|
28, 28, 27, 27, 27, 27, 27, 28, 28, 1,
|
|
30, 30, 0, 33, 12, 12, 10, 9, 10, 0,
|
|
2, 8, 0, 8, 0, 0, 5, 6, 8, 8,
|
|
0, 33, 33, 33, 27, 27, 27, 27, 27, 27,
|
|
33, 0, 33, 33, 33, 33, 33, 28, 28, 28,
|
|
27, 27, 27, 27, 27, 27, 28, 0, 33, 7,
|
|
7, 0, 7, 8, 33, 33, 33, 33, 33, 27,
|
|
27, 27, 27, 27, 27, 33, 0, 33, 33, 33,
|
|
|
|
28, 28, 28, 28, 28, 27, 27, 27, 27, 27,
|
|
27, 28, 33, 7, 33, 33, 33, 0, 19, 27,
|
|
27, 27, 27, 27, 33, 0, 33, 33, 28, 28,
|
|
28, 27, 27, 27, 27, 27, 28, 33, 33, 33,
|
|
33, 33, 33, 27, 27, 27, 27, 27, 33, 0,
|
|
33, 33, 28, 28, 28, 28, 28, 27, 27, 27,
|
|
27, 27, 28, 33, 24, 24, 24, 27, 0, 18,
|
|
27, 27, 0, 17, 33, 0, 33, 33, 24, 24,
|
|
24, 27, 27, 27, 28, 33, 33, 24, 24, 24,
|
|
24, 0, 21, 27, 27, 31, 0, 33, 14, 28,
|
|
|
|
24, 24, 24, 24, 27, 27, 28, 30, 33, 25,
|
|
25, 25, 27, 0, 16, 0, 33, 0, 33, 28,
|
|
25, 25, 25, 27, 33, 33, 25, 25, 25, 25,
|
|
25, 0, 20, 0, 15, 14, 0, 14, 0, 28,
|
|
28, 25, 25, 25, 25, 25, 33, 33, 33, 25,
|
|
25, 0, 13, 28, 28, 28, 25, 25, 33, 33,
|
|
33, 33, 33, 28, 28, 28, 28, 28, 33, 33,
|
|
33, 28, 28, 28, 33, 33, 33, 33, 33, 28,
|
|
28, 28, 28, 28, 24, 24, 24, 24, 24, 24,
|
|
24, 24, 24, 24, 24, 24, 0
|
|
|
|
} ;
|
|
|
|
static yyconst int yy_ec[256] =
|
|
{ 0,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 2, 4, 5, 6, 1, 7, 1, 1, 8,
|
|
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
|
|
19, 20, 21, 22, 22, 22, 22, 23, 1, 1,
|
|
24, 25, 10, 26, 27, 28, 29, 30, 31, 28,
|
|
28, 32, 33, 28, 28, 28, 34, 35, 36, 37,
|
|
28, 38, 39, 40, 41, 28, 42, 43, 28, 28,
|
|
10, 44, 10, 1, 45, 1, 46, 47, 48, 49,
|
|
|
|
50, 51, 47, 47, 52, 47, 47, 53, 54, 55,
|
|
56, 47, 47, 57, 58, 59, 60, 47, 47, 47,
|
|
47, 47, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1
|
|
} ;
|
|
|
|
static yyconst int yy_meta[61] =
|
|
{ 0,
|
|
1, 2, 2, 3, 1, 4, 1, 3, 3, 1,
|
|
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 5, 4, 3, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 6, 7, 7, 7, 7, 7, 7,
|
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7
|
|
} ;
|
|
|
|
static yyconst short int yy_base[422] =
|
|
{ 0,
|
|
0, 55, 96, 0, 155, 156, 163, 176, 219, 278,
|
|
337, 380, 1507, 1462, 1503, 2128, 1500, 1490, 1448, 2128,
|
|
2128, 1447, 2128, 164, 48, 210, 239, 2128, 2128, 424,
|
|
1447, 1443, 1442, 1447, 483, 19, 157, 1410, 1410, 1396,
|
|
1386, 1387, 1392, 220, 1391, 2128, 1388, 343, 271, 353,
|
|
389, 508, 1387, 1387, 1386, 1389, 567, 28, 1413, 351,
|
|
29, 0, 2128, 1410, 0, 2128, 583, 72, 0, 1368,
|
|
191, 47, 2128, 157, 2128, 74, 1367, 293, 1404, 1400,
|
|
1394, 2128, 1343, 508, 1324, 592, 354, 1314, 616, 592,
|
|
160, 628, 637, 646, 0, 1318, 1304, 49, 1290, 174,
|
|
|
|
2128, 46, 156, 140, 139, 147, 162, 148, 1268, 671,
|
|
230, 1258, 680, 1246, 704, 392, 713, 723, 300, 732,
|
|
741, 752, 0, 1258, 1244, 269, 1232, 242, 260, 1248,
|
|
689, 1205, 775, 263, 0, 1242, 79, 2128, 2128, 308,
|
|
0, 1201, 780, 800, 372, 375, 2128, 2128, 1198, 386,
|
|
795, 809, 818, 829, 1201, 1188, 1176, 1182, 1173, 1160,
|
|
252, 316, 350, 166, 175, 310, 309, 838, 847, 858,
|
|
1160, 1147, 1127, 1133, 1123, 1101, 301, 881, 346, 1095,
|
|
2128, 444, 883, 894, 892, 404, 903, 912, 923, 424,
|
|
1080, 1088, 1075, 1070, 1040, 370, 362, 276, 34, 158,
|
|
|
|
932, 558, 941, 952, 961, 488, 1041, 1049, 1044, 1012,
|
|
1000, 377, 378, 575, 970, 981, 990, 576, 2128, 947,
|
|
916, 870, 862, 868, 449, 571, 561, 379, 999, 1010,
|
|
1019, 854, 855, 848, 831, 803, 450, 452, 1028, 589,
|
|
1039, 1048, 1057, 784, 668, 777, 774, 676, 453, 574,
|
|
577, 254, 1068, 624, 1077, 1086, 1097, 777, 700, 774,
|
|
771, 707, 582, 585, 1107, 1116, 1127, 709, 724, 2128,
|
|
755, 750, 733, 2128, 538, 668, 591, 643, 1137, 1146,
|
|
1157, 772, 739, 701, 617, 641, 1166, 749, 1176, 1187,
|
|
1196, 786, 2128, 686, 787, 663, 410, 456, 1218, 1207,
|
|
|
|
750, 1217, 1237, 1248, 636, 788, 625, 608, 1256, 1266,
|
|
1277, 1287, 818, 819, 2128, 1245, 676, 588, 540, 1297,
|
|
1306, 1316, 1326, 869, 1335, 764, 1345, 1355, 1364, 1374,
|
|
1384, 892, 2128, 580, 537, 460, 1401, 459, 1425, 1422,
|
|
902, 1437, 1451, 1466, 1480, 1403, 1495, 1509, 1524, 1538,
|
|
1445, 343, 2128, 1553, 1567, 1582, 1596, 1459, 1603, 921,
|
|
1613, 1632, 1642, 1648, 950, 1661, 1677, 1690, 1698, 1708,
|
|
1719, 1729, 1739, 1748, 1758, 979, 1768, 1777, 1787, 1797,
|
|
1008, 1806, 1816, 1826, 1835, 1845, 1855, 1864, 1874, 1884,
|
|
250, 1893, 1903, 218, 1913, 1922, 2128, 1966, 1973, 1980,
|
|
|
|
1987, 1994, 2001, 2008, 2015, 2022, 2029, 2036, 2043, 2050,
|
|
2057, 178, 2064, 2071, 2078, 2085, 2092, 2099, 2106, 2113,
|
|
2120
|
|
} ;
|
|
|
|
static yyconst short int yy_def[422] =
|
|
{ 0,
|
|
397, 1, 397, 3, 1, 1, 398, 398, 399, 399,
|
|
400, 400, 397, 401, 397, 397, 397, 402, 403, 397,
|
|
397, 404, 397, 405, 401, 401, 401, 397, 397, 397,
|
|
30, 30, 30, 30, 401, 401, 402, 30, 30, 30,
|
|
30, 30, 406, 397, 407, 397, 408, 409, 406, 406,
|
|
406, 397, 52, 52, 52, 52, 406, 406, 397, 410,
|
|
401, 411, 397, 411, 411, 397, 397, 397, 412, 413,
|
|
414, 413, 397, 413, 397, 415, 401, 401, 397, 397,
|
|
402, 397, 403, 403, 404, 404, 405, 416, 401, 401,
|
|
401, 401, 401, 401, 30, 30, 30, 30, 30, 401,
|
|
|
|
397, 401, 402, 401, 401, 401, 401, 401, 406, 406,
|
|
397, 407, 407, 408, 408, 409, 406, 406, 406, 406,
|
|
406, 406, 52, 52, 52, 52, 52, 406, 406, 397,
|
|
410, 417, 401, 401, 411, 411, 397, 397, 397, 397,
|
|
412, 413, 413, 414, 418, 414, 397, 397, 413, 413,
|
|
397, 401, 401, 401, 30, 30, 30, 30, 30, 30,
|
|
401, 402, 401, 401, 401, 401, 401, 406, 406, 406,
|
|
52, 52, 52, 52, 52, 52, 406, 397, 401, 413,
|
|
397, 418, 414, 414, 401, 401, 401, 401, 401, 30,
|
|
30, 30, 30, 30, 30, 401, 402, 401, 401, 401,
|
|
|
|
406, 406, 406, 406, 406, 52, 52, 52, 52, 52,
|
|
52, 406, 401, 418, 401, 401, 401, 397, 397, 30,
|
|
30, 30, 30, 30, 401, 402, 401, 401, 406, 406,
|
|
406, 52, 52, 52, 52, 52, 406, 401, 401, 401,
|
|
401, 401, 401, 30, 30, 30, 30, 30, 401, 402,
|
|
401, 401, 406, 406, 406, 406, 406, 52, 52, 52,
|
|
52, 52, 406, 401, 401, 401, 401, 30, 397, 397,
|
|
30, 30, 397, 397, 401, 402, 401, 401, 406, 406,
|
|
406, 52, 52, 52, 406, 401, 401, 401, 401, 401,
|
|
401, 397, 397, 30, 30, 401, 402, 401, 401, 406,
|
|
|
|
406, 406, 406, 406, 52, 52, 406, 401, 401, 401,
|
|
401, 401, 30, 397, 397, 402, 401, 419, 420, 406,
|
|
406, 406, 406, 52, 401, 401, 401, 401, 401, 401,
|
|
401, 397, 397, 421, 401, 419, 419, 420, 420, 406,
|
|
406, 406, 406, 406, 406, 406, 401, 401, 401, 401,
|
|
401, 421, 397, 406, 406, 406, 406, 406, 401, 401,
|
|
401, 401, 401, 406, 406, 406, 406, 406, 401, 401,
|
|
401, 406, 406, 406, 401, 401, 401, 401, 401, 406,
|
|
406, 406, 406, 406, 401, 401, 401, 406, 406, 406,
|
|
401, 401, 401, 406, 406, 406, 0, 397, 397, 397,
|
|
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397
|
|
} ;
|
|
|
|
static yyconst short int yy_nxt[2189] =
|
|
{ 0,
|
|
14, 15, 16, 17, 14, 18, 19, 20, 21, 14,
|
|
22, 23, 14, 14, 24, 25, 26, 27, 25, 25,
|
|
25, 25, 28, 29, 21, 14, 30, 30, 30, 30,
|
|
31, 30, 30, 32, 33, 30, 34, 30, 30, 30,
|
|
30, 30, 30, 35, 14, 14, 14, 14, 14, 14,
|
|
14, 14, 14, 14, 14, 14, 14, 36, 14, 14,
|
|
37, 90, 78, 91, 91, 91, 91, 91, 91, 91,
|
|
147, 110, 78, 140, 101, 150, 101, 78, 102, 157,
|
|
140, 101, 158, 38, 39, 159, 40, 129, 134, 78,
|
|
143, 78, 41, 228, 161, 42, 43, 15, 16, 17,
|
|
|
|
43, 44, 45, 21, 46, 43, 47, 23, 43, 43,
|
|
48, 49, 50, 51, 49, 49, 49, 49, 28, 29,
|
|
21, 43, 52, 52, 52, 52, 53, 52, 52, 54,
|
|
55, 52, 56, 52, 52, 52, 52, 52, 52, 57,
|
|
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
|
|
43, 43, 43, 58, 43, 43, 59, 59, 82, 82,
|
|
21, 21, 21, 21, 15, 63, 64, 88, 65, 60,
|
|
60, 88, 88, 90, 66, 140, 101, 15, 63, 64,
|
|
148, 65, 78, 78, 141, 66, 65, 66, 88, 164,
|
|
78, 78, 145, 145, 163, 142, 145, 167, 66, 65,
|
|
|
|
143, 78, 145, 78, 165, 78, 67, 89, 103, 78,
|
|
162, 199, 61, 61, 145, 198, 166, 78, 78, 67,
|
|
15, 16, 17, 90, 18, 92, 92, 92, 92, 92,
|
|
92, 92, 111, 198, 146, 111, 111, 111, 111, 111,
|
|
111, 111, 111, 140, 101, 111, 111, 111, 111, 111,
|
|
111, 111, 90, 78, 93, 93, 93, 93, 93, 94,
|
|
91, 110, 68, 69, 69, 69, 69, 69, 69, 69,
|
|
69, 69, 69, 69, 69, 69, 69, 69, 69, 15,
|
|
16, 17, 78, 18, 118, 110, 119, 119, 119, 119,
|
|
119, 119, 119, 78, 77, 78, 77, 78, 77, 173,
|
|
|
|
77, 77, 174, 110, 77, 175, 78, 196, 177, 140,
|
|
101, 179, 278, 118, 110, 77, 77, 77, 82, 78,
|
|
227, 68, 69, 69, 69, 69, 69, 69, 69, 69,
|
|
69, 69, 69, 69, 69, 69, 69, 69, 15, 16,
|
|
17, 71, 18, 110, 110, 353, 88, 72, 73, 74,
|
|
88, 88, 78, 78, 132, 200, 212, 88, 132, 132,
|
|
75, 88, 88, 197, 82, 198, 118, 88, 120, 120,
|
|
120, 120, 120, 120, 120, 132, 181, 145, 88, 183,
|
|
76, 15, 16, 17, 71, 18, 117, 140, 101, 78,
|
|
72, 73, 74, 78, 133, 88, 110, 89, 198, 88,
|
|
|
|
88, 213, 118, 75, 121, 121, 121, 121, 121, 122,
|
|
119, 316, 82, 78, 226, 182, 88, 185, 184, 225,
|
|
110, 78, 78, 76, 77, 218, 237, 238, 77, 143,
|
|
77, 252, 110, 77, 77, 117, 77, 77, 77, 95,
|
|
95, 95, 95, 95, 95, 95, 219, 78, 214, 77,
|
|
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
|
|
95, 95, 95, 95, 95, 95, 95, 78, 95, 77,
|
|
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
|
|
77, 77, 77, 77, 100, 101, 77, 182, 77, 218,
|
|
77, 77, 78, 110, 77, 78, 78, 249, 263, 78,
|
|
|
|
264, 317, 339, 337, 275, 77, 77, 77, 109, 83,
|
|
219, 83, 109, 83, 109, 83, 83, 109, 109, 83,
|
|
109, 109, 109, 123, 123, 123, 123, 123, 123, 123,
|
|
83, 83, 83, 109, 123, 123, 123, 123, 123, 123,
|
|
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
|
|
123, 110, 123, 109, 109, 109, 109, 109, 109, 109,
|
|
109, 109, 109, 109, 109, 109, 109, 109, 128, 101,
|
|
109, 201, 109, 82, 109, 109, 82, 218, 109, 181,
|
|
78, 78, 353, 339, 137, 101, 138, 251, 139, 109,
|
|
109, 109, 138, 85, 139, 85, 296, 85, 219, 85,
|
|
|
|
85, 110, 239, 85, 78, 139, 139, 152, 153, 154,
|
|
152, 152, 152, 152, 85, 85, 85, 87, 182, 77,
|
|
78, 87, 276, 77, 77, 110, 139, 87, 78, 277,
|
|
250, 337, 78, 285, 78, 78, 286, 253, 87, 87,
|
|
77, 90, 298, 91, 91, 91, 91, 91, 91, 91,
|
|
90, 78, 91, 91, 91, 91, 91, 91, 91, 90,
|
|
110, 91, 91, 91, 91, 91, 91, 110, 110, 269,
|
|
82, 78, 109, 324, 109, 307, 109, 273, 109, 109,
|
|
78, 112, 109, 112, 78, 112, 78, 112, 112, 78,
|
|
270, 112, 132, 109, 109, 109, 132, 132, 274, 308,
|
|
|
|
299, 269, 112, 112, 112, 114, 78, 114, 273, 114,
|
|
292, 114, 114, 132, 116, 114, 109, 297, 116, 78,
|
|
109, 109, 270, 313, 116, 269, 114, 114, 114, 274,
|
|
306, 293, 133, 335, 273, 116, 116, 109, 168, 169,
|
|
170, 168, 168, 168, 168, 118, 270, 119, 119, 119,
|
|
119, 119, 119, 119, 118, 274, 119, 119, 119, 119,
|
|
119, 119, 119, 287, 300, 118, 110, 119, 119, 119,
|
|
119, 119, 119, 292, 305, 110, 131, 325, 77, 295,
|
|
131, 142, 77, 77, 110, 142, 131, 292, 314, 314,
|
|
294, 142, 78, 110, 293, 110, 88, 131, 131, 77,
|
|
|
|
88, 145, 145, 142, 180, 145, 88, 78, 293, 315,
|
|
315, 145, 284, 283, 282, 272, 271, 88, 88, 332,
|
|
314, 268, 185, 145, 186, 186, 186, 186, 186, 186,
|
|
186, 185, 262, 187, 187, 187, 187, 187, 187, 187,
|
|
333, 315, 185, 146, 188, 188, 188, 188, 188, 189,
|
|
186, 201, 78, 202, 202, 202, 202, 202, 202, 202,
|
|
201, 78, 203, 203, 203, 203, 203, 203, 203, 261,
|
|
332, 201, 78, 204, 204, 204, 204, 204, 205, 202,
|
|
260, 110, 132, 259, 145, 145, 132, 180, 145, 258,
|
|
110, 333, 132, 332, 145, 145, 145, 248, 183, 145,
|
|
|
|
247, 110, 246, 132, 132, 145, 145, 215, 216, 217,
|
|
215, 215, 215, 215, 333, 340, 185, 145, 186, 186,
|
|
186, 186, 186, 186, 186, 185, 146, 186, 186, 186,
|
|
186, 186, 186, 186, 359, 78, 185, 146, 186, 186,
|
|
186, 186, 186, 186, 245, 110, 78, 229, 230, 231,
|
|
229, 229, 229, 229, 201, 78, 202, 202, 202, 202,
|
|
202, 202, 202, 364, 78, 201, 78, 202, 202, 202,
|
|
202, 202, 202, 202, 201, 110, 202, 202, 202, 202,
|
|
202, 202, 244, 239, 110, 240, 240, 240, 240, 240,
|
|
240, 240, 375, 110, 239, 110, 241, 241, 241, 241,
|
|
|
|
241, 241, 241, 239, 110, 242, 242, 242, 242, 242,
|
|
243, 240, 253, 78, 254, 254, 254, 254, 254, 254,
|
|
254, 380, 78, 253, 78, 255, 255, 255, 255, 255,
|
|
255, 255, 253, 78, 256, 256, 256, 256, 256, 257,
|
|
254, 236, 110, 265, 266, 267, 265, 265, 265, 265,
|
|
235, 110, 239, 110, 240, 240, 240, 240, 240, 240,
|
|
240, 239, 110, 240, 240, 240, 240, 240, 240, 240,
|
|
239, 78, 240, 240, 240, 240, 240, 240, 234, 233,
|
|
232, 224, 78, 279, 280, 281, 279, 279, 279, 279,
|
|
253, 78, 254, 254, 254, 254, 254, 254, 254, 253,
|
|
|
|
78, 254, 254, 254, 254, 254, 254, 254, 223, 222,
|
|
253, 110, 254, 254, 254, 254, 254, 254, 221, 220,
|
|
110, 287, 288, 288, 288, 288, 288, 288, 288, 110,
|
|
287, 289, 289, 289, 289, 289, 289, 289, 143, 211,
|
|
110, 287, 290, 290, 290, 290, 290, 291, 288, 210,
|
|
78, 300, 301, 301, 301, 301, 301, 301, 301, 78,
|
|
300, 302, 302, 302, 302, 302, 302, 302, 209, 208,
|
|
78, 300, 303, 303, 303, 303, 303, 304, 301, 207,
|
|
110, 309, 310, 311, 312, 309, 309, 309, 206, 110,
|
|
287, 288, 288, 288, 288, 288, 288, 288, 195, 194,
|
|
|
|
110, 287, 288, 288, 288, 288, 288, 288, 288, 78,
|
|
287, 288, 288, 288, 288, 288, 288, 193, 192, 78,
|
|
191, 318, 320, 321, 322, 323, 320, 320, 320, 190,
|
|
78, 300, 301, 301, 301, 301, 301, 301, 301, 78,
|
|
318, 143, 318, 319, 143, 136, 316, 82, 178, 130,
|
|
110, 300, 301, 301, 301, 301, 301, 301, 301, 334,
|
|
110, 78, 300, 301, 301, 301, 301, 301, 301, 325,
|
|
176, 326, 326, 326, 326, 326, 326, 326, 172, 325,
|
|
110, 327, 327, 327, 327, 327, 327, 327, 171, 115,
|
|
325, 110, 328, 328, 328, 328, 328, 329, 330, 78,
|
|
|
|
325, 113, 331, 331, 331, 326, 326, 326, 326, 78,
|
|
340, 110, 341, 341, 341, 341, 341, 341, 341, 340,
|
|
78, 342, 342, 342, 342, 342, 342, 342, 160, 340,
|
|
78, 343, 343, 343, 343, 343, 344, 345, 156, 340,
|
|
110, 346, 346, 346, 341, 341, 341, 341, 155, 110,
|
|
347, 348, 349, 347, 347, 347, 347, 151, 325, 110,
|
|
330, 330, 330, 330, 330, 330, 330, 86, 325, 110,
|
|
330, 330, 330, 330, 330, 330, 330, 325, 78, 330,
|
|
330, 330, 330, 330, 330, 350, 84, 325, 78, 350,
|
|
350, 350, 350, 350, 350, 350, 82, 325, 78, 351,
|
|
|
|
351, 351, 336, 80, 336, 79, 336, 78, 336, 336,
|
|
78, 143, 336, 136, 130, 127, 340, 78, 358, 358,
|
|
358, 126, 125, 336, 336, 336, 338, 78, 338, 124,
|
|
338, 115, 338, 338, 113, 110, 338, 354, 355, 356,
|
|
354, 354, 354, 354, 108, 107, 110, 338, 338, 338,
|
|
340, 106, 345, 345, 345, 345, 345, 345, 345, 105,
|
|
351, 351, 351, 104, 340, 110, 345, 345, 345, 345,
|
|
345, 345, 345, 99, 358, 358, 358, 98, 97, 340,
|
|
110, 345, 345, 345, 345, 345, 345, 357, 78, 96,
|
|
86, 84, 82, 340, 110, 357, 357, 357, 357, 357,
|
|
|
|
357, 357, 110, 80, 79, 78, 397, 397, 359, 110,
|
|
360, 360, 360, 360, 360, 360, 360, 397, 397, 397,
|
|
397, 397, 359, 110, 361, 361, 361, 361, 361, 361,
|
|
361, 397, 397, 397, 397, 397, 397, 359, 78, 362,
|
|
362, 362, 362, 362, 363, 360, 397, 397, 397, 397,
|
|
397, 397, 78, 350, 350, 350, 350, 350, 350, 350,
|
|
397, 397, 397, 397, 397, 397, 364, 78, 365, 365,
|
|
365, 365, 365, 365, 365, 397, 397, 397, 397, 397,
|
|
364, 78, 366, 366, 366, 366, 366, 366, 366, 397,
|
|
397, 397, 397, 397, 397, 364, 110, 367, 367, 367,
|
|
|
|
367, 367, 368, 365, 397, 397, 397, 397, 397, 397,
|
|
110, 357, 357, 357, 357, 357, 357, 357, 369, 370,
|
|
371, 369, 369, 369, 369, 110, 359, 397, 360, 360,
|
|
360, 360, 360, 360, 360, 397, 397, 397, 397, 110,
|
|
397, 397, 397, 397, 397, 359, 78, 360, 360, 360,
|
|
360, 360, 360, 360, 397, 359, 78, 360, 360, 360,
|
|
360, 360, 360, 372, 373, 374, 372, 372, 372, 372,
|
|
397, 397, 397, 397, 364, 78, 365, 365, 365, 365,
|
|
365, 365, 365, 397, 397, 78, 397, 397, 397, 397,
|
|
364, 110, 365, 365, 365, 365, 365, 365, 365, 397,
|
|
|
|
397, 397, 397, 364, 110, 365, 365, 365, 365, 365,
|
|
365, 375, 397, 376, 376, 376, 376, 376, 376, 376,
|
|
110, 375, 397, 377, 377, 377, 377, 377, 377, 377,
|
|
397, 397, 375, 110, 378, 378, 378, 378, 378, 379,
|
|
376, 78, 380, 397, 381, 381, 381, 381, 381, 381,
|
|
381, 78, 380, 397, 382, 382, 382, 382, 382, 382,
|
|
382, 380, 78, 383, 383, 383, 383, 383, 384, 381,
|
|
397, 397, 110, 385, 386, 387, 385, 385, 385, 385,
|
|
397, 375, 110, 376, 376, 376, 376, 376, 376, 376,
|
|
375, 110, 376, 376, 376, 376, 376, 376, 376, 397,
|
|
|
|
375, 78, 376, 376, 376, 376, 376, 376, 397, 397,
|
|
397, 78, 388, 389, 390, 388, 388, 388, 388, 380,
|
|
78, 381, 381, 381, 381, 381, 381, 381, 397, 380,
|
|
78, 381, 381, 381, 381, 381, 381, 381, 397, 380,
|
|
110, 381, 381, 381, 381, 381, 381, 397, 397, 110,
|
|
391, 391, 391, 391, 391, 391, 391, 397, 397, 110,
|
|
385, 385, 385, 385, 385, 385, 385, 397, 397, 110,
|
|
392, 392, 392, 392, 392, 393, 391, 397, 78, 394,
|
|
394, 394, 394, 394, 394, 394, 397, 397, 78, 388,
|
|
388, 388, 388, 388, 388, 388, 397, 397, 78, 395,
|
|
|
|
395, 395, 395, 395, 396, 394, 397, 110, 391, 391,
|
|
391, 391, 391, 391, 391, 397, 397, 110, 391, 391,
|
|
391, 391, 391, 391, 397, 397, 397, 110, 394, 394,
|
|
394, 394, 394, 394, 394, 397, 78, 394, 394, 394,
|
|
394, 394, 394, 397, 397, 397, 78, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 110, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 110, 62, 62, 62, 62,
|
|
62, 62, 62, 21, 21, 21, 21, 21, 21, 21,
|
|
70, 70, 70, 70, 70, 70, 70, 77, 397, 397,
|
|
397, 397, 77, 77, 81, 81, 81, 81, 81, 81,
|
|
|
|
81, 83, 397, 397, 397, 397, 83, 83, 85, 397,
|
|
397, 397, 397, 85, 85, 87, 397, 87, 397, 397,
|
|
87, 87, 109, 397, 397, 397, 397, 109, 109, 112,
|
|
397, 397, 397, 397, 112, 112, 114, 397, 397, 397,
|
|
397, 114, 114, 116, 397, 116, 397, 397, 116, 116,
|
|
131, 397, 131, 397, 397, 131, 131, 135, 397, 135,
|
|
135, 397, 397, 135, 142, 397, 142, 397, 142, 142,
|
|
142, 144, 144, 144, 144, 144, 144, 144, 149, 149,
|
|
149, 149, 149, 149, 149, 88, 397, 88, 397, 397,
|
|
88, 88, 132, 397, 132, 397, 397, 132, 132, 145,
|
|
|
|
145, 145, 145, 145, 145, 145, 336, 397, 397, 397,
|
|
397, 336, 336, 338, 397, 397, 397, 397, 338, 338,
|
|
352, 352, 352, 352, 352, 352, 352, 13, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397
|
|
} ;
|
|
|
|
static yyconst short int yy_chk[2189] =
|
|
{ 0,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
2, 25, 36, 25, 25, 25, 25, 25, 25, 25,
|
|
72, 58, 61, 68, 68, 76, 76, 199, 36, 98,
|
|
137, 137, 98, 2, 2, 98, 2, 58, 61, 102,
|
|
72, 25, 2, 199, 102, 2, 3, 3, 3, 3,
|
|
|
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 3, 5, 6, 103, 37,
|
|
5, 6, 5, 6, 7, 7, 7, 24, 7, 5,
|
|
6, 24, 24, 91, 7, 100, 100, 8, 8, 8,
|
|
74, 8, 105, 104, 412, 7, 7, 8, 24, 105,
|
|
106, 108, 71, 71, 104, 71, 71, 108, 8, 8,
|
|
|
|
74, 200, 71, 91, 106, 107, 7, 24, 37, 164,
|
|
103, 164, 5, 6, 71, 200, 107, 100, 165, 8,
|
|
9, 9, 9, 26, 9, 26, 26, 26, 26, 26,
|
|
26, 26, 44, 165, 71, 44, 44, 44, 44, 44,
|
|
44, 44, 111, 128, 128, 111, 111, 111, 111, 111,
|
|
111, 111, 27, 26, 27, 27, 27, 27, 27, 27,
|
|
27, 394, 9, 9, 9, 9, 9, 9, 9, 9,
|
|
9, 9, 9, 9, 9, 9, 9, 9, 9, 10,
|
|
10, 10, 27, 10, 49, 128, 49, 49, 49, 49,
|
|
49, 49, 49, 391, 78, 161, 78, 252, 78, 126,
|
|
|
|
78, 78, 126, 129, 78, 126, 134, 161, 129, 140,
|
|
140, 134, 252, 119, 49, 78, 78, 78, 162, 198,
|
|
198, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
|
10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
|
|
11, 11, 11, 119, 177, 352, 48, 11, 11, 11,
|
|
48, 48, 167, 166, 60, 166, 177, 87, 60, 60,
|
|
11, 87, 87, 162, 197, 167, 50, 48, 50, 50,
|
|
50, 50, 50, 50, 50, 60, 145, 146, 87, 146,
|
|
11, 12, 12, 12, 12, 12, 48, 150, 150, 179,
|
|
12, 12, 12, 163, 60, 116, 50, 87, 163, 116,
|
|
|
|
116, 179, 51, 12, 51, 51, 51, 51, 51, 51,
|
|
51, 297, 297, 196, 197, 145, 116, 186, 146, 196,
|
|
212, 213, 228, 12, 30, 190, 212, 213, 30, 150,
|
|
30, 228, 51, 30, 30, 116, 30, 30, 30, 30,
|
|
30, 30, 30, 30, 30, 30, 190, 186, 182, 30,
|
|
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
|
|
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
|
|
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
|
|
30, 30, 30, 30, 35, 35, 35, 182, 35, 206,
|
|
35, 35, 225, 237, 35, 238, 249, 225, 237, 298,
|
|
|
|
238, 298, 338, 336, 249, 35, 35, 35, 52, 84,
|
|
206, 84, 52, 84, 52, 84, 84, 52, 52, 84,
|
|
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
|
|
84, 84, 84, 52, 52, 52, 52, 52, 52, 52,
|
|
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
|
|
52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
|
|
52, 52, 52, 52, 52, 52, 52, 52, 57, 57,
|
|
57, 202, 57, 226, 57, 57, 250, 218, 57, 214,
|
|
335, 275, 334, 319, 67, 67, 67, 227, 67, 57,
|
|
57, 57, 67, 86, 67, 86, 275, 86, 218, 86,
|
|
|
|
86, 202, 240, 86, 227, 67, 67, 90, 90, 90,
|
|
90, 90, 90, 90, 86, 86, 86, 89, 214, 89,
|
|
251, 89, 250, 89, 89, 263, 67, 89, 264, 251,
|
|
226, 318, 240, 263, 277, 90, 264, 254, 89, 89,
|
|
89, 92, 277, 92, 92, 92, 92, 92, 92, 92,
|
|
93, 308, 93, 93, 93, 93, 93, 93, 93, 94,
|
|
285, 94, 94, 94, 94, 94, 94, 254, 307, 245,
|
|
276, 92, 110, 305, 110, 285, 110, 248, 110, 110,
|
|
93, 113, 110, 113, 286, 113, 278, 113, 113, 94,
|
|
245, 113, 131, 110, 110, 110, 131, 131, 248, 286,
|
|
|
|
278, 259, 113, 113, 113, 115, 296, 115, 262, 115,
|
|
268, 115, 115, 131, 117, 115, 117, 276, 117, 317,
|
|
117, 117, 259, 294, 117, 269, 115, 115, 115, 262,
|
|
284, 268, 131, 317, 273, 117, 117, 117, 118, 118,
|
|
118, 118, 118, 118, 118, 120, 269, 120, 120, 120,
|
|
120, 120, 120, 120, 121, 273, 121, 121, 121, 121,
|
|
121, 121, 121, 288, 301, 122, 118, 122, 122, 122,
|
|
122, 122, 122, 282, 283, 120, 133, 326, 133, 272,
|
|
133, 143, 133, 133, 121, 143, 133, 292, 295, 306,
|
|
271, 143, 288, 301, 282, 122, 151, 133, 133, 133,
|
|
|
|
151, 144, 144, 143, 144, 144, 151, 326, 292, 295,
|
|
306, 144, 261, 260, 258, 247, 246, 151, 151, 313,
|
|
314, 244, 152, 144, 152, 152, 152, 152, 152, 152,
|
|
152, 153, 236, 153, 153, 153, 153, 153, 153, 153,
|
|
313, 314, 154, 144, 154, 154, 154, 154, 154, 154,
|
|
154, 168, 152, 168, 168, 168, 168, 168, 168, 168,
|
|
169, 153, 169, 169, 169, 169, 169, 169, 169, 235,
|
|
324, 170, 154, 170, 170, 170, 170, 170, 170, 170,
|
|
234, 168, 178, 233, 183, 183, 178, 183, 183, 232,
|
|
169, 324, 178, 332, 183, 184, 184, 224, 184, 184,
|
|
|
|
223, 170, 222, 178, 178, 184, 183, 185, 185, 185,
|
|
185, 185, 185, 185, 332, 341, 187, 184, 187, 187,
|
|
187, 187, 187, 187, 187, 188, 183, 188, 188, 188,
|
|
188, 188, 188, 188, 360, 185, 189, 184, 189, 189,
|
|
189, 189, 189, 189, 221, 341, 187, 201, 201, 201,
|
|
201, 201, 201, 201, 203, 188, 203, 203, 203, 203,
|
|
203, 203, 203, 365, 360, 204, 189, 204, 204, 204,
|
|
204, 204, 204, 204, 205, 201, 205, 205, 205, 205,
|
|
205, 205, 220, 215, 203, 215, 215, 215, 215, 215,
|
|
215, 215, 376, 365, 216, 204, 216, 216, 216, 216,
|
|
|
|
216, 216, 216, 217, 205, 217, 217, 217, 217, 217,
|
|
217, 217, 229, 215, 229, 229, 229, 229, 229, 229,
|
|
229, 381, 376, 230, 216, 230, 230, 230, 230, 230,
|
|
230, 230, 231, 217, 231, 231, 231, 231, 231, 231,
|
|
231, 211, 229, 239, 239, 239, 239, 239, 239, 239,
|
|
210, 381, 241, 230, 241, 241, 241, 241, 241, 241,
|
|
241, 242, 231, 242, 242, 242, 242, 242, 242, 242,
|
|
243, 239, 243, 243, 243, 243, 243, 243, 209, 208,
|
|
207, 195, 241, 253, 253, 253, 253, 253, 253, 253,
|
|
255, 242, 255, 255, 255, 255, 255, 255, 255, 256,
|
|
|
|
243, 256, 256, 256, 256, 256, 256, 256, 194, 193,
|
|
257, 253, 257, 257, 257, 257, 257, 257, 192, 191,
|
|
255, 265, 265, 265, 265, 265, 265, 265, 265, 256,
|
|
266, 266, 266, 266, 266, 266, 266, 266, 180, 176,
|
|
257, 267, 267, 267, 267, 267, 267, 267, 267, 175,
|
|
265, 279, 279, 279, 279, 279, 279, 279, 279, 266,
|
|
280, 280, 280, 280, 280, 280, 280, 280, 174, 173,
|
|
267, 281, 281, 281, 281, 281, 281, 281, 281, 172,
|
|
279, 287, 287, 287, 287, 287, 287, 287, 171, 280,
|
|
289, 289, 289, 289, 289, 289, 289, 289, 160, 159,
|
|
|
|
281, 290, 290, 290, 290, 290, 290, 290, 290, 287,
|
|
291, 291, 291, 291, 291, 291, 291, 158, 157, 289,
|
|
156, 299, 300, 300, 300, 300, 300, 300, 300, 155,
|
|
290, 302, 302, 302, 302, 302, 302, 302, 302, 291,
|
|
299, 149, 299, 299, 142, 136, 316, 316, 132, 130,
|
|
300, 303, 303, 303, 303, 303, 303, 303, 303, 316,
|
|
302, 299, 304, 304, 304, 304, 304, 304, 304, 309,
|
|
127, 309, 309, 309, 309, 309, 309, 309, 125, 310,
|
|
303, 310, 310, 310, 310, 310, 310, 310, 124, 114,
|
|
311, 304, 311, 311, 311, 311, 311, 311, 311, 309,
|
|
|
|
312, 112, 312, 312, 312, 312, 312, 312, 312, 310,
|
|
320, 109, 320, 320, 320, 320, 320, 320, 320, 321,
|
|
311, 321, 321, 321, 321, 321, 321, 321, 99, 322,
|
|
312, 322, 322, 322, 322, 322, 322, 322, 97, 323,
|
|
320, 323, 323, 323, 323, 323, 323, 323, 96, 321,
|
|
325, 325, 325, 325, 325, 325, 325, 88, 327, 322,
|
|
327, 327, 327, 327, 327, 327, 327, 85, 328, 323,
|
|
328, 328, 328, 328, 328, 328, 328, 329, 325, 329,
|
|
329, 329, 329, 329, 329, 329, 83, 330, 327, 330,
|
|
330, 330, 330, 330, 330, 330, 81, 331, 328, 331,
|
|
|
|
331, 331, 337, 80, 337, 79, 337, 329, 337, 337,
|
|
77, 70, 337, 64, 59, 56, 346, 330, 346, 346,
|
|
346, 55, 54, 337, 337, 337, 339, 331, 339, 53,
|
|
339, 47, 339, 339, 45, 43, 339, 340, 340, 340,
|
|
340, 340, 340, 340, 42, 41, 346, 339, 339, 339,
|
|
342, 40, 342, 342, 342, 342, 342, 342, 342, 39,
|
|
351, 351, 351, 38, 343, 340, 343, 343, 343, 343,
|
|
343, 343, 343, 34, 358, 358, 358, 33, 32, 344,
|
|
342, 344, 344, 344, 344, 344, 344, 344, 351, 31,
|
|
22, 19, 18, 345, 343, 345, 345, 345, 345, 345,
|
|
|
|
345, 345, 358, 17, 15, 14, 13, 0, 347, 344,
|
|
347, 347, 347, 347, 347, 347, 347, 0, 0, 0,
|
|
0, 0, 348, 345, 348, 348, 348, 348, 348, 348,
|
|
348, 0, 0, 0, 0, 0, 0, 349, 347, 349,
|
|
349, 349, 349, 349, 349, 349, 0, 0, 0, 0,
|
|
0, 0, 348, 350, 350, 350, 350, 350, 350, 350,
|
|
0, 0, 0, 0, 0, 0, 354, 349, 354, 354,
|
|
354, 354, 354, 354, 354, 0, 0, 0, 0, 0,
|
|
355, 350, 355, 355, 355, 355, 355, 355, 355, 0,
|
|
0, 0, 0, 0, 0, 356, 354, 356, 356, 356,
|
|
|
|
356, 356, 356, 356, 0, 0, 0, 0, 0, 0,
|
|
355, 357, 357, 357, 357, 357, 357, 357, 359, 359,
|
|
359, 359, 359, 359, 359, 356, 361, 0, 361, 361,
|
|
361, 361, 361, 361, 361, 0, 0, 0, 0, 357,
|
|
0, 0, 0, 0, 0, 362, 359, 362, 362, 362,
|
|
362, 362, 362, 362, 0, 363, 361, 363, 363, 363,
|
|
363, 363, 363, 364, 364, 364, 364, 364, 364, 364,
|
|
0, 0, 0, 0, 366, 362, 366, 366, 366, 366,
|
|
366, 366, 366, 0, 0, 363, 0, 0, 0, 0,
|
|
367, 364, 367, 367, 367, 367, 367, 367, 367, 0,
|
|
|
|
0, 0, 0, 368, 366, 368, 368, 368, 368, 368,
|
|
368, 369, 0, 369, 369, 369, 369, 369, 369, 369,
|
|
367, 370, 0, 370, 370, 370, 370, 370, 370, 370,
|
|
0, 0, 371, 368, 371, 371, 371, 371, 371, 371,
|
|
371, 369, 372, 0, 372, 372, 372, 372, 372, 372,
|
|
372, 370, 373, 0, 373, 373, 373, 373, 373, 373,
|
|
373, 374, 371, 374, 374, 374, 374, 374, 374, 374,
|
|
0, 0, 372, 375, 375, 375, 375, 375, 375, 375,
|
|
0, 377, 373, 377, 377, 377, 377, 377, 377, 377,
|
|
378, 374, 378, 378, 378, 378, 378, 378, 378, 0,
|
|
|
|
379, 375, 379, 379, 379, 379, 379, 379, 0, 0,
|
|
0, 377, 380, 380, 380, 380, 380, 380, 380, 382,
|
|
378, 382, 382, 382, 382, 382, 382, 382, 0, 383,
|
|
379, 383, 383, 383, 383, 383, 383, 383, 0, 384,
|
|
380, 384, 384, 384, 384, 384, 384, 0, 0, 382,
|
|
385, 385, 385, 385, 385, 385, 385, 0, 0, 383,
|
|
386, 386, 386, 386, 386, 386, 386, 0, 0, 384,
|
|
387, 387, 387, 387, 387, 387, 387, 0, 385, 388,
|
|
388, 388, 388, 388, 388, 388, 0, 0, 386, 389,
|
|
389, 389, 389, 389, 389, 389, 0, 0, 387, 390,
|
|
|
|
390, 390, 390, 390, 390, 390, 0, 388, 392, 392,
|
|
392, 392, 392, 392, 392, 0, 0, 389, 393, 393,
|
|
393, 393, 393, 393, 0, 0, 0, 390, 395, 395,
|
|
395, 395, 395, 395, 395, 0, 392, 396, 396, 396,
|
|
396, 396, 396, 0, 0, 0, 393, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 395, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 396, 398, 398, 398, 398,
|
|
398, 398, 398, 399, 399, 399, 399, 399, 399, 399,
|
|
400, 400, 400, 400, 400, 400, 400, 401, 0, 0,
|
|
0, 0, 401, 401, 402, 402, 402, 402, 402, 402,
|
|
|
|
402, 403, 0, 0, 0, 0, 403, 403, 404, 0,
|
|
0, 0, 0, 404, 404, 405, 0, 405, 0, 0,
|
|
405, 405, 406, 0, 0, 0, 0, 406, 406, 407,
|
|
0, 0, 0, 0, 407, 407, 408, 0, 0, 0,
|
|
0, 408, 408, 409, 0, 409, 0, 0, 409, 409,
|
|
410, 0, 410, 0, 0, 410, 410, 411, 0, 411,
|
|
411, 0, 0, 411, 413, 0, 413, 0, 413, 413,
|
|
413, 414, 414, 414, 414, 414, 414, 414, 415, 415,
|
|
415, 415, 415, 415, 415, 416, 0, 416, 0, 0,
|
|
416, 416, 417, 0, 417, 0, 0, 417, 417, 418,
|
|
|
|
418, 418, 418, 418, 418, 418, 419, 0, 0, 0,
|
|
0, 419, 419, 420, 0, 0, 0, 0, 420, 420,
|
|
421, 421, 421, 421, 421, 421, 421, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
|
|
397, 397, 397, 397, 397, 397, 397, 397
|
|
} ;
|
|
|
|
static yy_state_type yy_last_accepting_state;
|
|
static char *yy_last_accepting_cpos;
|
|
|
|
/* The intent behind this definition is that it'll catch
|
|
* any uses of REJECT which flex missed.
|
|
*/
|
|
#define REJECT reject_used_but_not_detected
|
|
#define yymore() yymore_used_but_not_detected
|
|
#define YY_MORE_ADJ 0
|
|
#define YY_RESTORE_YY_MORE_OFFSET
|
|
char *yytext;
|
|
#line 1 "toke.l"
|
|
#define INITIAL 0
|
|
#line 2 "toke.l"
|
|
/*
|
|
* Copyright (c) 1996, 1998-2004 Todd C. Miller <Todd.Miller@courtesan.com>
|
|
*
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
* Sponsored in part by the Defense Advanced Research Projects
|
|
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
|
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/param.h>
|
|
#include <stdio.h>
|
|
#ifdef STDC_HEADERS
|
|
# include <stdlib.h>
|
|
# include <stddef.h>
|
|
#else
|
|
# ifdef HAVE_STDLIB_H
|
|
# include <stdlib.h>
|
|
# endif
|
|
#endif /* STDC_HEADERS */
|
|
#ifdef HAVE_STRING_H
|
|
# include <string.h>
|
|
#else
|
|
# ifdef HAVE_STRINGS_H
|
|
# include <strings.h>
|
|
# endif
|
|
#endif /* HAVE_STRING_H */
|
|
#ifdef HAVE_UNISTD_H
|
|
# include <unistd.h>
|
|
#endif /* HAVE_UNISTD_H */
|
|
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
|
|
# include <malloc.h>
|
|
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
|
|
#include <ctype.h>
|
|
#include "sudo.h"
|
|
#include "parse.h"
|
|
#include <gram.h>
|
|
|
|
#ifndef lint
|
|
__unused static const char rcsid[] = "$Sudo$";
|
|
#endif /* lint */
|
|
|
|
extern YYSTYPE yylval;
|
|
int sudolineno = 1;
|
|
char *sudoers;
|
|
static int sawspace = 0;
|
|
static int arg_len = 0;
|
|
static int arg_size = 0;
|
|
|
|
static int fill __P((char *, int));
|
|
static int fill_cmnd __P((char *, int));
|
|
static int fill_args __P((char *, int, int));
|
|
static int switch_buffer __P((char *));
|
|
extern void yyerror __P((const char *));
|
|
|
|
#define push_include(_p) (switch_buffer((_p)))
|
|
#define pop_include() (switch_buffer(NULL))
|
|
|
|
/* realloc() to size + COMMANDARGINC to make room for command args */
|
|
#define COMMANDARGINC 64
|
|
|
|
#ifdef TRACELEXER
|
|
#define LEXTRACE(msg) fputs(msg, stderr)
|
|
#else
|
|
#define LEXTRACE(msg)
|
|
#endif
|
|
#define YY_NO_UNPUT 1
|
|
/* XXX - convert GOTRUNAS to exclusive state (GOTDEFS cannot be) */
|
|
#define GOTRUNAS 1
|
|
|
|
#define GOTDEFS 2
|
|
|
|
#define GOTCMND 3
|
|
|
|
#define STARTDEFS 4
|
|
|
|
#define INDEFS 5
|
|
|
|
#line 1083 "toke.c"
|
|
|
|
/* Macros after this point can all be overridden by user definitions in
|
|
* section 1.
|
|
*/
|
|
|
|
#ifndef YY_SKIP_YYWRAP
|
|
#ifdef __cplusplus
|
|
extern "C" int yywrap YY_PROTO(( void ));
|
|
#else
|
|
extern int yywrap YY_PROTO(( void ));
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef YY_NO_UNPUT
|
|
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
|
|
#endif
|
|
|
|
#ifndef yytext_ptr
|
|
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
|
|
#endif
|
|
|
|
#ifdef YY_NEED_STRLEN
|
|
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
|
|
#endif
|
|
|
|
#ifndef YY_NO_INPUT
|
|
#ifdef __cplusplus
|
|
static int yyinput YY_PROTO(( void ));
|
|
#else
|
|
static int input YY_PROTO(( void ));
|
|
#endif
|
|
#endif
|
|
|
|
#if YY_STACK_USED
|
|
static int yy_start_stack_ptr = 0;
|
|
static int yy_start_stack_depth = 0;
|
|
static int *yy_start_stack = 0;
|
|
#ifndef YY_NO_PUSH_STATE
|
|
static void yy_push_state YY_PROTO(( int new_state ));
|
|
#endif
|
|
#ifndef YY_NO_POP_STATE
|
|
static void yy_pop_state YY_PROTO(( void ));
|
|
#endif
|
|
#ifndef YY_NO_TOP_STATE
|
|
static int yy_top_state YY_PROTO(( void ));
|
|
#endif
|
|
|
|
#else
|
|
#define YY_NO_PUSH_STATE 1
|
|
#define YY_NO_POP_STATE 1
|
|
#define YY_NO_TOP_STATE 1
|
|
#endif
|
|
|
|
#ifdef YY_MALLOC_DECL
|
|
YY_MALLOC_DECL
|
|
#else
|
|
#ifdef __STDC__
|
|
#ifndef __cplusplus
|
|
#include <stdlib.h>
|
|
#endif
|
|
#else
|
|
/* Just try to get by without declaring the routines. This will fail
|
|
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
|
|
* or sizeof(void*) != sizeof(int).
|
|
*/
|
|
#endif
|
|
#endif
|
|
|
|
/* Amount of stuff to slurp up with each read. */
|
|
#ifndef YY_READ_BUF_SIZE
|
|
#define YY_READ_BUF_SIZE 8192
|
|
#endif
|
|
|
|
/* Copy whatever the last rule matched to the standard output. */
|
|
|
|
#ifndef ECHO
|
|
/* This used to be an fputs(), but since the string might contain NUL's,
|
|
* we now use fwrite().
|
|
*/
|
|
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
|
|
#endif
|
|
|
|
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
|
* is returned in "result".
|
|
*/
|
|
#ifndef YY_INPUT
|
|
#define YY_INPUT(buf,result,max_size) \
|
|
if ( yy_current_buffer->yy_is_interactive ) \
|
|
{ \
|
|
int c = '*', n; \
|
|
for ( n = 0; n < max_size && \
|
|
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
|
buf[n] = (char) c; \
|
|
if ( c == '\n' ) \
|
|
buf[n++] = (char) c; \
|
|
if ( c == EOF && ferror( yyin ) ) \
|
|
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
|
result = n; \
|
|
} \
|
|
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
|
|
&& ferror( yyin ) ) \
|
|
YY_FATAL_ERROR( "input in flex scanner failed" );
|
|
#endif
|
|
|
|
/* No semi-colon after return; correct usage is to write "yyterminate();" -
|
|
* we don't want an extra ';' after the "return" because that will cause
|
|
* some compilers to complain about unreachable statements.
|
|
*/
|
|
#ifndef yyterminate
|
|
#define yyterminate() return YY_NULL
|
|
#endif
|
|
|
|
/* Number of entries by which start-condition stack grows. */
|
|
#ifndef YY_START_STACK_INCR
|
|
#define YY_START_STACK_INCR 25
|
|
#endif
|
|
|
|
/* Report a fatal error. */
|
|
#ifndef YY_FATAL_ERROR
|
|
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
|
|
#endif
|
|
|
|
/* Default declaration of generated scanner - a define so the user can
|
|
* easily add parameters.
|
|
*/
|
|
#ifndef YY_DECL
|
|
#define YY_DECL int yylex YY_PROTO(( void ))
|
|
#endif
|
|
|
|
/* Code executed at the beginning of each rule, after yytext and yyleng
|
|
* have been set up.
|
|
*/
|
|
#ifndef YY_USER_ACTION
|
|
#define YY_USER_ACTION
|
|
#endif
|
|
|
|
/* Code executed at the end of each rule. */
|
|
#ifndef YY_BREAK
|
|
#define YY_BREAK break;
|
|
#endif
|
|
|
|
#define YY_RULE_SETUP \
|
|
if ( yyleng > 0 ) \
|
|
yy_current_buffer->yy_at_bol = \
|
|
(yytext[yyleng - 1] == '\n'); \
|
|
YY_USER_ACTION
|
|
|
|
YY_DECL
|
|
{
|
|
register yy_state_type yy_current_state;
|
|
register char *yy_cp, *yy_bp;
|
|
register int yy_act;
|
|
|
|
#line 104 "toke.l"
|
|
|
|
#line 1239 "toke.c"
|
|
|
|
if ( yy_init )
|
|
{
|
|
yy_init = 0;
|
|
|
|
#ifdef YY_USER_INIT
|
|
YY_USER_INIT;
|
|
#endif
|
|
|
|
if ( ! yy_start )
|
|
yy_start = 1; /* first start state */
|
|
|
|
if ( ! yyin )
|
|
yyin = stdin;
|
|
|
|
if ( ! yyout )
|
|
yyout = stdout;
|
|
|
|
if ( ! yy_current_buffer )
|
|
yy_current_buffer =
|
|
yy_create_buffer( yyin, YY_BUF_SIZE );
|
|
|
|
yy_load_buffer_state();
|
|
}
|
|
|
|
while ( 1 ) /* loops until end-of-file is reached */
|
|
{
|
|
yy_cp = yy_c_buf_p;
|
|
|
|
/* Support of yytext. */
|
|
*yy_cp = yy_hold_char;
|
|
|
|
/* yy_bp points to the position in yy_ch_buf of the start of
|
|
* the current run.
|
|
*/
|
|
yy_bp = yy_cp;
|
|
|
|
yy_current_state = yy_start;
|
|
yy_current_state += YY_AT_BOL();
|
|
yy_match:
|
|
do
|
|
{
|
|
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
|
if ( yy_accept[yy_current_state] )
|
|
{
|
|
yy_last_accepting_state = yy_current_state;
|
|
yy_last_accepting_cpos = yy_cp;
|
|
}
|
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
{
|
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
if ( yy_current_state >= 398 )
|
|
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] != 2128 );
|
|
|
|
yy_find_action:
|
|
yy_act = yy_accept[yy_current_state];
|
|
if ( yy_act == 0 )
|
|
{ /* have to back up */
|
|
yy_cp = yy_last_accepting_cpos;
|
|
yy_current_state = yy_last_accepting_state;
|
|
yy_act = yy_accept[yy_current_state];
|
|
}
|
|
|
|
YY_DO_BEFORE_ACTION;
|
|
|
|
|
|
do_action: /* This label is used only to access EOF actions. */
|
|
|
|
|
|
switch ( yy_act )
|
|
{ /* beginning of action switch */
|
|
case 0: /* must back up */
|
|
/* undo the effects of YY_DO_BEFORE_ACTION */
|
|
*yy_cp = yy_hold_char;
|
|
yy_cp = yy_last_accepting_cpos;
|
|
yy_current_state = yy_last_accepting_state;
|
|
goto yy_find_action;
|
|
|
|
case 1:
|
|
YY_RULE_SETUP
|
|
#line 105 "toke.l"
|
|
BEGIN STARTDEFS;
|
|
YY_BREAK
|
|
case 2:
|
|
YY_RULE_SETUP
|
|
#line 107 "toke.l"
|
|
{
|
|
BEGIN INDEFS;
|
|
LEXTRACE("DEFVAR ");
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
return(DEFVAR);
|
|
}
|
|
YY_BREAK
|
|
|
|
case 3:
|
|
YY_RULE_SETUP
|
|
#line 116 "toke.l"
|
|
{
|
|
BEGIN STARTDEFS;
|
|
LEXTRACE(", ");
|
|
return(',');
|
|
} /* return ',' */
|
|
YY_BREAK
|
|
case 4:
|
|
YY_RULE_SETUP
|
|
#line 122 "toke.l"
|
|
{
|
|
LEXTRACE("= ");
|
|
return('=');
|
|
} /* return '=' */
|
|
YY_BREAK
|
|
case 5:
|
|
YY_RULE_SETUP
|
|
#line 127 "toke.l"
|
|
{
|
|
LEXTRACE("+= ");
|
|
return('+');
|
|
} /* return '+' */
|
|
YY_BREAK
|
|
case 6:
|
|
YY_RULE_SETUP
|
|
#line 132 "toke.l"
|
|
{
|
|
LEXTRACE("-= ");
|
|
return('-');
|
|
} /* return '-' */
|
|
YY_BREAK
|
|
case 7:
|
|
YY_RULE_SETUP
|
|
#line 137 "toke.l"
|
|
{
|
|
LEXTRACE("WORD(1) ");
|
|
if (!fill(yytext + 1, yyleng - 2))
|
|
yyterminate();
|
|
return(WORD);
|
|
}
|
|
YY_BREAK
|
|
case 8:
|
|
YY_RULE_SETUP
|
|
#line 144 "toke.l"
|
|
{
|
|
LEXTRACE("WORD(2) ");
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
return(WORD);
|
|
}
|
|
YY_BREAK
|
|
|
|
|
|
case 9:
|
|
YY_RULE_SETUP
|
|
#line 153 "toke.l"
|
|
{
|
|
/* quoted fnmatch glob char, pass verbatim */
|
|
LEXTRACE("QUOTEDCHAR ");
|
|
if (!fill_args(yytext, 2, sawspace))
|
|
yyterminate();
|
|
sawspace = FALSE;
|
|
}
|
|
YY_BREAK
|
|
case 10:
|
|
YY_RULE_SETUP
|
|
#line 161 "toke.l"
|
|
{
|
|
/* quoted sudoers special char, strip backslash */
|
|
LEXTRACE("QUOTEDCHAR ");
|
|
if (!fill_args(yytext + 1, 1, sawspace))
|
|
yyterminate();
|
|
sawspace = FALSE;
|
|
}
|
|
YY_BREAK
|
|
case 11:
|
|
YY_RULE_SETUP
|
|
#line 169 "toke.l"
|
|
{
|
|
BEGIN INITIAL;
|
|
yyless(0);
|
|
return(COMMAND);
|
|
} /* end of command line args */
|
|
YY_BREAK
|
|
case 12:
|
|
YY_RULE_SETUP
|
|
#line 175 "toke.l"
|
|
{
|
|
LEXTRACE("ARG ");
|
|
if (!fill_args(yytext, yyleng, sawspace))
|
|
yyterminate();
|
|
sawspace = FALSE;
|
|
} /* a command line arg */
|
|
YY_BREAK
|
|
|
|
case 13:
|
|
YY_RULE_SETUP
|
|
#line 183 "toke.l"
|
|
{
|
|
char *cp, *ep;
|
|
++sudolineno;
|
|
/* pull out path from #include line */
|
|
for (cp = yytext + 9; isblank(*cp); cp++)
|
|
continue;
|
|
for (ep = cp; *ep != '\0' && !isspace(*ep); ep++)
|
|
continue;
|
|
*ep = '\0';
|
|
/* push current buffer and switch to include file */
|
|
if (!push_include(cp))
|
|
yyterminate();
|
|
LEXTRACE("INCLUDE\n");
|
|
return(COMMENT);
|
|
}
|
|
YY_BREAK
|
|
case 14:
|
|
YY_RULE_SETUP
|
|
#line 199 "toke.l"
|
|
{
|
|
BEGIN GOTDEFS;
|
|
switch (yytext[8]) {
|
|
case ':':
|
|
yyless(9);
|
|
LEXTRACE("DEFAULTS_USER ");
|
|
return(DEFAULTS_USER);
|
|
case '>':
|
|
yyless(9);
|
|
LEXTRACE("DEFAULTS_RUNAS ");
|
|
return(DEFAULTS_RUNAS);
|
|
case '@':
|
|
yyless(9);
|
|
LEXTRACE("DEFAULTS_HOST ");
|
|
return(DEFAULTS_HOST);
|
|
case '!':
|
|
yyless(9);
|
|
LEXTRACE("DEFAULTS_CMND ");
|
|
return(DEFAULTS_CMND);
|
|
default:
|
|
LEXTRACE("DEFAULTS ");
|
|
return(DEFAULTS);
|
|
}
|
|
}
|
|
YY_BREAK
|
|
case 15:
|
|
YY_RULE_SETUP
|
|
#line 224 "toke.l"
|
|
{
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
switch (*yytext) {
|
|
case 'H':
|
|
LEXTRACE("HOSTALIAS ");
|
|
return(HOSTALIAS);
|
|
case 'C':
|
|
LEXTRACE("CMNDALIAS ");
|
|
return(CMNDALIAS);
|
|
case 'U':
|
|
LEXTRACE("USERALIAS ");
|
|
return(USERALIAS);
|
|
case 'R':
|
|
LEXTRACE("RUNASALIAS ");
|
|
BEGIN GOTRUNAS;
|
|
return(RUNASALIAS);
|
|
}
|
|
}
|
|
YY_BREAK
|
|
case 16:
|
|
YY_RULE_SETUP
|
|
#line 244 "toke.l"
|
|
{
|
|
/* cmnd does not require passwd for this user */
|
|
LEXTRACE("NOPASSWD ");
|
|
return(NOPASSWD);
|
|
}
|
|
YY_BREAK
|
|
case 17:
|
|
YY_RULE_SETUP
|
|
#line 250 "toke.l"
|
|
{
|
|
/* cmnd requires passwd for this user */
|
|
LEXTRACE("PASSWD ");
|
|
return(PASSWD);
|
|
}
|
|
YY_BREAK
|
|
case 18:
|
|
YY_RULE_SETUP
|
|
#line 256 "toke.l"
|
|
{
|
|
LEXTRACE("NOEXEC ");
|
|
return(NOEXEC);
|
|
}
|
|
YY_BREAK
|
|
case 19:
|
|
YY_RULE_SETUP
|
|
#line 261 "toke.l"
|
|
{
|
|
LEXTRACE("EXEC ");
|
|
return(EXEC);
|
|
}
|
|
YY_BREAK
|
|
case 20:
|
|
YY_RULE_SETUP
|
|
#line 266 "toke.l"
|
|
{
|
|
LEXTRACE("NOMONITOR ");
|
|
return(NOMONITOR);
|
|
}
|
|
YY_BREAK
|
|
case 21:
|
|
YY_RULE_SETUP
|
|
#line 271 "toke.l"
|
|
{
|
|
LEXTRACE("MONITOR ");
|
|
return(MONITOR);
|
|
}
|
|
YY_BREAK
|
|
case 22:
|
|
YY_RULE_SETUP
|
|
#line 276 "toke.l"
|
|
{
|
|
/* netgroup */
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("NETGROUP ");
|
|
return(NETGROUP);
|
|
}
|
|
YY_BREAK
|
|
case 23:
|
|
YY_RULE_SETUP
|
|
#line 284 "toke.l"
|
|
{
|
|
/* UN*X group */
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("USERGROUP ");
|
|
return(USERGROUP);
|
|
}
|
|
YY_BREAK
|
|
case 24:
|
|
YY_RULE_SETUP
|
|
#line 292 "toke.l"
|
|
{
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("NTWKADDR ");
|
|
return(NTWKADDR);
|
|
}
|
|
YY_BREAK
|
|
case 25:
|
|
YY_RULE_SETUP
|
|
#line 299 "toke.l"
|
|
{
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("NTWKADDR ");
|
|
return(NTWKADDR);
|
|
}
|
|
YY_BREAK
|
|
case 26:
|
|
YY_RULE_SETUP
|
|
#line 306 "toke.l"
|
|
{
|
|
BEGIN GOTRUNAS;
|
|
LEXTRACE("RUNAS ");
|
|
return (RUNAS);
|
|
}
|
|
YY_BREAK
|
|
case 27:
|
|
YY_RULE_SETUP
|
|
#line 312 "toke.l"
|
|
{
|
|
if (strcmp(yytext, "ALL") == 0) {
|
|
LEXTRACE("ALL ");
|
|
return(ALL);
|
|
} else {
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("ALIAS ");
|
|
return(ALIAS);
|
|
}
|
|
}
|
|
YY_BREAK
|
|
case 28:
|
|
YY_RULE_SETUP
|
|
#line 324 "toke.l"
|
|
{
|
|
/* username/uid that user can run command as */
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("WORD(3) ");
|
|
return(WORD);
|
|
}
|
|
YY_BREAK
|
|
case 29:
|
|
YY_RULE_SETUP
|
|
#line 332 "toke.l"
|
|
{
|
|
BEGIN INITIAL;
|
|
}
|
|
YY_BREAK
|
|
case 30:
|
|
YY_RULE_SETUP
|
|
#line 336 "toke.l"
|
|
{
|
|
/* no command args allowed for Defaults!/path */
|
|
if (!fill_cmnd(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("COMMAND ");
|
|
return(COMMAND);
|
|
}
|
|
YY_BREAK
|
|
case 31:
|
|
YY_RULE_SETUP
|
|
#line 344 "toke.l"
|
|
{
|
|
BEGIN GOTCMND;
|
|
LEXTRACE("COMMAND ");
|
|
if (!fill_cmnd(yytext, yyleng))
|
|
yyterminate();
|
|
} /* sudo -e */
|
|
YY_BREAK
|
|
case 32:
|
|
YY_RULE_SETUP
|
|
#line 351 "toke.l"
|
|
{
|
|
/* directories can't have args... */
|
|
if (yytext[yyleng - 1] == '/') {
|
|
LEXTRACE("COMMAND ");
|
|
if (!fill_cmnd(yytext, yyleng))
|
|
yyterminate();
|
|
return(COMMAND);
|
|
} else {
|
|
BEGIN GOTCMND;
|
|
LEXTRACE("COMMAND ");
|
|
if (!fill_cmnd(yytext, yyleng))
|
|
yyterminate();
|
|
}
|
|
} /* a pathname */
|
|
YY_BREAK
|
|
case 33:
|
|
YY_RULE_SETUP
|
|
#line 366 "toke.l"
|
|
{
|
|
/* a word */
|
|
if (!fill(yytext, yyleng))
|
|
yyterminate();
|
|
LEXTRACE("WORD(4) ");
|
|
return(WORD);
|
|
}
|
|
YY_BREAK
|
|
case 34:
|
|
YY_RULE_SETUP
|
|
#line 374 "toke.l"
|
|
{
|
|
LEXTRACE(", ");
|
|
return(',');
|
|
} /* return ',' */
|
|
YY_BREAK
|
|
case 35:
|
|
YY_RULE_SETUP
|
|
#line 379 "toke.l"
|
|
{
|
|
LEXTRACE("= ");
|
|
return('=');
|
|
} /* return '=' */
|
|
YY_BREAK
|
|
case 36:
|
|
YY_RULE_SETUP
|
|
#line 384 "toke.l"
|
|
{
|
|
LEXTRACE(": ");
|
|
return(':');
|
|
} /* return ':' */
|
|
YY_BREAK
|
|
case 37:
|
|
YY_RULE_SETUP
|
|
#line 389 "toke.l"
|
|
{
|
|
if (yyleng % 2 == 1)
|
|
return('!'); /* return '!' */
|
|
}
|
|
YY_BREAK
|
|
case 38:
|
|
YY_RULE_SETUP
|
|
#line 394 "toke.l"
|
|
{
|
|
BEGIN INITIAL;
|
|
++sudolineno;
|
|
LEXTRACE("\n");
|
|
return(COMMENT);
|
|
} /* return newline */
|
|
YY_BREAK
|
|
case 39:
|
|
YY_RULE_SETUP
|
|
#line 401 "toke.l"
|
|
{ /* throw away space/tabs */
|
|
sawspace = TRUE; /* but remember for fill_args */
|
|
}
|
|
YY_BREAK
|
|
case 40:
|
|
YY_RULE_SETUP
|
|
#line 405 "toke.l"
|
|
{
|
|
sawspace = TRUE; /* remember for fill_args */
|
|
++sudolineno;
|
|
LEXTRACE("\n\t");
|
|
} /* throw away EOL after \ */
|
|
YY_BREAK
|
|
case 41:
|
|
YY_RULE_SETUP
|
|
#line 411 "toke.l"
|
|
{
|
|
BEGIN INITIAL;
|
|
++sudolineno;
|
|
LEXTRACE("\n");
|
|
return(COMMENT);
|
|
} /* return comments */
|
|
YY_BREAK
|
|
case 42:
|
|
YY_RULE_SETUP
|
|
#line 418 "toke.l"
|
|
{
|
|
LEXTRACE("ERROR ");
|
|
return(ERROR);
|
|
} /* parse error */
|
|
YY_BREAK
|
|
case YY_STATE_EOF(INITIAL):
|
|
case YY_STATE_EOF(GOTRUNAS):
|
|
case YY_STATE_EOF(GOTDEFS):
|
|
case YY_STATE_EOF(GOTCMND):
|
|
case YY_STATE_EOF(STARTDEFS):
|
|
case YY_STATE_EOF(INDEFS):
|
|
#line 423 "toke.l"
|
|
{
|
|
if (YY_START != INITIAL) {
|
|
BEGIN INITIAL;
|
|
LEXTRACE("ERROR ");
|
|
return(ERROR);
|
|
}
|
|
if (!pop_include())
|
|
yyterminate();
|
|
}
|
|
YY_BREAK
|
|
case 43:
|
|
YY_RULE_SETUP
|
|
#line 433 "toke.l"
|
|
ECHO;
|
|
YY_BREAK
|
|
#line 1789 "toke.c"
|
|
|
|
case YY_END_OF_BUFFER:
|
|
{
|
|
/* Amount of text matched not including the EOB char. */
|
|
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
|
|
|
|
/* Undo the effects of YY_DO_BEFORE_ACTION. */
|
|
*yy_cp = yy_hold_char;
|
|
YY_RESTORE_YY_MORE_OFFSET
|
|
|
|
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
|
|
{
|
|
/* We're scanning a new file or input source. It's
|
|
* possible that this happened because the user
|
|
* just pointed yyin at a new source and called
|
|
* yylex(). If so, then we have to assure
|
|
* consistency between yy_current_buffer and our
|
|
* globals. Here is the right place to do so, because
|
|
* this is the first action (other than possibly a
|
|
* back-up) that will match for the new input source.
|
|
*/
|
|
yy_n_chars = yy_current_buffer->yy_n_chars;
|
|
yy_current_buffer->yy_input_file = yyin;
|
|
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
|
|
}
|
|
|
|
/* Note that here we test for yy_c_buf_p "<=" to the position
|
|
* of the first EOB in the buffer, since yy_c_buf_p will
|
|
* already have been incremented past the NUL character
|
|
* (since all states make transitions on EOB to the
|
|
* end-of-buffer state). Contrast this with the test
|
|
* in input().
|
|
*/
|
|
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
|
|
{ /* This was really a NUL. */
|
|
yy_state_type yy_next_state;
|
|
|
|
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
|
|
|
|
yy_current_state = yy_get_previous_state();
|
|
|
|
/* Okay, we're now positioned to make the NUL
|
|
* transition. We couldn't have
|
|
* yy_get_previous_state() go ahead and do it
|
|
* for us because it doesn't know how to deal
|
|
* with the possibility of jamming (and we don't
|
|
* want to build jamming into it because then it
|
|
* will run more slowly).
|
|
*/
|
|
|
|
yy_next_state = yy_try_NUL_trans( yy_current_state );
|
|
|
|
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
|
|
if ( yy_next_state )
|
|
{
|
|
/* Consume the NUL. */
|
|
yy_cp = ++yy_c_buf_p;
|
|
yy_current_state = yy_next_state;
|
|
goto yy_match;
|
|
}
|
|
|
|
else
|
|
{
|
|
yy_cp = yy_c_buf_p;
|
|
goto yy_find_action;
|
|
}
|
|
}
|
|
|
|
else switch ( yy_get_next_buffer() )
|
|
{
|
|
case EOB_ACT_END_OF_FILE:
|
|
{
|
|
yy_did_buffer_switch_on_eof = 0;
|
|
|
|
if ( yywrap() )
|
|
{
|
|
/* Note: because we've taken care in
|
|
* yy_get_next_buffer() to have set up
|
|
* yytext, we can now set up
|
|
* yy_c_buf_p so that if some total
|
|
* hoser (like flex itself) wants to
|
|
* call the scanner after we return the
|
|
* YY_NULL, it'll still work - another
|
|
* YY_NULL will get returned.
|
|
*/
|
|
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
|
|
|
|
yy_act = YY_STATE_EOF(YY_START);
|
|
goto do_action;
|
|
}
|
|
|
|
else
|
|
{
|
|
if ( ! yy_did_buffer_switch_on_eof )
|
|
YY_NEW_FILE;
|
|
}
|
|
break;
|
|
}
|
|
|
|
case EOB_ACT_CONTINUE_SCAN:
|
|
yy_c_buf_p =
|
|
yytext_ptr + yy_amount_of_matched_text;
|
|
|
|
yy_current_state = yy_get_previous_state();
|
|
|
|
yy_cp = yy_c_buf_p;
|
|
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
goto yy_match;
|
|
|
|
case EOB_ACT_LAST_MATCH:
|
|
yy_c_buf_p =
|
|
&yy_current_buffer->yy_ch_buf[yy_n_chars];
|
|
|
|
yy_current_state = yy_get_previous_state();
|
|
|
|
yy_cp = yy_c_buf_p;
|
|
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
goto yy_find_action;
|
|
}
|
|
break;
|
|
}
|
|
|
|
default:
|
|
YY_FATAL_ERROR(
|
|
"fatal flex scanner internal error--no action found" );
|
|
} /* end of action switch */
|
|
} /* end of scanning one token */
|
|
} /* end of yylex */
|
|
|
|
|
|
/* yy_get_next_buffer - try to read in a new buffer
|
|
*
|
|
* Returns a code representing an action:
|
|
* EOB_ACT_LAST_MATCH -
|
|
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
|
|
* EOB_ACT_END_OF_FILE - end of file
|
|
*/
|
|
|
|
static int yy_get_next_buffer()
|
|
{
|
|
register char *dest = yy_current_buffer->yy_ch_buf;
|
|
register char *source = yytext_ptr;
|
|
register int number_to_move, i;
|
|
int ret_val;
|
|
|
|
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
|
|
YY_FATAL_ERROR(
|
|
"fatal flex scanner internal error--end of buffer missed" );
|
|
|
|
if ( yy_current_buffer->yy_fill_buffer == 0 )
|
|
{ /* Don't try to fill the buffer, so this is an EOF. */
|
|
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
|
|
{
|
|
/* We matched a single character, the EOB, so
|
|
* treat this as a final EOF.
|
|
*/
|
|
return EOB_ACT_END_OF_FILE;
|
|
}
|
|
|
|
else
|
|
{
|
|
/* We matched some text prior to the EOB, first
|
|
* process it.
|
|
*/
|
|
return EOB_ACT_LAST_MATCH;
|
|
}
|
|
}
|
|
|
|
/* Try to read more data. */
|
|
|
|
/* First move last chars to start of buffer. */
|
|
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
|
|
|
|
for ( i = 0; i < number_to_move; ++i )
|
|
*(dest++) = *(source++);
|
|
|
|
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
|
|
/* don't do the read, it's not guaranteed to return an EOF,
|
|
* just force an EOF
|
|
*/
|
|
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
|
|
|
|
else
|
|
{
|
|
int num_to_read =
|
|
yy_current_buffer->yy_buf_size - number_to_move - 1;
|
|
|
|
while ( num_to_read <= 0 )
|
|
{ /* Not enough room in the buffer - grow it. */
|
|
#ifdef YY_USES_REJECT
|
|
YY_FATAL_ERROR(
|
|
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
|
|
#else
|
|
|
|
/* just a shorter name for the current buffer */
|
|
YY_BUFFER_STATE b = yy_current_buffer;
|
|
|
|
int yy_c_buf_p_offset =
|
|
(int) (yy_c_buf_p - b->yy_ch_buf);
|
|
|
|
if ( b->yy_is_our_buffer )
|
|
{
|
|
int new_size = b->yy_buf_size * 2;
|
|
|
|
if ( new_size <= 0 )
|
|
b->yy_buf_size += b->yy_buf_size / 8;
|
|
else
|
|
b->yy_buf_size *= 2;
|
|
|
|
b->yy_ch_buf = (char *)
|
|
/* Include room in for 2 EOB chars. */
|
|
yy_flex_realloc( (void *) b->yy_ch_buf,
|
|
b->yy_buf_size + 2 );
|
|
}
|
|
else
|
|
/* Can't grow it, we don't own it. */
|
|
b->yy_ch_buf = 0;
|
|
|
|
if ( ! b->yy_ch_buf )
|
|
YY_FATAL_ERROR(
|
|
"fatal error - scanner input buffer overflow" );
|
|
|
|
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
|
|
|
|
num_to_read = yy_current_buffer->yy_buf_size -
|
|
number_to_move - 1;
|
|
#endif
|
|
}
|
|
|
|
if ( num_to_read > YY_READ_BUF_SIZE )
|
|
num_to_read = YY_READ_BUF_SIZE;
|
|
|
|
/* Read in more data. */
|
|
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
|
|
yy_n_chars, num_to_read );
|
|
|
|
yy_current_buffer->yy_n_chars = yy_n_chars;
|
|
}
|
|
|
|
if ( yy_n_chars == 0 )
|
|
{
|
|
if ( number_to_move == YY_MORE_ADJ )
|
|
{
|
|
ret_val = EOB_ACT_END_OF_FILE;
|
|
yyrestart( yyin );
|
|
}
|
|
|
|
else
|
|
{
|
|
ret_val = EOB_ACT_LAST_MATCH;
|
|
yy_current_buffer->yy_buffer_status =
|
|
YY_BUFFER_EOF_PENDING;
|
|
}
|
|
}
|
|
|
|
else
|
|
ret_val = EOB_ACT_CONTINUE_SCAN;
|
|
|
|
yy_n_chars += number_to_move;
|
|
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
|
|
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
|
|
|
|
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
|
|
|
|
return ret_val;
|
|
}
|
|
|
|
|
|
/* yy_get_previous_state - get the state just before the EOB char was reached */
|
|
|
|
static yy_state_type yy_get_previous_state()
|
|
{
|
|
register yy_state_type yy_current_state;
|
|
register char *yy_cp;
|
|
|
|
yy_current_state = yy_start;
|
|
yy_current_state += YY_AT_BOL();
|
|
|
|
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
|
|
{
|
|
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
|
|
if ( yy_accept[yy_current_state] )
|
|
{
|
|
yy_last_accepting_state = yy_current_state;
|
|
yy_last_accepting_cpos = yy_cp;
|
|
}
|
|
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
{
|
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
if ( yy_current_state >= 398 )
|
|
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 >= 398 )
|
|
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 == 397);
|
|
|
|
return yy_is_jam ? 0 : yy_current_state;
|
|
}
|
|
|
|
|
|
#ifndef YY_NO_UNPUT
|
|
#ifdef YY_USE_PROTOS
|
|
static void yyunput( int c, register char *yy_bp )
|
|
#else
|
|
static void yyunput( c, yy_bp )
|
|
int c;
|
|
register char *yy_bp;
|
|
#endif
|
|
{
|
|
register char *yy_cp = yy_c_buf_p;
|
|
|
|
/* undo effects of setting up yytext */
|
|
*yy_cp = yy_hold_char;
|
|
|
|
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
|
|
{ /* need to shift things up to make room */
|
|
/* +2 for EOB chars. */
|
|
register int number_to_move = yy_n_chars + 2;
|
|
register char *dest = &yy_current_buffer->yy_ch_buf[
|
|
yy_current_buffer->yy_buf_size + 2];
|
|
register char *source =
|
|
&yy_current_buffer->yy_ch_buf[number_to_move];
|
|
|
|
while ( source > yy_current_buffer->yy_ch_buf )
|
|
*--dest = *--source;
|
|
|
|
yy_cp += (int) (dest - source);
|
|
yy_bp += (int) (dest - source);
|
|
yy_current_buffer->yy_n_chars =
|
|
yy_n_chars = yy_current_buffer->yy_buf_size;
|
|
|
|
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
|
|
YY_FATAL_ERROR( "flex scanner push-back overflow" );
|
|
}
|
|
|
|
*--yy_cp = (char) c;
|
|
|
|
|
|
yytext_ptr = yy_bp;
|
|
yy_hold_char = *yy_cp;
|
|
yy_c_buf_p = yy_cp;
|
|
}
|
|
#endif /* ifndef YY_NO_UNPUT */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
static int yyinput()
|
|
#else
|
|
static int input()
|
|
#endif
|
|
{
|
|
int c;
|
|
|
|
*yy_c_buf_p = yy_hold_char;
|
|
|
|
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
|
|
{
|
|
/* yy_c_buf_p now points to the character we want to return.
|
|
* If this occurs *before* the EOB characters, then it's a
|
|
* valid NUL; if not, then we've hit the end of the buffer.
|
|
*/
|
|
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
|
|
/* This was really a NUL. */
|
|
*yy_c_buf_p = '\0';
|
|
|
|
else
|
|
{ /* need more input */
|
|
int offset = yy_c_buf_p - yytext_ptr;
|
|
++yy_c_buf_p;
|
|
|
|
switch ( yy_get_next_buffer() )
|
|
{
|
|
case EOB_ACT_LAST_MATCH:
|
|
/* This happens because yy_g_n_b()
|
|
* sees that we've accumulated a
|
|
* token and flags that we need to
|
|
* try matching the token before
|
|
* proceeding. But for input(),
|
|
* there's no matching to consider.
|
|
* So convert the EOB_ACT_LAST_MATCH
|
|
* to EOB_ACT_END_OF_FILE.
|
|
*/
|
|
|
|
/* Reset buffer status. */
|
|
yyrestart( yyin );
|
|
|
|
/* fall through */
|
|
|
|
case EOB_ACT_END_OF_FILE:
|
|
{
|
|
if ( yywrap() )
|
|
return EOF;
|
|
|
|
if ( ! yy_did_buffer_switch_on_eof )
|
|
YY_NEW_FILE;
|
|
#ifdef __cplusplus
|
|
return yyinput();
|
|
#else
|
|
return input();
|
|
#endif
|
|
}
|
|
|
|
case EOB_ACT_CONTINUE_SCAN:
|
|
yy_c_buf_p = yytext_ptr + offset;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
|
|
*yy_c_buf_p = '\0'; /* preserve yytext */
|
|
yy_hold_char = *++yy_c_buf_p;
|
|
|
|
yy_current_buffer->yy_at_bol = (c == '\n');
|
|
|
|
return c;
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yyrestart( FILE *input_file )
|
|
#else
|
|
void yyrestart( input_file )
|
|
FILE *input_file;
|
|
#endif
|
|
{
|
|
if ( ! yy_current_buffer )
|
|
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
|
|
|
|
yy_init_buffer( yy_current_buffer, input_file );
|
|
yy_load_buffer_state();
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
|
|
#else
|
|
void yy_switch_to_buffer( new_buffer )
|
|
YY_BUFFER_STATE new_buffer;
|
|
#endif
|
|
{
|
|
if ( yy_current_buffer == new_buffer )
|
|
return;
|
|
|
|
if ( yy_current_buffer )
|
|
{
|
|
/* Flush out information for old buffer. */
|
|
*yy_c_buf_p = yy_hold_char;
|
|
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
|
|
yy_current_buffer->yy_n_chars = yy_n_chars;
|
|
}
|
|
|
|
yy_current_buffer = new_buffer;
|
|
yy_load_buffer_state();
|
|
|
|
/* We don't actually know whether we did this switch during
|
|
* EOF (yywrap()) processing, but the only time this flag
|
|
* is looked at is after yywrap() is called, so it's safe
|
|
* to go ahead and always set it.
|
|
*/
|
|
yy_did_buffer_switch_on_eof = 1;
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yy_load_buffer_state( void )
|
|
#else
|
|
void yy_load_buffer_state()
|
|
#endif
|
|
{
|
|
yy_n_chars = yy_current_buffer->yy_n_chars;
|
|
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
|
|
yyin = yy_current_buffer->yy_input_file;
|
|
yy_hold_char = *yy_c_buf_p;
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
|
|
#else
|
|
YY_BUFFER_STATE yy_create_buffer( file, size )
|
|
FILE *file;
|
|
int size;
|
|
#endif
|
|
{
|
|
YY_BUFFER_STATE b;
|
|
|
|
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
|
|
if ( ! b )
|
|
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
|
|
b->yy_buf_size = size;
|
|
|
|
/* yy_ch_buf has to be 2 characters longer than the size given because
|
|
* we need to put in 2 end-of-buffer characters.
|
|
*/
|
|
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
|
|
if ( ! b->yy_ch_buf )
|
|
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
|
|
b->yy_is_our_buffer = 1;
|
|
|
|
yy_init_buffer( b, file );
|
|
|
|
return b;
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yy_delete_buffer( YY_BUFFER_STATE b )
|
|
#else
|
|
void yy_delete_buffer( b )
|
|
YY_BUFFER_STATE b;
|
|
#endif
|
|
{
|
|
if ( ! b )
|
|
return;
|
|
|
|
if ( b == yy_current_buffer )
|
|
yy_current_buffer = (YY_BUFFER_STATE) 0;
|
|
|
|
if ( b->yy_is_our_buffer )
|
|
yy_flex_free( (void *) b->yy_ch_buf );
|
|
|
|
yy_flex_free( (void *) b );
|
|
}
|
|
|
|
|
|
#ifndef YY_ALWAYS_INTERACTIVE
|
|
#ifndef YY_NEVER_INTERACTIVE
|
|
#include <unistd.h>
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
|
|
#else
|
|
void yy_init_buffer( b, file )
|
|
YY_BUFFER_STATE b;
|
|
FILE *file;
|
|
#endif
|
|
|
|
|
|
{
|
|
int oerrno = errno;
|
|
|
|
yy_flush_buffer( b );
|
|
|
|
b->yy_input_file = file;
|
|
b->yy_fill_buffer = 1;
|
|
|
|
#if YY_ALWAYS_INTERACTIVE
|
|
b->yy_is_interactive = 1;
|
|
#else
|
|
#if YY_NEVER_INTERACTIVE
|
|
b->yy_is_interactive = 0;
|
|
#else
|
|
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
|
|
#endif
|
|
#endif
|
|
errno = oerrno;
|
|
}
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
void yy_flush_buffer( YY_BUFFER_STATE b )
|
|
#else
|
|
void yy_flush_buffer( b )
|
|
YY_BUFFER_STATE b;
|
|
#endif
|
|
|
|
{
|
|
if ( ! b )
|
|
return;
|
|
|
|
b->yy_n_chars = 0;
|
|
|
|
/* We always need two end-of-buffer characters. The first causes
|
|
* a transition to the end-of-buffer state. The second causes
|
|
* a jam in that state.
|
|
*/
|
|
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
|
|
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
|
|
|
|
b->yy_buf_pos = &b->yy_ch_buf[0];
|
|
|
|
b->yy_at_bol = 1;
|
|
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
|
|
if ( b == yy_current_buffer )
|
|
yy_load_buffer_state();
|
|
}
|
|
|
|
|
|
#ifndef YY_NO_SCAN_BUFFER
|
|
#ifdef YY_USE_PROTOS
|
|
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
|
|
#else
|
|
YY_BUFFER_STATE yy_scan_buffer( base, size )
|
|
char *base;
|
|
yy_size_t size;
|
|
#endif
|
|
{
|
|
YY_BUFFER_STATE b;
|
|
|
|
if ( size < 2 ||
|
|
base[size-2] != YY_END_OF_BUFFER_CHAR ||
|
|
base[size-1] != YY_END_OF_BUFFER_CHAR )
|
|
/* They forgot to leave room for the EOB's. */
|
|
return 0;
|
|
|
|
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
|
|
if ( ! b )
|
|
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
|
|
|
|
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
|
|
b->yy_buf_pos = b->yy_ch_buf = base;
|
|
b->yy_is_our_buffer = 0;
|
|
b->yy_input_file = 0;
|
|
b->yy_n_chars = b->yy_buf_size;
|
|
b->yy_is_interactive = 0;
|
|
b->yy_at_bol = 1;
|
|
b->yy_fill_buffer = 0;
|
|
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
|
|
yy_switch_to_buffer( b );
|
|
|
|
return b;
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifndef YY_NO_SCAN_STRING
|
|
#ifdef YY_USE_PROTOS
|
|
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
|
|
#else
|
|
YY_BUFFER_STATE yy_scan_string( yy_str )
|
|
yyconst char *yy_str;
|
|
#endif
|
|
{
|
|
int len;
|
|
for ( len = 0; yy_str[len]; ++len )
|
|
;
|
|
|
|
return yy_scan_bytes( yy_str, len );
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifndef YY_NO_SCAN_BYTES
|
|
#ifdef YY_USE_PROTOS
|
|
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
|
|
#else
|
|
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
|
|
yyconst char *bytes;
|
|
int len;
|
|
#endif
|
|
{
|
|
YY_BUFFER_STATE b;
|
|
char *buf;
|
|
yy_size_t n;
|
|
int i;
|
|
|
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
|
n = len + 2;
|
|
buf = (char *) yy_flex_alloc( n );
|
|
if ( ! buf )
|
|
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
|
|
|
|
for ( i = 0; i < len; ++i )
|
|
buf[i] = bytes[i];
|
|
|
|
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
|
|
|
|
b = yy_scan_buffer( buf, n );
|
|
if ( ! b )
|
|
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
|
|
|
|
/* It's okay to grow etc. this buffer, and we should throw it
|
|
* away when we're done.
|
|
*/
|
|
b->yy_is_our_buffer = 1;
|
|
|
|
return b;
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifndef YY_NO_PUSH_STATE
|
|
#ifdef YY_USE_PROTOS
|
|
static void yy_push_state( int new_state )
|
|
#else
|
|
static void yy_push_state( new_state )
|
|
int new_state;
|
|
#endif
|
|
{
|
|
if ( yy_start_stack_ptr >= yy_start_stack_depth )
|
|
{
|
|
yy_size_t new_size;
|
|
|
|
yy_start_stack_depth += YY_START_STACK_INCR;
|
|
new_size = yy_start_stack_depth * sizeof( int );
|
|
|
|
if ( ! yy_start_stack )
|
|
yy_start_stack = (int *) yy_flex_alloc( new_size );
|
|
|
|
else
|
|
yy_start_stack = (int *) yy_flex_realloc(
|
|
(void *) yy_start_stack, new_size );
|
|
|
|
if ( ! yy_start_stack )
|
|
YY_FATAL_ERROR(
|
|
"out of memory expanding start-condition stack" );
|
|
}
|
|
|
|
yy_start_stack[yy_start_stack_ptr++] = YY_START;
|
|
|
|
BEGIN(new_state);
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifndef YY_NO_POP_STATE
|
|
static void yy_pop_state()
|
|
{
|
|
if ( --yy_start_stack_ptr < 0 )
|
|
YY_FATAL_ERROR( "start-condition stack underflow" );
|
|
|
|
BEGIN(yy_start_stack[yy_start_stack_ptr]);
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifndef YY_NO_TOP_STATE
|
|
static int yy_top_state()
|
|
{
|
|
return yy_start_stack[yy_start_stack_ptr - 1];
|
|
}
|
|
#endif
|
|
|
|
#ifndef YY_EXIT_FAILURE
|
|
#define YY_EXIT_FAILURE 2
|
|
#endif
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
static void yy_fatal_error( yyconst char msg[] )
|
|
#else
|
|
static void yy_fatal_error( msg )
|
|
char msg[];
|
|
#endif
|
|
{
|
|
(void) fprintf( stderr, "%s\n", msg );
|
|
exit( YY_EXIT_FAILURE );
|
|
}
|
|
|
|
|
|
|
|
/* Redefine yyless() so it works in section 3 code. */
|
|
|
|
#undef yyless
|
|
#define yyless(n) \
|
|
do \
|
|
{ \
|
|
/* Undo effects of setting up yytext. */ \
|
|
yytext[yyleng] = yy_hold_char; \
|
|
yy_c_buf_p = yytext + n; \
|
|
yy_hold_char = *yy_c_buf_p; \
|
|
*yy_c_buf_p = '\0'; \
|
|
yyleng = n; \
|
|
} \
|
|
while ( 0 )
|
|
|
|
|
|
/* Internal utility routines. */
|
|
|
|
#ifndef yytext_ptr
|
|
#ifdef YY_USE_PROTOS
|
|
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
|
|
#else
|
|
static void yy_flex_strncpy( s1, s2, n )
|
|
char *s1;
|
|
yyconst char *s2;
|
|
int n;
|
|
#endif
|
|
{
|
|
register int i;
|
|
for ( i = 0; i < n; ++i )
|
|
s1[i] = s2[i];
|
|
}
|
|
#endif
|
|
|
|
#ifdef YY_NEED_STRLEN
|
|
#ifdef YY_USE_PROTOS
|
|
static int yy_flex_strlen( yyconst char *s )
|
|
#else
|
|
static int yy_flex_strlen( s )
|
|
yyconst char *s;
|
|
#endif
|
|
{
|
|
register int n;
|
|
for ( n = 0; s[n]; ++n )
|
|
;
|
|
|
|
return n;
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
static void *yy_flex_alloc( yy_size_t size )
|
|
#else
|
|
static void *yy_flex_alloc( size )
|
|
yy_size_t size;
|
|
#endif
|
|
{
|
|
return (void *) malloc( size );
|
|
}
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
static void *yy_flex_realloc( void *ptr, yy_size_t size )
|
|
#else
|
|
static void *yy_flex_realloc( ptr, size )
|
|
void *ptr;
|
|
yy_size_t size;
|
|
#endif
|
|
{
|
|
/* The cast to (char *) in the following accommodates both
|
|
* implementations that use char* generic pointers, and those
|
|
* that use void* generic pointers. It works with the latter
|
|
* because both ANSI C and C++ allow castless assignment from
|
|
* any pointer type to void*, and deal with argument conversions
|
|
* as though doing an assignment.
|
|
*/
|
|
return (void *) realloc( (char *) ptr, size );
|
|
}
|
|
|
|
#ifdef YY_USE_PROTOS
|
|
static void yy_flex_free( void *ptr )
|
|
#else
|
|
static void yy_flex_free( ptr )
|
|
void *ptr;
|
|
#endif
|
|
{
|
|
free( ptr );
|
|
}
|
|
|
|
#if YY_MAIN
|
|
int main()
|
|
{
|
|
yylex();
|
|
return 0;
|
|
}
|
|
#endif
|
|
#line 433 "toke.l"
|
|
|
|
static int
|
|
fill(s, len)
|
|
char *s;
|
|
int len;
|
|
{
|
|
int i, j;
|
|
|
|
yylval.string = (char *) malloc(len + 1);
|
|
if (yylval.string == NULL) {
|
|
yyerror("unable to allocate memory");
|
|
return(FALSE);
|
|
}
|
|
|
|
/* Copy the string and collapse any escaped characters. */
|
|
for (i = 0, j = 0; i < len; i++, j++) {
|
|
if (s[i] == '\\' && i != len - 1)
|
|
yylval.string[j] = s[++i];
|
|
else
|
|
yylval.string[j] = s[i];
|
|
}
|
|
yylval.string[j] = '\0';
|
|
return(TRUE);
|
|
}
|
|
|
|
static int
|
|
fill_cmnd(s, len)
|
|
char *s;
|
|
int len;
|
|
{
|
|
arg_len = arg_size = 0;
|
|
|
|
yylval.command.cmnd = (char *) malloc(++len);
|
|
if (yylval.command.cmnd == NULL) {
|
|
yyerror("unable to allocate memory");
|
|
return(FALSE);
|
|
}
|
|
|
|
/* copy the string and NULL-terminate it (escapes handled by fnmatch) */
|
|
(void) strlcpy(yylval.command.cmnd, s, len);
|
|
|
|
yylval.command.args = NULL;
|
|
return(TRUE);
|
|
}
|
|
|
|
static int
|
|
fill_args(s, len, addspace)
|
|
char *s;
|
|
int len;
|
|
int addspace;
|
|
{
|
|
int new_len;
|
|
char *p;
|
|
|
|
if (yylval.command.args == NULL) {
|
|
addspace = 0;
|
|
new_len = len;
|
|
} else
|
|
new_len = arg_len + len + addspace;
|
|
|
|
if (new_len >= arg_size) {
|
|
/* Allocate more space than we need for subsequent args */
|
|
while (new_len >= (arg_size += COMMANDARGINC))
|
|
;
|
|
|
|
p = yylval.command.args ?
|
|
(char *) realloc(yylval.command.args, arg_size) :
|
|
(char *) malloc(arg_size);
|
|
if (p == NULL) {
|
|
if (yylval.command.args != NULL)
|
|
free(yylval.command.args);
|
|
yyerror("unable to allocate memory");
|
|
return(FALSE);
|
|
} else
|
|
yylval.command.args = p;
|
|
}
|
|
|
|
/* Efficiently append the arg (with a leading space if needed). */
|
|
p = yylval.command.args + arg_len;
|
|
if (addspace)
|
|
*p++ = ' ';
|
|
if (strlcpy(p, s, arg_size - (p - yylval.command.args)) != len) {
|
|
yyerror("fill_args: buffer overflow"); /* paranoia */
|
|
return(FALSE);
|
|
}
|
|
arg_len = new_len;
|
|
return(TRUE);
|
|
}
|
|
|
|
struct sudoers_state {
|
|
YY_BUFFER_STATE bs;
|
|
char *path;
|
|
int lineno;
|
|
};
|
|
|
|
#define MAX_SUDOERS_DEPTH 128
|
|
#define SUDOERS_STACK_INCREMENT 16
|
|
|
|
static int
|
|
switch_buffer(path)
|
|
char *path;
|
|
{
|
|
static size_t stacksize, depth;
|
|
static struct sudoers_state *state;
|
|
static int keepopen;
|
|
FILE *fp;
|
|
|
|
if (path != NULL) {
|
|
/* push current state */
|
|
if ((path = strdup(path)) == NULL) {
|
|
yyerror("unable to allocate memory");
|
|
return(FALSE);
|
|
}
|
|
if (depth >= stacksize) {
|
|
if (depth > MAX_SUDOERS_DEPTH) {
|
|
yyerror("too many levels of includes");
|
|
return(FALSE);
|
|
}
|
|
stacksize += SUDOERS_STACK_INCREMENT;
|
|
state = (struct sudoers_state *) realloc(state,
|
|
sizeof(state) * stacksize);
|
|
if (state == NULL) {
|
|
yyerror("unable to allocate memory");
|
|
return(FALSE);
|
|
}
|
|
}
|
|
if ((fp = open_sudoers(path, &keepopen)) == NULL) {
|
|
yyerror(path);
|
|
return(FALSE);
|
|
}
|
|
state[depth].bs = YY_CURRENT_BUFFER;
|
|
state[depth].path = sudoers;
|
|
state[depth].lineno = sudolineno;
|
|
depth++;
|
|
sudolineno = 1;
|
|
sudoers = path;
|
|
yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
|
|
} else {
|
|
/* pop */
|
|
if (depth == 0)
|
|
return(FALSE);
|
|
depth--;
|
|
if (!keepopen)
|
|
fclose(YY_CURRENT_BUFFER->yy_input_file);
|
|
yy_delete_buffer(YY_CURRENT_BUFFER);
|
|
yy_switch_to_buffer(state[depth].bs);
|
|
free(sudoers);
|
|
sudoers = state[depth].path;
|
|
sudolineno = state[depth].lineno;
|
|
keepopen = FALSE;
|
|
}
|
|
return(TRUE);
|
|
}
|