Ignore:
Timestamp:
Nov 18, 2015, 12:50:56 PM (10 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, with_gc
Children:
9ed3237
Parents:
0800284 (diff), 50eac1b (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 'override-autogen' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0800284 r84b08d4  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 28 18:18:32 2015
    13 // Update Count     : 1402
     12// Last Modified On : Thu Oct  8 17:17:54 2015
     13// Update Count     : 1473
    1414//
    1515
     
    104104%token ANDassign        ERassign        ORassign                                // &=   ^=      |=
    105105
     106%token ATassign                                                                                 // @=
     107
    106108// Types declaration
    107109%union
     
    120122}
    121123
    122 %type<tok> identifier  no_01_identifier  no_attr_identifier no_attr_identifier_01  zero_one
     124%type<tok> identifier  no_01_identifier  no_attr_identifier zero_one
    123125%type<tok> identifier_or_type_name  no_attr_identifier_or_type_name  no_01_identifier_or_type_name
    124126%type<constant> string_literal_list
     
    143145// statements
    144146%type<sn> labeled_statement                             compound_statement                      expression_statement            selection_statement
    145 %type<sn> iteration_statement                   jump_statement                          exception_statement                     asm_statement                   ctor_dtor
     147%type<sn> iteration_statement                   jump_statement                          exception_statement                     asm_statement
    146148%type<sn> fall_through_opt                              fall_through
    147149%type<sn> statement                                             statement_list
     
    317319        ;
    318320
     321// no zero_one because ambiguity with 0.0 : double constant or field selection
    319322no_attr_identifier:
    320323        IDENTIFIER
    321         ;
    322 
    323 no_attr_identifier_01:
    324         IDENTIFIER
    325         | zero_one
    326324        ;
    327325
     
    369367        | postfix_expression DECR
    370368                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::DecrPost ), $1 ); }
    371                 // GCC has priority: cast_expression
    372369        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99
    373370                { $$ = 0; }
     371        | postfix_expression '{' argument_expression_list '}' // CFA
     372                {
     373                        Token fn; fn.str = new std::string( "?{}" ); // location undefined
     374                        $$ = new CompositeExprNode( new VarRefNode( fn ), (ExpressionNode *)( $1 )->set_link( $3 ) );
     375                }
    374376        ;
    375377
     
    632634        | exception_statement
    633635        | asm_statement
    634         | ctor_dtor
     636        | '^' postfix_expression '{' argument_expression_list '}' ';' // CFA
     637                {
     638                        Token fn; fn.str = new std::string( "^?{}" ); // location undefined
     639                        $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ),
     640                                (ExpressionNode *)(new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), $2 ))->set_link( $4 ) ), 0 );
     641                }
    635642        ;
    636643
     
    945952        ;
    946953
    947 ctor_dtor:                                                                                              // CFA, constructor/destructor
    948         no_attr_identifier_01 '{' argument_expression_list '}' ';'
    949                 {
    950                         Token fn; fn.str = new std::string( "?{}" ); fn.loc = $1.loc;
    951                         $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ),
    952                                    (ExpressionNode *)((new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), new VarRefNode( $1 ) ))->set_link( $3 )) ), 0 );
    953                 }
    954         | '^' no_attr_identifier_01 '{' '}' ';'
    955                 {
    956                         Token fn; fn.str = new std::string( "^?{}" ); fn.loc = $2.loc;
    957                         $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ),
    958                                    new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), new VarRefNode( $2 ) ) ), 0 );
    959                 }
    960         ;
    961 
    962954//******************************* DECLARATIONS *********************************
    963955
     
    16891681        | '=' initializer
    16901682                { $$ = $2; }
     1683        | ATassign initializer
     1684                { $$ = $2; }
    16911685        ;
    16921686
     
    16971691
    16981692initializer_list:
    1699         initializer
     1693        // empty
     1694                { $$ = 0; }
     1695        | initializer
    17001696        | designation initializer                                       { $$ = $2->set_designators( $1 ); }
    17011697        | initializer_list ',' initializer                      { $$ = (InitializerNode *)( $1->set_link( $3 ) ); }
Note: See TracChangeset for help on using the changeset viewer.