Changeset 89231bc
- Timestamp:
- Apr 26, 2016, 12:55:40 PM (7 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 60089f4, 668edd6b
- Parents:
- dc5376a
- Location:
- src/SynTree
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AddressExpr.cc
rdc5376a r89231bc 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // AddressExpr.cc -- 7 // AddressExpr.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 23:54:44 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue May 19 16:52:51 201511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Apr 26 12:35:13 2016 13 13 // Update Count : 6 14 14 // … … 32 32 33 33 void AddressExpr::print( std::ostream &os, int indent ) const { 34 os << std::string( indent, ' ' ) <<"Address of:" << std::endl;34 os << "Address of:" << std::endl; 35 35 if ( arg ) { 36 arg->print( os, indent+2 ); 36 os << std::string( indent+2, ' ' ); 37 arg->print( os, indent+2 ); 37 38 } // if 38 39 } -
src/SynTree/ApplicationExpr.cc
rdc5376a r89231bc 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ApplicationExpr.cc.cc -- 7 // ApplicationExpr.cc.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 18 07:54:17 201511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Apr 26 12:41:06 2016 13 13 // Update Count : 4 14 14 // … … 47 47 FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ); 48 48 assert( function ); 49 49 50 50 for ( std::list< DeclarationWithType* >::const_iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) { 51 51 get_results().push_back( (*i)->get_type()->clone() ); … … 64 64 65 65 void ApplicationExpr::print( std::ostream &os, int indent ) const { 66 os << std::string( indent, ' ' ) << "Application of" << std::endl;66 os << "Application of" << std::endl << std::string(indent, ' '); 67 67 function->print( os, indent+2 ); 68 68 if ( ! args.empty() ) { -
src/SynTree/Expression.cc
rdc5376a r89231bc 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Apr 8 17:16:23201611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Apr 26 12:52:40 2016 13 13 // Update Count : 40 14 14 // … … 93 93 94 94 void VariableExpr::print( std::ostream &os, int indent ) const { 95 os << std::string( indent, ' ' ) <<"Variable Expression: ";95 os << "Variable Expression: "; 96 96 97 97 Declaration *decl = get_var(); … … 122 122 123 123 void SizeofExpr::print( std::ostream &os, int indent) const { 124 os << std::string( indent, ' ' ) <<"Sizeof Expression on: ";124 os << "Sizeof Expression on: "; 125 125 126 126 if (isType) … … 295 295 296 296 void CastExpr::print( std::ostream &os, int indent ) const { 297 os << std::string( indent, ' ' ) << "Cast of:" << std::endl;297 os << "Cast of:" << std::endl << std::string( indent+2, ' ' ); 298 298 arg->print(os, indent+2); 299 299 os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl; … … 318 318 319 319 void UntypedMemberExpr::print( std::ostream &os, int indent ) const { 320 os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();320 os << "Untyped Member Expression, with field: " << get_member(); 321 321 322 322 Expression *agg = get_aggregate(); 323 323 os << std::string( indent, ' ' ) << "from aggregate: "; 324 if (agg != 0) agg->print(os, indent + 2); 324 if (agg != 0) { 325 os << std::string( indent+2, ' ' ); 326 agg->print(os, indent + 2); 327 } 328 os << std::string( indent+2, ' ' ); 325 329 Expression::print( os, indent ); 326 330 } … … 345 349 346 350 void MemberExpr::print( std::ostream &os, int indent ) const { 347 os << std::string( indent, ' ' ) <<"Member Expression, with field: " << std::endl;351 os << "Member Expression, with field: " << std::endl; 348 352 349 353 assert( member ); … … 354 358 Expression *agg = get_aggregate(); 355 359 os << std::string( indent, ' ' ) << "from aggregate: " << std::endl; 356 if (agg != 0) agg->print(os, indent + 2); 360 if (agg != 0) { 361 os << std::string( indent+2, ' ' ); 362 agg->print(os, indent + 2); 363 } 364 os << std::string( indent+2, ' ' ); 357 365 Expression::print( os, indent ); 358 366 } … … 372 380 373 381 void UntypedExpr::print( std::ostream &os, int indent ) const { 374 os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl; 382 os << "Applying untyped: " << std::endl; 383 os << std::string( indent, ' ' ); 375 384 function->print(os, indent + 4); 376 385 os << std::string( indent, ' ' ) << "...to: " << std::endl; 386 os << std::string( indent, ' ' ); 377 387 printArgs(os, indent + 4); 378 388 Expression::print( os, indent ); … … 393 403 394 404 void NameExpr::print( std::ostream &os, int indent ) const { 395 os << std::string( indent, ' ' ) <<"Name: " << get_name() << std::endl;405 os << "Name: " << get_name() << std::endl; 396 406 Expression::print( os, indent ); 397 407 } -
src/SynTree/Initializer.cc
rdc5376a r89231bc 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Initializer.cc -- 7 // Initializer.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:05:25 201513 // Update Count : 1412 // Last Modified On : Tue Apr 26 12:50:47 2016 13 // Update Count : 28 14 14 // 15 15 … … 31 31 void Initializer::print( std::ostream &os, int indent ) {} 32 32 33 SingleInit::SingleInit( Expression *v, std::list< Expression *> &_designators ) : value ( v ), designators( _designators ) { 33 SingleInit::SingleInit( Expression *v, std::list< Expression *> &_designators ) : value ( v ), designators( _designators ) { 34 34 } 35 35 … … 65 65 66 66 void ListInit::print( std::ostream &os, int indent ) { 67 os << std::endl << std::string(indent, ' ') << "Compound initializer: "; 67 os << std::endl << std::string(indent, ' ') << "Compound initializer: "; 68 68 if ( ! designators.empty() ) { 69 69 os << std::string(indent + 2, ' ' ) << "designated by: ["; 70 70 for ( std::list < Expression * >::iterator i = designators.begin(); 71 71 i != designators.end(); i++ ) { 72 ( *i )->print(os, indent + 4 ); 72 ( *i )->print(os, indent + 4 ); 73 73 } // for 74 74 75 75 os << std::string(indent + 2, ' ' ) << "]"; 76 76 } // if 77 77 78 for ( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ ) 78 for ( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ ) 79 79 (*i)->print( os, indent + 2 ); 80 80 } -
src/SynTree/ObjectDecl.cc
rdc5376a r89231bc 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ObjectDecl.cc -- 7 // ObjectDecl.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Sep 29 14:13:01 201513 // Update Count : 1812 // Last Modified On : Tue Apr 26 12:53:13 2016 13 // Update Count : 30 14 14 // 15 15 … … 69 69 #if 0 70 70 if ( get_mangleName() != "") { 71 os << get_mangleName() << ": "; 72 } else 71 os << get_mangleName() << ": "; 72 } else 73 73 #endif 74 74 if ( get_name() != "" ) { -
src/SynTree/Statement.cc
rdc5376a r89231bc 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Dec 09 14:09:34 201512 // Last Modified On : Tue Apr 26 12:33:33 2016 13 13 // Update Count : 54 14 14 // … … 43 43 44 44 void ExprStmt::print( std::ostream &os, int indent ) const { 45 os << string( indent, ' ' ) << "Expression Statement:" << endl;45 os << "Expression Statement:" << endl << std::string( indent, ' ' ); 46 46 expr->print( os, indent + 2 ); 47 47 } … … 110 110 111 111 void ReturnStmt::print( std::ostream &os, int indent ) const { 112 os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: "; 113 if ( expr != 0 ) expr->print( os ); 112 os << string ( isThrow? "Throw":"Return" ) << " Statement, returning: "; 113 if ( expr != 0 ) { 114 os << endl << string( indent+2, ' ' ); 115 expr->print( os, indent + 2 ); 116 } 114 117 os << endl; 115 118 } … … 124 127 125 128 void IfStmt::print( std::ostream &os, int indent ) const { 126 os << string( indent, ' ' ) <<"If on condition: " << endl ;129 os << "If on condition: " << endl ; 127 130 condition->print( os, indent + 4 ); 128 131 … … 153 156 154 157 void SwitchStmt::print( std::ostream &os, int indent ) const { 155 os << string( indent, ' ' ) <<"Switch on condition: ";158 os << "Switch on condition: "; 156 159 condition->print( os ); 157 160 os << endl; … … 218 221 219 222 void ChooseStmt::print( std::ostream &os, int indent ) const { 220 os << string( indent, ' ' ) <<"Choose on condition: ";223 os << "Choose on condition: "; 221 224 condition->print( os ); 222 225 os << endl; … … 247 250 248 251 void WhileStmt::print( std::ostream &os, int indent ) const { 249 os << string( indent, ' ' ) <<"While on condition: " << endl ;252 os << "While on condition: " << endl ; 250 253 condition->print( os, indent + 4 ); 251 254 … … 273 276 274 277 void ForStmt::print( std::ostream &os, int indent ) const { 275 os << string( indent, ' ' ) <<"Labels: {";278 os << "Labels: {"; 276 279 for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) { 277 280 os << *it << ","; … … 314 317 315 318 void TryStmt::print( std::ostream &os, int indent ) const { 316 os << string( indent, ' ' ) <<"Try Statement" << endl;319 os << "Try Statement" << endl; 317 320 os << string( indent + 2, ' ' ) << "with block: " << endl; 318 321 block->print( os, indent + 4 ); … … 378 381 379 382 void NullStmt::print( std::ostream &os, int indent ) const { 380 os << string( indent, ' ' ) <<"Null Statement" << endl ;383 os << "Null Statement" << endl ; 381 384 } 382 385
Note: See TracChangeset
for help on using the changeset viewer.