Changes in src/SynTree/Statement.h [ba3706f:61255ad]
- File:
-
- 1 edited
-
src/SynTree/Statement.h (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.h
rba3706f r61255ad 37 37 std::list<Label> labels; 38 38 39 Statement( const std::list<Label> & labels = {});39 Statement( std::list<Label> labels ); 40 40 virtual ~Statement(); 41 41 … … 53 53 std::list<Statement*> kids; 54 54 55 CompoundStmt( );55 CompoundStmt( std::list<Label> labels ); 56 56 CompoundStmt( std::list<Statement *> stmts ); 57 57 CompoundStmt( const CompoundStmt &other ); … … 70 70 class NullStmt : public Statement { 71 71 public: 72 NullStmt( const std::list<Label> & labels = {} ); 72 NullStmt(); 73 NullStmt( std::list<Label> labels ); 73 74 74 75 virtual NullStmt *clone() const override { return new NullStmt( *this ); } … … 82 83 Expression *expr; 83 84 84 ExprStmt( Expression *expr );85 ExprStmt( std::list<Label> labels, Expression *expr ); 85 86 ExprStmt( const ExprStmt &other ); 86 87 virtual ~ExprStmt(); … … 103 104 std::list<Label> gotolabels; 104 105 105 AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );106 AsmStmt( std::list<Label> labels, bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ); 106 107 AsmStmt( const AsmStmt &other ); 107 108 virtual ~AsmStmt(); … … 133 134 std::list<Statement *> initialization; 134 135 135 IfStmt( Expression *condition, Statement *thenPart, Statement *elsePart,136 IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart, 136 137 std::list<Statement *> initialization = std::list<Statement *>() ); 137 138 IfStmt( const IfStmt &other ); … … 157 158 std::list<Statement *> statements; 158 159 159 SwitchStmt( Expression *condition, const std::list<Statement *> &statements );160 SwitchStmt( std::list<Label> labels, Expression *condition, const std::list<Statement *> &statements ); 160 161 SwitchStmt( const SwitchStmt &other ); 161 162 virtual ~SwitchStmt(); … … 179 180 std::list<Statement *> stmts; 180 181 181 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);182 CaseStmt( std::list<Label> labels, Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError); 182 183 CaseStmt( const CaseStmt &other ); 183 184 virtual ~CaseStmt(); 184 185 185 static CaseStmt * makeDefault( const std::list<Label> & labels = {}, std::list<Statement *> stmts = std::list<Statement *>() );186 static CaseStmt * makeDefault( std::list<Label> labels = std::list<Label>(), std::list<Statement *> stmts = std::list<Statement *>() ); 186 187 187 188 bool isDefault() const { return _isDefault; } … … 209 210 bool isDoWhile; 210 211 211 WhileStmt( Expression *condition,212 WhileStmt( std::list<Label> labels, Expression *condition, 212 213 Statement *body, bool isDoWhile = false ); 213 214 WhileStmt( const WhileStmt &other ); … … 234 235 Statement *body; 235 236 236 ForStmt( std::list< Statement *> initialization,237 ForStmt( std::list<Label> labels, std::list<Statement *> initialization, 237 238 Expression *condition = 0, Expression *increment = 0, Statement *body = 0 ); 238 239 ForStmt( const ForStmt &other ); … … 263 264 Type type; 264 265 265 BranchStmt( Label target, Type ) throw (SemanticError);266 BranchStmt( Expression *computedTarget, Type ) throw (SemanticError);266 BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError); 267 BranchStmt( std::list<Label> labels, Expression *computedTarget, Type ) throw (SemanticError); 267 268 268 269 Label get_originalTarget() { return originalTarget; } … … 288 289 Expression *expr; 289 290 290 ReturnStmt( Expression *expr );291 ReturnStmt( std::list<Label> labels, Expression *expr ); 291 292 ReturnStmt( const ReturnStmt &other ); 292 293 virtual ~ReturnStmt(); … … 309 310 Expression * target; 310 311 311 ThrowStmt( Kind kind, Expression * expr, Expression * target = nullptr );312 ThrowStmt( std::list<Label> labels, Kind kind, Expression * expr, Expression * target = nullptr ); 312 313 ThrowStmt( const ThrowStmt &other ); 313 314 virtual ~ThrowStmt(); … … 331 332 FinallyStmt * finallyBlock; 332 333 333 TryStmt( CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );334 TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 ); 334 335 TryStmt( const TryStmt &other ); 335 336 virtual ~TryStmt(); … … 357 358 Statement *body; 358 359 359 CatchStmt( Kind kind, Declaration *decl,360 CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl, 360 361 Expression *cond, Statement *body ); 361 362 CatchStmt( const CatchStmt &other ); … … 380 381 CompoundStmt *block; 381 382 382 FinallyStmt( CompoundStmt *block );383 FinallyStmt( std::list<Label> labels, CompoundStmt *block ); 383 384 FinallyStmt( const FinallyStmt &other ); 384 385 virtual ~FinallyStmt(); … … 407 408 }; 408 409 409 WaitForStmt( );410 WaitForStmt( std::list<Label> labels = noLabels ); 410 411 WaitForStmt( const WaitForStmt & ); 411 412 virtual ~WaitForStmt(); … … 431 432 }; 432 433 434 class WithStmt : public Statement { 435 public: 436 std::list< Expression * > exprs; 437 Statement * stmt; 438 439 WithStmt( const std::list< Expression * > & exprs, Statement * stmt ); 440 WithStmt( const WithStmt & other ); 441 virtual ~WithStmt(); 442 443 virtual WithStmt * clone() const override { return new WithStmt( *this ); } 444 virtual void accept( Visitor & v ) override { v.visit( this ); } 445 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 446 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 447 }; 448 433 449 434 450 // represents a declaration that occurs as part of a compound statement … … 437 453 Declaration *decl; 438 454 439 DeclStmt( Declaration *decl );455 DeclStmt( std::list<Label> labels, Declaration *decl ); 440 456 DeclStmt( const DeclStmt &other ); 441 457 virtual ~DeclStmt();
Note:
See TracChangeset
for help on using the changeset viewer.