Changeset 44b5ca0 for src/SynTree


Ignore:
Timestamp:
Jun 5, 2015, 8:12:32 AM (9 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/SynTree
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/CompoundStmt.cc

    rcf0941d r44b5ca0  
    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:11:02 2015
    13 // Update Count     : 1
     12// Last Modified On : Fri Jun  5 07:46:03 2015
     13// Update Count     : 2
    1414//
    1515
     
    3434
    3535void CompoundStmt::print( std::ostream &os, int indent ) {
    36         os << "\r" << string(indent, ' ') << "CompoundStmt" << endl ;
    37         printAll( kids, os, indent+2 );
     36        os << string( indent, ' ' ) << "CompoundStmt" << endl ;
     37        printAll( kids, os, indent + 2 );
    3838}
    3939
  • src/SynTree/Expression.cc

    rcf0941d r44b5ca0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  4 21:42:55 2015
    13 // Update Count     : 10
     12// Last Modified On : Fri Jun  5 07:51:09 2015
     13// Update Count     : 11
    1414//
    1515
     
    9393
    9494void VariableExpr::print( std::ostream &os, int indent ) const {
    95         os << std::string(indent, ' ') << "Variable Expression: ";
     95        os << std::string( indent, ' ' ) << "Variable Expression: ";
    9696
    9797        Declaration *decl = get_var();
     
    122122
    123123void SizeofExpr::print( std::ostream &os, int indent) const {
    124         os << std::string(indent, ' ') << "Sizeof Expression on: ";
     124        os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
    125125
    126126        if (isType)
     
    152152
    153153void AttrExpr::print( std::ostream &os, int indent) const {
    154         os << std::string(indent, ' ') << "Attr ";
     154        os << std::string( indent, ' ' ) << "Attr ";
    155155        attr->print( os, indent + 2 );
    156156        if ( isType || expr ) {
     
    184184
    185185void CastExpr::print( std::ostream &os, int indent ) const {
    186         os << std::string(indent, ' ') << "Cast of:" << std::endl;
     186        os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
    187187        arg->print(os, indent+2);
    188         os << std::endl << std::string(indent, ' ') << "to:" << std::endl;
     188        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
    189189        if ( results.empty() ) {
    190                 os << std::string(indent+2, ' ') << "nothing" << std::endl;
     190                os << std::string( indent+2, ' ' ) << "nothing" << std::endl;
    191191        } else {
    192192                printAll(results, os, indent+2);
     
    207207
    208208void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
    209         os << std::string(indent, ' ') << "Member Expression, with field: " << get_member();
     209        os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
    210210
    211211        Expression *agg = get_aggregate();
    212         os << std::string(indent, ' ') << "from aggregate: ";
     212        os << std::string( indent, ' ' ) << "from aggregate: ";
    213213        if (agg != 0) agg->print(os, indent + 2);
    214214        Expression::print( os, indent );
     
    234234
    235235void MemberExpr::print( std::ostream &os, int indent ) const {
    236         os << std::string(indent, ' ') << "Member Expression, with field: " << std::endl;
     236        os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
    237237
    238238        assert( member );
    239         os << std::string(indent + 2, ' ');
     239        os << std::string( indent + 2, ' ' );
    240240        member->print( os, indent + 2 );
    241241        os << std::endl;
    242242
    243243        Expression *agg = get_aggregate();
    244         os << std::string(indent, ' ') << "from aggregate: " << std::endl;
     244        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
    245245        if (agg != 0) agg->print(os, indent + 2);
    246246        Expression::print( os, indent );
     
    261261
    262262void UntypedExpr::print( std::ostream &os, int indent ) const {
    263         os << std::string(indent, ' ') << "Applying untyped: " << std::endl;
     263        os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
    264264        function->print(os, indent + 4);
    265         os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;
     265        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    266266        printArgs(os, indent + 4);
    267267        Expression::print( os, indent );
     
    282282
    283283void NameExpr::print( std::ostream &os, int indent ) const {
    284         os << std::string(indent, ' ') << "Name: " << get_name() << std::endl;
     284        os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
    285285        Expression::print( os, indent );
    286286}
     
    301301
    302302void LogicalExpr::print( std::ostream &os, int indent )const {
    303         os << std::string(indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
     303        os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    304304        arg1->print(os);
    305305        os << " and ";
     
    323323
    324324void ConditionalExpr::print( std::ostream &os, int indent ) const {
    325         os << std::string(indent, ' ') << "Conditional expression on: " << std::endl;
     325        os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl;
    326326        arg1->print( os, indent+2 );
    327         os << std::string(indent, ' ') << "First alternative:" << std::endl;
     327        os << std::string( indent, ' ' ) << "First alternative:" << std::endl;
    328328        arg2->print( os, indent+2 );
    329         os << std::string(indent, ' ') << "Second alternative:" << std::endl;
     329        os << std::string( indent, ' ' ) << "Second alternative:" << std::endl;
    330330        arg3->print( os, indent+2 );
    331331        os << std::endl;
     
    334334
    335335void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    336         os << std::string(indent, ' ') << "Valof Expression: " << std::endl;
     336        os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
    337337        if ( get_body() != 0 )
    338338                get_body()->print( os, indent + 2 );
  • src/SynTree/Statement.cc

    rcf0941d r44b5ca0  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Jun 02 13:07:09 2015
    13 // Update Count     : 14
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jun  5 07:51:04 2015
     13// Update Count     : 15
    1414//
    1515
     
    3939
    4040void ExprStmt::print( std::ostream &os, int indent ) {
    41         os << "\r" << string(indent, ' ') << "Expression Statement:" << endl;
     41        os << string( indent, ' ' ) << "Expression Statement:" << endl;
    4242        expr->print( os, indent + 2 );
    4343}
     
    5959
    6060void BranchStmt::print( std::ostream &os, int indent ) {
    61         os << "\r" << string( indent, ' ') << "Branch (" << brType[type] << ")" << endl ;
     61        os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ;
    6262}
    6363
     
    6969
    7070void ReturnStmt::print( std::ostream &os, int indent ) {
    71         os << "\r" << std::string( indent, ' ') << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
     71        os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
    7272        if ( expr != 0 ) expr->print( os );
    7373        os << endl;
     
    8080
    8181void IfStmt::print( std::ostream &os, int indent ) {
    82         os << "\r" << string( indent, ' ') << "If on condition: " << endl ;
     82        os << string( indent, ' ' ) << "If on condition: " << endl ;
    8383        condition->print( os, indent + 4 );
    8484
    85         os << string( indent, ' ') << ".... and branches: " << endl;
     85        os << string( indent, ' ' ) << ".... and branches: " << endl;
    8686
    8787        thenPart->print( os, indent + 4 );
     
    104104
    105105void SwitchStmt::print( std::ostream &os, int indent ) {
    106         os << "\r" << string( indent, ' ') << "Switch on condition: ";
     106        os << string( indent, ' ' ) << "Switch on condition: ";
    107107        condition->print( os );
    108108        os << endl;
     
    131131
    132132void CaseStmt::print( std::ostream &os, int indent ) {
    133         os << "\r" << string( indent, ' ');
     133        os << string( indent, ' ' );
    134134
    135135        if ( isDefault())
     
    159159
    160160void ChooseStmt::print( std::ostream &os, int indent ) {
    161         os << "\r" << string( indent, ' ') << "Choose on condition: ";
     161        os << string( indent, ' ' ) << "Choose on condition: ";
    162162        condition->print( os );
    163163        os << endl;
     
    172172
    173173void FallthruStmt::print( std::ostream &os, int indent ) {
    174         os << "\r" << string( indent, ' ') << "Fall-through statement" << endl;
     174        os << string( indent, ' ' ) << "Fall-through statement" << endl;
    175175}
    176176
     
    184184
    185185void WhileStmt::print( std::ostream &os, int indent ) {
    186         os << "\r" << string( indent, ' ') << "While on condition: " << endl ;
     186        os << string( indent, ' ' ) << "While on condition: " << endl ;
    187187        condition->print( os, indent + 4 );
    188188
    189         os << string( indent, ' ') << ".... with body: " << endl;
     189        os << string( indent, ' ' ) << ".... with body: " << endl;
    190190
    191191        if ( body != 0 ) body->print( os, indent + 4 );
     
    204204
    205205void ForStmt::print( std::ostream &os, int indent ) {
    206         os << "\r" << string( indent, ' ') << "Labels: {";
     206        os << string( indent, ' ' ) << "Labels: {";
    207207        for (std::list<Label>::iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
    208208                os << *it << ",";
     
    210210        os << "}" << endl;
    211211
    212         os << "\r" << string( indent, ' ') << "For Statement" << endl ;
    213 
    214         os << "\r" << string( indent + 2, ' ') << "initialization: \n";
     212        os << string( indent, ' ' ) << "For Statement" << endl ;
     213
     214        os << string( indent + 2, ' ' ) << "initialization: \n";
    215215        if ( initialization != 0 )
    216216                initialization->print( os, indent + 4 );
    217217
    218         os << "\n\r" << string( indent + 2, ' ') << "condition: \n";
     218        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
    219219        if ( condition != 0 )
    220220                condition->print( os, indent + 4 );
    221221
    222         os << "\n\r" << string( indent + 2, ' ') << "increment: \n";
     222        os << "\n" << string( indent + 2, ' ' ) << "increment: \n";
    223223        if ( increment != 0 )
    224224                increment->print( os, indent + 4 );
    225225
    226         os << "\n\r" << string( indent + 2, ' ') << "statement block: \n";
     226        os << "\n" << string( indent + 2, ' ' ) << "statement block: \n";
    227227        if ( body != 0 )
    228228                body->print( os, indent + 4 );
     
    246246
    247247void TryStmt::print( std::ostream &os, int indent ) {
    248         os << "\r" << string( indent, ' ') << "Try Statement" << endl;
    249         os << string( indent + 2, ' ') << "with block: " << endl;
     248        os << string( indent, ' ' ) << "Try Statement" << endl;
     249        os << string( indent + 2, ' ' ) << "with block: " << endl;
    250250        block->print( os, indent + 4 );
    251251
    252252        // handlers
    253         os << string( indent + 2, ' ') << "and handlers: " << endl;
     253        os << string( indent + 2, ' ' ) << "and handlers: " << endl;
    254254        std::list<Statement *>::iterator i;
    255255        for ( i = handlers.begin(); i != handlers.end(); i++)
     
    258258        // finally block
    259259        if ( finallyBlock != 0 ) {
    260                 os << string( indent + 2, ' ') << "Finally block: " << endl;
     260                os << string( indent + 2, ' ' ) << "Finally block: " << endl;
    261261                finallyBlock->print( os, indent + 4 );
    262262        } // if
     
    273273
    274274void CatchStmt::print( std::ostream &os, int indent ) {
    275         os << "\r" << string( indent, ' ') << "Catch Statement" << endl;
    276 
    277         os << "\r" << string( indent, ' ') << "... catching" << endl;
     275        os << string( indent, ' ' ) << "Catch Statement" << endl;
     276
     277        os << string( indent, ' ' ) << "... catching" << endl;
    278278        if ( decl ) {
    279279                decl->printShort( os, indent + 4 );
    280280                os << endl;
    281281        } else if ( catchRest )
    282                 os << "\r" << string( indent + 4 , ' ') << "the rest" << endl;
     282                os << string( indent + 4 , ' ' ) << "the rest" << endl;
    283283        else
    284                 os << "\r" << string( indent + 4 , ' ') << ">>> Error:  this catch clause must have a declaration <<<" << endl;
     284                os << string( indent + 4 , ' ' ) << ">>> Error:  this catch clause must have a declaration <<<" << endl;
    285285}
    286286
     
    295295
    296296void FinallyStmt::print( std::ostream &os, int indent ) {
    297         os << "\r" << string( indent, ' ') << "Finally Statement" << endl;
    298         os << string( indent + 2, ' ') << "with block: " << endl;
     297        os << string( indent, ' ' ) << "Finally Statement" << endl;
     298        os << string( indent + 2, ' ' ) << "with block: " << endl;
    299299        block->print( os, indent + 4 );
    300300}
     
    305305
    306306void NullStmt::print( std::ostream &os, int indent ) {
    307         os << "\r" << string( indent, ' ') << "Null Statement" << endl ;
     307        os << string( indent, ' ' ) << "Null Statement" << endl ;
    308308}
    309309
Note: See TracChangeset for help on using the changeset viewer.