Changeset 4789 for trunk/licq/src/rtf.cc

Show
Ignore:
Timestamp:
11/26/06 18:07:07 (2 years ago)
Author:
emostar
Message:

Show some new emoticons:
*JOKINGLY*
*STOP*

Fixes #1443.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/src/rtf.cc

    r4526 r4789  
    1515#define yyrestart rtfrestart 
    1616#define yytext rtftext 
     17#define yylineno rtflineno 
    1718#define yywrap rtfwrap 
    1819 
    19 #line 20 "rtf.cc" 
     20#line 21 "rtf.cc" 
    2021/* A lexical scanner generated by flex */ 
    2122 
    2223/* 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 $ 
    2425 */ 
    2526 
     
    281282#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 
    282283 
     284 
     285#define YY_USES_REJECT 
    283286typedef unsigned char YY_CHAR; 
    284287FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 
    285288typedef int yy_state_type; 
    286 extern char *yytext; 
    287 #define yytext_ptr yytext 
     289#define YY_FLEX_LEX_COMPAT 
     290extern int yylineno; 
     291int yylineno = 1; 
     292extern char yytext[]; 
     293 
    288294 
    289295static yy_state_type yy_get_previous_state YY_PROTO(( void )); 
     
    300306    yy_hold_char = *yy_cp; \ 
    301307    *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; \ 
    302314    yy_c_buf_p = yy_cp; 
    303315 
    304316#define YY_NUM_RULES 10 
    305317#define YY_END_OF_BUFFER 11 
    306 static yyconst short int yy_accept[32] = 
     318static yyconst short int yy_acclist[33] = 
    307319    {   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 
     326static 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 
    312332    } ; 
    313333 
     
    390410    } ; 
    391411 
    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 
     412static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; 
     413static char *yy_full_match; 
     414static int yy_lp; 
     415#define REJECT \ 
     416{ \ 
     417*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ 
     418yy_cp = yy_full_match; /* restore poss. backed-over text */ \ 
     419++yy_lp; \ 
     420goto find_rule; \ 
     421} 
     422static int yy_more_offset = 0; 
     423static int yy_prev_more_offset = 0; 
     424#define yymore() (yy_more_offset = yy_flex_strlen( yytext )) 
     425#define YY_NEED_STRLEN 
    400426#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 
     436char yytext[YYLMAX]; 
     437char *yytext_ptr; 
    403438#line 1 "rtf.ll" 
    404439#define INITIAL 0 
     
    450485#define YY_NO_UNPUT 1 
    451486#define YY_STACK_USED 0 
    452 #line 453 "rtf.cc" 
     487#line 488 "rtf.cc" 
    453488 
    454489/* Macros after this point can all be overridden by user definitions in 
     
    604639 
    605640 
    606 #line 607 "rtf.cc" 
     641#line 642 "rtf.cc" 
    607642 
    608643    if ( yy_init ) 
     
    643678 
    644679        yy_current_state = yy_start; 
     680        yy_state_ptr = yy_state_buf; 
     681        *yy_state_ptr++ = yy_current_state; 
    645682yy_match: 
    646683        do 
    647684            { 
    648685            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                 } 
    654686            while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 
    655687                { 
     
    659691                } 
    660692            yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 
     693            *yy_state_ptr++ = yy_current_state; 
    661694            ++yy_cp; 
    662695            } 
     
    664697 
    665698yy_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]; 
     701find_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]; 
    672715            } 
    673716 
    674717        YY_DO_BEFORE_ACTION; 
    675718 
     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            } 
    676726 
    677727do_action:  /* This label is used only to access EOF actions. */ 
     
    680730        switch ( yy_act ) 
    681731    { /* 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  
    689732case 1: 
    690733YY_RULE_SETUP 
     
    737780ECHO; 
    738781    YY_BREAK 
    739 #line 740 "rtf.cc" 
    740 case YY_STATE_EOF(INITIAL): 
    741     yyterminate(); 
     782#line 783 "rtf.cc" 
     783            case YY_STATE_EOF(INITIAL): 
     784                yyterminate(); 
    742785 
    743786    case YY_END_OF_BUFFER: 
     
    10171060 
    10181061    yy_current_state = yy_start; 
     1062    yy_state_ptr = yy_state_buf; 
     1063    *yy_state_ptr++ = yy_current_state; 
    10191064 
    10201065    for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 
    10211066        { 
    10221067        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             } 
    10281068        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 
    10291069            { 
     
    10331073            } 
    10341074        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 
     1075        *yy_state_ptr++ = yy_current_state; 
    10351076        } 
    10361077 
     
    10531094    { 
    10541095    register int yy_is_jam; 
    1055     register char *yy_cp = yy_c_buf_p; 
    10561096 
    10571097    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         } 
    10631098    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 
    10641099        { 
     
    10691104    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 
    10701105    yy_is_jam = (yy_current_state == 31); 
     1106    if ( ! yy_is_jam ) 
     1107        *yy_state_ptr++ = yy_current_state; 
    10711108 
    10721109    return yy_is_jam ? 0 : yy_current_state; 
     
    11111148    *--yy_cp = (char) c; 
    11121149 
     1150    if ( c == '\n' ) 
     1151        --yylineno; 
    11131152 
    11141153    yytext_ptr = yy_bp; 
     
    11881227    yy_hold_char = *++yy_c_buf_p; 
    11891228 
     1229    if ( c == '\n' ) 
     1230        ++yylineno; 
    11901231 
    11911232    return c; 
     
    17381779        case TAG_FONT_COLOR: 
    17391780            if ((unsigned)t.param < (unsigned)colors.size()){ 
    1740                 color &c = colors[t.param]; 
     1781                //color &c = colors[t.param]; 
    17411782                //PrintUnquoted("<font color=\"#%02X%02X%02X\">", c.red, c.green, c.blue); 
    17421783            }else{ 
     
    17481789            break; 
    17491790        case TAG_BG_COLOR:{ 
    1750                 color &c = colors[t.param]; 
     1791                //color &c = colors[t.param]; 
    17511792                //PrintUnquoted("<span style=\"bgcolor:#%02X%02X%02X;\">", c.red, c.green, c.blue); 
    17521793                break; 
     
    22912332                    case 0x0F: 
    22922333                        PrintQuoted(":-D"); 
     2334                        break; 
     2335                    case 0x10: 
     2336                        PrintQuoted("*STOP*"); 
     2337                        break; 
     2338                    case 0x14: 
     2339                        PrintQuoted("*JOKINGLY*"); 
    22932340                        break; 
    22942341                    }