- File:
-
- 1 edited
-
translator/SynTree/Statement.cc (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/Statement.cc
rc11e31c r51b73452 14 14 15 15 16 // *** Statement 16 17 Statement::Statement(std::list<Label> _labels): 17 18 labels(_labels) {} … … 21 22 Statement::~Statement() {} 22 23 24 //*** ExprStmt 23 25 ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ): 24 26 Statement(_labels), expr(_expr) {} … … 31 33 } 32 34 35 //*** BranchStmt 33 36 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 34 37 … … 54 57 } 55 58 59 //*** ReturnStmt 56 60 ReturnStmt::ReturnStmt( std::list<Label> labels, Expression *_expr, bool throwP ) : 57 61 Statement( labels ), expr( _expr ), isThrow( throwP ) {} … … 68 72 69 73 74 // *** IfStmt 70 75 IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ): 71 76 Statement(_labels), condition(_condition), thenPart(_thenPart), elsePart(_elsePart) {} … … 86 91 } 87 92 93 // *** SwitchStmt 88 94 SwitchStmt::SwitchStmt(std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches): 89 95 Statement(_labels), condition(_condition), branches(_branches) … … 110 116 } 111 117 118 // *** CaseStmt 112 119 CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, 113 120 std::list<Statement *> &_statements, bool deflt ) … … 140 147 } 141 148 149 //*** ChooseStmt 142 150 //ChooseStmt::ChooseStmt( std::list<Label> labels, Expression *condition, Statement *body ) {} 143 151 ChooseStmt::ChooseStmt(std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches): … … 164 172 } 165 173 174 //*** FallthruStmt 166 175 void FallthruStmt::print(std::ostream &os, int indent) { 167 176 os << "\r" << string(indent, ' ') << "Fall-through statement" << endl; 168 177 } 169 178 179 //*** WhileStmt 170 180 WhileStmt::WhileStmt( std::list<Label> labels, Expression *condition_, 171 181 Statement *body_, bool isDoWhile_ ): … … 186 196 } 187 197 198 //*** ForStmt 188 199 ForStmt::ForStmt( std::list<Label> labels, Statement *initialization_, 189 200 Expression *condition_, Expression *increment_, Statement *body_ ): … … 222 233 } 223 234 235 //*** TryStmt 224 236 TryStmt::TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<Statement *> &_handlers, FinallyStmt *_finallyBlock ) : 225 237 Statement( labels ), block( tryBlock ), handlers( _handlers ), finallyBlock( _finallyBlock ) … … 254 266 } 255 267 268 //*** CatchStmt 256 269 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool isCatchRest ) : 257 270 Statement( labels ), decl ( _decl ), body( _body ), catchRest ( isCatchRest ) … … 277 290 278 291 292 //*** FinallyStmt 279 293 FinallyStmt::FinallyStmt( std::list<Label> labels, CompoundStmt *_block ) : 280 294 Statement( labels ), block( _block ) … … 293 307 } 294 308 309 //*** NullStmt 295 310 NullStmt::NullStmt( std::list<Label> labels ) : CompoundStmt( labels ) {} 296 311 NullStmt::NullStmt() : CompoundStmt( std::list<Label>() ) {}
Note:
See TracChangeset
for help on using the changeset viewer.