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