Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    ra7c90d4 rd0ffed1  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar  5 15:48:24 2017
    13 // Update Count     : 2227
     12// Last Modified On : Tue Feb 28 09:58:10 2017
     13// Update Count     : 2208
    1414//
    1515
     
    9191// keywords
    9292%token TYPEDEF
    93 %token EXTERN STATIC AUTO REGISTER
    94 %token THREADLOCAL                                                                              // C11
    95 %token INLINE FORTRAN                                                                   // C99, extension ISO/IEC 9899:1999 Section J.5.9(1)
    96 %token NORETURN                                                                                 // C11
     93%token AUTO EXTERN REGISTER STATIC
     94%token INLINE                                                                                   // C99
     95%token FORTRAN                                                                                  // C99, extension ISO/IEC 9899:1999 Section J.5.9(1)
    9796%token CONST VOLATILE
    9897%token RESTRICT                                                                                 // C99
    99 %token ATOMIC                                                                                   // C11
    100 %token FORALL LVALUE MUTEX                                                              // CFA
     98%token FORALL LVALUE                                                                    // CFA
    10199%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED ZERO_T ONE_T
    102100%token VALIST                                                                                   // GCC
     
    104102%token TYPEOF LABEL                                                                             // GCC
    105103%token ENUM STRUCT UNION
    106 %token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
     104%token OTYPE FTYPE DTYPE TTYPE TRAIT                                                    // CFA
    107105%token SIZEOF OFFSETOF
    108106%token ATTRIBUTE EXTENSION                                                              // GCC
     
    110108%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT        // CFA
    111109%token ASM                                                                                              // C99, extension ISO/IEC 9899:1999 Section J.5.10(1)
    112 %token ALIGNAS ALIGNOF GENERIC STATICASSERT                             // C11
     110%token ALIGNAS ALIGNOF ATOMIC GENERIC NORETURN STATICASSERT THREADLOCAL // C11
    113111
    114112// names and constants: lexer differentiates between identifier and typedef names
     
    14021400type_qualifier_name:
    14031401        CONST
    1404                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); }
     1402                { $$ = DeclarationNode::newQualifier( DeclarationNode::Const ); }
    14051403        | RESTRICT
    1406                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); }
     1404                { $$ = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
    14071405        | VOLATILE
    1408                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); }
     1406                { $$ = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
    14091407        | LVALUE                                                                                        // CFA
    1410                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); }
    1411         | MUTEX
    1412                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Mutex ); }
     1408                { $$ = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
    14131409        | ATOMIC
    1414                 { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); }
     1410                { $$ = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
    14151411        | FORALL '('
    14161412                {
     
    14521448        | REGISTER
    14531449                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
     1450        | INLINE                                                                                        // C99
     1451                //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
     1452                { $$ = new DeclarationNode; $$->isInline = true; }
     1453        | FORTRAN                                                                                       // C99
     1454                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
     1455        | NORETURN                                                                                      // C11
     1456                //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
     1457                { $$ = new DeclarationNode; $$->isNoreturn = true; }
    14541458        | THREADLOCAL                                                                           // C11
    14551459                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
    1456                 // Put function specifiers here to simplify parsing rules, but separate them semantically.
    1457         | INLINE                                                                                        // C99
    1458                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Inline ); }
    1459         | FORTRAN                                                                                       // C99
    1460                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Fortran ); }
    1461         | NORETURN                                                                                      // C11
    1462                 { $$ = DeclarationNode::newFuncSpecifier( DeclarationNode::Noreturn ); }
    14631460        ;
    14641461
     
    20362033                { $$ = $3->addQualifiers( $1 ); }
    20372034        | type_declaring_list ',' type_declarator
    2038                 { $$ = $1->appendList( $3->copySpecifiers( $1 ) ); }
     2035                { $$ = $1->appendList( $3->copyStorageClasses( $1 ) ); }
    20392036        ;
    20402037
Note: See TracChangeset for help on using the changeset viewer.