Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r60089f4 r3be261a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 28 13:34:32 2016
     12// Last Modified On : Wed Dec 09 14:09:34 2015
    1313// Update Count     : 54
    1414//
     
    4343
    4444void ExprStmt::print( std::ostream &os, int indent ) const {
    45         os << "Expression Statement:" << endl << std::string( indent, ' ' );
     45        os << string( indent, ' ' ) << "Expression Statement:" << endl;
    4646        expr->print( os, indent + 2 );
    4747}
     
    110110
    111111void 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 );
    117114        os << endl;
    118115}
     
    127124
    128125void 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 ;
    131127        condition->print( os, indent + 4 );
    132128
    133         os << string( indent+2, ' ' ) << "... then: " << endl;
    134 
    135         os << string( indent+4, ' ' );
     129        os << string( indent, ' ' ) << ".... and branches: " << endl;
     130
    136131        thenPart->print( os, indent + 4 );
    137132
    138133        if ( elsePart != 0 ) {
    139                 os << string( indent+2, ' ' ) << "... else: " << endl;
    140                 os << string( indent+4, ' ' );
    141134                elsePart->print( os, indent + 4 );
    142135        } // if
     
    160153
    161154void SwitchStmt::print( std::ostream &os, int indent ) const {
    162         os << "Switch on condition: ";
     155        os << string( indent, ' ' ) << "Switch on condition: ";
    163156        condition->print( os );
    164157        os << endl;
     
    225218
    226219void ChooseStmt::print( std::ostream &os, int indent ) const {
    227         os << "Choose on condition: ";
     220        os << string( indent, ' ' ) << "Choose on condition: ";
    228221        condition->print( os );
    229222        os << endl;
     
    254247
    255248void WhileStmt::print( std::ostream &os, int indent ) const {
    256         os << "While on condition: " << endl ;
     249        os << string( indent, ' ' ) << "While on condition: " << endl ;
    257250        condition->print( os, indent + 4 );
    258251
     
    280273
    281274void ForStmt::print( std::ostream &os, int indent ) const {
    282         os << "Labels: {";
     275        os << string( indent, ' ' ) << "Labels: {";
    283276        for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
    284277                os << *it << ",";
     
    321314
    322315void TryStmt::print( std::ostream &os, int indent ) const {
    323         os << "Try Statement" << endl;
     316        os << string( indent, ' ' ) << "Try Statement" << endl;
    324317        os << string( indent + 2, ' ' ) << "with block: " << endl;
    325318        block->print( os, indent + 4 );
     
    385378
    386379void NullStmt::print( std::ostream &os, int indent ) const {
    387         os << "Null Statement" << endl ;
     380        os << string( indent, ' ' ) << "Null Statement" << endl ;
    388381}
    389382
Note: See TracChangeset for help on using the changeset viewer.