Changeset 6eb8948 for src/SynTree/Expression.cc
- Timestamp:
- Sep 12, 2016, 6:32:46 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- f006f01
- Parents:
- 8f7cea1
- git-author:
- Rob Schluntz <rschlunt@…> (09/12/16 18:24:34)
- git-committer:
- Rob Schluntz <rschlunt@…> (09/12/16 18:32:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r8f7cea1 r6eb8948 375 375 } 376 376 377 378 UntypedExpr::UntypedExpr( Expression *_function, Expression *_aname ) : Expression( _aname ), function( _function) {}377 UntypedExpr::UntypedExpr( Expression *_function, const std::list<Expression *> &_args, Expression *_aname ) : 378 Expression( _aname ), function(_function), args(_args) {} 379 379 380 380 UntypedExpr::UntypedExpr( const UntypedExpr &other ) : … … 382 382 cloneAll( other.args, args ); 383 383 } 384 385 UntypedExpr::UntypedExpr( Expression *_function, std::list<Expression *> &_args, Expression *_aname ) :386 Expression( _aname ), function(_function), args(_args) {}387 384 388 385 UntypedExpr::~UntypedExpr() { … … 568 565 } 569 566 567 StmtExpr::StmtExpr( CompoundStmt *statements ) : statements( statements ) { 568 assert( statements ); 569 std::list< Statement * > & body = statements->get_kids(); 570 if ( ! body.empty() ) { 571 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) { 572 cloneAll( exprStmt->get_expr()->get_results(), get_results() ); 573 } 574 } 575 } 576 StmtExpr::StmtExpr( const StmtExpr &other ) : statements( other.statements->clone() ) {} 577 StmtExpr::~StmtExpr() { 578 delete statements; 579 } 580 void StmtExpr::print( std::ostream &os, int indent ) const { 581 os << std::string( indent, ' ' ) << "Statement Expression: " << std::endl; 582 statements->print( os, indent+2 ); 583 } 584 570 585 std::ostream & operator<<( std::ostream & out, const Expression * expr ) { 571 586 expr->print( out );
Note: See TracChangeset
for help on using the changeset viewer.