Changeset b3c7963 for src/Parser/lex.ll


Ignore:
Timestamp:
Sep 12, 2017, 5:55:31 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    ra506df4 rb3c7963  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Thu Aug 31 21:30:10 2017
    13  * Update Count     : 598
     12 * Last Modified On : Sun Sep 10 22:29:15 2017
     13 * Update Count     : 620
    1414 */
    1515
     
    9393                                // numeric constants, CFA: '_' in constant
    9494hex_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]?))))?
     95length ("ll"|"LL"|[lL])|("hh"|"HH"|[hH])
     96integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))?{user_suffix_opt}
    9697
    9798octal_digits ({octal})|({octal}({octal}|"_")*{octal})
    9899octal_prefix "0""_"?
    99 octal_constant (("0")|({octal_prefix}{octal_digits})){integer_suffix_opt}{user_suffix_opt}
     100octal_constant (("0")|({octal_prefix}{octal_digits})){integer_suffix_opt}
    100101
    101102nonzero_digits ({nonzero})|({nonzero}({decimal}|"_")*{decimal})
    102 decimal_constant {nonzero_digits}{integer_suffix_opt}{user_suffix_opt}
     103decimal_constant {nonzero_digits}{integer_suffix_opt}
    103104
    104105hex_digits ({hex})|({hex}({hex}|"_")*{hex})
    105106hex_prefix "0"[xX]"_"?
    106 hex_constant {hex_prefix}{hex_digits}{integer_suffix_opt}{user_suffix_opt}
     107hex_constant {hex_prefix}{hex_digits}{integer_suffix_opt}
    107108
    108109                                // GCC: D (double) and iI (imaginary) suffixes, and DL (long double)
    109 floating_suffix_opt ("_"?([fFdDlL][iI]?|[iI][lLfFdD]?|"DL"))?
     110exponent "_"?[eE]"_"?[+-]?{decimal_digits}
     111floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD])
     112floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt}
    110113decimal_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}
     114floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt}
     115floating_fraction "."{decimal_digits}{exponent}?{floating_suffix_opt}
     116floating_constant ({decimal_digits}{exponent}{floating_suffix_opt})|({decimal_digits}{floating_fraction})
    116117
    117118binary_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}
     119hex_floating_suffix_opt ("_"?({floating_suffix}))?{user_suffix_opt}
     120hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".")
     121hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){hex_floating_suffix_opt}
    120122
    121123                                // character escape sequence, GCC: \e => esc character
    122124simple_escape "\\"[abefnrtv'"?\\]
    123                                 // ' stop highlighting
     125                                // ' stop editor highlighting
    124126octal_escape "\\"{octal}("_"?{octal}){0,2}
    125127hex_escape "\\""x""_"?{hex_digits}
     
    154156                                /* line directives */
    155157^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" {
    156         /* " stop highlighting */
     158        /* " stop editor highlighting */
    157159        static char filename[FILENAME_MAX];                                     // temporarily store current source-file name
    158160        char *end_num;
     
    310312{octal_constant} { NUMERIC_RETURN(INTEGERconstant); }
    311313{hex_constant}  { NUMERIC_RETURN(INTEGERconstant); }
    312 {real_decimal}  { NUMERIC_RETURN(REALDECIMALconstant); } // must appear before floating_constant
    313 {real_fraction} { NUMERIC_RETURN(REALFRACTIONconstant); } // must appear before floating_constant
     314{floating_decimal}      { NUMERIC_RETURN(FLOATING_DECIMALconstant); } // must appear before floating_constant
     315{floating_fraction}     { NUMERIC_RETURN(FLOATING_FRACTIONconstant); } // must appear before floating_constant
    314316{floating_constant}     { NUMERIC_RETURN(FLOATINGconstant); }
    315317{hex_floating_constant} { NUMERIC_RETURN(FLOATINGconstant); }
     
    319321<QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); }
    320322<QUOTE>['\n]{user_suffix_opt}   { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); }
    321                                 /* ' stop highlighting */
     323                                /* ' stop editor highlighting */
    322324
    323325                                /* string constant */
     
    325327<STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); }
    326328<STRING>["\n]{user_suffix_opt}  { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); }
    327                                 /* " stop highlighting */
     329                                /* " stop editor highlighting */
    328330
    329331                                /* common character/string constant */
Note: See TracChangeset for help on using the changeset viewer.