Changeset 930f69e for src/Parser/lex.ll
- Timestamp:
- Sep 10, 2017, 5:35:59 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, 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:
- de9285f
- Parents:
- 0cc818b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r0cc818b r930f69e 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 31 21:30:10201713 * Update Count : 59812 * Last Modified On : Sun Sep 10 11:15:37 2017 13 * Update Count : 617 14 14 */ 15 15 … … 93 93 // numeric constants, CFA: '_' in constant 94 94 hex_quad {hex}("_"?{hex}){3} 95 integer_suffix_opt ("_"?(([uU](("ll"|"LL"|[lL])[iI]|[iI]?("ll"|"LL"|[lL])?))|([iI](("ll"|"LL"|[lL])[uU]|[uU]?("ll"|"LL"|[lL])?))|(("ll"|"LL"|[lL])([iI][uU]|[uU]?[iI]?))))? 95 length ("ll"|"LL"|[lL])|("hh"|"HH"|[hH]) 96 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))?{user_suffix_opt} 96 97 97 98 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) 98 99 octal_prefix "0""_"? 99 octal_constant (("0")|({octal_prefix}{octal_digits})){integer_suffix_opt} {user_suffix_opt}100 octal_constant (("0")|({octal_prefix}{octal_digits})){integer_suffix_opt} 100 101 101 102 nonzero_digits ({nonzero})|({nonzero}({decimal}|"_")*{decimal}) 102 decimal_constant {nonzero_digits}{integer_suffix_opt} {user_suffix_opt}103 decimal_constant {nonzero_digits}{integer_suffix_opt} 103 104 104 105 hex_digits ({hex})|({hex}({hex}|"_")*{hex}) 105 106 hex_prefix "0"[xX]"_"? 106 hex_constant {hex_prefix}{hex_digits}{integer_suffix_opt} {user_suffix_opt}107 hex_constant {hex_prefix}{hex_digits}{integer_suffix_opt} 107 108 108 109 // GCC: D (double) and iI (imaginary) suffixes, and DL (long double) 109 floating_suffix_opt ("_"?( [fFdDlL][iI]?|[iI][lLfFdD]?|"DL"))?110 floating_suffix_opt ("_"?(([fFdDlL]?[iI]?)|([iI][lLfFdD])|"DL"))?{user_suffix_opt} 110 111 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) 111 real_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt}{user_suffix_opt}112 real_fraction "."{decimal_digits}{exponent}?{floating_suffix_opt}{user_suffix_opt}113 real_constant {decimal_digits}{real_fraction}114 112 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 115 floating_constant (({real_constant}{exponent}?)|({decimal_digits}{exponent})){floating_suffix_opt}{user_suffix_opt} 113 floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt} 114 floating_fraction "."{decimal_digits}{exponent}?{floating_suffix_opt} 115 floating_constant ({decimal_digits}{exponent}{floating_suffix_opt})|({decimal_digits}{floating_fraction}) 116 116 117 117 binary_exponent "_"?[pP]"_"?[+-]?{decimal_digits} 118 hex_f ractional_constant({hex_digits}?"."{hex_digits})|({hex_digits}".")119 hex_floating_constant {hex_prefix}(({hex_f ractional_constant}{binary_exponent})|({hex_digits}{binary_exponent})){floating_suffix_opt}118 hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".") 119 hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){floating_suffix_opt} 120 120 121 121 // character escape sequence, GCC: \e => esc character 122 122 simple_escape "\\"[abefnrtv'"?\\] 123 // ' stop highlighting123 // ' stop editor highlighting 124 124 octal_escape "\\"{octal}("_"?{octal}){0,2} 125 125 hex_escape "\\""x""_"?{hex_digits} … … 154 154 /* line directives */ 155 155 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 156 /* " stop highlighting */156 /* " stop editor highlighting */ 157 157 static char filename[FILENAME_MAX]; // temporarily store current source-file name 158 158 char *end_num; … … 310 310 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); } 311 311 {hex_constant} { NUMERIC_RETURN(INTEGERconstant); } 312 { real_decimal} { NUMERIC_RETURN(REALDECIMALconstant); } // must appear before floating_constant313 { real_fraction} { NUMERIC_RETURN(REALFRACTIONconstant); } // must appear before floating_constant312 {floating_decimal} { NUMERIC_RETURN(FLOATING_DECIMALconstant); } // must appear before floating_constant 313 {floating_fraction} { NUMERIC_RETURN(FLOATING_FRACTIONconstant); } // must appear before floating_constant 314 314 {floating_constant} { NUMERIC_RETURN(FLOATINGconstant); } 315 315 {hex_floating_constant} { NUMERIC_RETURN(FLOATINGconstant); } … … 319 319 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); } 320 320 <QUOTE>['\n]{user_suffix_opt} { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); } 321 /* ' stop highlighting */321 /* ' stop editor highlighting */ 322 322 323 323 /* string constant */ … … 325 325 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); } 326 326 <STRING>["\n]{user_suffix_opt} { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); } 327 /* " stop highlighting */327 /* " stop editor highlighting */ 328 328 329 329 /* common character/string constant */
Note: See TracChangeset
for help on using the changeset viewer.