Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r843054c2 r5f2f2d7  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:27:07 2015
    13 // Update Count     : 2
     12// Last Modified On : Sun Jun  7 08:40:46 2015
     13// Update Count     : 16
    1414//
    1515
     
    5050}
    5151
    52 void Expression::print(std::ostream &os, int indent) const {
     52void Expression::print( std::ostream &os, int indent ) const {
    5353        if ( env ) {
    54                 os << std::string(indent, ' ') << "with environment:" << std::endl;
     54                os << std::string( indent, ' ' ) << "with environment:" << std::endl;
    5555                env->print( os, indent+2 );
    5656        } // if
    5757
    5858        if ( argName ) {
    59                 os << std::string(indent, ' ') << "with designator:";
     59                os << std::string( indent, ' ' ) << "with designator:";
    6060                argName->print( os, indent+2 );
    6161        } // if
     
    7272
    7373void ConstantExpr::print( std::ostream &os, int indent ) const {
    74         os << std::string(indent, ' ') << "Constant Expression: " ;
    75         constant.print(os);
    76         os << std::endl;
     74        os << "constant expression " ;
     75        constant.print( os );
    7776        Expression::print( os, indent );
    7877}
     
    9392
    9493void VariableExpr::print( std::ostream &os, int indent ) const {
    95         os << std::string(indent, ' ') << "Variable Expression: ";
     94        os << std::string( indent, ' ' ) << "Variable Expression: ";
    9695
    9796        Declaration *decl = get_var();
     
    122121
    123122void SizeofExpr::print( std::ostream &os, int indent) const {
    124         os << std::string(indent, ' ') << "Sizeof Expression on: ";
     123        os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
    125124
    126125        if (isType)
     
    152151
    153152void AttrExpr::print( std::ostream &os, int indent) const {
    154         os << std::string(indent, ' ') << "Attr ";
     153        os << std::string( indent, ' ' ) << "Attr ";
    155154        attr->print( os, indent + 2 );
    156155        if ( isType || expr ) {
     
    184183
    185184void CastExpr::print( std::ostream &os, int indent ) const {
    186         os << std::string(indent, ' ') << "Cast of:" << std::endl;
     185        os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
    187186        arg->print(os, indent+2);
    188         os << std::endl << std::string(indent, ' ') << "to:" << std::endl;
     187        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
    189188        if ( results.empty() ) {
    190                 os << std::string(indent+2, ' ') << "nothing" << std::endl;
     189                os << std::string( indent+2, ' ' ) << "nothing" << std::endl;
    191190        } else {
    192191                printAll(results, os, indent+2);
     
    207206
    208207void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
    209         os << std::string(indent, ' ') << "Member Expression, with field: " << get_member();
     208        os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
    210209
    211210        Expression *agg = get_aggregate();
    212         os << std::string(indent, ' ') << "from aggregate: ";
     211        os << std::string( indent, ' ' ) << "from aggregate: ";
    213212        if (agg != 0) agg->print(os, indent + 2);
    214213        Expression::print( os, indent );
     
    234233
    235234void MemberExpr::print( std::ostream &os, int indent ) const {
    236         os << std::string(indent, ' ') << "Member Expression, with field: " << std::endl;
     235        os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
    237236
    238237        assert( member );
    239         os << std::string(indent + 2, ' ');
     238        os << std::string( indent + 2, ' ' );
    240239        member->print( os, indent + 2 );
    241240        os << std::endl;
    242241
    243242        Expression *agg = get_aggregate();
    244         os << std::string(indent, ' ') << "from aggregate: " << std::endl;
     243        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
    245244        if (agg != 0) agg->print(os, indent + 2);
    246245        Expression::print( os, indent );
     
    261260
    262261void UntypedExpr::print( std::ostream &os, int indent ) const {
    263         os << std::string(indent, ' ') << "Applying untyped: " << std::endl;
     262        os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
    264263        function->print(os, indent + 4);
    265         os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;
     264        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    266265        printArgs(os, indent + 4);
    267266        Expression::print( os, indent );
     
    282281
    283282void NameExpr::print( std::ostream &os, int indent ) const {
    284         os << std::string(indent, ' ') << "Name: " << get_name() << std::endl;
     283        os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
    285284        Expression::print( os, indent );
    286285}
     
    301300
    302301void LogicalExpr::print( std::ostream &os, int indent )const {
    303         os << std::string(indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
     302        os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    304303        arg1->print(os);
    305304        os << " and ";
     
    323322
    324323void ConditionalExpr::print( std::ostream &os, int indent ) const {
    325         os << std::string(indent, ' ') << "Conditional expression on: " << std::endl;
     324        os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl;
    326325        arg1->print( os, indent+2 );
    327         os << std::string(indent, ' ') << "First alternative:" << std::endl;
     326        os << std::string( indent, ' ' ) << "First alternative:" << std::endl;
    328327        arg2->print( os, indent+2 );
    329         os << std::string(indent, ' ') << "Second alternative:" << std::endl;
     328        os << std::string( indent, ' ' ) << "Second alternative:" << std::endl;
    330329        arg3->print( os, indent+2 );
    331330        os << std::endl;
     
    334333
    335334void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    336         os << std::string(indent, ' ') << "Valof Expression: " << std::endl;
     335        os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
    337336        if ( get_body() != 0 )
    338337                get_body()->print( os, indent + 2 );
Note: See TracChangeset for help on using the changeset viewer.