Changeset bb8ea30 for src/SynTree


Ignore:
Timestamp:
May 13, 2016, 1:22:24 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, with_gc
Children:
d668182
Parents:
9243a501
Message:

fix printing for ArrayType?, Expression, Initializer, etc.

Location:
src/SynTree
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ArrayType.cc

    r9243a501 rbb8ea30  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ArrayType.cc -- 
     7// ArrayType.cc --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 12 14:19:07 2015
     12// Last Modified On : Thu May 12 14:07:16 2016
    1313// Update Count     : 11
    1414//
     
    5151        if ( dimension ) {
    5252                os << " with dimension of ";
    53                 dimension->print( os, 0 );
     53                dimension->print( os, indent );
    5454        } // if
    5555}
  • src/SynTree/Expression.cc

    r9243a501 rbb8ea30  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed May 04 12:14:09 2016
     12// Last Modified On : Fri May 13 13:19:09 2016
    1313// Update Count     : 40
    1414//
     
    7575        constant.print( os );
    7676        Expression::print( os, indent );
    77         os << std::endl;
    7877}
    7978
     
    323322        os << ", from aggregate: ";
    324323        if (agg != 0) {
     324                os << std::string( indent + 2, ' ' );
    325325                agg->print(os, indent + 2);
    326326        }
     
    358358        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
    359359        if (agg != 0) {
     360                os << std::string( indent + 2, ' ' );
    360361                agg->print(os, indent + 2);
    361362        }
     
    379380void UntypedExpr::print( std::ostream &os, int indent ) const {
    380381        os << "Applying untyped: " << std::endl;
    381         os << std::string( indent+4, ' ' );
    382         function->print(os, indent + 4);
     382        os << std::string( indent+2, ' ' );
     383        function->print(os, indent + 2);
    383384        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    384         printAll(args, os, indent + 4);
     385        printAll(args, os, indent + 2);
    385386        Expression::print( os, indent );
    386387}
  • src/SynTree/Initializer.cc

    r9243a501 rbb8ea30  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Apr 26 12:50:47 2016
     12// Last Modified On : Fri May 13 13:19:30 2016
    1313// Update Count     : 28
    1414//
     
    4848
    4949        if ( ! designators.empty() ) {
    50                 os << std::endl << std::string(indent + 2, ' ' ) << "designated by: "   << std::endl;
     50                os << std::endl << std::string(indent + 2, ' ' ) << "designated by: " << std::endl;
    5151                for ( std::list < Expression * >::iterator i = designators.begin(); i != designators.end(); i++ ) {
     52                        os << std::string(indent + 4, ' ' );
    5253                        ( *i )->print(os, indent + 4 );
    5354                }
  • src/SynTree/ObjectDecl.cc

    r9243a501 rbb8ea30  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed May 04 12:11:56 2016
     12// Last Modified On : Fri May 13 13:20:17 2016
    1313// Update Count     : 30
    1414//
     
    5656
    5757        if ( init ) {
    58                 os << std::string(indent, ' ');
    5958                os << " with initializer ";
    6059                init->print( os, indent );
  • src/SynTree/Statement.cc

    r9243a501 rbb8ea30  
    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 : Thu May 12 13:33:18 2016
    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 << "Expression Statement:" << endl << std::string( indent + 2, ' ' );
    4646        expr->print( os, indent + 2 );
    4747}
     
    290290        os << string( indent + 2, ' ' ) << "initialization: \n";
    291291        for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) {
     292                os << string( indent + 4, ' ' );
    292293                (*it)->print( os, indent + 4 );
    293294        }
    294295
    295296        os << "\n" << string( indent + 2, ' ' ) << "condition: \n";
    296         if ( condition != 0 )
     297        if ( condition != 0 ) {
     298                os << string( indent + 4, ' ' );
    297299                condition->print( os, indent + 4 );
     300        }
    298301
    299302        os << "\n" << string( indent + 2, ' ' ) << "increment: \n";
    300         if ( increment != 0 )
     303        if ( increment != 0 ) {
     304                os << string( indent + 4, ' ' );
    301305                increment->print( os, indent + 4 );
     306        }
    302307
    303308        os << "\n" << string( indent + 2, ' ' ) << "statement block: \n";
    304         if ( body != 0 )
     309        if ( body != 0 ) {
     310                os << string( indent + 4, ' ' );
    305311                body->print( os, indent + 4 );
     312        }
    306313
    307314        os << endl;
Note: See TracChangeset for help on using the changeset viewer.