Ignore:
Timestamp:
May 2, 2016, 3:28:16 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:
1b7ea43
Parents:
1f6e009 (diff), e945826 (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' into global-init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r1f6e009 r1048b31  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 24 16:16:16 2016
    13 // Update Count     : 1498
     12// Last Modified On : Wed Apr 13 16:58:43 2016
     13// Update Count     : 1519
    1414//
    1515
     
    372372                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::DecrPost ), $1 ); }
    373373        | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99
    374                 { $$ = 0; }
     374                { $$ = new CompoundLiteralNode( $2, new InitializerNode( $5, true ) ); }
    375375        | postfix_expression '{' argument_expression_list '}' // CFA
    376376                {
     
    14381438                { $$ = DeclarationNode::newAggregate( $1, 0, 0, $3 ); }
    14391439        | aggregate_key no_attr_identifier_or_type_name
    1440                 { $$ = DeclarationNode::newAggregate( $1, $2, 0, 0 ); }
    1441         | aggregate_key no_attr_identifier_or_type_name '{' field_declaration_list '}'
    1442                 { $$ = DeclarationNode::newAggregate( $1, $2, 0, $4 ); }
     1440                {
     1441                        typedefTable.makeTypedef( *$2 );
     1442                        $$ = DeclarationNode::newAggregate( $1, $2, 0, 0 );
     1443                }
     1444        | aggregate_key no_attr_identifier_or_type_name
     1445                { typedefTable.makeTypedef( *$2 ); }
     1446                '{' field_declaration_list '}'
     1447                { $$ = DeclarationNode::newAggregate( $1, $2, 0, $5); }
    14431448        | aggregate_key '(' type_name_list ')' '{' field_declaration_list '}' // CFA
    1444                 { $$ = DeclarationNode::newAggregate( $1, 0, $3, $6 ); }
     1449                { $$ = DeclarationNode::newAggregate( $1, 0, $3, $6 ); }
    14451450        | aggregate_key typegen_name                                            // CFA, S/R conflict
    14461451                { $$ = $2; }
     
    15201525        enum_key '{' enumerator_list comma_opt '}'
    15211526                { $$ = DeclarationNode::newEnum( 0, $3 ); }
    1522         | enum_key no_attr_identifier_or_type_name '{' enumerator_list comma_opt '}'
    1523                 { $$ = DeclarationNode::newEnum( $2, $4 ); }
    15241527        | enum_key no_attr_identifier_or_type_name
    1525                 { $$ = DeclarationNode::newEnum( $2, 0 ); }
     1528                {
     1529                        typedefTable.makeTypedef( *$2 );
     1530                        $$ = DeclarationNode::newEnum( $2, 0 );
     1531                }
     1532        | enum_key no_attr_identifier_or_type_name
     1533                { typedefTable.makeTypedef( *$2 ); }
     1534                '{' enumerator_list comma_opt '}'
     1535                { $$ = DeclarationNode::newEnum( $2, $5 ); }
    15261536        ;
    15271537
     
    28132823        std::cout << "Error ";
    28142824        if ( yyfilename ) {
    2815             std::cout << "in file " << yyfilename << " ";
     2825                std::cout << "in file " << yyfilename << " ";
    28162826        } // if
    28172827        std::cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" << std::endl;
Note: See TracChangeset for help on using the changeset viewer.