Changeset 44b5ca0 for src/Parser


Ignore:
Timestamp:
Jun 5, 2015, 8:12:32 AM (10 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, string, with_gc
Children:
a65d92e
Parents:
cf0941d
Message:

remove all carriage returns from printing, work on regression testing

Location:
src/Parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Parser/ExpressionNode.cc

    rcf0941d r44b5ca0  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  4 21:40:22 2015
    13 // Update Count     : 9
     12// Last Modified On : Fri Jun  5 07:44:47 2015
     13// Update Count     : 10
    1414//
    1515
     
    250250void VarRefNode::print( std::ostream &os, int indent ) const {
    251251        printDesignation( os );
    252         os << '\r' << string( indent, ' ') << "Referencing: ";
     252        os << string( indent, ' ' ) << "Referencing: ";
    253253        os << "Variable: " << get_name();
    254254        os << endl;
     
    273273void OperatorNode::print( std::ostream &os, int indent ) const{
    274274        printDesignation( os );
    275         os << '\r' << string( indent, ' ') << "Operator: " << OpName[type] << endl;
     275        os << string( indent, ' ' ) << "Operator: " << OpName[type] << endl;
    276276        return;
    277277}
     
    550550void CompositeExprNode::print( std::ostream &os, int indent ) const {
    551551        printDesignation( os );
    552         os << '\r' << string( indent, ' ') << "Application of: " << endl;
     552        os << string( indent, ' ' ) << "Application of: " << endl;
    553553        function->print( os, indent + ParseNode::indent_by );
    554554
    555         os << '\r' << string( indent, ' ') ;
     555        os << string( indent, ' ' ) ;
    556556        if ( arguments ) {
    557557                os << "... on arguments: " << endl;
  • TabularUnified src/Parser/StatementNode.cc

    rcf0941d r44b5ca0  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun  3 11:55:01 2015
    13 // Update Count     : 8
     12// Last Modified On : Fri Jun  5 07:43:40 2015
     13// Update Count     : 10
    1414//
    1515
     
    4949                                next->set_next( new StatementNode( dynamic_cast< DeclarationNode* >( decl->get_link() ) ) );
    5050                                decl->set_next( 0 );
    51                         }
     51                        } // if
    5252                } else {
    5353                        if ( decl->get_link() ) {
    5454                                next = new StatementNode( dynamic_cast< DeclarationNode* >( decl->get_link() ) );
    5555                                decl->set_next( 0 );
    56                         }
     56                        } // if
    5757                        this->decl = decl;
    58                 }
    59         }
     58                } // if
     59        } // if
    6060}
    6161
     
    9898        } else {
    9999                newnode->target = 0;
    100         }
     100        } // if
    101101        newnode->decl = maybeClone( decl );
    102102        return newnode;
     
    132132                labels->push_front(*l );
    133133                delete l;
    134         }
     134        } // if
    135135        return this;
    136136}
     
    151151                else
    152152                        block->set_link( stmt );
    153         }
     153        } // if
    154154        return this;
    155155}
     
    165165                        else
    166166                                block->set_link( stmt );
    167         }
     167        } // if
    168168        return this;
    169169}
    170170
    171171void StatementNode::print( std::ostream &os, int indent ) const {
    172         if ( labels != 0 )
     172        if ( labels != 0 ) {
    173173                if ( ! labels->empty()) {
    174174                        std::list<std::string>::const_iterator i;
    175175
    176                         os << '\r' << string( indent, ' ');
     176                        os << string( indent, ' ' );
    177177                        for ( i = labels->begin(); i != labels->end(); i++ )
    178178                                os << *i << ":";
    179179                        os << endl;
    180                 }
     180                } // if
     181        } // if
    181182
    182183        switch ( type ) {
     
    193194                break;
    194195          default:
    195                 os << '\r' << string( indent, ' ') << StatementNode::StType[type] << endl;
     196                os << string( indent, ' ' ) << StatementNode::StType[type] << endl;
    196197                if ( type == Catch ) {
    197198                        if ( decl ) {
    198                                 os << '\r' << string( indent + ParseNode::indent_by, ' ' ) << "Declaration: " << endl;
     199                                os << string( indent + ParseNode::indent_by, ' ' ) << "Declaration: " << endl;
    199200                                decl->print( os, indent + 2*ParseNode::indent_by );
    200201                        } else if ( isCatchRest ) {
    201                                 os << '\r' << string( indent + ParseNode::indent_by, ' ' ) << "Catches the rest " << endl;
     202                                os << string( indent + ParseNode::indent_by, ' ' ) << "Catches the rest " << endl;
    202203                        } else {
    203204                                ; // should never reach here
    204                         }
    205                 }
     205                        } // if
     206                } // if
    206207                if ( control ) {
    207                         os << '\r' << string( indent + ParseNode::indent_by, ' ' ) << "Expression: " << endl;
     208                        os << string( indent + ParseNode::indent_by, ' ' ) << "Expression: " << endl;
    208209                        control->printList( os, indent + 2*ParseNode::indent_by );
    209                 }
     210                } // if
    210211                if ( block ) {
    211                         os << '\r' << string( indent + ParseNode::indent_by, ' ' ) << "Branches of execution: " << endl;
     212                        os << string( indent + ParseNode::indent_by, ' ' ) << "Branches of execution: " << endl;
    212213                        block->printList( os, indent + 2*ParseNode::indent_by ); 
    213                 }
     214                } // if
    214215                if ( target ) {
    215                         os << '\r' << string( indent + ParseNode::indent_by, ' ' ) << "Target: " << get_target() << endl;
    216                 }
     216                        os << string( indent + ParseNode::indent_by, ' ' ) << "Target: " << get_target() << endl;
     217                } // if
    217218                break;
    218         }
     219        } // switch
    219220}
    220221
     
    227228                std::back_insert_iterator< std::list<Label> > lab_it( labs );
    228229                copy( labels->begin(), labels->end(), lab_it );
    229         }
     230        } // if
    230231
    231232        // try {
     
    254255                                elseb = branches.front();
    255256                                branches.pop_front();
    256                         }
     257                        } // if
    257258                        return new IfStmt( labs, notZeroExpr( get_control()->build() ), thenb, elseb );
    258259                }
     
    299300                                assert( get_control() != 0 );
    300301                                return new BranchStmt( labs, get_control()->build(), BranchStmt::Goto );
    301                         }
     302                        } // if
    302303
    303304                        return new BranchStmt( labs, get_target(), BranchStmt::Goto );
     
    322323                        if ( ( finallyBlock = dynamic_cast<FinallyStmt *>( branches.back())) ) {
    323324                                branches.pop_back();
    324                         }
     325                        } // if
    325326                        return new TryStmt( labs, tryBlock, branches, finallyBlock );
    326327                }
     
    342343                // shouldn't be here
    343344                return 0;
    344         }
     345        } // switch
    345346}
    346347
     
    356357        } else {
    357358                last = 0;
    358         }
     359        } // if
    359360}
    360361
     
    367368                last->set_link( stmt );
    368369                last = ( StatementNode *)( stmt->get_link());
    369         }
     370        } // if
    370371}
    371372
     
    373374        if ( first ) {
    374375                first->printList( os, indent+2 );
    375         }
     376        } // if
    376377}
    377378
     
    383384                std::back_insert_iterator< std::list<Label> > lab_it( labs );
    384385                copy( labels->begin(), labels->end(), lab_it );
    385         }
     386        } // if
    386387
    387388        CompoundStmt *cs = new CompoundStmt( labs );
     
    391392
    392393void NullStmtNode::print( ostream &os, int indent ) const {
    393         os << "\r" << string( indent, ' ') << "Null Statement:" << endl;
     394        os << string( indent, ' ' ) << "Null Statement:" << endl;
    394395}
    395396
Note: See TracChangeset for help on using the changeset viewer.