Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    rc1c1112 rf487962  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Wed Aug 24 13:27:04 2016
    13  * Update Count     : 487
     12 * Last Modified On : Thu Aug 18 22:17:30 2016
     13 * Update Count     : 472
    1414 */
    1515
     
    141141^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" {
    142142        /* " stop highlighting */
    143         static char filename[FILENAME_MAX];                                     // temporarily store current source-file name
     143        static char *filename[FILENAME_MAX];                            // temporarily store current source-file name
    144144        char *end_num;
    145145        char *begin_string, *end_string;
     
    156156                //std::cout << "file " << filename << " line " << lineno << std::endl;
    157157                yylineno = lineno;
    158                 yyfilename = filename;
     158                yyfilename = filename[0];
    159159        } // if
    160160}
     
    288288
    289289                                /* character constant, allows empty value */
    290 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new std::string( yytext, yyleng ); }
    291 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); }
    292 <QUOTE>['\n]    { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); }
     290({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); }
     291<QUOTE>[^'\\\n]* { *strtext += std::string( yytext ); }
     292<QUOTE>['\n]    { BEGIN 0; *strtext += std::string( yytext); RETURN_STR(CHARACTERconstant); }
    293293                                /* ' stop highlighting */
    294294
    295295                                /* string constant */
    296 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new std::string( yytext, yyleng ); }
    297 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); }
    298 <STRING>["\n]   { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); }
     296({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); }
     297<STRING>[^"\\\n]* { *strtext += std::string( yytext ); }
     298<STRING>["\n]   { BEGIN 0; *strtext += std::string( yytext ); RETURN_STR(STRINGliteral); }
    299299                                /* " stop highlighting */
    300300
    301301                                /* common character/string constant */
    302 <QUOTE,STRING>{escape_seq} { rm_underscore(); strtext->append( yytext, yyleng ); }
     302<QUOTE,STRING>{escape_seq} { rm_underscore(); *strtext += std::string( yytext ); }
    303303<QUOTE,STRING>"\\"{h_white}*"\n" {}                                             // continuation (ALSO HANDLED BY CPP)
    304 <QUOTE,STRING>"\\" { strtext->append( yytext, yyleng ); } // unknown escape character
     304<QUOTE,STRING>"\\" { *strtext += std::string( yytext ); } // unknown escape character
    305305
    306306                                /* punctuation */
Note: See TracChangeset for help on using the changeset viewer.