#define yy_create_buffer yylp_create_buffer #define yy_delete_buffer yylp_delete_buffer #define yy_scan_buffer yylp_scan_buffer #define yy_scan_string yylp_scan_string #define yy_scan_bytes yylp_scan_bytes #define yy_flex_debug yylp_flex_debug #define yy_init_buffer yylp_init_buffer #define yy_flush_buffer yylp_flush_buffer #define yy_load_buffer_state yylp_load_buffer_state #define yy_switch_to_buffer yylp_switch_to_buffer #define yyin yylpin #define yyleng yylpleng #define yylex yylplex #define yyout yylpout #define yyrestart yylprestart #define yytext yylptext #define yywrap yylpwrap #line 20 "libparse.cc" /* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /exports/cvsroot-2/cvsroot/Singular/libparse.cc,v 1.2 2004-05-13 16:52:03 Singular Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 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; \ yytext_ptr -= yy_more_len; \ yyleng = (int) (yy_cp - yytext_ptr); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 95 #define YY_END_OF_BUFFER 96 static yyconst short int yy_accept[456] = { 0, 0, 0, 0, 0, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 94, 1, 91, 92, 2, 93, 94, 94, 94, 94, 94, 94, 94, 94, 19, 18, 19, 19, 19, 19, 19, 19, 19, 28, 27, 26, 28, 28, 28, 28, 28, 28, 28, 95, 29, 95, 95, 95, 38, 31, 35, 32, 33, 37, 34, 42, 42, 95, 42, 42, 42, 42, 42, 41, 46, 45, 46, 44, 48, 50, 47, 49, 62, 61, 52, 57, 58, 62, 59, 60, 62, 55, 56, 82, 81, 74, 77, 78, 82, 79, 80, 75, 76, 87, 86, 83, 87, 72, 71, 69, 72, 90, 89, 90, 65, 64, 63, 68, 67, 66, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 0, 0, 0, 0, 0, 0, 0, 29, 0, 30, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 41, 41, 43, 48, 51, 0, 73, 85, 84, 70, 88, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 12, 0, 0, 0, 0, 0, 27, 27, 27, 27, 21, 20, 0, 0, 0, 0, 0, 36, 36, 0, 0, 0, 40, 0, 41, 0, 0, 0, 0, 0, 51, 0, 73, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 13, 12, 12, 0, 0, 0, 0, 0, 27, 21, 20, 20, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 39, 0, 40, 0, 0, 0, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 16, 0, 14, 20, 0, 0, 0, 0, 24, 0, 23, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 6, 0, 0, 11, 0, 0, 15, 0, 17, 0, 0, 22, 0, 25, 0, 0, 0, 0, 0, 54, 0, 0, 7, 7, 0, 8, 0, 0, 3, 0, 0, 7, 7, 7, 0, 0, 11, 11, 11, 0, 0, 0, 0, 0, 0, 7, 7, 7, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 11, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 4, 0, 0, 5, 5, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 11, 16, 11, 10, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 11, 21, 11, 11, 12, 22, 23, 22, 22, 22, 22, 22, 24, 25, 22, 22, 26, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 27, 28, 29, 30, 31, 11, 32, 22, 33, 34, 35, 36, 37, 22, 38, 22, 22, 39, 40, 41, 42, 43, 22, 44, 45, 46, 22, 47, 22, 48, 49, 22, 50, 11, 51, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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[52] = { 0, 1, 2, 3, 1, 2, 1, 4, 5, 1, 4, 1, 6, 7, 8, 4, 9, 4, 10, 4, 1, 1, 6, 6, 6, 6, 6, 1, 1, 1, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 11, 1 } ; static yyconst short int yy_base[504] = { 0, 0, 46, 6, 91, 137, 183, 230, 281, 332, 383, 5, 11, 434, 0, 9, 12, 62, 68, 483, 532, 0, 0, 581, 630, 24, 71, 79, 85, 26, 31, 51, 53, 80, 93, 0, 0, 1103, 1961, 1058, 1961, 1961, 1082, 1961, 1072, 1087, 1060, 1034, 1040, 1036, 1032, 1040, 1961, 1961, 1057, 60, 1037, 1026, 1025, 1026, 1002, 1961, 93, 1961, 1023, 89, 1003, 993, 997, 1002, 981, 1961, 1961, 1011, 1002, 1005, 1961, 1961, 1961, 1961, 1961, 987, 1961, 1961, 680, 0, 120, 128, 730, 141, 148, 1961, 1961, 1961, 947, 1961, 99, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 975, 1961, 1961, 946, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 971, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 4, 1961, 1961, 1961, 14, 1961, 1961, 966, 1961, 1961, 1961, 1961, 1961, 1961, 885, 911, 904, 918, 877, 890, 885, 877, 886, 872, 147, 908, 895, 863, 867, 856, 872, 850, 100, 780, 884, 867, 738, 747, 634, 654, 634, 1961, 668, 1961, 659, 665, 654, 0, 0, 155, 166, 0, 174, 188, 1961, 663, 662, 199, 661, 78, 830, 203, 1961, 109, 0, 625, 0, 1961, 1961, 1961, 1961, 624, 0, 636, 161, 0, 616, 609, 600, 608, 584, 583, 178, 187, 610, 0, 605, 585, 571, 559, 114, 570, 585, 580, 579, 575, 0, 574, 554, 543, 535, 187, 545, 0, 557, 212, 220, 261, 0, 269, 556, 0, 0, 313, 0, 551, 0, 524, 0, 522, 240, 531, 0, 500, 493, 302, 192, 494, 492, 487, 484, 0, 0, 499, 476, 353, 473, 360, 504, 0, 0, 0, 484, 462, 486, 460, 364, 489, 322, 373, 1961, 501, 512, 0, 490, 1961, 518, 295, 250, 1961, 1961, 445, 392, 396, 411, 291, 397, 387, 396, 408, 409, 383, 403, 522, 380, 1961, 414, 1961, 402, 373, 539, 545, 367, 1961, 393, 1961, 551, 562, 0, 500, 568, 574, 880, 588, 349, 356, 604, 929, 72, 1961, 1961, 340, 336, 980, 324, 633, 1961, 323, 1961, 313, 643, 1961, 313, 1961, 993, 273, 319, 346, 567, 1961, 312, 0, 114, 1961, 300, 1961, 340, 306, 0, 292, 291, 141, 147, 189, 884, 254, 0, 1043, 246, 211, 1000, 191, 1012, 621, 886, 230, 236, 238, 1017, 1961, 222, 653, 658, 180, 1034, 894, 899, 1056, 905, 1021, 1060, 263, 1104, 1071, 1082, 1134, 1124, 1008, 1151, 1157, 1177, 199, 1083, 1227, 1233, 1122, 1239, 1248, 1243, 1260, 172, 0, 185, 1254, 215, 1273, 1309, 175, 154, 0, 140, 134, 1360, 1279, 1285, 1377, 389, 260, 612, 1961, 1126, 1106, 1383, 130, 129, 0, 119, 113, 1961, 108, 0, 1414, 91, 1398, 326, 1464, 1428, 1442, 1494, 1484, 1961, 102, 1391, 0, 66, 1439, 290, 1500, 603, 299, 1506, 1961, 1537, 1548, 1559, 1570, 1581, 1592, 1603, 1614, 1625, 1636, 1647, 1658, 1669, 1680, 1691, 1699, 1706, 1716, 1727, 1738, 1749, 1760, 1771, 1782, 1793, 1804, 1814, 1819, 1824, 1834, 1835, 1845, 51, 1851, 1861, 1871, 1880, 1885, 1890, 1895, 0, 1905, 1915, 1924, 1930, 1940, 1945, 1950 } ; static yyconst short int yy_def[504] = { 0, 456, 456, 457, 457, 458, 458, 459, 459, 460, 460, 461, 461, 455, 13, 462, 462, 463, 463, 464, 464, 463, 463, 465, 465, 466, 466, 467, 467, 468, 468, 469, 469, 470, 470, 463, 463, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 471, 455, 472, 455, 455, 455, 455, 455, 455, 455, 455, 455, 84, 84, 84, 455, 84, 84, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 473, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 471, 455, 455, 472, 474, 84, 84, 84, 84, 88, 84, 84, 455, 88, 88, 88, 88, 88, 455, 84, 455, 455, 475, 455, 476, 455, 455, 455, 455, 455, 473, 473, 455, 477, 455, 455, 455, 455, 455, 455, 455, 455, 455, 478, 479, 455, 455, 455, 455, 455, 157, 157, 157, 157, 480, 481, 455, 455, 455, 455, 455, 474, 474, 84, 88, 88, 184, 88, 88, 184, 184, 455, 184, 184, 475, 455, 476, 455, 455, 455, 477, 455, 455, 455, 455, 455, 455, 455, 455, 478, 479, 479, 455, 455, 455, 455, 455, 157, 480, 481, 481, 455, 455, 455, 455, 455, 84, 84, 455, 88, 88, 184, 455, 455, 184, 482, 455, 455, 455, 455, 455, 455, 455, 483, 455, 455, 455, 455, 479, 455, 455, 455, 455, 455, 455, 455, 481, 455, 455, 455, 455, 455, 455, 455, 184, 184, 184, 482, 484, 482, 484, 485, 455, 455, 455, 455, 486, 455, 455, 455, 455, 487, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 316, 488, 316, 316, 455, 315, 316, 489, 455, 455, 455, 321, 321, 321, 321, 321, 486, 486, 486, 455, 455, 490, 487, 361, 455, 455, 455, 455, 491, 492, 489, 489, 489, 455, 455, 321, 455, 455, 455, 455, 455, 455, 455, 455, 455, 493, 455, 494, 491, 491, 494, 492, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 495, 455, 496, 389, 455, 388, 388, 455, 455, 394, 394, 394, 394, 394, 497, 455, 455, 495, 455, 455, 455, 455, 498, 499, 495, 410, 410, 410, 410, 410, 455, 394, 500, 497, 435, 501, 455, 502, 498, 498, 502, 499, 455, 410, 503, 442, 455, 441, 441, 503, 455, 455, 503, 0, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; static yyconst short int yy_nxt[2013] = { 0, 455, 39, 40, 41, 39, 424, 77, 78, 53, 77, 191, 93, 77, 78, 93, 77, 42, 79, 80, 43, 193, 81, 54, 79, 80, 44, 122, 81, 130, 45, 123, 192, 46, 130, 47, 55, 94, 48, 56, 94, 131, 193, 49, 57, 50, 131, 51, 39, 40, 41, 39, 124, 58, 133, 82, 133, 367, 134, 95, 134, 82, 95, 42, 96, 97, 43, 96, 149, 98, 96, 97, 44, 96, 122, 98, 45, 150, 123, 46, 454, 47, 126, 136, 48, 233, 127, 137, 126, 49, 356, 50, 127, 51, 53, 156, 136, 158, 156, 124, 137, 187, 156, 357, 187, 156, 159, 128, 54, 444, 436, 187, 99, 128, 187, 432, 261, 59, 99, 261, 445, 55, 174, 173, 56, 174, 444, 173, 234, 57, 174, 173, 370, 174, 60, 173, 444, 444, 58, 62, 63, 433, 62, 174, 173, 371, 174, 432, 173, 206, 174, 173, 206, 174, 64, 173, 207, 174, 173, 356, 174, 432, 173, 244, 208, 356, 244, 65, 174, 173, 66, 174, 357, 173, 245, 67, 174, 173, 357, 174, 206, 173, 432, 206, 68, 62, 63, 207, 62, 270, 174, 173, 270, 174, 289, 173, 207, 289, 185, 426, 64, 230, 231, 425, 230, 174, 173, 356, 174, 69, 173, 253, 254, 65, 272, 273, 66, 272, 416, 229, 357, 67, 230, 231, 395, 230, 70, 229, 406, 373, 68, 71, 71, 71, 71, 71, 71, 72, 185, 71, 381, 71, 244, 71, 71, 244, 408, 283, 370, 232, 71, 71, 317, 245, 370, 317, 370, 71, 71, 71, 378, 371, 274, 230, 231, 362, 230, 371, 229, 371, 232, 275, 276, 406, 275, 338, 229, 403, 338, 404, 71, 71, 71, 71, 71, 71, 71, 71, 72, 377, 71, 421, 71, 289, 71, 71, 289, 313, 374, 373, 313, 71, 71, 448, 287, 287, 339, 287, 71, 71, 71, 232, 448, 373, 344, 278, 278, 344, 278, 277, 237, 450, 323, 288, 272, 273, 315, 272, 316, 173, 453, 71, 71, 71, 71, 71, 71, 71, 71, 74, 403, 71, 404, 71, 249, 71, 71, 373, 338, 372, 368, 338, 71, 71, 366, 296, 296, 365, 296, 71, 71, 71, 261, 279, 364, 261, 270, 299, 363, 270, 359, 307, 274, 300, 297, 272, 273, 308, 272, 339, 173, 358, 71, 71, 71, 71, 71, 71, 71, 71, 74, 349, 71, 348, 71, 259, 71, 71, 287, 287, 337, 287, 406, 71, 71, 296, 296, 420, 296, 336, 71, 71, 71, 320, 320, 333, 320, 288, 321, 266, 421, 332, 331, 274, 297, 328, 257, 327, 326, 325, 324, 319, 288, 71, 71, 83, 84, 85, 86, 84, 87, 88, 87, 89, 87, 87, 89, 87, 87, 87, 87, 87, 89, 87, 87, 87, 86, 86, 86, 86, 86, 87, 90, 87, 87, 87, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 91, 87, 101, 318, 304, 304, 102, 304, 278, 278, 309, 278, 103, 104, 306, 303, 105, 302, 313, 275, 276, 313, 275, 305, 229, 301, 106, 298, 107, 295, 275, 276, 294, 275, 293, 229, 310, 311, 292, 310, 329, 329, 108, 329, 268, 330, 291, 315, 290, 109, 110, 101, 286, 285, 284, 102, 279, 304, 304, 297, 304, 103, 104, 334, 334, 105, 334, 277, 335, 310, 311, 282, 310, 281, 280, 106, 305, 107, 277, 229, 310, 311, 305, 310, 312, 338, 338, 338, 338, 338, 228, 108, 338, 338, 271, 338, 269, 340, 109, 110, 112, 268, 341, 340, 113, 267, 317, 266, 263, 317, 114, 115, 216, 216, 116, 342, 339, 312, 216, 262, 260, 315, 320, 320, 117, 320, 118, 321, 312, 259, 422, 422, 448, 422, 343, 347, 258, 452, 257, 384, 343, 288, 384, 148, 252, 385, 251, 119, 120, 112, 453, 329, 329, 113, 329, 387, 330, 250, 249, 114, 115, 334, 334, 116, 334, 248, 335, 247, 388, 197, 297, 375, 375, 117, 375, 118, 393, 393, 423, 393, 305, 394, 243, 241, 229, 229, 229, 228, 168, 167, 376, 165, 226, 225, 224, 376, 119, 120, 171, 172, 173, 171, 174, 175, 174, 176, 174, 174, 176, 174, 174, 174, 174, 174, 176, 174, 174, 174, 173, 173, 173, 173, 173, 174, 177, 174, 174, 174, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 178, 174, 179, 180, 180, 179, 179, 181, 179, 182, 179, 179, 182, 179, 179, 179, 179, 179, 182, 179, 179, 179, 180, 180, 180, 180, 180, 179, 183, 179, 179, 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 184, 179, 216, 223, 222, 216, 216, 217, 216, 218, 216, 216, 218, 216, 216, 216, 216, 219, 218, 216, 216, 216, 217, 217, 217, 217, 217, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 216, 216, 235, 236, 236, 235, 235, 237, 235, 238, 235, 235, 238, 235, 235, 235, 235, 235, 238, 235, 235, 235, 236, 236, 236, 236, 236, 235, 239, 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 235, 235, 344, 338, 221, 344, 375, 375, 384, 375, 220, 384, 215, 340, 385, 214, 379, 379, 341, 379, 213, 398, 398, 212, 398, 376, 330, 382, 382, 211, 382, 342, 210, 345, 209, 380, 205, 390, 204, 203, 380, 202, 201, 200, 199, 358, 383, 198, 197, 195, 343, 350, 351, 351, 350, 350, 352, 350, 353, 350, 350, 353, 350, 350, 350, 350, 350, 353, 350, 350, 350, 351, 351, 351, 351, 351, 350, 354, 350, 350, 350, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 351, 350, 350, 360, 360, 194, 360, 360, 360, 360, 190, 360, 189, 360, 188, 360, 360, 338, 338, 186, 338, 362, 360, 360, 379, 379, 170, 379, 340, 360, 360, 360, 391, 391, 168, 391, 382, 382, 167, 382, 165, 391, 391, 380, 391, 401, 401, 164, 401, 163, 335, 392, 360, 360, 162, 383, 161, 160, 396, 396, 392, 396, 157, 364, 383, 343, 360, 360, 155, 360, 360, 360, 360, 154, 360, 366, 360, 397, 360, 360, 399, 399, 153, 399, 384, 360, 360, 384, 372, 152, 385, 151, 360, 360, 360, 384, 148, 147, 384, 400, 146, 385, 145, 144, 143, 378, 384, 396, 396, 384, 396, 387, 385, 385, 142, 360, 360, 141, 403, 140, 404, 139, 387, 138, 388, 455, 397, 381, 384, 455, 437, 384, 455, 437, 385, 388, 438, 455, 455, 406, 403, 455, 404, 455, 407, 455, 399, 399, 384, 399, 437, 384, 455, 437, 385, 455, 438, 408, 384, 443, 403, 384, 404, 455, 385, 400, 440, 455, 455, 406, 403, 455, 404, 455, 407, 409, 409, 390, 409, 441, 410, 393, 393, 455, 393, 455, 394, 408, 455, 455, 455, 455, 455, 455, 392, 455, 455, 455, 455, 455, 376, 411, 412, 412, 411, 411, 413, 411, 414, 411, 411, 414, 411, 411, 411, 411, 411, 414, 411, 411, 411, 412, 412, 412, 412, 412, 411, 415, 411, 411, 411, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, 411, 411, 417, 417, 455, 417, 455, 330, 398, 398, 455, 398, 455, 330, 418, 418, 455, 418, 455, 335, 455, 397, 455, 401, 401, 455, 401, 380, 335, 406, 403, 455, 404, 400, 420, 422, 422, 455, 422, 455, 406, 455, 383, 455, 455, 407, 340, 421, 409, 409, 455, 409, 455, 410, 417, 417, 455, 417, 408, 330, 418, 418, 455, 418, 455, 335, 455, 392, 455, 455, 455, 455, 455, 397, 455, 455, 455, 455, 455, 400, 455, 455, 455, 423, 427, 428, 428, 427, 427, 429, 427, 430, 427, 427, 430, 427, 427, 427, 427, 427, 430, 427, 427, 427, 428, 428, 428, 428, 428, 427, 431, 427, 427, 427, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 427, 427, 434, 434, 455, 434, 434, 434, 434, 455, 434, 455, 434, 455, 434, 434, 455, 455, 455, 455, 436, 434, 434, 455, 455, 455, 455, 455, 434, 434, 434, 406, 455, 455, 455, 455, 420, 406, 403, 455, 404, 437, 420, 455, 437, 448, 403, 438, 404, 421, 452, 434, 434, 455, 455, 421, 434, 434, 455, 434, 434, 434, 434, 453, 434, 455, 434, 455, 434, 434, 438, 437, 455, 455, 437, 434, 434, 438, 455, 455, 455, 455, 434, 434, 434, 437, 455, 440, 437, 455, 455, 438, 455, 448, 455, 455, 455, 403, 449, 404, 441, 440, 455, 455, 455, 434, 434, 437, 455, 455, 437, 450, 455, 438, 441, 455, 455, 455, 448, 403, 455, 404, 455, 449, 455, 455, 455, 437, 455, 455, 437, 455, 455, 438, 455, 455, 450, 437, 455, 403, 437, 404, 455, 438, 455, 455, 455, 455, 448, 403, 455, 404, 455, 449, 448, 455, 443, 455, 455, 452, 448, 403, 455, 404, 455, 452, 450, 455, 455, 455, 455, 455, 453, 455, 455, 455, 455, 455, 453, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 166, 166, 166, 455, 455, 166, 166, 169, 169, 169, 455, 455, 169, 169, 196, 196, 455, 196, 196, 196, 196, 196, 196, 196, 196, 227, 227, 455, 227, 227, 227, 227, 227, 227, 227, 227, 240, 240, 455, 240, 240, 240, 240, 240, 240, 240, 240, 242, 242, 455, 242, 242, 242, 242, 242, 242, 242, 242, 246, 246, 455, 246, 246, 246, 246, 246, 246, 246, 246, 255, 255, 455, 255, 255, 255, 255, 255, 255, 255, 255, 256, 256, 455, 256, 256, 256, 256, 256, 256, 256, 256, 264, 264, 455, 264, 264, 264, 264, 264, 264, 264, 264, 265, 265, 455, 265, 265, 265, 265, 265, 265, 265, 265, 314, 455, 455, 455, 314, 322, 455, 455, 455, 322, 339, 339, 455, 455, 339, 339, 455, 455, 339, 339, 346, 455, 455, 455, 346, 355, 455, 455, 455, 355, 361, 361, 455, 361, 361, 361, 361, 361, 361, 361, 361, 369, 455, 455, 455, 369, 360, 360, 455, 360, 360, 360, 360, 360, 360, 360, 360, 386, 455, 455, 386, 386, 455, 455, 455, 386, 389, 455, 455, 389, 389, 402, 455, 455, 402, 402, 405, 455, 455, 405, 405, 405, 405, 405, 405, 419, 419, 419, 419, 419, 435, 435, 455, 435, 435, 435, 435, 435, 435, 435, 435, 439, 455, 455, 439, 439, 455, 455, 455, 439, 442, 455, 455, 442, 442, 434, 434, 455, 434, 434, 434, 434, 434, 434, 434, 434, 446, 455, 455, 446, 446, 447, 455, 455, 447, 447, 447, 447, 447, 447, 451, 451, 451, 451, 451, 37, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; static yyconst short int yy_chk[2013] = { 0, 0, 1, 1, 1, 1, 496, 11, 11, 3, 11, 124, 15, 12, 12, 16, 12, 1, 11, 11, 1, 128, 11, 3, 12, 12, 1, 25, 12, 29, 1, 25, 124, 1, 30, 1, 3, 15, 1, 3, 16, 29, 128, 1, 3, 1, 30, 1, 2, 2, 2, 2, 25, 3, 31, 11, 32, 488, 31, 15, 32, 12, 16, 2, 17, 17, 2, 17, 55, 17, 18, 18, 2, 18, 26, 18, 2, 55, 26, 2, 448, 2, 27, 33, 2, 183, 27, 33, 28, 2, 322, 2, 28, 2, 4, 62, 34, 65, 62, 26, 34, 96, 156, 322, 96, 156, 65, 27, 4, 445, 436, 187, 17, 28, 187, 433, 214, 4, 18, 214, 431, 4, 86, 86, 4, 86, 430, 86, 183, 4, 87, 87, 346, 87, 4, 87, 428, 427, 4, 5, 5, 415, 5, 89, 89, 346, 89, 414, 89, 148, 90, 90, 148, 90, 5, 90, 148, 173, 173, 355, 173, 412, 173, 198, 148, 356, 198, 5, 174, 174, 5, 174, 355, 174, 198, 5, 176, 176, 356, 176, 206, 176, 411, 206, 5, 6, 6, 206, 6, 225, 177, 177, 225, 177, 250, 177, 207, 250, 90, 406, 6, 181, 181, 404, 181, 185, 185, 357, 185, 6, 185, 207, 207, 6, 229, 229, 6, 229, 395, 229, 357, 6, 230, 230, 377, 230, 6, 230, 408, 374, 6, 7, 7, 7, 7, 7, 7, 7, 177, 7, 365, 7, 244, 7, 7, 244, 408, 244, 369, 181, 7, 7, 282, 244, 370, 282, 371, 7, 7, 7, 363, 369, 229, 231, 231, 362, 231, 370, 231, 371, 230, 233, 233, 421, 233, 339, 233, 385, 339, 385, 7, 7, 8, 8, 8, 8, 8, 8, 8, 359, 8, 421, 8, 289, 8, 8, 289, 281, 354, 353, 281, 8, 8, 450, 249, 249, 339, 249, 8, 8, 8, 231, 453, 351, 344, 237, 237, 344, 237, 233, 237, 450, 289, 249, 272, 272, 281, 272, 281, 272, 453, 8, 8, 9, 9, 9, 9, 9, 9, 9, 438, 9, 438, 9, 249, 9, 9, 350, 341, 348, 340, 341, 9, 9, 336, 259, 259, 333, 259, 9, 9, 9, 261, 237, 331, 261, 270, 261, 328, 270, 326, 270, 272, 261, 259, 273, 273, 270, 273, 341, 273, 325, 9, 9, 10, 10, 10, 10, 10, 10, 10, 319, 10, 318, 10, 259, 10, 10, 287, 287, 308, 287, 420, 10, 10, 296, 296, 420, 296, 306, 10, 10, 10, 288, 288, 303, 288, 287, 288, 302, 420, 300, 298, 273, 296, 295, 294, 293, 292, 291, 290, 286, 288, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 19, 285, 268, 268, 19, 268, 278, 278, 271, 278, 19, 19, 269, 267, 19, 266, 313, 275, 275, 313, 275, 268, 275, 262, 19, 260, 19, 258, 276, 276, 257, 276, 254, 276, 280, 280, 253, 280, 297, 297, 19, 297, 268, 297, 252, 313, 251, 19, 19, 20, 248, 247, 245, 20, 278, 304, 304, 297, 304, 20, 20, 305, 305, 20, 305, 275, 305, 310, 310, 243, 310, 241, 239, 20, 304, 20, 276, 234, 311, 311, 305, 311, 280, 342, 314, 314, 342, 314, 228, 20, 315, 315, 226, 315, 224, 314, 20, 20, 23, 223, 314, 315, 23, 222, 317, 221, 219, 317, 23, 23, 218, 217, 23, 314, 342, 310, 216, 215, 213, 315, 320, 320, 23, 320, 23, 320, 311, 212, 422, 422, 452, 422, 314, 317, 211, 452, 210, 367, 315, 320, 367, 208, 205, 367, 204, 23, 23, 24, 452, 329, 329, 24, 329, 367, 329, 203, 202, 24, 24, 334, 334, 24, 334, 201, 334, 200, 367, 197, 329, 375, 375, 24, 375, 24, 376, 376, 422, 376, 334, 376, 195, 189, 182, 180, 179, 170, 169, 168, 375, 166, 164, 163, 162, 376, 24, 24, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 157, 161, 160, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 316, 316, 159, 316, 358, 358, 368, 358, 158, 368, 155, 316, 368, 154, 379, 379, 316, 379, 153, 380, 380, 152, 380, 358, 380, 382, 382, 151, 382, 316, 150, 316, 149, 379, 147, 368, 146, 145, 380, 144, 143, 142, 141, 358, 382, 140, 139, 138, 316, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, 327, 327, 131, 327, 327, 327, 327, 116, 327, 108, 327, 105, 327, 327, 338, 338, 94, 338, 327, 327, 327, 364, 364, 81, 364, 338, 327, 327, 327, 391, 391, 75, 391, 366, 366, 74, 366, 73, 372, 372, 364, 372, 383, 383, 70, 383, 69, 383, 391, 327, 327, 68, 366, 67, 66, 378, 378, 372, 378, 64, 364, 383, 338, 361, 361, 60, 361, 361, 361, 361, 59, 361, 366, 361, 378, 361, 361, 381, 381, 58, 381, 384, 361, 361, 384, 372, 57, 384, 56, 361, 361, 361, 387, 54, 51, 387, 381, 50, 387, 49, 48, 47, 378, 388, 396, 396, 388, 396, 387, 388, 384, 46, 361, 361, 45, 388, 44, 388, 42, 388, 39, 387, 37, 396, 381, 386, 0, 425, 386, 0, 425, 386, 388, 425, 0, 0, 386, 386, 0, 386, 0, 386, 0, 399, 399, 390, 399, 424, 390, 0, 424, 390, 0, 424, 386, 389, 425, 390, 389, 390, 0, 389, 399, 424, 0, 0, 389, 389, 0, 389, 0, 389, 392, 392, 390, 392, 424, 392, 393, 393, 0, 393, 0, 393, 389, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 393, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 397, 397, 0, 397, 0, 397, 398, 398, 0, 398, 0, 398, 400, 400, 0, 400, 0, 400, 0, 397, 0, 401, 401, 0, 401, 398, 401, 402, 402, 0, 402, 400, 402, 403, 403, 0, 403, 0, 407, 407, 401, 407, 0, 407, 403, 402, 409, 409, 0, 409, 0, 409, 417, 417, 0, 417, 407, 417, 418, 418, 0, 418, 0, 418, 0, 409, 0, 0, 0, 0, 0, 417, 0, 0, 0, 0, 0, 418, 0, 0, 0, 403, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 416, 416, 0, 416, 416, 416, 416, 0, 416, 0, 416, 0, 416, 416, 0, 0, 0, 0, 416, 416, 416, 0, 0, 0, 0, 0, 416, 416, 416, 419, 419, 0, 419, 0, 419, 426, 426, 0, 426, 437, 426, 0, 437, 446, 446, 437, 446, 419, 446, 416, 416, 0, 0, 426, 435, 435, 0, 435, 435, 435, 435, 446, 435, 0, 435, 0, 435, 435, 437, 440, 0, 0, 440, 435, 435, 440, 0, 0, 0, 0, 435, 435, 435, 441, 0, 440, 441, 0, 0, 441, 0, 449, 449, 0, 449, 441, 449, 441, 440, 441, 0, 0, 0, 435, 435, 439, 0, 0, 439, 449, 0, 439, 441, 0, 0, 0, 439, 439, 0, 439, 0, 439, 0, 0, 0, 443, 0, 0, 443, 0, 0, 443, 0, 0, 439, 442, 0, 443, 442, 443, 0, 442, 0, 0, 0, 0, 442, 442, 0, 442, 0, 442, 451, 451, 443, 451, 0, 451, 454, 454, 0, 454, 0, 454, 442, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 454, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, 463, 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 471, 471, 471, 0, 0, 471, 471, 472, 472, 472, 0, 0, 472, 472, 473, 473, 0, 473, 473, 473, 473, 473, 473, 473, 473, 474, 474, 0, 474, 474, 474, 474, 474, 474, 474, 474, 475, 475, 0, 475, 475, 475, 475, 475, 475, 475, 475, 476, 476, 0, 476, 476, 476, 476, 476, 476, 476, 476, 477, 477, 0, 477, 477, 477, 477, 477, 477, 477, 477, 478, 478, 0, 478, 478, 478, 478, 478, 478, 478, 478, 479, 479, 0, 479, 479, 479, 479, 479, 479, 479, 479, 480, 480, 0, 480, 480, 480, 480, 480, 480, 480, 480, 481, 481, 0, 481, 481, 481, 481, 481, 481, 481, 481, 482, 0, 0, 0, 482, 483, 0, 0, 0, 483, 484, 484, 0, 0, 484, 484, 0, 0, 484, 484, 485, 0, 0, 0, 485, 486, 0, 0, 0, 486, 487, 487, 0, 487, 487, 487, 487, 487, 487, 487, 487, 489, 0, 0, 0, 489, 490, 490, 0, 490, 490, 490, 490, 490, 490, 490, 490, 491, 0, 0, 491, 491, 0, 0, 0, 491, 492, 0, 0, 492, 492, 493, 0, 0, 493, 493, 494, 0, 0, 494, 494, 494, 494, 494, 494, 495, 495, 495, 495, 495, 497, 497, 0, 497, 497, 497, 497, 497, 497, 497, 497, 498, 0, 0, 498, 498, 0, 0, 0, 498, 499, 0, 0, 499, 499, 500, 500, 0, 500, 500, 500, 500, 500, 500, 500, 500, 501, 0, 0, 501, 501, 502, 0, 0, 502, 502, 502, 502, 502, 502, 503, 503, 503, 503, 503, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, 455 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected static int yy_more_flag = 0; static int yy_more_len = 0; #define yymore() (yy_more_flag = 1) #define YY_MORE_ADJ yy_more_len #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "libparse.l" #define INITIAL 0 #line 2 "libparse.l" /**************************************** * Computer Algebra System SINGULAR * ****************************************/ /* $Id: libparse.cc,v 1.2 2004-05-13 16:52:03 Singular Exp $ */ #include #include #include #include #include "mod2.h" #ifdef STANDALONE_PARSER #include "utils.h" #define HAVE_LIBPARSER #define YYLPDEBUG 1 #else #include "subexpr.h" #include "grammar.h" #include "ipshell.h" #include "ipid.h" #include "tok.h" #include "febase.h" #include "omalloc.h" #endif #include "libparse.h" #ifdef HAVE_LIBPARSER #define YY_SKIP_YYWRAP typedef enum { LP_NONE, LP_INFO, LP_CATEGORY, LP_VERSION} lib_cmds; int libread(FILE* f, char* buf, int max_size); int current_pos(int i); void print_version(lp_modes mode, char *p); void copy_string(lp_modes mode); extern void piCleanUp(procinfov pi); void make_version(char *p, int what); int brace1 = 0; /* { } */ int brace2 = 0; /* ( ) */ int brace3 = 0; /* [ ] */ int quote = 0; /* " */ int offset = 0; BOOLEAN p_static = FALSE; int old_state = 0; lib_cmds last_cmd = LP_NONE; char libnamebuf[128]; char *text_buffer=NULL; long string_start; char *yylp_buffer_start; int yylplineno = 1; int lpverbose = 0, check = 0; int texinfo_out = 0; int found_info=0, found_cat=0, found_version=0, found_oldhelp = 0, found_proc_in_proc = 0; char *yylp_errlist[]= { "", "missing close bracket ')' for proc definition in line %d.", /* 1 */ "missing close bracket ')' for procbody in line %d.", /* 2 */ "missing close bracket ']' for procbody in line %d.", /* 3 */ "too many ')' closed brackets in line %d.", /* 4 */ "too many ']' closed brackets in line %d.", /* 5 */ "missing close bracket ')' for example in line %d.", /* 6 */ "missing close bracket ']' for example in line %d.", /* 7 */ "cannot assign character '%c' in line %d to any group.", /* 8 */ "there must be a quote missing somewhere before line %d.", /* 9 */ "missing close bracket '}' at end of library in line %d.", /* 10 */ "missing close bracket ')' at end of library in line %d.", /* 11 */ "missing close bracket ']' at end of library in line %d.", /* 12 */ NULL }; int yylp_errno = 0; #ifdef __MWERKS__ #ifdef __cplusplus extern "C" { #endif long ftell(FILE *fp); #ifdef macintosh int fileno(FILE *stream); FILE *fdopen(int filedes, char *type); int isatty(int filedes); #else int _fileno(FILE *stream); FILE *_fdopen(int filedes, char *type); int _isatty(int filedes); #define fileno _fileno #define fdopen _fdopen #define isatty _isatty #endif /* macintosh */ #ifdef __cplusplus } #endif #endif #ifdef STANDALONE_PARSER procinfov pi; int category_out = 0; void printpi(procinfov pi); void pi_clear(procinfov pi); extern "C" { int yylpwrap(); } void main_init(int argc, char *argv[]); void main_result(char *libname); #else /* STANDALONE_PARSER */ idhdl h0; #ifdef HAVE_NS idhdl h_top; #endif #define pi IDPROC(h0) extern "C" { int yylpwrap(); } extern libstackv library_stack; #endif /* STANDALONE_PARSER */ static unsigned long help_chksum; #define SET_DEF_END(mode, pi, p) \ if ( mode == LOAD_LIB) pi->data.s.def_end = p; #define SET_HELP_START(mode, pi, p) \ if ( mode == LOAD_LIB) {pi->data.s.help_start = p; help_chksum = 0;} #define SET_HELP_END(mode, pi, p) \ if ( mode == LOAD_LIB) {pi->data.s.help_end = p; \ pi->data.s.help_chksum = help_chksum;} #define SET_BODY_START(mode, pi, l, p) \ if ( mode == LOAD_LIB) \ { \ pi->data.s.body_lineno = l; \ pi->data.s.body_start = p; \ } #define SET_BODY_END(mode, pi, p) \ if ( mode == LOAD_LIB) \ { \ pi->data.s.body_end = p-1; \ pi->data.s.proc_end = p-1; \ } #define SET_EXAMPLE_START(mode, pi, l, p) \ if ( mode == LOAD_LIB) \ { \ pi->data.s.example_lineno = l; \ pi->data.s.example_start = p; \ } #define SET_PROC_END(mode, pi, p) \ if ( mode == LOAD_LIB) \ { \ pi->data.s.proc_end = p-1; \ if(pi->data.s.body_end==0) \ pi->data.s.body_end = p-1; \ } #define ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x8000; else (c) >>= 1; #define IncrCheckSum(c) \ do \ { \ ROTATE_RIGHT(help_chksum); \ help_chksum += c; \ help_chksum &= 0xffff; \ } \ while(0) #undef YY_DECL #ifdef HAVE_NS #define YY_DECL int yylex(char *newlib, char *libfile, \ lib_style_types *lib_style, \ idhdl pl, BOOLEAN autoexport, lp_modes mode) #else #define YY_DECL int yylex(char *newlib, char *libfile, \ lib_style_types *lib_style, \ lp_modes mode) #endif /* HAVE_NS */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( ((result = libread( (yyin), (char *) buf, max_size )) < 0 ) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "read in flex scanner failed" ); #define YY_USER_INIT { \ BEGIN(header); \ yylplineno = 1; \ yylp_errno = 0; \ *lib_style = OLD_LIBSTYLE; \ strcpy(libnamebuf,"(**unknown version**)"); \ } #if 0 proc[ \t]+{name} { printf("MISSING: PROC-cmd found. ERROR!\n"); } example[ \t]*\n { yylplineno++; printf("MISSING: EXAMPLE-cmd found. ERROR!\n"); } info=+"\"" { #endif /* %start START */ #define header 1 #define help 2 #define libcmd 3 #define libcmd2 4 #define pdef 5 #define phead 6 #define poldhelp 7 #define phelp 8 #define pbody 9 #define pstr 10 #define pexample 11 #define pestr 12 #define string 13 #define comment 14 #define info 15 #define category 16 #define version 17 #line 1230 "libparse.cc" /* 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 #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; #line 257 "libparse.l" #line 1386 "libparse.cc" 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_more_len = 0; if ( yy_more_flag ) { yy_more_len = yy_c_buf_p - yytext_ptr; yy_more_flag = 0; } yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1961 ); 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 258 "libparse.l" { } YY_BREAK case 2: YY_RULE_SETUP #line 259 "libparse.l" { old_state = YYSTATE; BEGIN(comment); } YY_BREAK case 3: YY_RULE_SETUP #line 261 "libparse.l" { yyless(4); old_state = YYSTATE; BEGIN(info); } YY_BREAK case 4: YY_RULE_SETUP #line 264 "libparse.l" { yyless(8); old_state = YYSTATE; BEGIN(category); } YY_BREAK case 5: YY_RULE_SETUP #line 267 "libparse.l" { found_version++; if ( mode != GET_INFO ) { make_version(yytext,1); #ifdef STANDALONE_PARSER if (texinfo_out) { char *c = libnamebuf; printf("$version = \""); while (*c != '\0') { if (*c == '$' || *c == '@') putchar('\\'); if (*c != '\r') putchar(*c); if (*c == '\\') { c++; if (*c != '"') putchar('\\'); } else c++; } printf("\";\n"); } else if (!category_out) printf("Version:%s;\n", libnamebuf); #else if (text_buffer!=NULL) omFree((ADDRESS)text_buffer); text_buffer = omStrDup(libnamebuf); omMarkAsStaticAddr(text_buffer); #endif } } YY_BREAK case 6: YY_RULE_SETUP #line 301 "libparse.l" { p_static=TRUE; } YY_BREAK case 7: YY_RULE_SETUP #line 303 "libparse.l" { char proc[256]; BEGIN(pdef); found_proc_in_proc = 0; proc[0]='\0'; sscanf( yytext, "%*[^p]proc %s", proc); if(strlen(proc)<1) sscanf( yytext, "proc %s", proc); #if YYLPDEBUG > 1 printf("Newlib:%s\n", newlib); #endif #ifdef STANDALONE_PARSER if ( pi != NULL ) { printpi(pi); pi_clear(pi); } #ifdef STANDALONE_PARSER pi = (procinfo *)malloc(sizeof(procinfo)); #else pi = (procinfo *)omAlloc(sizeof(procinfo)); #endif iiInitSingularProcinfo(pi, newlib, proc, yylplineno, current_pos(0), p_static); #else STANDALONE_PARSER if( mode == LOAD_LIB) { #ifdef HAVE_NS h0 = enterid( proc, 0 /*myynest*/, PROC_CMD, &(IDPACKAGE(pl)->idroot), TRUE); if(!p_static && autoexport) { h_top = enterid( proc, 0 /*myynest*/, PROC_CMD, &(basePack->idroot), FALSE ); } #else h0 = enterid( proc, 0 /*myynest*/, PROC_CMD, &IDROOT, TRUE ); #endif /* HAVE_NS */ /* omCheckAddr(IDID(h0)); */ if (h0!=NULL) { iiInitSingularProcinfo(IDPROC(h0), newlib, proc, yylplineno, current_pos(0),p_static); #ifdef HAVE_NS if (!p_static && h_top != NULL && autoexport) { if(IDPROC(h_top)!=NULL) piCleanUp((procinfo *)IDPROC(h_top)); IDPROC(h_top)=IDPROC(h0); IDPROC(h_top)->ref++; } IDPROC(h0)->pack=IDPACKAGE(pl); #endif /* HAVE_NS */ if (BVERBOSE(V_LOAD_PROC)) Warn( " proc '%s' registered", proc ); } #endif STANDALONE_PARSER SET_DEF_END(mode, pi, current_pos(yyleng+1)); #if YYLPDEBUG if(lpverbose) { printf("// PROCEDURE '%s' status: %s, ", proc, p_static ? "local" : "global"); printf("starting at line %d,%d: definition end: %d (%d).\n", yylplineno, current_pos(0), (int)pi->data.s.def_end, brace1); } #endif p_static=FALSE; #ifndef STANDALONE_PARSER } #endif STANDALONE_PARSER } YY_BREAK case 8: YY_RULE_SETUP #line 374 "libparse.l" { BEGIN(pexample); SET_EXAMPLE_START(mode, pi, yylplineno, current_pos(0)); #if YYLPDEBUG if(lpverbose) { printf("// EXAMPLE at line %d,%d (%d)\n", yylplineno, current_pos(0), brace1); } #endif } YY_BREAK case 9: YY_RULE_SETUP #line 386 "libparse.l" { quote++; BEGIN(libcmd); } YY_BREAK case 10: YY_RULE_SETUP #line 390 "libparse.l" { quote++; brace2++; BEGIN(libcmd2); } YY_BREAK case 11: YY_RULE_SETUP #line 394 "libparse.l" { make_version(yytext, 0); #if YYLPDEBUG > 1 printf("+(id)HEAD:%s\n", yytext); #endif } YY_BREAK case 12: YY_RULE_SETUP #line 400 "libparse.l" { #if YYLPDEBUG printf("+(cmt)HEAD:%s\n", yytext); #endif } YY_BREAK case 13: YY_RULE_SETUP #line 405 "libparse.l" { #if YYLPDEBUG > 1 printf("-HEAD:%s\n", yytext); #endif } YY_BREAK case 14: YY_RULE_SETUP #line 410 "libparse.l" { yyless(0); BEGIN(INITIAL); yymore(); } YY_BREAK case 15: YY_RULE_SETUP #line 414 "libparse.l" { yyless(0); *lib_style = NEW_LIBSTYLE; BEGIN(INITIAL); yymore(); } YY_BREAK case 16: YY_RULE_SETUP #line 421 "libparse.l" { quote++; BEGIN(libcmd); } YY_BREAK case 17: YY_RULE_SETUP #line 424 "libparse.l" { quote++; brace2++; BEGIN(libcmd2); } YY_BREAK case 18: YY_RULE_SETUP #line 427 "libparse.l" { yylplineno++; } YY_BREAK case 19: YY_RULE_SETUP #line 428 "libparse.l" { #if YYLPDEBUG > 1 printf(" HEAD:%s\n", yytext); #endif yyless(0); BEGIN(help); } YY_BREAK case 20: YY_RULE_SETUP #line 435 "libparse.l" { #if YYLPDEBUG > 1 printf(" HELP:%s\n", yytext); #endif BEGIN(INITIAL); } YY_BREAK case 21: YY_RULE_SETUP #line 440 "libparse.l" { #if YYLPDEBUG > 1 printf(" HELP:%s\n", yytext); #endif BEGIN(INITIAL); } YY_BREAK case 22: YY_RULE_SETUP #line 446 "libparse.l" { yyless(0); *lib_style = NEW_LIBSTYLE; BEGIN(INITIAL); yymore(); } YY_BREAK case 23: YY_RULE_SETUP #line 452 "libparse.l" { yyless(0); //printf("2) proc found.\n"); BEGIN(INITIAL); yymore(); } YY_BREAK case 24: YY_RULE_SETUP #line 458 "libparse.l" { quote++; BEGIN(libcmd); } YY_BREAK case 25: YY_RULE_SETUP #line 461 "libparse.l" { quote++; brace2++; BEGIN(libcmd2); } YY_BREAK case 26: YY_RULE_SETUP #line 465 "libparse.l" { yylplineno++; } YY_BREAK case 27: YY_RULE_SETUP #line 466 "libparse.l" { #if YYLPDEBUG if(lpverbose>2) printf("--->%s<---\n", yytext); #endif } YY_BREAK case 28: YY_RULE_SETUP #line 471 "libparse.l" { found_oldhelp=1; #if YYLPDEBUG > 1 printf("-HELP:%s\n", yytext); #endif } YY_BREAK case 29: YY_RULE_SETUP #line 479 "libparse.l" { quote--; yytext[yyleng-1] = '\0'; #ifndef STANDALONE_PARSER if ( mode == LOAD_LIB ) { library_stack->push(newlib, yytext); } #endif /* STANDALONE_PARSER */ #if YYLPDEBUG if(lpverbose>1) printf("LIB:'%s'\n", yytext); #endif BEGIN(INITIAL); } YY_BREAK case 30: YY_RULE_SETUP #line 492 "libparse.l" { quote--; brace2--; yytext[yyleng-1] = '\0'; #ifndef STANDALONE_PARSER if ( mode == LOAD_LIB ) { library_stack->push(newlib, yytext); } #endif /* STANDALONE_PARSER */ #if YYLPDEBUG if(lpverbose>1) printf("LIB:'%s'\n", yytext); #endif BEGIN(INITIAL); } YY_BREAK case 31: YY_RULE_SETUP #line 506 "libparse.l" { } YY_BREAK case 32: YY_RULE_SETUP #line 507 "libparse.l" { brace2++; #if YYLPDEBUG > 1 printf("%s", yytext); #endif } YY_BREAK case 33: YY_RULE_SETUP #line 513 "libparse.l" { brace2--; #if YYLPDEBUG > 1 printf(">%s<\n", yytext); printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif if(brace2<=0) { #if YYLPDEBUG > 1 printf("BEGIN(phead){=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif SET_DEF_END(mode, pi, current_pos(yyleng)); BEGIN(phead); } } YY_BREAK case 34: YY_RULE_SETUP #line 528 "libparse.l" { if(brace2>0) { #if YYLPDEBUG > 1 printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif yylp_errno = YYLP_DEF_BR2; return(1); } else { brace1++; BEGIN(pbody); if(lpverbose) printf("// BODY at line %d,%d (%d)\n", yylplineno, current_pos(0), brace1); SET_BODY_START(mode, pi, yylplineno, current_pos(0)); } } YY_BREAK case 35: YY_RULE_SETUP #line 546 "libparse.l" { yylplineno++; if(brace2<=0) { #if YYLPDEBUG > 1 printf("BEGIN(phead-2){=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif BEGIN(phead); } } YY_BREAK case 36: YY_RULE_SETUP #line 555 "libparse.l" { } YY_BREAK case 37: YY_RULE_SETUP #line 556 "libparse.l" { old_state = YYSTATE; BEGIN(comment); } YY_BREAK case 38: YY_RULE_SETUP #line 557 "libparse.l" { if(brace2<=0) { BEGIN(phead); yyless(0); } } YY_BREAK case 39: YY_RULE_SETUP #line 565 "libparse.l" { #if YYLPDEBUG if(lpverbose>2)printf("0-Len=%d;\n", yyleng); #endif if(check) { printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n", pi->procname, pi->data.s.proc_lineno); } SET_HELP_START(mode, pi, current_pos(0)); BEGIN(poldhelp); yyless(0); } YY_BREAK case 40: YY_RULE_SETUP #line 578 "libparse.l" { #if YYLPDEBUG if(lpverbose>2)printf("1-Len=%d;\n", yyleng); #endif BEGIN(phelp); yyless(0); } YY_BREAK case 41: YY_RULE_SETUP #line 585 "libparse.l" { if(check && yyleng>2) { printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n", pi->procname, pi->data.s.proc_lineno); } #if YYLPDEBUG if(lpverbose>2 && yyleng>2) printf("2-Len=%d, %s;\n", yyleng, pi->procname); #endif SET_HELP_START(mode, pi, current_pos(0)); BEGIN(poldhelp); yyless(0); } YY_BREAK case 42: YY_RULE_SETUP #line 599 "libparse.l" { printf("[%s]", yytext); } YY_BREAK case 43: YY_RULE_SETUP #line 601 "libparse.l" { } YY_BREAK case 44: YY_RULE_SETUP #line 602 "libparse.l" { SET_HELP_END(mode, pi, current_pos(0)); brace1++; BEGIN(pbody); if(lpverbose) { printf("// HELP from %d to %d\n", (int)pi->data.s.help_start, (int)pi->data.s.help_end); printf("// BODY at line %d,%d (%d)\n", yylplineno, current_pos(0), brace1); } #if YYLPDEBUG > 1 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif SET_BODY_START(mode, pi, yylplineno, current_pos(0)); #if YYLPDEBUG > 1 printf("BODY at %d/%d", yylplineno, current_pos(0)); #endif } YY_BREAK case 45: YY_RULE_SETUP #line 620 "libparse.l" { yylplineno++; } YY_BREAK case 46: YY_RULE_SETUP #line 621 "libparse.l" { } YY_BREAK case 47: YY_RULE_SETUP #line 623 "libparse.l" { old_state = YYSTATE; BEGIN(string); SET_HELP_START(mode, pi, current_pos(1)); } YY_BREAK case 48: YY_RULE_SETUP #line 628 "libparse.l" {} YY_BREAK case 49: YY_RULE_SETUP #line 629 "libparse.l" { brace1++; BEGIN(pbody); if(lpverbose) { printf("// HELP from %d to %d\n", (int)pi->data.s.help_start, (int)pi->data.s.help_end); printf("// BODY at line %d,%d (%d)\n", yylplineno, current_pos(0), brace1); } #if YYLPDEBUG > 1 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); #endif SET_BODY_START(mode, pi, yylplineno, current_pos(0)); #if YYLPDEBUG > 1 printf("BODY at %d/%d", yylplineno, current_pos(0)); #endif } YY_BREAK case 50: YY_RULE_SETUP #line 646 "libparse.l" { yylplineno++;} YY_BREAK case 51: YY_RULE_SETUP #line 648 "libparse.l" { } YY_BREAK case 52: YY_RULE_SETUP #line 649 "libparse.l" { quote++; old_state = YYSTATE; BEGIN(string); /* printf("%s", yytext); */ } YY_BREAK case 53: YY_RULE_SETUP #line 653 "libparse.l" { if(check) printf("*** found 2 proc whithin procedure '%s'.\n", pi->procname); yyless(yyleng-1); } YY_BREAK case 54: YY_RULE_SETUP #line 658 "libparse.l" { if(check) printf("*** found 1 proc whithin procedure '%s'.\n", pi->procname); yyless(yyleng-1); } YY_BREAK case 55: YY_RULE_SETUP #line 663 "libparse.l" { brace1++; #if YYLPDEBUG > 1 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext); #endif } YY_BREAK case 56: YY_RULE_SETUP #line 669 "libparse.l" { #if YYLPDEBUG > 1 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext); #endif brace1--; if(brace2>0) { yylp_errno = YYLP_BODY_BR2; return(1); } if(brace3>0) { yylp_errno = YYLP_BODY_BR3; return(1); } if(brace1<=0) { SET_BODY_END(mode, pi, current_pos(yyleng)); SET_PROC_END(mode, pi, current_pos(yyleng)); #if YYLPDEBUG > 1 printf("-%d\n", current_pos(0)); #endif BEGIN(INITIAL); } } YY_BREAK case 57: YY_RULE_SETUP #line 695 "libparse.l" { brace2++; /* printf("%s", yytext); */ } YY_BREAK case 58: YY_RULE_SETUP #line 698 "libparse.l" { brace2--; /* printf("%s", yytext); */ if(brace2<0) { yylp_errno = YYLP_BODY_TMBR2; return(1); } } YY_BREAK case 59: YY_RULE_SETUP #line 705 "libparse.l" { brace3++; /* printf("%s", yytext); */ } YY_BREAK case 60: YY_RULE_SETUP #line 708 "libparse.l" { brace3--; /* printf("%s", yytext); */ if(brace3<0) { yylp_errno = YYLP_BODY_TMBR3; return(1); } } YY_BREAK case 61: YY_RULE_SETUP #line 715 "libparse.l" { yylplineno++; } YY_BREAK case 62: YY_RULE_SETUP #line 716 "libparse.l" { } YY_BREAK case 63: YY_RULE_SETUP #line 718 "libparse.l" { quote++; BEGIN(string); found_info++; string_start = current_pos(yyleng); *lib_style = NEW_LIBSTYLE; last_cmd = LP_INFO; } YY_BREAK case 64: YY_RULE_SETUP #line 725 "libparse.l" { yylplineno++; } YY_BREAK case 65: YY_RULE_SETUP #line 726 "libparse.l" { } YY_BREAK case 66: YY_RULE_SETUP #line 728 "libparse.l" { quote++; BEGIN(string); found_cat++; string_start = current_pos(yyleng); *lib_style = NEW_LIBSTYLE; last_cmd = LP_CATEGORY; } YY_BREAK case 67: YY_RULE_SETUP #line 735 "libparse.l" { yylplineno++; } YY_BREAK case 68: YY_RULE_SETUP #line 736 "libparse.l" { } YY_BREAK case 69: YY_RULE_SETUP #line 738 "libparse.l" { quote--; copy_string(mode); last_cmd = LP_NONE; if(old_state==phelp) { SET_HELP_END(mode, pi, current_pos(0)); } BEGIN(old_state); /* printf("%s", yytext); */ } YY_BREAK case 70: YY_RULE_SETUP #line 747 "libparse.l" { if (old_state == phelp) IncrCheckSum(*yytext);} YY_BREAK case 71: YY_RULE_SETUP #line 748 "libparse.l" { yylplineno++; if (old_state == phelp) IncrCheckSum('\n');} YY_BREAK case 72: YY_RULE_SETUP #line 749 "libparse.l" { if (old_state == phelp) IncrCheckSum(*yytext);} YY_BREAK case 73: YY_RULE_SETUP #line 751 "libparse.l" { } YY_BREAK case 74: YY_RULE_SETUP #line 752 "libparse.l" { quote++; old_state = YYSTATE; BEGIN(string); /* printf("%s", yytext); */ } YY_BREAK case 75: YY_RULE_SETUP #line 755 "libparse.l" { brace1++; /* printf("(%d)%s", brace1, yytext); */ } YY_BREAK case 76: YY_RULE_SETUP #line 758 "libparse.l" { brace1--; /* printf("(%d)%s", brace1, yytext); */ if(brace1<=0) { if(brace2>0) { yylp_errno=YYLP_EX_BR2; return(1); } if(brace3>0) { yylp_errno=YYLP_EX_BR3; return(1); } BEGIN(INITIAL); SET_PROC_END(mode, pi, current_pos(yyleng)); } } YY_BREAK case 77: YY_RULE_SETUP #line 767 "libparse.l" { brace2++; /* printf("%s", yytext); */ } YY_BREAK case 78: YY_RULE_SETUP #line 770 "libparse.l" { brace2--; /* printf("%s", yytext); */ } YY_BREAK case 79: YY_RULE_SETUP #line 773 "libparse.l" { brace3++; /* printf("%s", yytext); */ } YY_BREAK case 80: YY_RULE_SETUP #line 776 "libparse.l" { brace3--; /* printf("%s", yytext); */ } YY_BREAK case 81: YY_RULE_SETUP #line 779 "libparse.l" { yylplineno++; } YY_BREAK case 82: YY_RULE_SETUP #line 780 "libparse.l" { } YY_BREAK case 83: YY_RULE_SETUP #line 782 "libparse.l" { quote--; BEGIN(pexample); /* printf("%s", yytext); */ } YY_BREAK case 84: YY_RULE_SETUP #line 785 "libparse.l" { } YY_BREAK case 85: YY_RULE_SETUP #line 786 "libparse.l" { } YY_BREAK case 86: YY_RULE_SETUP #line 787 "libparse.l" { yylplineno++; } YY_BREAK case 87: YY_RULE_SETUP #line 788 "libparse.l" { } YY_BREAK case 88: YY_RULE_SETUP #line 790 "libparse.l" { BEGIN(old_state); } YY_BREAK case 89: YY_RULE_SETUP #line 791 "libparse.l" { yylplineno++; } YY_BREAK case 90: YY_RULE_SETUP #line 792 "libparse.l" { } YY_BREAK case 91: YY_RULE_SETUP #line 794 "libparse.l" { yylplineno++; } YY_BREAK case 92: YY_RULE_SETUP #line 795 "libparse.l" { } YY_BREAK case 93: YY_RULE_SETUP #line 796 "libparse.l" { p_static = FALSE; #if YYLPDEBUG > 1 printf("%s", yytext); #endif } YY_BREAK case 94: YY_RULE_SETUP #line 801 "libparse.l" { p_static = FALSE; yylp_errno = YYLP_BAD_CHAR; #ifdef STANDALONE_PARSER printf("[%d]", *yytext); #else if (text_buffer!=NULL) omFree((ADDRESS)text_buffer); text_buffer = omStrDup(yytext); omMarkAsStaticAddr(text_buffer); #endif #if YYLPDEBUG > 1 printf("[%s]", yytext); #endif return(1); } YY_BREAK case 95: YY_RULE_SETUP #line 816 "libparse.l" ECHO; YY_BREAK #line 2391 "libparse.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(header): case YY_STATE_EOF(help): case YY_STATE_EOF(libcmd): case YY_STATE_EOF(libcmd2): case YY_STATE_EOF(pdef): case YY_STATE_EOF(phead): case YY_STATE_EOF(poldhelp): case YY_STATE_EOF(phelp): case YY_STATE_EOF(pbody): case YY_STATE_EOF(pstr): case YY_STATE_EOF(pexample): case YY_STATE_EOF(pestr): case YY_STATE_EOF(string): case YY_STATE_EOF(comment): case YY_STATE_EOF(info): case YY_STATE_EOF(category): case YY_STATE_EOF(version): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 456 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 455); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; yy_current_buffer->yy_at_bol = (c == '\n'); return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #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 { 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 } #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 816 "libparse.l" int current_pos(int i) { return(i+offset+(int)(yytext-yylp_buffer_start)); } int libread(FILE* f, char* buf, int max_size) { int rc; offset = ftell(f); rc = myfread( buf, 1, max_size, f ); #if YYLPDEBUG >2 printf("fread: %d of %d\n", rc, max_size); #endif yylp_buffer_start = buf; return rc; } extern "C" { int yylpwrap() { //printf("======================= YYWRAP ====================\n"); if(brace1>0) { yylp_errno=YYLP_MISS_BR1; } if(brace2>0) { yylp_errno=YYLP_MISS_BR2; } if(brace3>0) { yylp_errno=YYLP_MISS_BR3; } if(quote>0) { yylp_errno=YYLP_MISSQUOT; } /* printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);/**/ if(feof(yyin)) return 1; else return 0; } } void reinit_yylp() { brace1 = 0; brace2 = 0; brace3 = 0; quote = 0; yy_init=1; yy_delete_buffer(yy_current_buffer); } void make_version(char *p,int what) { char ver[10]; char date[16]; ver[0]='?'; ver[1]='.'; ver[2]='?'; ver[3]='\0'; date[0]='?'; date[1]='\0'; if(what) sscanf(p,"%*[^=]= %*s %*s %10s %16s",ver,date); else sscanf(p,"// %*s %*s %10s %16s",ver,date); strcpy(libnamebuf,"("); strcat(libnamebuf,ver); strcat(libnamebuf,","); strcat(libnamebuf,date); strcat(libnamebuf,")"); if(what && strcmp(libnamebuf, "(?.?,?)")==0) { sscanf(p,"%*[^\"]\"%[^\"]\"",libnamebuf); } //printf("ID=(%d)%s; \n", what, p); } void copy_string(lp_modes mode) { #ifdef STANDALONE_PARSER if ((texinfo_out && (last_cmd == LP_INFO || last_cmd == LP_CATEGORY)) || (category_out && last_cmd == LP_CATEGORY)) { long current_location = ftell(yylpin), i = string_start, quote = 0; char c; if (texinfo_out) { if (last_cmd == LP_INFO) { printf("$info = <0) text_buffer[i-offset] = text_buffer[i]; } } #endif /* STANDALONE_PARSER */ } void print_init() { printf("Init=%d\n", yy_init); } void print_version(lp_modes mode, char *p) { #ifdef STANDALONE_PARSER //printf("loading %s%s", p, libnamebuf); #else if ( mode == LOAD_LIB ) { if (BVERBOSE(V_LOAD_LIB) && p!=NULL ) Print(" %s...", p); //Warn( "loading %s%s", p, libnamebuf); } #endif } #ifdef STANDALONE_PARSER main( int argc, char *argv[] ) { lib_style_types lib_style; main_init(argc, argv); if(yyin == NULL) { fprintf(stderr, "No library found to parse.\n"); exit(1); } if (! (texinfo_out || category_out)) { if(lpverbose)printf("Verbose level=%d\n", lpverbose); if(check)printf("Reporting most possible annomalies.\n"); if(lpverbose||check)printf("\n"); printf( " %-15s %20s %s,%s %s,%s %s,%s\n", "Library", "function", "line", "start-eod", "line", "body-eob", "line", "example-eoe"); } #ifdef HAVE_NS yylplex(argv[0], argv[0], &lib_style,NULL); #else yylplex(argv[0], argv[0], &lib_style); #endif if(yylp_errno) { printf("ERROR occured: [%d] ", yylp_errno); printf(yylp_errlist[yylp_errno], yylplineno); printf("\n"); } else if(pi!=NULL) printpi(pi); if (texinfo_out) printf("1;"); exit(0); } #endif /* STANDALONE_PARSER */ #endif /* HAVE_LIBPARSE */