Changeset 8688ce1 for src/SynTree/Statement.cc
- Timestamp:
- Aug 4, 2016, 12:29:54 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 76e8c55
- Parents:
- e80ebe5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
re80ebe5 r8688ce1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 12 17:52:32201613 // Update Count : 5512 // Last Modified On : Thu Aug 4 11:25:20 2016 13 // Update Count : 61 14 14 // 15 15 … … 143 143 } 144 144 145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_ branches ):146 Statement( _labels ), condition( _condition ), branches( _branches ) {145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_statements ): 146 Statement( _labels ), condition( _condition ), statements( _statements ) { 147 147 } 148 148 149 149 SwitchStmt::SwitchStmt( const SwitchStmt & other ): 150 150 Statement( other ), condition( maybeClone( other.condition ) ) { 151 cloneAll( other. branches, branches );151 cloneAll( other.statements, statements ); 152 152 } 153 153 154 154 SwitchStmt::~SwitchStmt() { 155 155 delete condition; 156 // destroy branches 157 } 158 159 void SwitchStmt::add_case( CaseStmt *c ) {} 156 // destroy statements 157 } 160 158 161 159 void SwitchStmt::print( std::ostream &os, int indent ) const { … … 164 162 os << endl; 165 163 166 // branches164 // statements 167 165 std::list<Statement *>::const_iterator i; 168 for ( i = branches.begin(); i != branches.end(); i++)166 for ( i = statements.begin(); i != statements.end(); i++) 169 167 (*i)->print( os, indent + 4 ); 170 168 171 //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os ));169 //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os )); 172 170 } 173 171 … … 187 185 } 188 186 189 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) {190 return new CaseStmt( labels, 0, branches, true );187 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> stmts ) { 188 return new CaseStmt( labels, 0, stmts, true ); 191 189 } 192 190
Note: See TracChangeset
for help on using the changeset viewer.