Changeset e15b0a0a for src/Parser/cfa.y


Ignore:
Timestamp:
May 26, 2015, 10:41:24 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
4d51835
Parents:
a77e7b5
Message:

allow arbitrary ordering of storage/type qualifiers for new function decl/defn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/cfa.y

    ra77e7b5 re15b0a0a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat May 16 11:55:39 2015
    13 // Update Count     : 975
     12// Last Modified On : Tue May 26 22:38:42 2015
     13// Update Count     : 995
    1414//
    1515
     
    10091009                                        $$ = $1;
    10101010                                }
    1011                 | declaration_qualifier_list new_function_specifier
    1012                                 // declaration_qualifier_list also includes type_qualifier_list, so a semantic check is
    1013                                 // necessary to preclude them as a type_qualifier cannot appear in this context.
     1011                | type_qualifier_list new_function_specifier
    10141012                                {
    10151013                                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    10161014                                        $$ = $2->addQualifiers( $1 );
     1015                                }
     1016                | declaration_qualifier_list new_function_specifier
     1017                                {
     1018                                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     1019                                        $$ = $2->addQualifiers( $1 );
     1020                                }
     1021                | declaration_qualifier_list type_qualifier_list new_function_specifier
     1022                                {
     1023                                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     1024                                        $$ = $3->addQualifiers( $1 )->addQualifiers( $2 );
    10171025                                }
    10181026                | new_function_declaration pop ',' push identifier_or_typedef_name
     
    19041912
    19051913function_definition:
    1906                 new_function_specifier compound_statement               // CFA
     1914                new_function_declaration compound_statement             // CFA
    19071915                                {
    19081916                                        typedefTable.addToEnclosingScope( TypedefTable::ID );
     
    19101918                                        $$ = $1->addFunctionBody( $2 );
    19111919                                }
    1912                 | declaration_qualifier_list new_function_specifier compound_statement // CFA
    1913                                 // declaration_qualifier_list also includes type_qualifier_list, so a semantic check is
    1914                                 // necessary to preclude them as a type_qualifier cannot appear in this context.
    1915                                 {
    1916                                         typedefTable.addToEnclosingScope( TypedefTable::ID );
    1917                                         typedefTable.leaveScope();
    1918                                         $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 );
    1919                                 }
    1920 
     1920//              | declaration_qualifier_list new_function_specifier compound_statement // CFA
     1921//                              // declaration_qualifier_list also includes type_qualifier_list, so a semantic check is
     1922//                              // necessary to preclude them as a type_qualifier cannot appear in this context.
     1923//                              {
     1924//                                      typedefTable.addToEnclosingScope( TypedefTable::ID );
     1925//                                      typedefTable.leaveScope();
     1926//                                      $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 );
     1927//                              }
    19211928                | declaration_specifier function_declarator compound_statement
    19221929                                {
Note: See TracChangeset for help on using the changeset viewer.