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