Changes in src/SynTree/Statement.cc [1d4580a:4e06c1e]
- File:
-
- 1 edited
-
src/SynTree/Statement.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
r1d4580a r4e06c1e 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 12 13:58:48201613 // Update Count : 6212 // Last Modified On : Tue Jul 12 17:52:32 2016 13 // Update Count : 55 14 14 // 15 15 … … 143 143 } 144 144 145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_ statements ):146 Statement( _labels ), condition( _condition ), statements( _statements ) {145 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ): 146 Statement( _labels ), condition( _condition ), branches( _branches ) { 147 147 } 148 148 149 149 SwitchStmt::SwitchStmt( const SwitchStmt & other ): 150 150 Statement( other ), condition( maybeClone( other.condition ) ) { 151 cloneAll( other. statements, statements );151 cloneAll( other.branches, branches ); 152 152 } 153 153 154 154 SwitchStmt::~SwitchStmt() { 155 155 delete condition; 156 // destroy statements 157 } 156 // destroy branches 157 } 158 159 void SwitchStmt::add_case( CaseStmt *c ) {} 158 160 159 161 void SwitchStmt::print( std::ostream &os, int indent ) const { … … 162 164 os << endl; 163 165 164 // statements166 // branches 165 167 std::list<Statement *>::const_iterator i; 166 for ( i = statements.begin(); i != statements.end(); i++)168 for ( i = branches.begin(); i != branches.end(); i++) 167 169 (*i)->print( os, indent + 4 ); 168 170 169 //for_each( statements.begin(), statements.end(), mem_fun( bind1st(&Statement::print ), os ));171 //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os )); 170 172 } 171 173 … … 185 187 } 186 188 187 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> stmts ) {188 return new CaseStmt( labels, 0, stmts, true );189 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) { 190 return new CaseStmt( labels, 0, branches, true ); 189 191 } 190 192 … … 309 311 } 310 312 311 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool catchAny) :312 Statement( labels ), decl ( _decl ), body( _body ), catchRest ( catchAny) {313 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool isCatchRest ) : 314 Statement( labels ), decl ( _decl ), body( _body ), catchRest ( isCatchRest ) { 313 315 } 314 316
Note:
See TracChangeset
for help on using the changeset viewer.