Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r5f2f2d7 r843054c2  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jun  7 08:40:46 2015
    13 // Update Count     : 16
     12// Last Modified On : Mon May 18 08:27:07 2015
     13// Update Count     : 2
    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 << "constant expression " ;
    75         constant.print( os );
     74        os << std::string(indent, ' ') << "Constant Expression: " ;
     75        constant.print(os);
     76        os << std::endl;
    7677        Expression::print( os, indent );
    7778}
     
    9293
    9394void VariableExpr::print( std::ostream &os, int indent ) const {
    94         os << std::string( indent, ' ' ) << "Variable Expression: ";
     95        os << std::string(indent, ' ') << "Variable Expression: ";
    9596
    9697        Declaration *decl = get_var();
     
    121122
    122123void SizeofExpr::print( std::ostream &os, int indent) const {
    123         os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
     124        os << std::string(indent, ' ') << "Sizeof Expression on: ";
    124125
    125126        if (isType)
     
    151152
    152153void AttrExpr::print( std::ostream &os, int indent) const {
    153         os << std::string( indent, ' ' ) << "Attr ";
     154        os << std::string(indent, ' ') << "Attr ";
    154155        attr->print( os, indent + 2 );
    155156        if ( isType || expr ) {
     
    183184
    184185void CastExpr::print( std::ostream &os, int indent ) const {
    185         os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
     186        os << std::string(indent, ' ') << "Cast of:" << std::endl;
    186187        arg->print(os, indent+2);
    187         os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     188        os << std::endl << std::string(indent, ' ') << "to:" << std::endl;
    188189        if ( results.empty() ) {
    189                 os << std::string( indent+2, ' ' ) << "nothing" << std::endl;
     190                os << std::string(indent+2, ' ') << "nothing" << std::endl;
    190191        } else {
    191192                printAll(results, os, indent+2);
     
    206207
    207208void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
    208         os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
     209        os << std::string(indent, ' ') << "Member Expression, with field: " << get_member();
    209210
    210211        Expression *agg = get_aggregate();
    211         os << std::string( indent, ' ' ) << "from aggregate: ";
     212        os << std::string(indent, ' ') << "from aggregate: ";
    212213        if (agg != 0) agg->print(os, indent + 2);
    213214        Expression::print( os, indent );
     
    233234
    234235void MemberExpr::print( std::ostream &os, int indent ) const {
    235         os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
     236        os << std::string(indent, ' ') << "Member Expression, with field: " << std::endl;
    236237
    237238        assert( member );
    238         os << std::string( indent + 2, ' ' );
     239        os << std::string(indent + 2, ' ');
    239240        member->print( os, indent + 2 );
    240241        os << std::endl;
    241242
    242243        Expression *agg = get_aggregate();
    243         os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
     244        os << std::string(indent, ' ') << "from aggregate: " << std::endl;
    244245        if (agg != 0) agg->print(os, indent + 2);
    245246        Expression::print( os, indent );
     
    260261
    261262void UntypedExpr::print( std::ostream &os, int indent ) const {
    262         os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
     263        os << std::string(indent, ' ') << "Applying untyped: " << std::endl;
    263264        function->print(os, indent + 4);
    264         os << std::string( indent, ' ' ) << "...to: " << std::endl;
     265        os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;
    265266        printArgs(os, indent + 4);
    266267        Expression::print( os, indent );
     
    281282
    282283void NameExpr::print( std::ostream &os, int indent ) const {
    283         os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
     284        os << std::string(indent, ' ') << "Name: " << get_name() << std::endl;
    284285        Expression::print( os, indent );
    285286}
     
    300301
    301302void LogicalExpr::print( std::ostream &os, int indent )const {
    302         os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
     303        os << std::string(indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    303304        arg1->print(os);
    304305        os << " and ";
     
    322323
    323324void ConditionalExpr::print( std::ostream &os, int indent ) const {
    324         os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl;
     325        os << std::string(indent, ' ') << "Conditional expression on: " << std::endl;
    325326        arg1->print( os, indent+2 );
    326         os << std::string( indent, ' ' ) << "First alternative:" << std::endl;
     327        os << std::string(indent, ' ') << "First alternative:" << std::endl;
    327328        arg2->print( os, indent+2 );
    328         os << std::string( indent, ' ' ) << "Second alternative:" << std::endl;
     329        os << std::string(indent, ' ') << "Second alternative:" << std::endl;
    329330        arg3->print( os, indent+2 );
    330331        os << std::endl;
     
    333334
    334335void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    335         os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
     336        os << std::string(indent, ' ') << "Valof Expression: " << std::endl;
    336337        if ( get_body() != 0 )
    337338                get_body()->print( os, indent + 2 );
Note: See TracChangeset for help on using the changeset viewer.