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