Changeset 4789 for trunk/licq/src/rtf.cc
- Timestamp:
- 11/26/06 18:07:07 (2 years ago)
- Files:
-
- 1 modified
-
trunk/licq/src/rtf.cc (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/licq/src/rtf.cc
r4526 r4789 15 15 #define yyrestart rtfrestart 16 16 #define yytext rtftext 17 #define yylineno rtflineno 17 18 #define yywrap rtfwrap 18 19 19 #line 2 0"rtf.cc"20 #line 21 "rtf.cc" 20 21 /* A lexical scanner generated by flex */ 21 22 22 23 /* Scanner skeleton version: 23 * $Header $24 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ 24 25 */ 25 26 … … 281 282 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 282 283 284 285 #define YY_USES_REJECT 283 286 typedef unsigned char YY_CHAR; 284 287 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 285 288 typedef int yy_state_type; 286 extern char *yytext; 287 #define yytext_ptr yytext 289 #define YY_FLEX_LEX_COMPAT 290 extern int yylineno; 291 int yylineno = 1; 292 extern char yytext[]; 293 288 294 289 295 static yy_state_type yy_get_previous_state YY_PROTO(( void )); … … 300 306 yy_hold_char = *yy_cp; \ 301 307 *yy_cp = '\0'; \ 308 if ( yyleng + yy_more_offset >= YYLMAX ) \ 309 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ 310 yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \ 311 yyleng += yy_more_offset; \ 312 yy_prev_more_offset = yy_more_offset; \ 313 yy_more_offset = 0; \ 302 314 yy_c_buf_p = yy_cp; 303 315 304 316 #define YY_NUM_RULES 10 305 317 #define YY_END_OF_BUFFER 11 306 static yyconst short int yy_acc ept[32] =318 static yyconst short int yy_acclist[33] = 307 319 { 0, 308 0, 0, 11, 8, 8, 9, 9, 1, 2, 8, 309 0, 0, 5, 3, 5, 0, 0, 5, 5, 5, 310 0, 6, 5, 7, 5, 5, 4, 5, 5, 5, 311 0 320 11, 8, 9, 10, 8, 10, 9, 10, 9, 10, 321 1, 9, 10, 2, 9, 10, 8, 5, 3, 5, 322 5, 5, 5, 6, 5, 7, 5, 5, 4, 5, 323 5, 5 324 } ; 325 326 static yyconst short int yy_accept[33] = 327 { 0, 328 1, 1, 1, 2, 5, 7, 9, 11, 14, 17, 329 18, 18, 18, 19, 20, 21, 21, 21, 22, 23, 330 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 331 33, 33 312 332 } ; 313 333 … … 390 410 } ; 391 411 392 static yy_state_type yy_last_accepting_state; 393 static char *yy_last_accepting_cpos; 394 395 /* The intent behind this definition is that it'll catch 396 * any uses of REJECT which flex missed. 397 */ 398 #define REJECT reject_used_but_not_detected 399 #define yymore() yymore_used_but_not_detected 412 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; 413 static char *yy_full_match; 414 static int yy_lp; 415 #define REJECT \ 416 { \ 417 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ 418 yy_cp = yy_full_match; /* restore poss. backed-over text */ \ 419 ++yy_lp; \ 420 goto find_rule; \ 421 } 422 static int yy_more_offset = 0; 423 static int yy_prev_more_offset = 0; 424 #define yymore() (yy_more_offset = yy_flex_strlen( yytext )) 425 #define YY_NEED_STRLEN 400 426 #define YY_MORE_ADJ 0 401 #define YY_RESTORE_YY_MORE_OFFSET 402 char *yytext; 427 #define YY_RESTORE_YY_MORE_OFFSET \ 428 { \ 429 yy_more_offset = yy_prev_more_offset; \ 430 yyleng -= yy_more_offset; \ 431 } 432 #ifndef YYLMAX 433 #define YYLMAX 8192 434 #endif 435 436 char yytext[YYLMAX]; 437 char *yytext_ptr; 403 438 #line 1 "rtf.ll" 404 439 #define INITIAL 0 … … 450 485 #define YY_NO_UNPUT 1 451 486 #define YY_STACK_USED 0 452 #line 4 53"rtf.cc"487 #line 488 "rtf.cc" 453 488 454 489 /* Macros after this point can all be overridden by user definitions in … … 604 639 605 640 606 #line 6 07"rtf.cc"641 #line 642 "rtf.cc" 607 642 608 643 if ( yy_init ) … … 643 678 644 679 yy_current_state = yy_start; 680 yy_state_ptr = yy_state_buf; 681 *yy_state_ptr++ = yy_current_state; 645 682 yy_match: 646 683 do 647 684 { 648 685 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 649 if ( yy_accept[yy_current_state] )650 {651 yy_last_accepting_state = yy_current_state;652 yy_last_accepting_cpos = yy_cp;653 }654 686 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 655 687 { … … 659 691 } 660 692 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 693 *yy_state_ptr++ = yy_current_state; 661 694 ++yy_cp; 662 695 } … … 664 697 665 698 yy_find_action: 666 yy_act = yy_accept[yy_current_state]; 667 if ( yy_act == 0 ) 668 { /* have to back up */ 669 yy_cp = yy_last_accepting_cpos; 670 yy_current_state = yy_last_accepting_state; 671 yy_act = yy_accept[yy_current_state]; 699 yy_current_state = *--yy_state_ptr; 700 yy_lp = yy_accept[yy_current_state]; 701 find_rule: /* we branch to this label when backing up */ 702 for ( ; ; ) /* until we find what rule we matched */ 703 { 704 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) 705 { 706 yy_act = yy_acclist[yy_lp]; 707 { 708 yy_full_match = yy_cp; 709 break; 710 } 711 } 712 --yy_cp; 713 yy_current_state = *--yy_state_ptr; 714 yy_lp = yy_accept[yy_current_state]; 672 715 } 673 716 674 717 YY_DO_BEFORE_ACTION; 675 718 719 if ( yy_act != YY_END_OF_BUFFER ) 720 { 721 int yyl; 722 for ( yyl = 0; yyl < yyleng; ++yyl ) 723 if ( yytext[yyl] == '\n' ) 724 ++yylineno; 725 } 676 726 677 727 do_action: /* This label is used only to access EOF actions. */ … … 680 730 switch ( yy_act ) 681 731 { /* beginning of action switch */ 682 case 0: /* must back up */683 /* undo the effects of YY_DO_BEFORE_ACTION */684 *yy_cp = yy_hold_char;685 yy_cp = yy_last_accepting_cpos;686 yy_current_state = yy_last_accepting_state;687 goto yy_find_action;688 689 732 case 1: 690 733 YY_RULE_SETUP … … 737 780 ECHO; 738 781 YY_BREAK 739 #line 7 40"rtf.cc"740 case YY_STATE_EOF(INITIAL):741 yyterminate();782 #line 783 "rtf.cc" 783 case YY_STATE_EOF(INITIAL): 784 yyterminate(); 742 785 743 786 case YY_END_OF_BUFFER: … … 1017 1060 1018 1061 yy_current_state = yy_start; 1062 yy_state_ptr = yy_state_buf; 1063 *yy_state_ptr++ = yy_current_state; 1019 1064 1020 1065 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1021 1066 { 1022 1067 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1023 if ( yy_accept[yy_current_state] )1024 {1025 yy_last_accepting_state = yy_current_state;1026 yy_last_accepting_cpos = yy_cp;1027 }1028 1068 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1029 1069 { … … 1033 1073 } 1034 1074 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1075 *yy_state_ptr++ = yy_current_state; 1035 1076 } 1036 1077 … … 1053 1094 { 1054 1095 register int yy_is_jam; 1055 register char *yy_cp = yy_c_buf_p;1056 1096 1057 1097 register YY_CHAR yy_c = 1; 1058 if ( yy_accept[yy_current_state] )1059 {1060 yy_last_accepting_state = yy_current_state;1061 yy_last_accepting_cpos = yy_cp;1062 }1063 1098 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1064 1099 { … … 1069 1104 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1070 1105 yy_is_jam = (yy_current_state == 31); 1106 if ( ! yy_is_jam ) 1107 *yy_state_ptr++ = yy_current_state; 1071 1108 1072 1109 return yy_is_jam ? 0 : yy_current_state; … … 1111 1148 *--yy_cp = (char) c; 1112 1149 1150 if ( c == '\n' ) 1151 --yylineno; 1113 1152 1114 1153 yytext_ptr = yy_bp; … … 1188 1227 yy_hold_char = *++yy_c_buf_p; 1189 1228 1229 if ( c == '\n' ) 1230 ++yylineno; 1190 1231 1191 1232 return c; … … 1738 1779 case TAG_FONT_COLOR: 1739 1780 if ((unsigned)t.param < (unsigned)colors.size()){ 1740 color &c = colors[t.param];1781 //color &c = colors[t.param]; 1741 1782 //PrintUnquoted("<font color=\"#%02X%02X%02X\">", c.red, c.green, c.blue); 1742 1783 }else{ … … 1748 1789 break; 1749 1790 case TAG_BG_COLOR:{ 1750 color &c = colors[t.param];1791 //color &c = colors[t.param]; 1751 1792 //PrintUnquoted("<span style=\"bgcolor:#%02X%02X%02X;\">", c.red, c.green, c.blue); 1752 1793 break; … … 2291 2332 case 0x0F: 2292 2333 PrintQuoted(":-D"); 2334 break; 2335 case 0x10: 2336 PrintQuoted("*STOP*"); 2337 break; 2338 case 0x14: 2339 PrintQuoted("*JOKINGLY*"); 2293 2340 break; 2294 2341 }
