Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r4ffdd63 r60089f4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 27 17:07:19 2016
     12// Last Modified On : Tue Apr 26 12:52:40 2016
    1313// Update Count     : 40
    1414//
     
    7272
    7373void ConstantExpr::print( std::ostream &os, int indent ) const {
    74         os << std::string( indent, ' ' ) << "constant expression " ;
     74        os << "constant expression " ;
    7575        constant.print( os );
    7676        Expression::print( os, indent );
     
    7979
    8080VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) {
    81         assert( var );
    82         assert( var->get_type() );
    8381        add_result( var->get_type()->clone() );
    8482        for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
     
    383381void UntypedExpr::print( std::ostream &os, int indent ) const {
    384382        os << "Applying untyped: " << std::endl;
    385         os << std::string( indent, ' ' );
     383        os << std::string( indent+4, ' ' );
    386384        function->print(os, indent + 4);
    387385        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    388         os << std::string( indent, ' ' );
    389         printArgs(os, indent + 4);
     386        printAll(args, os, indent + 4);
    390387        Expression::print( os, indent );
    391388}
     
    393390void UntypedExpr::printArgs( std::ostream &os, int indent ) const {
    394391        std::list<Expression *>::const_iterator i;
    395         for (i = args.begin(); i != args.end(); i++)
     392        for (i = args.begin(); i != args.end(); i++) {
     393                os << std::string(indent, ' ' );
    396394                (*i)->print(os, indent);
     395        }
    397396}
    398397
     
    466465}
    467466
    468 
    469 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) {
    470         assert( callExpr );
    471         cloneAll( callExpr->get_results(), results );
    472 }
    473 
    474 ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
    475         cloneAll( other.tempDecls, tempDecls );
    476         cloneAll( other.returnDecls, returnDecls );
    477         cloneAll( other.dtors, dtors );
    478 }
    479 
    480 ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
    481         delete callExpr;
    482         deleteAll( tempDecls );
    483         deleteAll( returnDecls );
    484         deleteAll( dtors );
    485 }
    486 
    487 void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
    488         os << std::string( indent, ' ' ) <<  "Implicit Copy Constructor Expression: " << std::endl;
    489         assert( callExpr );
    490         callExpr->print( os, indent + 2 );
    491         os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
    492         printAll(tempDecls, os, indent+2);
    493         os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;
    494         printAll(returnDecls, os, indent+2);
    495         Expression::print( os, indent );
    496 }
    497 
    498467UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    499468
Note: See TracChangeset for help on using the changeset viewer.