Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    r984dce6 rbd85400  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Mon Mar 21 23:33:46 2016
    13  * Update Count     : 450
     12 * Last Modified On : Tue Feb  2 15:06:54 2016
     13 * Update Count     : 426
    1414 */
    1515
     
    2727
    2828#include "lex.h"
     29#include "ParseNode.h"
    2930#include "parser.h"                                                                             // YACC generated definitions based on C++ grammar
    30 #include "ParseNode.h"
    31 #include "TypedefTable.h"
    3231
    3332char *yyfilename;
     
    4544#define NUMERIC_RETURN(x)       rm_underscore(); RETURN_VAL( x ) // numeric constant
    4645#define KEYWORD_RETURN(x)       RETURN_CHAR( x )                        // keyword
    47 #define IDENTIFIER_RETURN()     RETURN_VAL( typedefTable.isKind( yytext ) )
     46#define IDENTIFIER_RETURN()     RETURN_VAL( (typedefTable.isIdentifier( yytext ) ? IDENTIFIER : typedefTable.isTypedef( yytext ) ? TYPEDEFname : TYPEGENname ) )
    4847#define ATTRIBUTE_RETURN()      RETURN_VAL( ATTR_IDENTIFIER )
    4948
     
    9695fractional_constant ({decimal_digits}?"."{decimal_digits})|({decimal_digits}".")
    9796exponent "_"?[eE]"_"?[+-]?{decimal_digits}
    98                                 // GCC: D (double), DL (long double) and iI (imaginary) suffixes
    99 floating_suffix "_"?([fFdDlL][iI]?|"DL"|[iI][lLfFdD]?)
    100                                 //floating_suffix "_"?([fFdD]|[lL]|[D][L])|([iI][lLfFdD])|([lLfFdD][iI]))
     97                                // GCC: D (double), LD (long double) and iI (imaginary) suffixes
     98floating_suffix "_"?([fFdD]?|([lL]?)|([iI][lLfFdD]?)|([lLfFdD][iI]))
    10199floating_constant (({fractional_constant}{exponent}?)|({decimal_digits}{exponent})){floating_suffix}?
    102100
     
    139137%%
    140138                                   /* line directives */
    141 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" {
     139^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["][^\n]*"\n" {
    142140        /* " stop highlighting */
    143141        char *end_num;
     
    203201__const                 { KEYWORD_RETURN(CONST); }                              // GCC
    204202__const__               { KEYWORD_RETURN(CONST); }                              // GCC
     203context                 { KEYWORD_RETURN(CONTEXT); }                    // CFA
    205204continue                { KEYWORD_RETURN(CONTINUE); }
    206205default                 { KEYWORD_RETURN(DEFAULT); }
     
    238237_Noreturn               { KEYWORD_RETURN(NORETURN); }                   // C11
    239238__builtin_offsetof { KEYWORD_RETURN(OFFSETOF); }                // GCC
    240 otype                   { KEYWORD_RETURN(OTYPE); }                              // CFA
    241239register                { KEYWORD_RETURN(REGISTER); }
    242240restrict                { KEYWORD_RETURN(RESTRICT); }                   // C99
     
    256254throw                   { KEYWORD_RETURN(THROW); }                              // CFA
    257255throwResume             { KEYWORD_RETURN(THROWRESUME); }                // CFA
    258 trait                   { KEYWORD_RETURN(TRAIT); }                              // CFA
    259256try                             { KEYWORD_RETURN(TRY); }                                // CFA
     257type                    { KEYWORD_RETURN(TYPE); }                               // CFA
    260258typedef                 { KEYWORD_RETURN(TYPEDEF); }
    261259typeof                  { KEYWORD_RETURN(TYPEOF); }                             // GCC
     
    264262union                   { KEYWORD_RETURN(UNION); }
    265263unsigned                { KEYWORD_RETURN(UNSIGNED); }
    266 __builtin_va_list { KEYWORD_RETURN(VALIST); }                   // GCC
    267264void                    { KEYWORD_RETURN(VOID); }
    268265volatile                { KEYWORD_RETURN(VOLATILE); }
Note: See TracChangeset for help on using the changeset viewer.