Changes in src/SynTree/Statement.h [ca78437:294647b]
- File:
-
- 1 edited
-
src/SynTree/Statement.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.h
rca78437 r294647b 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 12 13:35:00 201713 // Update Count : 6 711 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 12 13:57:46 2016 13 // Update Count : 65 14 14 // 15 15 … … 57 57 private: 58 58 std::list<Statement*> kids; 59 };60 61 class NullStmt : public CompoundStmt {62 public:63 NullStmt();64 NullStmt( std::list<Label> labels );65 66 virtual NullStmt *clone() const { return new NullStmt( *this ); }67 virtual void accept( Visitor &v ) { v.visit( this ); }68 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }69 virtual void print( std::ostream &os, int indent = 0 ) const;70 71 private:72 59 }; 73 60 … … 274 261 class ReturnStmt : public Statement { 275 262 public: 276 ReturnStmt( std::list<Label> labels, Expression *expr );263 ReturnStmt( std::list<Label> labels, Expression *expr, bool throwP = false ); 277 264 ReturnStmt( const ReturnStmt &other ); 278 265 virtual ~ReturnStmt(); … … 287 274 private: 288 275 Expression *expr; 289 }; 290 291 class ThrowStmt : public Statement { 292 public: 293 enum Kind { Terminate, Resume }; 294 295 ThrowStmt( std::list<Label> labels, Kind kind, Expression * expr, Expression * target = nullptr ); 296 ThrowStmt( const ThrowStmt &other ); 297 virtual ~ThrowStmt(); 298 299 Kind get_kind() { return kind; } 300 Expression * get_expr() { return expr; } 301 void set_expr( Expression * newExpr ) { expr = newExpr; } 302 Expression * get_target() { return target; } 303 void set_target( Expression * newTarget ) { target = newTarget; } 304 305 virtual ThrowStmt *clone() const { return new ThrowStmt( *this ); } 306 virtual void accept( Visitor &v ) { v.visit( this ); } 307 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 308 virtual void print( std::ostream &os, int indent = 0 ) const; 309 private: 310 Kind kind; 311 Expression * expr; 312 Expression * target; 276 bool isThrow; 277 }; 278 279 280 class NullStmt : public CompoundStmt { 281 public: 282 NullStmt(); 283 NullStmt( std::list<Label> labels ); 284 285 virtual NullStmt *clone() const { return new NullStmt( *this ); } 286 virtual void accept( Visitor &v ) { v.visit( this ); } 287 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 288 virtual void print( std::ostream &os, int indent = 0 ) const; 289 290 private: 313 291 }; 314 292 … … 339 317 class CatchStmt : public Statement { 340 318 public: 341 enum Kind { Terminate, Resume }; 342 343 CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, 344 Expression *cond, Statement *body ); 319 CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool catchAny = false ); 345 320 CatchStmt( const CatchStmt &other ); 346 321 virtual ~CatchStmt(); 347 322 348 Kind get_kind() { return kind; }349 323 Declaration *get_decl() { return decl; } 350 324 void set_decl( Declaration *newValue ) { decl = newValue; } 351 Expression *get_cond() { return cond; } 352 void set_cond( Expression *newCond ) { cond = newCond; } 325 353 326 Statement *get_body() { return body; } 354 327 void set_body( Statement *newValue ) { body = newValue; } … … 360 333 361 334 private: 362 Kind kind;363 335 Declaration *decl; 364 Expression *cond;365 336 Statement *body; 337 bool catchRest; 366 338 }; 367 339
Note:
See TracChangeset
for help on using the changeset viewer.