/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh 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) #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 13 #define YY_END_OF_BUFFER 14 static yyconst short int yy_accept[501] = { 0, 0, 0, 0, 0, 14, 13, 13, 13, 12, 11, 12, 11, 11, 0, 0, 9, 9, 8, 10, 10, 10, 7, 0, 0, 0, 0, 10, 0, 10, 10, 10, 0, 0, 0, 6, 10, 10, 0, 0, 0, 10, 10, 0, 0, 0, 10, 0, 10, 0, 10, 10, 0, 0, 0, 10, 0, 0, 10, 10, 0, 10, 0, 0, 0, 0, 10, 0, 0, 0, 10, 10, 0, 10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 10, 10, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 10, 10, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 5, 4, 10, 10, 0, 10, 2, 0, 3, 2, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 3, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 10, 10, 0, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 4, 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 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 6, 1, 1, 7, 8, 9, 10, 11, 7, 7, 7, 12, 13, 1, 1, 1, 1, 1, 1, 1, 14, 14, 15, 16, 17, 14, 1, 1, 18, 1, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 24, 1, 1, 1, 1, 1, 1, 25, 1, 1, 26, 1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 33, 33, 36, 33, 33, 33, 37, 33, 38, 39, 40, 33, 33, 33, 33, 41, 33, 42, 1, 43, 44, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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[45] = { 0, 1, 2, 3, 1, 1, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 7, 1, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, 10, 1 } ; static yyconst short int yy_base[550] = { 0, 0, 1, 2, 4, 1345, 2259, 1312, 1318, 2259, 2259, 47, 1317, 2259, 1312, 0, 2259, 0, 2259, 89, 100, 1, 2259, 1306, 1304, 1298, 0, 2259, 0, 1331, 2, 76, 1306, 1299, 1288, 2259, 6, 8, 1290, 1291, 1290, 86, 129, 1286, 1286, 1267, 65, 1270, 1269, 167, 190, 210, 1262, 1250, 1252, 87, 1265, 9, 249, 1264, 1285, 269, 1247, 1244, 1267, 1250, 88, 1258, 94, 156, 1257, 308, 1278, 328, 1272, 1261, 0, 1245, 11, 1250, 95, 157, 179, 1249, 367, 1270, 387, 1262, 6, 1239, 0, 1243, 159, 169, 195, 196, 197, 1242, 426, 1263, 446, 1245, 4, 1199, 2, 1211, 186, 184, 202, 203, 204, 228, 229, 1210, 485, 1231, 505, 2259, 107, 1230, 1229, 1206, 194, 230, 253, 254, 211, 263, 264, 1205, 1204, 1203, 544, 1224, 564, 105, 2259, 1201, 245, 243, 261, 262, 267, 287, 288, 1200, 1199, 1198, 603, 1219, 623, 168, 1196, 251, 256, 312, 303, 311, 322, 323, 1195, 1192, 1191, 662, 1212, 682, 212, 1186, 306, 302, 319, 321, 326, 346, 347, 1185, 1183, 1182, 721, 1177, 741, 1159, 1151, 310, 315, 371, 362, 370, 381, 382, 1150, 1148, 1146, 780, 1167, 800, 371, 1144, 320, 363, 387, 379, 386, 405, 406, 1143, 1142, 1141, 839, 1162, 859, 165, 1139, 369, 407, 430, 431, 432, 440, 441, 1138, 1137, 1136, 898, 1154, 918, 429, 1131, 378, 423, 439, 443, 445, 464, 466, 1128, 1127, 1126, 957, 1147, 977, 441, 1124, 474, 465, 490, 491, 447, 500, 502, 1123, 1114, 1096, 1016, 1115, 1036, 217, 1092, 482, 483, 538, 498, 499, 525, 555, 1091, 1090, 1089, 1075, 1110, 1095, 513, 1087, 488, 534, 550, 551, 505, 561, 562, 1086, 1085, 1082, 1134, 1103, 1154, 563, 566, 570, 1080, 494, 546, 607, 596, 553, 616, 617, 1077, 1074, 1073, 1193, 1090, 1213, 664, 723, 1088, 618, 1034, 547, 598, 614, 615, 564, 624, 642, 1032, 1031, 1029, 1252, 1048, 1272, 782, 841, 642, 672, 1025, 606, 609, 667, 668, 622, 677, 678, 1024, 1023, 1022, 1311, 1043, 1331, 900, 918, 1018, 1077, 183, 1136, 693, 1002, 696, 733, 1019, 664, 669, 734, 715, 729, 680, 760, 976, 964, 915, 1370, 935, 1390, 960, 1154, 892, 1254, 754, 1390, 744, 907, 769, 725, 742, 784, 736, 795, 796, 903, 902, 896, 1431, 875, 1451, 1194, 824, 1313, 811, 771, 815, 870, 1433, 851, 730, 778, 777, 797, 793, 798, 841, 857, 679, 676, 674, 1490, 683, 1510, 1195, 600, 1510, 873, 587, 877, 929, 933, 540, 937, 578, 1515, 969, 504, 838, 787, 851, 860, 901, 900, 960, 496, 446, 436, 1556, 410, 1576, 1552, 2259, 1576, 242, 989, 362, 992, 988, 1581, 926, 375, 848, 949, 1027, 970, 904, 974, 1018, 328, 318, 269, 1030, 1037, 1622, 1331, 1518, 251, 1618, 1076, 90, 54, 0, 4, 0, 9, 5, 2259, 2259, 1372, 1635, 1677, 1035, 1451, 1640, 1644, 1085, 1393, 1719, 1647, 1086, 1623, 1670, 1700, 980, 1641, 1706, 1723, 982, 1651, 1713, 1734, 1710, 1742, 1583, 1765, 1729, 2259, 1808, 1818, 1824, 1830, 1834, 2, 1842, 1852, 1861, 1871, 1879, 1889, 1899, 1909, 1919, 1929, 1939, 1949, 1959, 1969, 1979, 1989, 1999, 2009, 2019, 2027, 2037, 2047, 2057, 2067, 2077, 2087, 2097, 2107, 2117, 2127, 2137, 2147, 2157, 2167, 2177, 2187, 2197, 2207, 2217, 2227, 2237, 2245, 2250 } ; static yyconst short int yy_def[550] = { 0, 501, 501, 502, 502, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 503, 500, 504, 504, 20, 500, 500, 500, 500, 505, 500, 506, 506, 20, 20, 500, 500, 500, 500, 20, 20, 500, 500, 500, 20, 500, 500, 500, 500, 20, 507, 507, 507, 507, 50, 500, 508, 500, 20, 509, 509, 509, 509, 58, 58, 500, 508, 510, 500, 20, 511, 511, 511, 511, 511, 71, 71, 500, 510, 510, 500, 20, 512, 512, 512, 512, 512, 512, 84, 84, 500, 510, 500, 506, 513, 513, 513, 513, 513, 513, 513, 513, 98, 98, 500, 510, 500, 506, 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, 114, 114, 500, 510, 500, 506, 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, 132, 132, 510, 500, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, 148, 148, 510, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 163, 163, 510, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 178, 178, 510, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 193, 193, 510, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 208, 208, 510, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 223, 223, 510, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 238, 238, 510, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 253, 253, 510, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 268, 268, 525, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 283, 283, 525, 527, 525, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 300, 300, 527, 527, 529, 525, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 318, 318, 531, 527, 532, 525, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 336, 336, 531, 534, 531, 531, 529, 527, 532, 535, 532, 525, 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 360, 360, 531, 534, 500, 531, 537, 527, 525, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, 381, 381, 534, 539, 531, 537, 539, 540, 541, 527, 525, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 404, 404, 534, 543, 531, 540, 544, 540, 541, 541, 543, 545, 529, 527, 525, 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, 431, 431, 534, 500, 531, 543, 545, 547, 545, 529, 527, 525, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 548, 548, 549, 534, 531, 500, 527, 525, 500, 500, 500, 500, 500, 500, 500, 500, 500, 534, 531, 527, 525, 534, 531, 527, 525, 534, 531, 527, 525, 534, 531, 527, 525, 534, 531, 527, 525, 534, 531, 527, 534, 531, 534, 531, 534, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 } ; static yyconst short int yy_nxt[2304] = { 0, 500, 500, 27, 10, 27, 10, 29, 471, 104, 466, 467, 470, 469, 120, 468, 500, 500, 76, 90, 88, 102, 76, 118, 76, 7, 7, 11, 31, 11, 19, 19, 24, 41, 68, 19, 36, 19, 42, 25, 19, 69, 8, 8, 12, 13, 12, 13, 16, 16, 16, 16, 17, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 19, 19, 19, 19, 19, 20, 19, 19, 19, 19, 21, 19, 19, 19, 19, 16, 16, 22, 27, 465, 19, 28, 29, 29, 29, 29, 29, 29, 29, 27, 55, 19, 28, 29, 29, 29, 29, 29, 29, 29, 37, 19, 19, 19, 66, 80, 92, 151, 464, 76, 46, 76, 81, 93, 78, 30, 47, 135, 48, 47, 47, 49, 50, 50, 50, 50, 50, 50, 50, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 47, 47, 47, 58, 58, 58, 58, 58, 58, 58, 80, 92, 76, 106, 166, 76, 323, 226, 95, 96, 107, 57, 59, 106, 82, 94, 58, 58, 58, 58, 58, 58, 58, 92, 109, 110, 111, 108, 122, 112, 122, 125, 126, 127, 57, 60, 128, 123, 138, 106, 106, 106, 124, 144, 367, 139, 122, 122, 122, 76, 129, 130, 181, 271, 76, 138, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 70, 122, 122, 138, 71, 71, 71, 71, 71, 71, 71, 141, 142, 143, 145, 146, 153, 140, 153, 156, 157, 158, 68, 72, 168, 154, 138, 138, 159, 168, 155, 169, 385, 435, 153, 153, 138, 138, 160, 161, 153, 385, 463, 170, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 83, 153, 153, 173, 84, 84, 84, 84, 84, 84, 84, 171, 172, 174, 175, 176, 183, 168, 186, 187, 183, 188, 80, 85, 198, 168, 168, 184, 189, 198, 185, 199, 463, 183, 213, 183, 168, 168, 190, 191, 183, 214, 463, 200, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 97, 183, 183, 203, 98, 98, 98, 98, 98, 98, 98, 201, 202, 204, 205, 206, 211, 198, 213, 76, 218, 88, 92, 99, 228, 198, 198, 216, 217, 219, 463, 229, 215, 243, 213, 460, 198, 198, 220, 221, 244, 213, 213, 444, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 113, 213, 213, 228, 114, 114, 114, 114, 114, 114, 114, 231, 232, 233, 235, 236, 234, 230, 76, 243, 246, 247, 106, 115, 241, 248, 228, 228, 228, 249, 76, 264, 445, 245, 256, 243, 228, 228, 250, 243, 251, 243, 445, 258, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 131, 243, 258, 243, 132, 132, 132, 132, 132, 132, 132, 258, 261, 262, 263, 265, 260, 266, 259, 273, 273, 278, 122, 133, 279, 290, 274, 258, 258, 287, 296, 308, 291, 445, 275, 273, 273, 258, 309, 258, 280, 445, 290, 288, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 147, 276, 277, 273, 148, 148, 148, 148, 148, 148, 148, 281, 290, 293, 294, 295, 273, 297, 298, 314, 287, 286, 138, 149, 308, 326, 292, 287, 290, 290, 332, 308, 327, 273, 288, 323, 435, 304, 310, 290, 290, 288, 326, 306, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 162, 313, 305, 305, 163, 163, 163, 163, 163, 163, 163, 311, 312, 315, 316, 308, 287, 326, 329, 330, 331, 333, 153, 164, 437, 350, 308, 324, 350, 356, 288, 328, 351, 326, 326, 308, 308, 435, 346, 334, 347, 350, 352, 326, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 177, 286, 326, 321, 178, 178, 178, 178, 178, 178, 178, 287, 353, 354, 355, 357, 358, 304, 378, 305, 343, 420, 168, 179, 371, 288, 348, 350, 350, 371, 346, 372, 347, 346, 421, 347, 421, 350, 350, 421, 371, 305, 305, 373, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 192, 286, 376, 321, 193, 193, 193, 193, 193, 193, 193, 305, 343, 287, 305, 343, 371, 304, 377, 322, 374, 375, 183, 194, 287, 400, 394, 288, 397, 398, 371, 421, 388, 369, 389, 371, 392, 394, 288, 379, 396, 305, 305, 394, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 207, 340, 371, 341, 208, 208, 208, 208, 208, 208, 208, 394, 399, 305, 390, 401, 402, 342, 395, 421, 421, 426, 198, 209, 424, 425, 394, 422, 427, 445, 388, 408, 389, 423, 411, 421, 412, 394, 394, 421, 421, 305, 343, 447, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 222, 286, 428, 321, 223, 223, 223, 223, 223, 223, 223, 305, 390, 287, 344, 305, 413, 304, 429, 448, 449, 445, 213, 224, 421, 408, 419, 288, 446, 450, 415, 463, 416, 411, 445, 412, 393, 411, 464, 412, 421, 305, 305, 445, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 237, 340, 452, 341, 238, 238, 238, 238, 238, 238, 238, 305, 417, 451, 305, 413, 469, 342, 305, 413, 394, 363, 228, 239, 445, 445, 394, 394, 463, 287, 415, 394, 416, 385, 415, 364, 416, 370, 439, 371, 440, 305, 343, 462, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 252, 365, 340, 453, 253, 253, 253, 253, 253, 253, 253, 367, 417, 287, 463, 305, 417, 470, 342, 305, 441, 468, 243, 254, 287, 445, 287, 288, 465, 371, 443, 439, 323, 440, 439, 463, 440, 491, 288, 463, 288, 371, 305, 343, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 267, 340, 471, 341, 268, 268, 268, 268, 268, 268, 268, 367, 305, 441, 27, 305, 441, 342, 466, 467, 287, 500, 258, 269, 463, 371, 365, 349, 350, 350, 350, 350, 325, 463, 288, 326, 463, 326, 326, 479, 326, 305, 343, 463, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 282, 340, 287, 341, 283, 283, 283, 283, 283, 283, 283, 287, 287, 475, 323, 307, 288, 342, 306, 366, 308, 308, 273, 284, 308, 288, 288, 308, 289, 290, 487, 483, 290, 290, 290, 272, 273, 273, 273, 273, 257, 305, 343, 258, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 299, 286, 258, 321, 300, 300, 300, 300, 300, 300, 300, 258, 258, 242, 243, 243, 243, 304, 368, 243, 227, 363, 290, 301, 228, 228, 228, 228, 212, 213, 213, 213, 213, 197, 198, 364, 198, 384, 198, 198, 196, 305, 305, 182, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 317, 365, 363, 363, 318, 318, 318, 318, 318, 318, 318, 183, 183, 407, 183, 183, 364, 364, 434, 167, 168, 168, 308, 319, 168, 168, 152, 153, 153, 153, 153, 137, 138, 138, 138, 138, 27, 136, 121, 122, 122, 365, 365, 119, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 335, 340, 117, 341, 336, 336, 336, 336, 336, 336, 336, 105, 106, 106, 386, 103, 101, 342, 91, 92, 92, 89, 326, 337, 76, 87, 79, 80, 80, 77, 76, 64, 74, 67, 68, 68, 65, 64, 62, 57, 57, 305, 343, 54, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 359, 340, 53, 341, 360, 360, 360, 360, 360, 360, 360, 52, 45, 44, 43, 40, 39, 342, 409, 38, 27, 363, 350, 361, 34, 33, 32, 23, 15, 15, 14, 500, 500, 472, 500, 364, 500, 500, 500, 500, 500, 305, 343, 500, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 380, 365, 500, 363, 381, 381, 381, 381, 381, 381, 381, 500, 500, 500, 500, 500, 476, 364, 500, 286, 500, 321, 371, 382, 363, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 304, 500, 500, 484, 500, 500, 391, 365, 500, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 305, 305, 403, 286, 365, 321, 404, 404, 404, 404, 404, 404, 404, 500, 500, 500, 500, 418, 500, 304, 500, 500, 500, 363, 394, 405, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 364, 500, 500, 480, 500, 500, 305, 305, 500, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 430, 365, 500, 500, 431, 431, 431, 431, 431, 431, 431, 500, 500, 500, 500, 500, 500, 500, 500, 340, 500, 341, 421, 432, 286, 500, 321, 340, 500, 341, 500, 500, 500, 500, 500, 342, 500, 500, 500, 442, 304, 436, 473, 342, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 305, 343, 500, 500, 363, 305, 305, 454, 305, 343, 500, 455, 455, 455, 455, 455, 455, 455, 364, 500, 500, 500, 500, 500, 458, 500, 340, 500, 341, 445, 456, 286, 500, 321, 500, 363, 500, 500, 500, 500, 459, 500, 342, 365, 500, 500, 500, 304, 499, 364, 461, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, 305, 343, 286, 500, 321, 305, 305, 27, 365, 363, 28, 29, 29, 29, 29, 29, 29, 29, 474, 340, 488, 341, 500, 364, 340, 384, 341, 363, 286, 463, 321, 286, 500, 321, 500, 342, 500, 363, 477, 500, 481, 364, 305, 305, 304, 500, 492, 304, 365, 482, 500, 364, 500, 486, 340, 500, 341, 495, 500, 305, 343, 286, 500, 321, 305, 343, 365, 500, 305, 305, 342, 305, 305, 500, 478, 489, 365, 304, 500, 322, 500, 500, 500, 500, 286, 500, 321, 500, 500, 500, 340, 500, 341, 500, 305, 343, 363, 340, 500, 341, 304, 305, 305, 340, 490, 341, 342, 286, 500, 321, 364, 500, 493, 342, 497, 363, 485, 496, 286, 342, 321, 366, 494, 304, 305, 305, 340, 500, 341, 364, 305, 343, 500, 500, 304, 365, 500, 305, 343, 500, 500, 498, 342, 305, 343, 500, 500, 305, 305, 340, 500, 341, 500, 500, 365, 500, 500, 500, 305, 305, 500, 500, 500, 500, 500, 342, 305, 343, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 305, 343, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 26, 26, 500, 26, 19, 19, 19, 500, 500, 19, 35, 35, 500, 35, 56, 500, 56, 56, 56, 56, 56, 56, 56, 56, 63, 63, 63, 63, 63, 63, 63, 63, 63, 67, 500, 67, 67, 67, 67, 67, 67, 67, 67, 75, 75, 75, 75, 75, 75, 75, 75, 79, 500, 79, 79, 79, 79, 79, 79, 79, 79, 91, 500, 91, 91, 91, 91, 91, 91, 91, 91, 105, 500, 105, 105, 105, 105, 105, 105, 105, 105, 121, 500, 121, 121, 121, 121, 121, 121, 121, 121, 137, 500, 137, 137, 137, 137, 137, 137, 137, 137, 152, 500, 152, 152, 152, 152, 152, 152, 152, 152, 167, 500, 167, 167, 167, 167, 167, 167, 167, 167, 182, 500, 182, 182, 182, 182, 182, 182, 182, 182, 197, 500, 197, 197, 197, 197, 197, 197, 197, 197, 212, 500, 212, 212, 212, 212, 212, 212, 212, 212, 227, 500, 227, 227, 227, 227, 227, 227, 227, 227, 242, 500, 242, 242, 242, 242, 242, 242, 242, 242, 257, 500, 257, 257, 257, 257, 257, 257, 257, 257, 272, 500, 272, 272, 272, 272, 272, 272, 272, 272, 286, 286, 286, 286, 286, 286, 286, 286, 289, 500, 289, 289, 289, 289, 289, 289, 289, 289, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 307, 500, 307, 307, 307, 307, 307, 307, 307, 307, 305, 500, 305, 305, 305, 305, 305, 305, 305, 305, 325, 500, 325, 325, 325, 325, 325, 325, 325, 325, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, 349, 500, 349, 349, 349, 349, 349, 349, 349, 349, 340, 340, 340, 340, 340, 340, 340, 340, 500, 340, 346, 346, 346, 346, 346, 346, 346, 346, 500, 346, 370, 500, 370, 370, 370, 370, 370, 370, 370, 370, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 393, 500, 393, 393, 393, 393, 393, 393, 393, 393, 388, 388, 388, 388, 388, 388, 388, 388, 500, 388, 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, 420, 500, 420, 420, 420, 420, 420, 420, 420, 420, 415, 415, 415, 415, 415, 415, 415, 415, 500, 415, 411, 411, 411, 411, 411, 411, 411, 411, 500, 411, 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, 444, 500, 444, 444, 444, 444, 444, 444, 444, 444, 439, 439, 439, 439, 439, 439, 439, 439, 500, 439, 29, 500, 29, 500, 29, 19, 19, 19, 500, 19, 19, 5, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 } ; static yyconst short int yy_chk[2304] = { 0, 0, 0, 90, 3, 104, 4, 506, 469, 90, 465, 465, 468, 467, 104, 466, 0, 0, 76, 78, 76, 88, 102, 102, 88, 1, 2, 3, 21, 4, 21, 30, 15, 36, 57, 36, 30, 37, 37, 15, 78, 57, 1, 2, 3, 3, 4, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 19, 464, 46, 19, 19, 19, 19, 19, 19, 19, 19, 20, 46, 31, 20, 20, 20, 20, 20, 20, 20, 20, 31, 41, 55, 66, 55, 68, 80, 135, 463, 135, 41, 118, 68, 80, 66, 20, 42, 118, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 49, 49, 49, 49, 49, 49, 49, 69, 81, 211, 92, 151, 151, 343, 211, 82, 82, 92, 49, 50, 93, 69, 81, 50, 50, 50, 50, 50, 50, 50, 82, 94, 94, 95, 93, 107, 96, 106, 108, 108, 109, 50, 51, 110, 106, 122, 94, 95, 96, 107, 126, 343, 122, 108, 109, 110, 166, 111, 112, 166, 256, 256, 126, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 58, 111, 112, 123, 58, 58, 58, 58, 58, 58, 58, 124, 124, 125, 127, 128, 139, 123, 138, 140, 140, 141, 58, 61, 153, 138, 124, 125, 142, 154, 139, 153, 437, 437, 140, 141, 127, 128, 143, 144, 142, 460, 454, 154, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 71, 143, 144, 156, 71, 71, 71, 71, 71, 71, 71, 155, 155, 157, 158, 159, 169, 156, 170, 170, 168, 171, 71, 73, 183, 157, 155, 168, 172, 184, 169, 183, 453, 170, 198, 171, 158, 159, 173, 174, 172, 198, 452, 184, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 84, 173, 174, 186, 84, 84, 84, 84, 84, 84, 84, 185, 185, 187, 188, 189, 196, 186, 199, 196, 201, 196, 84, 86, 213, 187, 185, 200, 200, 202, 444, 213, 199, 228, 201, 439, 188, 189, 203, 204, 228, 202, 200, 432, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 98, 203, 204, 214, 98, 98, 98, 98, 98, 98, 98, 215, 215, 216, 218, 219, 217, 214, 226, 229, 230, 230, 98, 100, 226, 231, 215, 216, 217, 232, 241, 247, 430, 229, 241, 230, 218, 219, 233, 231, 234, 232, 429, 247, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 114, 233, 244, 234, 114, 114, 114, 114, 114, 114, 114, 243, 245, 245, 246, 248, 244, 249, 243, 258, 259, 261, 114, 116, 262, 273, 258, 245, 246, 271, 277, 290, 273, 428, 259, 261, 262, 248, 290, 249, 263, 420, 277, 271, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 132, 260, 260, 263, 132, 132, 132, 132, 132, 132, 132, 264, 274, 275, 275, 276, 260, 278, 279, 294, 286, 287, 132, 134, 291, 308, 274, 288, 275, 276, 312, 294, 308, 264, 286, 417, 415, 287, 291, 278, 279, 288, 312, 288, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 148, 293, 287, 287, 148, 148, 148, 148, 148, 148, 148, 292, 292, 295, 296, 293, 306, 309, 310, 310, 311, 313, 148, 150, 411, 326, 292, 306, 327, 330, 306, 309, 326, 310, 311, 295, 296, 408, 323, 314, 323, 330, 327, 313, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 163, 303, 314, 303, 163, 163, 163, 163, 163, 163, 163, 324, 328, 328, 329, 331, 332, 303, 355, 323, 323, 405, 163, 165, 350, 324, 324, 328, 329, 351, 345, 350, 345, 347, 403, 347, 402, 331, 332, 401, 355, 303, 303, 351, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 178, 304, 353, 304, 178, 178, 178, 178, 178, 178, 178, 345, 345, 348, 347, 347, 353, 304, 354, 304, 352, 352, 178, 180, 369, 375, 372, 348, 373, 373, 354, 393, 367, 348, 367, 352, 369, 375, 369, 356, 372, 304, 304, 373, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 193, 321, 356, 321, 193, 193, 193, 193, 193, 193, 193, 371, 374, 367, 367, 376, 377, 321, 371, 395, 394, 397, 193, 195, 396, 396, 374, 394, 398, 422, 387, 388, 387, 395, 389, 397, 389, 376, 377, 396, 398, 321, 321, 422, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 208, 322, 399, 322, 208, 208, 208, 208, 208, 208, 208, 387, 387, 392, 322, 389, 389, 322, 400, 423, 423, 421, 208, 210, 399, 385, 392, 392, 421, 424, 390, 445, 390, 410, 423, 410, 382, 412, 445, 412, 400, 322, 322, 424, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 223, 339, 426, 339, 223, 223, 223, 223, 223, 223, 223, 390, 390, 425, 410, 410, 449, 339, 412, 412, 380, 340, 223, 225, 426, 425, 379, 378, 449, 443, 413, 370, 413, 365, 414, 340, 414, 361, 416, 359, 416, 339, 339, 443, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 238, 340, 363, 427, 238, 238, 238, 238, 238, 238, 238, 413, 413, 419, 446, 414, 414, 450, 363, 416, 416, 448, 238, 240, 487, 427, 491, 419, 446, 358, 419, 438, 441, 438, 440, 448, 440, 487, 487, 450, 491, 357, 363, 363, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 253, 341, 451, 341, 253, 253, 253, 253, 253, 253, 253, 441, 438, 438, 455, 440, 440, 341, 447, 447, 475, 456, 253, 255, 451, 349, 346, 337, 335, 334, 333, 325, 319, 447, 475, 317, 455, 316, 315, 475, 307, 341, 341, 456, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 268, 342, 462, 342, 268, 268, 268, 268, 268, 268, 268, 479, 483, 462, 305, 301, 462, 342, 462, 342, 299, 298, 268, 270, 297, 479, 483, 289, 284, 282, 483, 479, 281, 280, 272, 269, 267, 266, 265, 257, 254, 342, 342, 252, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 283, 344, 251, 344, 283, 283, 283, 283, 283, 283, 283, 250, 242, 239, 237, 236, 235, 344, 344, 227, 224, 364, 283, 285, 222, 221, 220, 212, 209, 207, 206, 205, 197, 194, 192, 364, 191, 364, 190, 182, 181, 344, 344, 179, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 300, 364, 384, 407, 300, 300, 300, 300, 300, 300, 300, 177, 176, 384, 175, 167, 384, 407, 407, 164, 162, 161, 300, 302, 160, 152, 149, 147, 146, 145, 137, 133, 131, 130, 129, 121, 120, 119, 115, 113, 105, 384, 407, 103, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, 318, 366, 101, 366, 318, 318, 318, 318, 318, 318, 318, 99, 97, 91, 366, 89, 87, 366, 85, 83, 79, 77, 318, 320, 75, 74, 72, 70, 67, 65, 64, 63, 62, 60, 59, 56, 54, 53, 52, 48, 47, 366, 366, 45, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 336, 386, 44, 386, 336, 336, 336, 336, 336, 336, 336, 43, 40, 39, 38, 34, 33, 386, 386, 32, 29, 458, 336, 338, 25, 24, 23, 14, 12, 8, 7, 5, 0, 458, 0, 458, 0, 0, 0, 0, 0, 386, 386, 0, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 360, 458, 0, 472, 360, 360, 360, 360, 360, 360, 360, 0, 0, 0, 0, 0, 472, 472, 0, 368, 0, 368, 360, 362, 480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 0, 0, 480, 0, 0, 368, 472, 0, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 368, 368, 381, 391, 480, 391, 381, 381, 381, 381, 381, 381, 381, 0, 0, 0, 0, 391, 0, 391, 0, 0, 0, 476, 381, 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 476, 0, 0, 476, 0, 0, 391, 391, 0, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 404, 476, 0, 0, 404, 404, 404, 404, 404, 404, 404, 0, 0, 0, 0, 0, 0, 0, 0, 409, 0, 409, 404, 406, 418, 0, 418, 459, 0, 459, 0, 0, 0, 0, 0, 409, 0, 0, 0, 418, 418, 409, 459, 459, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 409, 409, 0, 0, 434, 418, 418, 431, 459, 459, 0, 431, 431, 431, 431, 431, 431, 431, 434, 0, 0, 0, 0, 0, 434, 0, 436, 0, 436, 431, 433, 442, 0, 442, 0, 497, 0, 0, 0, 0, 436, 0, 436, 434, 0, 0, 0, 442, 497, 497, 442, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 436, 436, 461, 0, 461, 442, 442, 457, 497, 484, 457, 457, 457, 457, 457, 457, 457, 457, 461, 473, 484, 473, 0, 484, 477, 484, 477, 488, 478, 457, 478, 482, 0, 482, 0, 473, 0, 492, 473, 0, 477, 488, 461, 461, 478, 0, 488, 482, 484, 478, 0, 492, 0, 482, 485, 0, 485, 492, 0, 473, 473, 474, 0, 474, 477, 477, 488, 0, 478, 478, 485, 482, 482, 0, 474, 485, 492, 474, 0, 474, 0, 0, 0, 0, 486, 0, 486, 0, 0, 0, 489, 0, 489, 0, 485, 485, 495, 493, 0, 493, 486, 474, 474, 481, 486, 481, 489, 490, 0, 490, 495, 0, 489, 493, 495, 499, 481, 493, 494, 481, 494, 481, 490, 490, 486, 486, 496, 0, 496, 499, 489, 489, 0, 0, 494, 495, 0, 493, 493, 0, 0, 496, 496, 481, 481, 0, 0, 490, 490, 498, 0, 498, 0, 0, 499, 0, 0, 0, 494, 494, 0, 0, 0, 0, 0, 498, 496, 496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 498, 498, 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 503, 503, 0, 503, 504, 504, 504, 0, 0, 504, 505, 505, 0, 505, 507, 0, 507, 507, 507, 507, 507, 507, 507, 507, 508, 508, 508, 508, 508, 508, 508, 508, 508, 509, 0, 509, 509, 509, 509, 509, 509, 509, 509, 510, 510, 510, 510, 510, 510, 510, 510, 511, 0, 511, 511, 511, 511, 511, 511, 511, 511, 512, 0, 512, 512, 512, 512, 512, 512, 512, 512, 513, 0, 513, 513, 513, 513, 513, 513, 513, 513, 514, 0, 514, 514, 514, 514, 514, 514, 514, 514, 515, 0, 515, 515, 515, 515, 515, 515, 515, 515, 516, 0, 516, 516, 516, 516, 516, 516, 516, 516, 517, 0, 517, 517, 517, 517, 517, 517, 517, 517, 518, 0, 518, 518, 518, 518, 518, 518, 518, 518, 519, 0, 519, 519, 519, 519, 519, 519, 519, 519, 520, 0, 520, 520, 520, 520, 520, 520, 520, 520, 521, 0, 521, 521, 521, 521, 521, 521, 521, 521, 522, 0, 522, 522, 522, 522, 522, 522, 522, 522, 523, 0, 523, 523, 523, 523, 523, 523, 523, 523, 524, 0, 524, 524, 524, 524, 524, 524, 524, 524, 525, 525, 525, 525, 525, 525, 525, 525, 526, 0, 526, 526, 526, 526, 526, 526, 526, 526, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 528, 0, 528, 528, 528, 528, 528, 528, 528, 528, 529, 0, 529, 529, 529, 529, 529, 529, 529, 529, 530, 0, 530, 530, 530, 530, 530, 530, 530, 530, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 533, 0, 533, 533, 533, 533, 533, 533, 533, 533, 534, 534, 534, 534, 534, 534, 534, 534, 0, 534, 535, 535, 535, 535, 535, 535, 535, 535, 0, 535, 536, 0, 536, 536, 536, 536, 536, 536, 536, 536, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 538, 0, 538, 538, 538, 538, 538, 538, 538, 538, 539, 539, 539, 539, 539, 539, 539, 539, 0, 539, 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 542, 0, 542, 542, 542, 542, 542, 542, 542, 542, 543, 543, 543, 543, 543, 543, 543, 543, 0, 543, 544, 544, 544, 544, 544, 544, 544, 544, 0, 544, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 546, 0, 546, 546, 546, 546, 546, 546, 546, 546, 547, 547, 547, 547, 547, 547, 547, 547, 0, 547, 548, 0, 548, 0, 548, 549, 549, 549, 0, 549, 549, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 } ; 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 "fixrtf.l" #define INITIAL 0 #line 2 "fixrtf.l" /*- * Copyright (c) 2005, 2006 intron . All rights reserved. * Copyright (c) 2005, 2006 The FreeBSD Simplified Chinese Project. * All rights reserved. * * This code is derived from software contributed to The FreeBSD Simplified * Chinese Project by intron. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 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. * * From CNPROJ: doc/zh_CN.GB2312/share/mk/fixrtf.lex,v 1.1.1000.20 2006/02/19 10:21:40 intron Exp */ #include __FBSDID("$FreeBSD: ports/textproc/fixrtf/src/fixrtf.l,v 1.1 2006/03/16 07:50:15 delphij Exp $"); #include #include #include #include #include #include #include #include #include /* * This program is used to fix RTF: * 1. Embed PNGs into RTF. * 2. Embed FreeBSD-specific information into RTF, such as organization name, * building time. But unfortunately, so far only Microsoft Word can read * them. In contrast, Microsoft Word Viewer and OpenOffice even cannot read * this kind of information from RTF created by Microsoft Word and * OpenOffice. (Option: -i) * 3. Do some locale-specific fixing. (Option: -e ) * * See also Rich Text Format (RTF) Specification: * 1. Version 1.8 (Microsoft Word 2003) * http://www.microsoft.com/downloads/details.aspx?familyid=ac57de32-17f0-4b46-9e4e-467ef9bc5540&displaylang=en * 2. Version 1.7 (Microsoft Word 2002) * http://support.microsoft.com/kb/q86999/ * 3. Version 1.6 (Microsoft Word 2000) * http://msdn.microsoft.com/library/en-us/dnrtfspec/html/rtfspec.asp */ int embedpng_enable=0; /* See also http://msdn.microsoft.com/library/en-us/intl/unicode_81rn.asp */ #define ENCODING_UNKNOWN 0 #define ENCODING_GB2312 936 #define ENCODING_GB18030 54936 #define ENCODING_BIG5 950 int encoding=ENCODING_UNKNOWN; int fetchinfo_enable=0; /* FALSE */ #define MY_BUFFER_SIZE 3072 #define MY_BUFFER_LIMIT 2048 /* MY_BUFFER_LIMIT is smaller MY_BUFFER_SIZE, reserving some redundance. */ /* * "mybuffer" is used to cache RTF stream * while fetching book/article information. */ size_t mybufferlength=0; char mybuffer[MY_BUFFER_SIZE]; #define INFO_TITLE 0 #define INFO_AUTHOR 1 /* To store fetched book/article information */ struct { size_t length; char text[MY_BUFFER_SIZE]; } *pinfobuf=NULL,infobuf[]= { {0,""}, {0,""} }; /* * See also the section "Pictures" in RTF specification. */ void embedpng(char *field) { char *p1,*p2,fn[PATH_MAX]; unsigned char buf[256]; FILE *fp; int l,i,nret; png_structp png_ptr; png_infop info_ptr,end_info; png_uint_32 width,height; p1=strcasestr(field,"INCLUDEPICTURE"); p1=strchr(p1+14,'"'); /* String after "INCLUDEPICTURE" */ p2=strchr(p1+1,'"'); l=p2-(p1+1); /* Substantial length of file name */ if(l>sizeof(fn)-1) { warnx("*** Buffer Overflow Attack Detected !!! ***"); exit(1); } memcpy(fn,p1+1,l); fn[l]=0; if(l<4) /* It should be longer than ".png". */ { warnx("File name '%s' is too short!",fn); goto embedpng_exit_1; } if(strcasecmp(fn+(l-4),".png")!=0) { warnx("File name '%s' has not a suffix '.png'. Keep untouched.",fn); goto embedpng_exit_1; } if((fp=fopen(fn,"rb"))==NULL) { warnx("Failed to open '%s'!",fn); goto embedpng_exit_1; } fread(buf,1,8,fp); if (png_sig_cmp(buf,0,8)) { warnx("The file '%s' is NOT in PNG format!",fn); goto embedpng_exit_2; } png_ptr=png_create_read_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); if (!png_ptr) { warnx("Unable to create PNG read struct(*png_ptr)!"); goto embedpng_exit_2; } info_ptr=png_create_info_struct(png_ptr); if (!info_ptr) { warnx("Unable to create PNG info struct(*info_ptr)!"); png_destroy_read_struct(&png_ptr,(png_infopp)NULL,(png_infopp)NULL); goto embedpng_exit_2; } end_info=png_create_info_struct(png_ptr); if(!end_info) { warnx("Unable to create PNG info struct(*end_info)!"); png_destroy_read_struct(&png_ptr,&info_ptr,(png_infopp)NULL); goto embedpng_exit_2; } if (setjmp(png_jmpbuf(png_ptr))) { warnx("LibPNG crashed!"); png_destroy_read_struct(&png_ptr,&info_ptr,&end_info); goto embedpng_exit_2; } rewind(fp); png_init_io(png_ptr,fp); png_read_info(png_ptr,info_ptr); width=png_get_image_width(png_ptr,info_ptr); height=png_get_image_height(png_ptr,info_ptr); if(width>1024 || height>768) warnx("Picture is too large!"); /* * According to Microsoft's RTF specification, \picwN and \pichN is * mandatory for \pict group. Actually, in both Microsoft Word Viewer * and OpenOffice, these two control words take no effect for PNG. */ printf("{\\pict\\pngblip\\picscalex100\\picscaley100\\picw%u\\pich%u", (unsigned int)width,(unsigned int)height); rewind(fp); while((nret=fread(buf,1,64,fp))>0) { printf("\n"); for(i=0;i %s",fcharset,s); return; } /* * (init|addto|flush)mybuffer maintain buffer to cache RTF stream * while fetching book/article information. */ void initmybuffer() { int i; mybufferlength=0; for(i=0;iMY_BUFFER_LIMIT) return -1; /* warnx("_%s_",yytext); */ memcpy(mybuffer+mybufferlength,text,leng); mybufferlength+=leng; /* No terminator '\0' */ return 0; } void flushmybuffer() { fwrite(mybuffer,1,mybufferlength,yyout); mybufferlength=0; } #define ADDTOBUF { \ if(addtomybuffer(yytext,yyleng)) \ { \ haltfetch(); \ ECHO; \ BEGIN(0); \ warnx("Had been fetching book/article information until buffer was full!"); \ YY_BREAK; \ } \ } /* Collect book/article information RTF sequence */ void collectinfo(char *text, size_t leng) { assert(pinfobuf!=NULL); if(pinfobuf->length+leng>=MY_BUFFER_LIMIT) /* Consider terminator '\0' */ { warnx("*** Too long text for title or author !!! ***"); warnx("*** Buffer Overflow Attack To Be Considered !!! ***"); return; /* Information item buffer is full. */ } memcpy(pinfobuf->text+pinfobuf->length,text,leng); pinfobuf->length+=leng; pinfobuf->text[pinfobuf->length]=0; } /* Identify a RTF control word */ int identifyctrlword(char *text, size_t leng, char *key) { if(text[leng-1]==' ') { /* Tailed by a space as delimiter */ if(strlen(key)!=leng-1) return 0; return !strncmp(text,key,leng-1); } return !strcmp(text,key); } /* * Output fetch book/article information. * See also the section "Information Group" in RTF specification. */ void outputinfo() { time_t t; char buf[128]; printf("{\\info\\uc0"); printf("{\\title %s}{\\author %s}", infobuf[INFO_TITLE].text,infobuf[INFO_AUTHOR].text); time(&t); strftime(buf,sizeof(buf),"\\yr%Y\\mo%m\\dy%d\\hr%H\\min%M\\sec%S",localtime(&t)); printf("{\\creatim%s}",buf); printf("}"); } void haltfetch() { warnx("Title: %s",infobuf[INFO_TITLE].text); warnx("Author: %s",infobuf[INFO_AUTHOR].text); outputinfo(); flushmybuffer(); } #define fetchinfo 1 /* 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 \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 367 "fixrtf.l" 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_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 >= 501 ) 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] != 2259 ); 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 369 "fixrtf.l" { /* * Substitute RTF \pict group for RTF field group. * An example generated by Jade/OpenJade: * {\field\flddirty{\*\fldinst INCLUDEPICTURE "sockets/layers.png" }{\fldrslt }} */ if(embedpng_enable) embedpng(yytext); else { ECHO; } } YY_BREAK case 2: YY_RULE_SETUP #line 378 "fixrtf.l" { /* * Jade/OpenJade mis-mark Chinese as Shift-JIS encoded Japanese. * This may cause RTF viewer to display Chinese with Japanese font. */ if(encoding!=ENCODING_UNKNOWN) modifycharset(yytext); else { ECHO; } } YY_BREAK case 3: YY_RULE_SETUP #line 387 "fixrtf.l" { /* Insert book/article information just before style sheet. */ if(fetchinfo_enable) { /* Begin fetching book/article information. */ initmybuffer(); BEGIN(fetchinfo); fetchinfo_enable=0; /* FALSE, one-off */ ADDTOBUF; } else { ECHO; } } YY_BREAK case 4: YY_RULE_SETUP #line 401 "fixrtf.l" { /* Beginning of title, hacked by font size. */ ADDTOBUF; pinfobuf=&(infobuf[INFO_TITLE]); if(pinfobuf->length>0) collectinfo(", ",2); /* Duplicated */ } YY_BREAK case 5: YY_RULE_SETUP #line 407 "fixrtf.l" { /* Beginning of author, hacked by font size. */ ADDTOBUF; pinfobuf=&(infobuf[INFO_AUTHOR]); if(pinfobuf->length>0) collectinfo(", ",2); /* Duplicated */ } YY_BREAK case 6: YY_RULE_SETUP #line 413 "fixrtf.l" { /* A hexadecimal value, ignore. */ ADDTOBUF; } YY_BREAK case 7: YY_RULE_SETUP #line 417 "fixrtf.l" { /* Nonbreaking space, a control symbol, collect */ ADDTOBUF; if(pinfobuf!=NULL) collectinfo(" ",1); } YY_BREAK case 8: YY_RULE_SETUP #line 422 "fixrtf.l" { /* Optional/nonbreaking hyphen, a control symbol, collect */ ADDTOBUF; if(pinfobuf!=NULL) collectinfo("-",1); } YY_BREAK case 9: YY_RULE_SETUP #line 427 "fixrtf.l" { /* Other control symbols, ignore */ ADDTOBUF; } YY_BREAK case 10: YY_RULE_SETUP #line 431 "fixrtf.l" { /* Control word */ ADDTOBUF; if(identifyctrlword(yytext,yyleng,"\\keepn")) { /* End of title or author, actually a hack */ pinfobuf=NULL; } else if(yytext[0]=='\\' && yytext[1]=='u' && ((yytext[2]>='0' && yytext[2]<='9') || yytext[2]=='-') ) { /* Unicode Character, collect */ if(pinfobuf!=NULL) { collectinfo(yytext,yyleng); if(yytext[yyleng-1]!=' ') collectinfo(" ",1); } } else if(identifyctrlword(yytext,yyleng,"\\page")) { /* Accomplished !!! */ haltfetch(); BEGIN(0); } } YY_BREAK case 11: YY_RULE_SETUP #line 454 "fixrtf.l" { /* Ignore */ ADDTOBUF; } YY_BREAK case 12: YY_RULE_SETUP #line 458 "fixrtf.l" { /* Collect */ ADDTOBUF; if(pinfobuf!=NULL) collectinfo(yytext,yyleng); } YY_BREAK case 13: YY_RULE_SETUP #line 463 "fixrtf.l" ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(fetchinfo): 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; 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 >= 501 ) 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 >= 501 ) 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 == 500); 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; 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 463 "fixrtf.l" void printusage() { fprintf(stderr, "Usage: fixrtf [-e encoding] [-i] [-p] < inputfile > outputfile\n" " Fix RTF file generated by Jade/OpenJade.\n" "Options:\n" " -e encoding\n" " Specify encoding to do specific fixing. (GB2312|BIG5)\n" " -i\n" " Fill RTF file information, such as title and author,\n" " hacked from RTF file generated by Jade/OpenJade.\n" " -p\n" " Embed linked PNG images into RTF file.\n" ); } int main(int argc, char *argv[]) { int ch; if(argc<=1) { warnx("You should indicate at least one kind of fixing."); printusage(); return 1; } while ((ch = getopt(argc, argv, "e:ip")) != -1) { switch (ch) { case 'e': if(strcasecmp(optarg,"GB2312")==0 || strcasecmp(optarg,"GBK")==0) { encoding=ENCODING_GB2312; } else if(strcasecmp(optarg,"GB18030")==0) { encoding=ENCODING_GB18030; } else if(strcasecmp(optarg,"BIG5")==0) { encoding=ENCODING_BIG5; } break; case 'i': fetchinfo_enable=1; /* One-off */ break; case 'p': embedpng_enable=1; break; default: printusage(); return 1; break; } } yylex(); return 0; }