Changeset 89231bc for src/SynTree/Statement.cc
- Timestamp:
- Apr 26, 2016, 12:55:40 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.