Ignore:
Timestamp:
Mar 8, 2017, 3:22:50 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
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:
031a2c95, 0e7ea335
Parents:
87c3bef (diff), 6363ad1 (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:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r87c3bef rbe8bd88  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 28 09:58:10 2017
    13 // Update Count     : 2208
     12// Last Modified On : Sun Mar  5 15:48:24 2017
     13// Update Count     : 2227
    1414//
    1515
     
    9191// keywords
    9292%token TYPEDEF
    93 %token AUTO EXTERN REGISTER STATIC
    94 %token INLINE                                                                                   // C99
    95 %token FORTRAN                                                                                  // C99, extension ISO/IEC 9899:1999 Section J.5.9(1)
     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
    9697%token CONST VOLATILE
    9798%token RESTRICT                                                                                 // C99
    98 %token FORALL LVALUE                                                                    // CFA
     99%token ATOMIC                                                                                   // C11
     100%token FORALL LVALUE MUTEX                                                              // CFA
    99101%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED ZERO_T ONE_T
    100102%token VALIST                                                                                   // GCC
     
    102104%token TYPEOF LABEL                                                                             // GCC
    103105%token ENUM STRUCT UNION
    104 %token OTYPE FTYPE DTYPE TTYPE TRAIT                                                    // CFA
     106%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    105107%token SIZEOF OFFSETOF
    106108%token ATTRIBUTE EXTENSION                                                              // GCC
     
    108110%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT        // CFA
    109111%token ASM                                                                                              // C99, extension ISO/IEC 9899:1999 Section J.5.10(1)
    110 %token ALIGNAS ALIGNOF ATOMIC GENERIC NORETURN STATICASSERT THREADLOCAL // C11
     112%token ALIGNAS ALIGNOF GENERIC STATICASSERT                             // C11
    111113
    112114// names and constants: lexer differentiates between identifier and typedef names
     
    14001402type_qualifier_name:
    14011403        CONST
    1402                 { $$ = DeclarationNode::newQualifier( DeclarationNode::Const ); }
     1404                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Const ); }
    14031405        | RESTRICT
    1404                 { $$ = DeclarationNode::newQualifier( DeclarationNode::Restrict ); }
     1406                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Restrict ); }
    14051407        | VOLATILE
    1406                 { $$ = DeclarationNode::newQualifier( DeclarationNode::Volatile ); }
     1408                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Volatile ); }
    14071409        | LVALUE                                                                                        // CFA
    1408                 { $$ = DeclarationNode::newQualifier( DeclarationNode::Lvalue ); }
     1410                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Lvalue ); }
     1411        | MUTEX
     1412                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Mutex ); }
    14091413        | ATOMIC
    1410                 { $$ = DeclarationNode::newQualifier( DeclarationNode::Atomic ); }
     1414                { $$ = DeclarationNode::newTypeQualifier( DeclarationNode::Atomic ); }
    14111415        | FORALL '('
    14121416                {
     
    14481452        | REGISTER
    14491453                { $$ = 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; }
    14581454        | THREADLOCAL                                                                           // C11
    14591455                { $$ = 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 ); }
    14601463        ;
    14611464
     
    20332036                { $$ = $3->addQualifiers( $1 ); }
    20342037        | type_declaring_list ',' type_declarator
    2035                 { $$ = $1->appendList( $3->copyStorageClasses( $1 ) ); }
     2038                { $$ = $1->appendList( $3->copySpecifiers( $1 ) ); }
    20362039        ;
    20372040
Note: See TracChangeset for help on using the changeset viewer.