Changeset 724c2b6 for src/SynTree
- Timestamp:
- Jul 15, 2015, 4:47:48 PM (9 years ago)
- 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, string, with_gc
- Children:
- 1db21619
- Parents:
- 9163b9c (diff), 1ab4ce2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/SynTree
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.cc
r9163b9c r724c2b6 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 18 10:10:46201513 // Update Count : 111 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jul 14 12:31:39 2015 13 // Update Count : 2 14 14 // 15 15 … … 109 109 110 110 Statement *Mutator::mutate( ForStmt *forStmt ) { 111 forStmt->set_initialization( maybeMutate( forStmt->get_initialization(), *this ));111 mutateAll( forStmt->get_initialization(), *this ); 112 112 forStmt->set_condition( maybeMutate( forStmt->get_condition(), *this ) ); 113 113 forStmt->set_increment( maybeMutate( forStmt->get_increment(), *this ) ); -
src/SynTree/Statement.cc
r9163b9c r724c2b6 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jun 29 17:37:10 201513 // Update Count : 2 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jul 15 14:57:40 2015 13 // Update Count : 27 14 14 // 15 15 … … 192 192 } 193 193 194 ForStmt::ForStmt( std::list<Label> labels, Statement *initialization_, Expression *condition_, Expression *increment_, Statement *body_ ):194 ForStmt::ForStmt( std::list<Label> labels, std::list<Statement *> initialization_, Expression *condition_, Expression *increment_, Statement *body_ ): 195 195 Statement( labels ), initialization( initialization_ ), condition( condition_ ), increment( increment_ ), body( body_ ) { 196 196 } 197 197 198 198 ForStmt::~ForStmt() { 199 delete initialization;199 deleteAll( initialization ); 200 200 delete condition; 201 201 delete increment; … … 213 213 214 214 os << string( indent + 2, ' ' ) << "initialization: \n"; 215 if ( initialization != 0 ) 216 initialization->print( os, indent + 4 ); 215 for ( std::list<Statement *>::const_iterator it = initialization.begin(); it != initialization.end(); ++it ) { 216 (*it)->print( os, indent + 4 ); 217 } 217 218 218 219 os << "\n" << string( indent + 2, ' ' ) << "condition: \n"; -
src/SynTree/Statement.h
r9163b9c r724c2b6 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue Ju n 23 11:44:27201513 // Update Count : 2 011 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jul 14 12:14:54 2015 13 // Update Count : 24 14 14 // 15 15 … … 199 199 class ForStmt : public Statement { 200 200 public: 201 ForStmt( std::list<Label> labels, Statement *initialization = 0,201 ForStmt( std::list<Label> labels, std::list<Statement *> initialization, 202 202 Expression *condition = 0, Expression *increment = 0, Statement *body = 0 ); 203 203 virtual ~ForStmt(); 204 204 205 Statement *get_initialization() { return initialization; }206 void set_initialization( Statement *newValue ) { initialization = newValue; }205 std::list<Statement *> &get_initialization() { return initialization; } 206 void set_initialization( std::list<Statement *> newValue ) { initialization = newValue; } 207 207 Expression *get_condition() { return condition; } 208 208 void set_condition( Expression *newValue ) { condition = newValue; } … … 217 217 virtual void print( std::ostream &os, int indent = 0 ) const; 218 218 private: 219 Statement *initialization;219 std::list<Statement *> initialization; 220 220 Expression *condition; 221 221 Expression *increment; -
src/SynTree/Visitor.cc
r9163b9c r724c2b6 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 18 11:14:51201513 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jul 14 12:31:03 2015 13 // Update Count : 3 14 14 // 15 15 … … 94 94 95 95 void Visitor::visit( ForStmt *forStmt ) { 96 // ForStmt still needs to be fixed 97 maybeAccept( forStmt->get_initialization(), *this ); 96 acceptAll( forStmt->get_initialization(), *this ); 98 97 maybeAccept( forStmt->get_condition(), *this ); 99 98 maybeAccept( forStmt->get_increment(), *this );
Note: See TracChangeset
for help on using the changeset viewer.