Changeset 15596d7 for src/Parser/DeclarationNode.cc
- Timestamp:
- Mar 14, 2023, 11:15:15 AM (17 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 9fa61f5
- Parents:
- 089a0d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r089a0d7 r15596d7 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 25 12:15:40202313 // Update Count : 140 412 // Last Modified On : Tue Mar 14 08:54:13 2023 13 // Update Count : 1405 14 14 // 15 15 … … 600 600 } else { 601 601 switch ( dst->kind ) { 602 case TypeData::Unknown:602 case TypeData::Unknown: 603 603 src->qualifiers |= dst->qualifiers; 604 604 dst = src; 605 605 src = nullptr; 606 606 break; 607 case TypeData::Basic:607 case TypeData::Basic: 608 608 dst->qualifiers |= src->qualifiers; 609 609 if ( src->kind != TypeData::Unknown ) { … … 633 633 } // if 634 634 break; 635 default:635 default: 636 636 switch ( src->kind ) { 637 case TypeData::Aggregate:638 case TypeData::Enum:637 case TypeData::Aggregate: 638 case TypeData::Enum: 639 639 dst->base = new TypeData( TypeData::AggregateInst ); 640 640 dst->base->aggInst.aggregate = src; … … 645 645 src = nullptr; 646 646 break; 647 default:647 default: 648 648 if ( dst->forall ) { 649 649 dst->forall->appendList( src->forall ); … … 727 727 assert( type ); 728 728 switch ( type->kind ) { 729 case TypeData::Symbolic:729 case TypeData::Symbolic: 730 730 if ( type->symbolic.assertions ) { 731 731 type->symbolic.assertions->appendList( assertions ); … … 734 734 } // if 735 735 break; 736 default:736 default: 737 737 assert( false ); 738 738 } // switch … … 833 833 if ( type ) { 834 834 switch ( type->kind ) { 835 case TypeData::Aggregate:836 case TypeData::Enum:835 case TypeData::Aggregate: 836 case TypeData::Enum: 837 837 p->type->base = new TypeData( TypeData::AggregateInst ); 838 838 p->type->base->aggInst.aggregate = type; … … 843 843 break; 844 844 845 default:845 default: 846 846 p->type->base = type; 847 847 } // switch … … 865 865 866 866 DeclarationNode * DeclarationNode::addNewArray( DeclarationNode * a ) { 867 867 if ( ! a ) return this; 868 868 assert( a->type->kind == TypeData::Array ); 869 869 TypeData * lastArray = findLast( a->type ); 870 870 if ( type ) { 871 871 switch ( type->kind ) { 872 case TypeData::Aggregate:873 case TypeData::Enum:872 case TypeData::Aggregate: 873 case TypeData::Enum: 874 874 lastArray->base = new TypeData( TypeData::AggregateInst ); 875 875 lastArray->base->aggInst.aggregate = type; … … 879 879 lastArray->base->qualifiers |= type->qualifiers; 880 880 break; 881 default:881 default: 882 882 lastArray->base = type; 883 883 } // switch … … 1245 1245 1246 1246 switch ( type->kind ) { 1247 case TypeData::Enum:1248 case TypeData::Aggregate: {1249 ReferenceToType * ret = buildComAggInst( type, attributes, linkage );1250 buildList( type->aggregate.actuals, ret->get_parameters() );1251 return ret;1252 }1253 case TypeData::Symbolic: {1254 TypeInstType * ret = new TypeInstType( buildQualifiers( type ), *type->symbolic.name, false, attributes );1255 buildList( type->symbolic.actuals, ret->get_parameters() );1256 return ret;1257 }1258 default:1247 case TypeData::Enum: 1248 case TypeData::Aggregate: { 1249 ReferenceToType * ret = buildComAggInst( type, attributes, linkage ); 1250 buildList( type->aggregate.actuals, ret->get_parameters() ); 1251 return ret; 1252 } 1253 case TypeData::Symbolic: { 1254 TypeInstType * ret = new TypeInstType( buildQualifiers( type ), *type->symbolic.name, false, attributes ); 1255 buildList( type->symbolic.actuals, ret->get_parameters() ); 1256 return ret; 1257 } 1258 default: 1259 1259 Type * simpletypes = typebuild( type ); 1260 1260 simpletypes->get_attributes() = attributes; // copy because member is const
Note: See TracChangeset
for help on using the changeset viewer.