Changes in src/SynTree/Expression.cc [4ffdd63:60089f4]
- File:
-
- 1 edited
-
src/SynTree/Expression.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r4ffdd63 r60089f4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Apr 27 17:07:19201612 // Last Modified On : Tue Apr 26 12:52:40 2016 13 13 // Update Count : 40 14 14 // … … 72 72 73 73 void ConstantExpr::print( std::ostream &os, int indent ) const { 74 os << std::string( indent, ' ' ) <<"constant expression " ;74 os << "constant expression " ; 75 75 constant.print( os ); 76 76 Expression::print( os, indent ); … … 79 79 80 80 VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) { 81 assert( var );82 assert( var->get_type() );83 81 add_result( var->get_type()->clone() ); 84 82 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) { … … 383 381 void UntypedExpr::print( std::ostream &os, int indent ) const { 384 382 os << "Applying untyped: " << std::endl; 385 os << std::string( indent , ' ' );383 os << std::string( indent+4, ' ' ); 386 384 function->print(os, indent + 4); 387 385 os << std::string( indent, ' ' ) << "...to: " << std::endl; 388 os << std::string( indent, ' ' ); 389 printArgs(os, indent + 4); 386 printAll(args, os, indent + 4); 390 387 Expression::print( os, indent ); 391 388 } … … 393 390 void UntypedExpr::printArgs( std::ostream &os, int indent ) const { 394 391 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, ' ' ); 396 394 (*i)->print(os, indent); 395 } 397 396 } 398 397 … … 466 465 } 467 466 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 498 467 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {} 499 468
Note:
See TracChangeset
for help on using the changeset viewer.