Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r8b47e50 r307a732  
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  1 20:22:55 2001
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul 12 18:23:36 2017
    13 // Update Count     : 2426
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Jun 30 15:38:00 2017
     13// Update Count     : 2415
    1414//
    1515
     
    129129%token ATTRIBUTE EXTENSION                                                              // GCC
    130130%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
    131 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH   // CFA
     131%token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT        // CFA
    132132%token ASM                                                                                              // C99, extension ISO/IEC 9899:1999 Section J.5.10(1)
    133133%token ALIGNAS ALIGNOF GENERIC STATICASSERT                             // C11
     
    184184// statements
    185185%type<sn> labeled_statement                             compound_statement                      expression_statement            selection_statement
    186 %type<sn> iteration_statement                   jump_statement
    187 %type<sn> with_statement                                exception_statement                     asm_statement
     186%type<sn> iteration_statement                   jump_statement                          exception_statement                     asm_statement
    188187%type<sn> fall_through_opt                              fall_through
    189188%type<sn> statement                                             statement_list
    190189%type<sn> block_item_list                               block_item
    191 %type<sn> with_clause_opt
     190%type<sn> case_clause
    192191%type<en> case_value
    193 %type<sn> case_clause                                   case_value_list                         case_label                                      case_label_list
     192%type<sn> case_value_list                               case_label                                      case_label_list
    194193%type<sn> switch_clause_list_opt                switch_clause_list                      choose_clause_list_opt          choose_clause_list
    195194%type<sn> /* handler_list */                    handler_clause                          finally_clause
     
    730729        | iteration_statement
    731730        | jump_statement
    732         | with_statement
    733731        | exception_statement
    734732        | asm_statement
     
    936934        | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume
    937935                { $$ = new StatementNode( build_resume_at( $2, $4 ) ); }
    938         ;
    939 
    940 with_statement:
    941         WITH identifier_list compound_statement
    942                 { $$ = (StatementNode *)0; }                                    // FIX ME
    943936        ;
    944937
     
    21832176                {
    21842177                        linkageStack.push( linkage );                           // handle nested extern "C"/"Cforall"
    2185                         linkage = LinkageSpec::linkageUpdate( linkage, $2 );
     2178                        linkage = LinkageSpec::linkageCheck( $2 );
    21862179                }
    21872180          '{' external_definition_list_opt '}'
     
    22192212        ;
    22202213
    2221 with_clause_opt:
    2222         // empty
    2223                 { $$ = (StatementNode *)0; }                                    // FIX ME
    2224         | WITH identifier_list
    2225                 { $$ = (StatementNode *)0; }                                    // FIX ME
    2226         ;
    2227 
    22282214function_definition:
    2229         cfa_function_declaration with_clause_opt compound_statement     // CFA
     2215        cfa_function_declaration compound_statement                     // CFA
    22302216                {
    22312217                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22322218                        typedefTable.leaveScope();
    2233                         $$ = $1->addFunctionBody( $3 );
    2234                 }
    2235         | declaration_specifier function_declarator with_clause_opt compound_statement
     2219                        $$ = $1->addFunctionBody( $2 );
     2220                }
     2221        | declaration_specifier function_declarator compound_statement
    22362222                {
    22372223                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22382224                        typedefTable.leaveScope();
    2239                         $$ = $2->addFunctionBody( $4 )->addType( $1 );
    2240                 }
    2241         | type_qualifier_list function_declarator with_clause_opt compound_statement
     2225                        $$ = $2->addFunctionBody( $3 )->addType( $1 );
     2226                }
     2227        | type_qualifier_list function_declarator compound_statement
    22422228                {
    22432229                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22442230                        typedefTable.leaveScope();
    2245                         $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 );
    2246                 }
    2247         | declaration_qualifier_list function_declarator with_clause_opt compound_statement
     2231                        $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 );
     2232                }
     2233        | declaration_qualifier_list function_declarator compound_statement
    22482234                {
    22492235                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22502236                        typedefTable.leaveScope();
    2251                         $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 );
    2252                 }
    2253         | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement
     2237                        $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 );
     2238                }
     2239        | declaration_qualifier_list type_qualifier_list function_declarator compound_statement
    22542240                {
    22552241                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22562242                        typedefTable.leaveScope();
    2257                         $$ = $3->addFunctionBody( $5 )->addQualifiers( $2 )->addQualifiers( $1 );
     2243                        $$ = $3->addFunctionBody( $4 )->addQualifiers( $2 )->addQualifiers( $1 );
    22582244                }
    22592245
    22602246                // Old-style K&R function definition, OBSOLESCENT (see 4)
    2261         | declaration_specifier KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
     2247        | declaration_specifier KR_function_declarator push KR_declaration_list_opt compound_statement
    22622248                {
    22632249                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22642250                        typedefTable.leaveScope();
    2265                         $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addType( $1 );
    2266                 }
    2267         | type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
     2251                        $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addType( $1 );
     2252                }
     2253        | type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement
    22682254                {
    22692255                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22702256                        typedefTable.leaveScope();
    2271                         $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 );
     2257                        $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addQualifiers( $1 );
    22722258                }
    22732259
    22742260                // Old-style K&R function definition with "implicit int" type_specifier, OBSOLESCENT (see 4)
    2275         | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
     2261        | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement
    22762262                {
    22772263                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22782264                        typedefTable.leaveScope();
    2279                         $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 );
    2280                 }
    2281         | declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement
     2265                        $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addQualifiers( $1 );
     2266                }
     2267        | declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement
    22822268                {
    22832269                        typedefTable.addToEnclosingScope( TypedefTable::ID );
    22842270                        typedefTable.leaveScope();
    2285                         $$ = $3->addOldDeclList( $5 )->addFunctionBody( $7 )->addQualifiers( $2 )->addQualifiers( $1 );
     2271                        $$ = $3->addOldDeclList( $5 )->addFunctionBody( $6 )->addQualifiers( $2 )->addQualifiers( $1 );
    22862272                }
    22872273        ;
     
    23462332        | TYPEGENname
    23472333        | CONST
    2348                 { $$ = Token{ new string( "__const__" ), { nullptr, -1 } }; }
     2334                { $$ = Token{ new string( "__const__" ) }; }
    23492335        ;
    23502336
Note: See TracChangeset for help on using the changeset viewer.