Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r6ea87486 re6cee92  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:55:00 2017
    13 // Update Count     : 1020
     12// Last Modified On : Wed Jun 28 15:27:00 2017
     13// Update Count     : 1019
    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;
    257255        return newnode;
    258256} // DeclarationNode::newAggregate
     
    275273        return newnode;
    276274} // DeclarationNode::newEnumConstant
    277 
    278 DeclarationNode * 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
    291275
    292276DeclarationNode * DeclarationNode::newName( string * name ) {
     
    345329} // DeclarationNode::newTypeDecl
    346330
    347 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {
    348         DeclarationNode * newnode = new DeclarationNode;
    349         newnode->type = new TypeData( TypeData::Pointer );
     331DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) {
     332        DeclarationNode * newnode = new DeclarationNode;
     333        newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference );
    350334        if ( qualifiers ) {
    351335                return newnode->addQualifiers( qualifiers );
     
    764748DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) {
    765749        if ( p ) {
    766                 assert( p->type->kind == TypeData::Pointer );
     750                assert( p->type->kind == TypeData::Pointer || TypeData::Reference );
    767751                setBase( p->type );
    768752                p->type = nullptr;
     
    786770DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) {
    787771        if ( p ) {
    788                 assert( p->type->kind == TypeData::Pointer );
     772                assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference );
    789773                if ( type ) {
    790774                        switch ( type->kind ) {
Note: See TracChangeset for help on using the changeset viewer.