Ignore:
Timestamp:
Jul 15, 2016, 10:16:47 PM (8 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, 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:
873ffb7
Parents:
5ed9061
Message:

start code allowing structures to no fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r5ed9061 r5d125e4  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 17:26:32 2016
    13 // Update Count     : 1659
     12// Last Modified On : Tue Jul 12 20:52:53 2016
     13// Update Count     : 1661
    1414//
    1515
     
    14521452aggregate_name:
    14531453        aggregate_key '{' field_declaration_list '}'
    1454                 { $$ = DeclarationNode::newAggregate( $1, 0, 0, $3 ); }
     1454                { $$ = DeclarationNode::newAggregate( $1, 0, 0, $3, true ); }
    14551455        | aggregate_key no_attr_identifier_or_type_name
    14561456                {
    14571457                        typedefTable.makeTypedef( *$2 );
    1458                         $$ = DeclarationNode::newAggregate( $1, $2, 0, 0 );
     1458                        $$ = DeclarationNode::newAggregate( $1, $2, 0, 0, false );
    14591459                }
    14601460        | aggregate_key no_attr_identifier_or_type_name
    14611461                { typedefTable.makeTypedef( *$2 ); }
    14621462                '{' field_declaration_list '}'
    1463                 { $$ = DeclarationNode::newAggregate( $1, $2, 0, $5 ); }
     1463                { $$ = DeclarationNode::newAggregate( $1, $2, 0, $5, true ); }
    14641464        | aggregate_key '(' type_name_list ')' '{' field_declaration_list '}' // CFA
    1465                 { $$ = DeclarationNode::newAggregate( $1, 0, $3, $6 ); }
     1465                { $$ = DeclarationNode::newAggregate( $1, 0, $3, $6, false ); }
    14661466        | aggregate_key typegen_name                                            // CFA, S/R conflict
    14671467                { $$ = $2; }
     
    14761476
    14771477field_declaration_list:
    1478         field_declaration
    1479                 { $$ = $1; }
     1478        // empty
     1479                { $$ = 0; }
    14801480        | field_declaration_list field_declaration
    1481                 { $$ = $1->appendList( $2 ); }
     1481                { $$ = $1 != 0 ? $1->appendList( $2 ) : $2; }
    14821482        ;
    14831483
Note: See TracChangeset for help on using the changeset viewer.