Changeset b3c7963 for src/Parser/lex.ll
- Timestamp:
- Sep 12, 2017, 5:55:31 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:
- 4639b0d
- Parents:
- a506df4 (diff), a46478a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
ra506df4 rb3c7963 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 22:29:15 2017 13 * Update Count : 620 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 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 111 floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD]) 112 floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt} 110 113 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 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 115 floating_constant (({real_constant}{exponent}?)|({decimal_digits}{exponent})){floating_suffix_opt}{user_suffix_opt} 114 floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt} 115 floating_fraction "."{decimal_digits}{exponent}?{floating_suffix_opt} 116 floating_constant ({decimal_digits}{exponent}{floating_suffix_opt})|({decimal_digits}{floating_fraction}) 116 117 117 118 binary_exponent "_"?[pP]"_"?[+-]?{decimal_digits} 118 hex_fractional_constant ({hex_digits}?"."{hex_digits})|({hex_digits}".") 119 hex_floating_constant {hex_prefix}(({hex_fractional_constant}{binary_exponent})|({hex_digits}{binary_exponent})){floating_suffix_opt} 119 hex_floating_suffix_opt ("_"?({floating_suffix}))?{user_suffix_opt} 120 hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".") 121 hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){hex_floating_suffix_opt} 120 122 121 123 // character escape sequence, GCC: \e => esc character 122 124 simple_escape "\\"[abefnrtv'"?\\] 123 // ' stop highlighting125 // ' stop editor highlighting 124 126 octal_escape "\\"{octal}("_"?{octal}){0,2} 125 127 hex_escape "\\""x""_"?{hex_digits} … … 154 156 /* line directives */ 155 157 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 156 /* " stop highlighting */158 /* " stop editor highlighting */ 157 159 static char filename[FILENAME_MAX]; // temporarily store current source-file name 158 160 char *end_num; … … 310 312 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); } 311 313 {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_constant314 {floating_decimal} { NUMERIC_RETURN(FLOATING_DECIMALconstant); } // must appear before floating_constant 315 {floating_fraction} { NUMERIC_RETURN(FLOATING_FRACTIONconstant); } // must appear before floating_constant 314 316 {floating_constant} { NUMERIC_RETURN(FLOATINGconstant); } 315 317 {hex_floating_constant} { NUMERIC_RETURN(FLOATINGconstant); } … … 319 321 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); } 320 322 <QUOTE>['\n]{user_suffix_opt} { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); } 321 /* ' stop highlighting */323 /* ' stop editor highlighting */ 322 324 323 325 /* string constant */ … … 325 327 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); } 326 328 <STRING>["\n]{user_suffix_opt} { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); } 327 /* " stop highlighting */329 /* " stop editor highlighting */ 328 330 329 331 /* common character/string constant */
Note: See TracChangeset
for help on using the changeset viewer.