Changeset bac5158 for src/Parser


Ignore:
Timestamp:
Jul 15, 2017, 9:47:54 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
478b1d0
Parents:
994d080 (diff), 6ea87486 (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:

fix conflict

Location:
src/Parser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r994d080 rbac5158  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 28 15:27:00 2017
    13 // Update Count     : 1019
     12// Last Modified On : Fri Jul 14 16:55:00 2017
     13// Update Count     : 1020
    1414//
    1515
     
    253253        newnode->type->aggregate.fields = fields;
    254254        newnode->type->aggregate.body = body;
     255        newnode->type->aggregate.tagged = false;
     256        newnode->type->aggregate.parent = nullptr;
    255257        return newnode;
    256258} // DeclarationNode::newAggregate
     
    273275        return newnode;
    274276} // DeclarationNode::newEnumConstant
     277
     278DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
     279        assert( name );
     280        DeclarationNode * newnode = new DeclarationNode;
     281        newnode->type = new TypeData( TypeData::Aggregate );
     282        newnode->type->aggregate.kind = kind;
     283        newnode->type->aggregate.name = name;
     284        newnode->type->aggregate.actuals = actuals;
     285        newnode->type->aggregate.fields = fields;
     286        newnode->type->aggregate.body = body;
     287        newnode->type->aggregate.tagged = true;
     288        newnode->type->aggregate.parent = parent;
     289        return newnode;
     290} // DeclarationNode::newTreeStruct
    275291
    276292DeclarationNode * DeclarationNode::newName( string * name ) {
  • src/Parser/ParseNode.h

    r994d080 rbac5158  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jun 12 13:00:00 2017
    13 // Update Count     : 779
     12// Last Modified On : Fri Jul 14 16:56:00 2017
     13// Update Count     : 780
    1414//
    1515
     
    248248        static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement
    249249
     250        // Perhaps this would best fold into newAggragate.
     251        static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body );
     252
    250253        DeclarationNode();
    251254        ~DeclarationNode();
     
    332335
    333336        static UniqueName anonymous;
     337
     338        // Temp to test TreeStruct
     339        const std::string * parent_name;
    334340}; // DeclarationNode
    335341
  • src/Parser/TypeData.cc

    r994d080 rbac5158  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 28 15:28:00 2017
    13 // Update Count     : 564
     12// Last Modified On : Fri Jul 14 16:58:00 2017
     13// Update Count     : 565
    1414//
    1515
     
    6363                aggregate.fields = nullptr;
    6464                aggregate.body = false;
     65                aggregate.tagged = false;
     66                aggregate.parent = nullptr;
    6567                break;
    6668          case AggregateInst:
     
    121123                delete aggregate.actuals;
    122124                delete aggregate.fields;
     125                delete aggregate.parent;
    123126                // delete aggregate;
    124127                break;
     
    192195                newtype->aggregate.kind = aggregate.kind;
    193196                newtype->aggregate.body = aggregate.body;
     197                newtype->aggregate.tagged = aggregate.tagged;
     198                newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;
    194199                break;
    195200          case AggregateInst:
     
    619624        switch ( td->aggregate.kind ) {
    620625          case DeclarationNode::Struct:
     626                if ( td->aggregate.tagged ) {
     627                        at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );
     628                        buildForall( td->aggregate.params, at->get_parameters() );
     629                        break;
     630                }
    621631          case DeclarationNode::Coroutine:
    622632          case DeclarationNode::Monitor:
  • src/Parser/TypeData.h

    r994d080 rbac5158  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 28 15:29:00 2017
    13 // Update Count     : 186
     12// Last Modified On : Fri Jul 14 16:57:00 2017
     13// Update Count     : 187
    1414//
    1515
     
    3131                DeclarationNode * fields;
    3232                bool body;
     33
     34                bool tagged;
     35                const std::string * parent;
    3336        };
    3437
  • src/Parser/parser.yy

    r994d080 rbac5158  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 15 08:17:48 2017
    13 // Update Count     : 2450
     12// Last Modified On : Sat Jul 15 09:46:26 2017
     13// Update Count     : 2451
    1414//
    1515
     
    16791679        | aggregate_key attribute_list_opt typegen_name         // CFA
    16801680                { $$ = $3->addQualifiers( $2 ); }
     1681
     1682// Temp, testing TreeStruct
     1683    | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name
     1684        {
     1685            typedefTable.makeTypedef( *$4 );            // create typedef
     1686            if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
     1687            forall = false;                             // reset
     1688        }
     1689      '{' field_declaration_list '}'
     1690        {
     1691            $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
     1692                $4, nullptr, nullptr, $7, true )->addQualifiers( $3 );
     1693        }
     1694    | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name TYPEDEFname
     1695        {
     1696            typedefTable.makeTypedef( *$4 );            // create typedef
     1697            if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $
     1698            forall = false;                             // reset
     1699        }
     1700      '{' field_declaration_list '}'
     1701        {
     1702            $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct,
     1703                $4, $5, nullptr, $8, true )->addQualifiers( $3 );
     1704        }
    16811705        ;
    16821706
Note: See TracChangeset for help on using the changeset viewer.