Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rca78437 r67cf18c  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun 12 12:59:00 2017
    13 // Update Count     : 2402
     12// Last Modified On : Thu May 25 15:21:59 2017
     13// Update Count     : 2398
    1414//
    1515
     
    193193%type<sn> case_value_list                               case_label                                      case_label_list
    194194%type<sn> switch_clause_list_opt                switch_clause_list                      choose_clause_list_opt          choose_clause_list
    195 %type<sn> /* handler_list */                    handler_clause                          finally_clause
     195%type<sn> handler_list                                  handler_clause                          finally_clause
    196196
    197197// declarations
     
    547547                { $$ = new ExpressionNode( build_attrtype( build_varref( $1 ), $3 ) ); }
    548548//      | ANDAND IDENTIFIER                                                                     // GCC, address of label
    549 //              { $$ = new ExpressionNode( new OperatorNode( OperKinds::LabelAddress ), new ExpressionNode( build_varref( $2 ) ); }
     549//              { $$ = new ExpressionNode( new OperatorNode( OperKinds::LabelAddress ), new ExpressionNode( build_varref( $2, true ) ); }
    550550        ;
    551551
     
    931931                { $$ = new StatementNode( build_throw( $2 ) ); }
    932932        | THROWRESUME assignment_expression_opt ';'                     // handles reresume
    933                 { $$ = new StatementNode( build_resume( $2 ) ); }
     933                { $$ = new StatementNode( build_throw( $2 ) ); }
    934934        | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume
    935                 { $$ = new StatementNode( build_resume_at( $2, $4 ) ); }
     935                { $$ = new StatementNode( build_throw( $2 ) ); }
    936936        ;
    937937
    938938exception_statement:
    939         TRY compound_statement handler_clause
     939        TRY compound_statement handler_list
    940940                { $$ = new StatementNode( build_try( $2, $3, 0 ) ); }
    941941        | TRY compound_statement finally_clause
    942942                { $$ = new StatementNode( build_try( $2, 0, $3 ) ); }
    943         | TRY compound_statement handler_clause finally_clause
     943        | TRY compound_statement handler_list finally_clause
    944944                { $$ = new StatementNode( build_try( $2, $3, $4 ) ); }
    945945        ;
    946946
    947 //handler_list:
    948 //      handler_clause
    949 //              // ISO/IEC 9899:1999 Section 15.3(6 ) If present, a "..." handler shall be the last handler for its try block.
    950 //      | CATCH '(' ELLIPSIS ')' compound_statement
    951 //              { $$ = new StatementNode( build_catch( 0, $5, true ) ); }
    952 //      | handler_clause CATCH '(' ELLIPSIS ')' compound_statement
    953 //              { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( 0, $6, true ) ) ); }
    954 //      | CATCHRESUME '(' ELLIPSIS ')' compound_statement
    955 //              { $$ = new StatementNode( build_catch( 0, $5, true ) ); }
    956 //      | handler_clause CATCHRESUME '(' ELLIPSIS ')' compound_statement
    957 //              { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( 0, $6, true ) ) ); }
    958 //      ;
     947handler_list:
     948        handler_clause
     949                // ISO/IEC 9899:1999 Section 15.3(6 ) If present, a "..." handler shall be the last handler for its try block.
     950        | CATCH '(' ELLIPSIS ')' compound_statement
     951                { $$ = new StatementNode( build_catch( 0, $5, true ) ); }
     952        | handler_clause CATCH '(' ELLIPSIS ')' compound_statement
     953                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( 0, $6, true ) ) ); }
     954        | CATCHRESUME '(' ELLIPSIS ')' compound_statement
     955                { $$ = new StatementNode( build_catch( 0, $5, true ) ); }
     956        | handler_clause CATCHRESUME '(' ELLIPSIS ')' compound_statement
     957                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( 0, $6, true ) ) ); }
     958        ;
    959959
    960960handler_clause:
    961961        CATCH '(' push push exception_declaration pop ')' compound_statement pop
    962                 { $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); }
     962                { $$ = new StatementNode( build_catch( $5, $8 ) ); }
    963963        | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop
    964                 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Terminate, $6, nullptr, $9 ) ) ); }
     964                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); }
    965965        | CATCHRESUME '(' push push exception_declaration pop ')' compound_statement pop
    966                 { $$ = new StatementNode( build_catch( CatchStmt::Resume, $5, nullptr, $8 ) ); }
     966                { $$ = new StatementNode( build_catch( $5, $8 ) ); }
    967967        | handler_clause CATCHRESUME '(' push push exception_declaration pop ')' compound_statement pop
    968                 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Resume, $6, nullptr, $9 ) ) ); }
     968                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $6, $9 ) ) ); }
    969969        ;
    970970
Note: See TracChangeset for help on using the changeset viewer.