Changes in src/SynTree/Statement.cc [60089f4:3be261a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
r60089f4 r3be261a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Apr 28 13:34:32 201612 // Last Modified On : Wed Dec 09 14:09:34 2015 13 13 // Update Count : 54 14 14 // … … 43 43 44 44 void ExprStmt::print( std::ostream &os, int indent ) const { 45 os << "Expression Statement:" << endl << std::string( indent, ' ' );45 os << string( indent, ' ' ) << "Expression Statement:" << endl; 46 46 expr->print( os, indent + 2 ); 47 47 } … … 110 110 111 111 void ReturnStmt::print( std::ostream &os, int indent ) const { 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 } 112 os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: "; 113 if ( expr != 0 ) expr->print( os ); 117 114 os << endl; 118 115 } … … 127 124 128 125 void IfStmt::print( std::ostream &os, int indent ) const { 129 os << "If on condition: " << endl ; 130 os << string( indent+4, ' ' ); 126 os << string( indent, ' ' ) << "If on condition: " << endl ; 131 127 condition->print( os, indent + 4 ); 132 128 133 os << string( indent+2, ' ' ) << "... then: " << endl; 134 135 os << string( indent+4, ' ' ); 129 os << string( indent, ' ' ) << ".... and branches: " << endl; 130 136 131 thenPart->print( os, indent + 4 ); 137 132 138 133 if ( elsePart != 0 ) { 139 os << string( indent+2, ' ' ) << "... else: " << endl;140 os << string( indent+4, ' ' );141 134 elsePart->print( os, indent + 4 ); 142 135 } // if … … 160 153 161 154 void SwitchStmt::print( std::ostream &os, int indent ) const { 162 os << "Switch on condition: ";155 os << string( indent, ' ' ) << "Switch on condition: "; 163 156 condition->print( os ); 164 157 os << endl; … … 225 218 226 219 void ChooseStmt::print( std::ostream &os, int indent ) const { 227 os << "Choose on condition: ";220 os << string( indent, ' ' ) << "Choose on condition: "; 228 221 condition->print( os ); 229 222 os << endl; … … 254 247 255 248 void WhileStmt::print( std::ostream &os, int indent ) const { 256 os << "While on condition: " << endl ;249 os << string( indent, ' ' ) << "While on condition: " << endl ; 257 250 condition->print( os, indent + 4 ); 258 251 … … 280 273 281 274 void ForStmt::print( std::ostream &os, int indent ) const { 282 os << "Labels: {";275 os << string( indent, ' ' ) << "Labels: {"; 283 276 for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) { 284 277 os << *it << ","; … … 321 314 322 315 void TryStmt::print( std::ostream &os, int indent ) const { 323 os << "Try Statement" << endl;316 os << string( indent, ' ' ) << "Try Statement" << endl; 324 317 os << string( indent + 2, ' ' ) << "with block: " << endl; 325 318 block->print( os, indent + 4 ); … … 385 378 386 379 void NullStmt::print( std::ostream &os, int indent ) const { 387 os << "Null Statement" << endl ;380 os << string( indent, ' ' ) << "Null Statement" << endl ; 388 381 } 389 382
Note: See TracChangeset
for help on using the changeset viewer.