Changeset b38f6da
- Timestamp:
- Jun 17, 2023, 6:48:23 PM (17 months ago)
- Branches:
- master
- Children:
- a983cbf
- Parents:
- 600478d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r600478d rb38f6da 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Apr 20 11:46:00202313 // Update Count : 1 39311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 14:41:48 2023 13 // Update Count : 1405 14 14 // 15 15 … … 459 459 std::vector<ast::ptr<ast::Expr>> exprs; 460 460 buildList( expr, exprs ); 461 newnode->attributes.push_back( 462 new ast::Attribute( *name, std::move( exprs ) ) ); 461 newnode->attributes.push_back( new ast::Attribute( *name, std::move( exprs ) ) ); 463 462 delete name; 464 463 return newnode; … … 633 632 dst->basictype = src->basictype; 634 633 } else if ( src->basictype != DeclarationNode::NoBasicType ) 635 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 634 SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::basicTypeNames[ dst->basictype ] + 635 "\" and \"" + DeclarationNode::basicTypeNames[ src->basictype ] + "\"." ); 636 636 637 637 if ( dst->complextype == DeclarationNode::NoComplexType ) { 638 638 dst->complextype = src->complextype; 639 639 } else if ( src->complextype != DeclarationNode::NoComplexType ) 640 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 640 SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::complexTypeNames[ src->complextype ] + 641 "\" and \"" + DeclarationNode::complexTypeNames[ src->complextype ] + "\"." ); 641 642 642 643 if ( dst->signedness == DeclarationNode::NoSignedness ) { 643 644 dst->signedness = src->signedness; 644 645 } else if ( src->signedness != DeclarationNode::NoSignedness ) 645 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 646 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::signednessNames[ dst->signedness ] + 647 "\" and \"" + DeclarationNode::signednessNames[ src->signedness ] + "\"." ); 646 648 647 649 if ( dst->length == DeclarationNode::NoLength ) { … … 650 652 dst->length = DeclarationNode::LongLong; 651 653 } else if ( src->length != DeclarationNode::NoLength ) 652 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 654 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::lengthNames[ dst->length ] + 655 "\" and \"" + DeclarationNode::lengthNames[ src->length ] + "\"." ); 653 656 } // if 654 657 break; … … 718 721 719 722 DeclarationNode * DeclarationNode::addEnumBase( DeclarationNode * o ) { 720 if ( o && o ->type) {723 if ( o && o->type) { 721 724 type->base= o->type; 722 } 725 } // if 723 726 delete o; 724 727 return this; … … 1003 1006 } 1004 1007 1005 // If a typedef wraps an anonymous declaration, name the inner declaration 1006 // so it has a consistent name acrosstranslation units.1008 // If a typedef wraps an anonymous declaration, name the inner declaration so it has a consistent name across 1009 // translation units. 1007 1010 static void nameTypedefedDecl( 1008 1011 DeclarationNode * innerDecl, … … 1085 1088 } 1086 1089 1087 void buildList( DeclarationNode * firstNode, 1088 std::vector<ast::ptr<ast::Decl>> & outputList ) { 1090 void buildList( DeclarationNode * firstNode, std::vector<ast::ptr<ast::Decl>> & outputList ) { 1089 1091 SemanticErrorException errors; 1090 1092 std::back_insert_iterator<std::vector<ast::ptr<ast::Decl>>> out( outputList );
Note: See TracChangeset
for help on using the changeset viewer.