Changeset f2f512ba
- Timestamp:
- Jul 20, 2018, 3:52:19 PM (6 years ago)
- 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 1cb35c0
- Parents:
- f7e4db27
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rf7e4db27 rf2f512ba 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 19 17:40:03201813 // Update Count : 110 612 // Last Modified On : Fri Jul 20 14:56:54 2018 13 // Update Count : 1107 14 14 // 15 15 … … 124 124 } // DeclarationNode::clone 125 125 126 void DeclarationNode::print( std::ostream & os, int indent ) const {126 void DeclarationNode::print( std::ostream & os, int indent ) const { 127 127 os << string( indent, ' ' ); 128 128 if ( name ) { … … 160 160 } 161 161 162 void DeclarationNode::printList( std::ostream & os, int indent ) const {162 void DeclarationNode::printList( std::ostream & os, int indent ) const { 163 163 ParseNode::printList( os, indent ); 164 164 if ( hasEllipsis ) { … … 514 514 } // DeclarationNode::copySpecifiers 515 515 516 static void addQualifiersToType( TypeData *& src, TypeData * dst ) {516 static void addQualifiersToType( TypeData *& src, TypeData * dst ) { 517 517 if ( dst->base ) { 518 518 addQualifiersToType( src, dst->base ); … … 567 567 } // addQualifiers 568 568 569 static void addTypeToType( TypeData *& src, TypeData *&dst ) {569 static void addTypeToType( TypeData *& src, TypeData *& dst ) { 570 570 if ( src->forall && dst->kind == TypeData::Function ) { 571 571 if ( dst->forall ) { … … 958 958 } 959 959 960 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) {960 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) { 961 961 SemanticErrorException errors; 962 962 std::back_insert_iterator< std::list< Declaration * > > out( outputList ); … … 1013 1013 } // if 1014 1014 } // if 1015 } catch( SemanticErrorException & e ) {1015 } catch( SemanticErrorException & e ) { 1016 1016 errors.append( e ); 1017 1017 } // try … … 1024 1024 1025 1025 // currently only builds assertions, function parameters, and return values 1026 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ) {1026 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ) { 1027 1027 SemanticErrorException errors; 1028 1028 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList ); … … 1055 1055 * out++ = obj; 1056 1056 } // if 1057 } catch( SemanticErrorException & e ) {1057 } catch( SemanticErrorException & e ) { 1058 1058 errors.append( e ); 1059 1059 } // try … … 1065 1065 } // buildList 1066 1066 1067 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) {1067 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) { 1068 1068 SemanticErrorException errors; 1069 1069 std::back_insert_iterator< std::list< Type * > > out( outputList ); … … 1073 1073 try { 1074 1074 * out++ = cur->buildType(); 1075 } catch( SemanticErrorException & e ) {1075 } catch( SemanticErrorException & e ) { 1076 1076 errors.append( e ); 1077 1077 } // try -
src/Parser/ParseNode.h
rf7e4db27 rf2f512ba 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 19 15:55:26201813 // Update Count : 8 4812 // Last Modified On : Fri Jul 20 14:56:30 2018 13 // Update Count : 850 14 14 // 15 15 … … 68 68 } 69 69 70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {}71 virtual void printList( std::ostream & os, int indent = 0 ) const {70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 71 virtual void printList( std::ostream & os, int indent = 0 ) const { 72 72 print( os, indent ); 73 73 if ( next ) next->print( os, indent ); … … 103 103 InitializerNode * next_init() const { return kids; } 104 104 105 void print( std::ostream & os, int indent = 0 ) const;105 void print( std::ostream & os, int indent = 0 ) const; 106 106 void printOneLine( std::ostream & ) const; 107 107 … … 127 127 ExpressionNode * set_extension( bool exten ) { extension = exten; return this; } 128 128 129 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override {130 os << expr.get() << std::endl;131 } 132 void printOneLine( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {}129 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 130 os << expr.get(); 131 } 132 void printOneLine( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 133 133 134 134 template<typename T> … … 290 290 } 291 291 292 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;293 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;292 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 293 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 294 294 295 295 Declaration * build() const; … … 381 381 virtual StatementNode * append_last_case( StatementNode * ); 382 382 383 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override {383 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 384 384 os << stmt.get() << std::endl; 385 385 } … … 439 439 440 440 template< typename SynTreeType, typename NodeType, template< typename, typename...> class Container, typename... Args > 441 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) {441 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) { 442 442 SemanticErrorException errors; 443 443 std::back_insert_iterator< Container< SynTreeType *, Args... > > out( outputList ); … … 453 453 assertf(false, "buildList unknown type"); 454 454 } // if 455 } catch( SemanticErrorException & e ) {455 } catch( SemanticErrorException & e ) { 456 456 errors.append( e ); 457 457 } // try … … 464 464 465 465 // in DeclarationNode.cc 466 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList );467 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList );468 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList );466 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ); 467 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ); 468 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ); 469 469 470 470 template< typename SynTreeType, typename NodeType > 471 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) {471 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) { 472 472 buildList( firstNode, outputList ); 473 473 delete firstNode;
Note: See TracChangeset
for help on using the changeset viewer.