Changes in src/SynTree/Statement.h [3be261a:baf7fee]
- File:
-
- 1 edited
-
src/SynTree/Statement.h (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.h
r3be261a rbaf7fee 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Statement.h -- 7 // Statement.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 57 57 public: 58 58 ExprStmt( std::list<Label> labels, Expression *expr ); 59 ExprStmt( const ExprStmt &other );60 59 virtual ~ExprStmt(); 61 60 … … 74 73 public: 75 74 AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> input, std::list<Expression *> output, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ); 76 AsmStmt( const AsmStmt &other );77 75 virtual ~AsmStmt(); 78 76 … … 105 103 public: 106 104 IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart ); 107 IfStmt( const IfStmt &other );108 105 virtual ~IfStmt(); 109 106 … … 114 111 Statement *get_elsePart() { return elsePart; } 115 112 void set_elsePart( Statement *newValue ) { elsePart = newValue; } 116 113 117 114 virtual IfStmt *clone() const { return new IfStmt( *this ); } 118 115 virtual void accept( Visitor &v ) { v.visit( this ); } … … 128 125 public: 129 126 SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches ); 130 SwitchStmt( const SwitchStmt &other );131 127 virtual ~SwitchStmt(); 132 128 … … 150 146 public: 151 147 ChooseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches ); 152 ChooseStmt( const ChooseStmt &other );153 148 virtual ~ChooseStmt(); 154 149 … … 182 177 class CaseStmt : public Statement { 183 178 public: 184 CaseStmt( std::list<Label> labels, Expression *conditions, 179 CaseStmt( std::list<Label> labels, Expression *conditions, 185 180 std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError); 186 CaseStmt( const CaseStmt &other );187 181 virtual ~CaseStmt(); 188 182 … … 198 192 std::list<Statement *> &get_statements() { return stmts; } 199 193 void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; } 200 194 201 195 virtual void accept( Visitor &v ) { v.visit( this ); } 202 196 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } … … 214 208 WhileStmt( std::list<Label> labels, Expression *condition, 215 209 Statement *body, bool isDoWhile = false ); 216 WhileStmt( const WhileStmt &other );217 210 virtual ~WhileStmt(); 218 211 … … 223 216 bool get_isDoWhile() { return isDoWhile; } 224 217 void set_isDoWhile( bool newValue ) { isDoWhile = newValue; } 225 218 226 219 virtual WhileStmt *clone() const { return new WhileStmt( *this ); } 227 220 virtual void accept( Visitor &v ) { v.visit( this ); } … … 238 231 ForStmt( std::list<Label> labels, std::list<Statement *> initialization, 239 232 Expression *condition = 0, Expression *increment = 0, Statement *body = 0 ); 240 ForStmt( const ForStmt &other );241 233 virtual ~ForStmt(); 242 234 … … 249 241 Statement *get_body() { return body; } 250 242 void set_body( Statement *newValue ) { body = newValue; } 251 243 252 244 virtual ForStmt *clone() const { return new ForStmt( *this ); } 253 245 virtual void accept( Visitor &v ) { v.visit( this ); } … … 267 259 BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError); 268 260 BranchStmt( std::list<Label> labels, Expression *computedTarget, Type ) throw (SemanticError); 261 virtual ~BranchStmt() {} 269 262 270 263 Label get_originalTarget() { return originalTarget; } 271 264 Label get_target() { return target; } 272 265 void set_target( Label newValue ) { target = newValue; } 273 266 274 267 Expression *get_computedTarget() { return computedTarget; } 275 268 void set_target( Expression * newValue ) { computedTarget = newValue; } … … 293 286 public: 294 287 ReturnStmt( std::list<Label> labels, Expression *expr, bool throwP = false ); 295 ReturnStmt( const ReturnStmt &other );296 288 virtual ~ReturnStmt(); 297 289 298 290 Expression *get_expr() { return expr; } 299 291 void set_expr( Expression *newValue ) { expr = newValue; } 300 292 301 293 virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); } 302 294 virtual void accept( Visitor &v ) { v.visit( this ); } … … 313 305 NullStmt(); 314 306 NullStmt( std::list<Label> labels ); 307 virtual ~NullStmt(); 315 308 316 309 virtual NullStmt *clone() const { return new NullStmt( *this ); } … … 318 311 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 319 312 virtual void print( std::ostream &os, int indent = 0 ) const; 320 321 private: 322 }; 323 324 class TryStmt : public Statement { 313 314 private: 315 }; 316 317 class TryStmt : public Statement { 325 318 public: 326 319 TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<Statement *> &handlers, FinallyStmt *finallyBlock = 0 ); … … 339 332 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 340 333 virtual void print( std::ostream &os, int indent = 0 ) const; 341 334 342 335 private: 343 336 CompoundStmt *block; 344 337 std::list<Statement *> handlers; 345 338 FinallyStmt *finallyBlock; 346 }; 339 }; 347 340 348 341 class CatchStmt : public Statement { 349 342 public: 350 343 CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool isCatchRest = false ); 351 CatchStmt( const CatchStmt &other );352 344 virtual ~CatchStmt(); 353 345 … … 357 349 Statement *get_body() { return body; } 358 350 void set_body( Statement *newValue ) { body = newValue; } 359 351 360 352 virtual CatchStmt *clone() const { return new CatchStmt( *this ); } 361 353 virtual void accept( Visitor &v ) { v.visit( this ); } 362 354 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 363 355 virtual void print( std::ostream &os, int indent = 0 ) const; 364 356 365 357 private: 366 358 Declaration *decl; … … 369 361 }; 370 362 371 class FinallyStmt : public Statement { 363 class FinallyStmt : public Statement { 372 364 public: 373 365 FinallyStmt( std::list<Label> labels, CompoundStmt *block ); 374 FinallyStmt( const FinallyStmt &other );375 366 virtual ~FinallyStmt(); 376 367 377 368 CompoundStmt *get_block() const { return block; } 378 369 void set_block( CompoundStmt *newValue ) { block = newValue; } 379 370 380 371 virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); } 381 372 virtual void accept( Visitor &v ) { v.visit( this ); } … … 384 375 private: 385 376 CompoundStmt *block; 386 }; 377 }; 387 378 388 379
Note:
See TracChangeset
for help on using the changeset viewer.