Changeset c1c1112 for src/Parser/lex.ll
- Timestamp:
- Aug 25, 2016, 9:14:06 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4e2b9710
- Parents:
- 2acf5fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r2acf5fc rc1c1112 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Thu Aug 18 22:17:30201613 * Update Count : 4 7212 * Last Modified On : Wed Aug 24 13:27:04 2016 13 * Update Count : 487 14 14 */ 15 15 … … 141 141 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 142 142 /* " stop highlighting */ 143 static char *filename[FILENAME_MAX];// temporarily store current source-file name143 static char filename[FILENAME_MAX]; // temporarily store current source-file name 144 144 char *end_num; 145 145 char *begin_string, *end_string; … … 156 156 //std::cout << "file " << filename << " line " << lineno << std::endl; 157 157 yylineno = lineno; 158 yyfilename = filename [0];158 yyfilename = filename; 159 159 } // if 160 160 } … … 288 288 289 289 /* character constant, allows empty value */ 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); }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); } 293 293 /* ' stop highlighting */ 294 294 295 295 /* string constant */ 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); }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); } 299 299 /* " stop highlighting */ 300 300 301 301 /* common character/string constant */ 302 <QUOTE,STRING>{escape_seq} { rm_underscore(); *strtext += std::string( yytext); }302 <QUOTE,STRING>{escape_seq} { rm_underscore(); strtext->append( yytext, yyleng ); } 303 303 <QUOTE,STRING>"\\"{h_white}*"\n" {} // continuation (ALSO HANDLED BY CPP) 304 <QUOTE,STRING>"\\" { *strtext += std::string( yytext); } // unknown escape character304 <QUOTE,STRING>"\\" { strtext->append( yytext, yyleng ); } // unknown escape character 305 305 306 306 /* punctuation */
Note: See TracChangeset
for help on using the changeset viewer.