comparison dmd/statement.h @ 148:86d3bb8ca33e trunk

[svn r154] renaming enclosingtry to enclosingtryfinally to distinguish it from enclosingtrycatch, which will probably need to be added for exception handling
author ChristianK
date Sat, 22 Mar 2008 12:20:32 +0100
parents 8f704cb9969b
children 761c8352f494
comparison
equal deleted inserted replaced
147:0636f6269dfd 148:86d3bb8ca33e
191 * of the statements, and break will go to the end of the statements. 191 * of the statements, and break will go to the end of the statements.
192 */ 192 */
193 struct UnrolledLoopStatement : Statement 193 struct UnrolledLoopStatement : Statement
194 { 194 {
195 Statements *statements; 195 Statements *statements;
196 TryFinallyStatement *enclosingtry; 196 TryFinallyStatement *enclosingtryfinally;
197 197
198 UnrolledLoopStatement(Loc loc, Statements *statements); 198 UnrolledLoopStatement(Loc loc, Statements *statements);
199 Statement *syntaxCopy(); 199 Statement *syntaxCopy();
200 Statement *semantic(Scope *sc); 200 Statement *semantic(Scope *sc);
201 int hasBreak(); 201 int hasBreak();
236 236
237 struct WhileStatement : Statement 237 struct WhileStatement : Statement
238 { 238 {
239 Expression *condition; 239 Expression *condition;
240 Statement *body; 240 Statement *body;
241 TryFinallyStatement *enclosingtry; 241 TryFinallyStatement *enclosingtryfinally;
242 242
243 WhileStatement(Loc loc, Expression *c, Statement *b); 243 WhileStatement(Loc loc, Expression *c, Statement *b);
244 Statement *syntaxCopy(); 244 Statement *syntaxCopy();
245 Statement *semantic(Scope *sc); 245 Statement *semantic(Scope *sc);
246 int hasBreak(); 246 int hasBreak();
258 258
259 struct DoStatement : Statement 259 struct DoStatement : Statement
260 { 260 {
261 Statement *body; 261 Statement *body;
262 Expression *condition; 262 Expression *condition;
263 TryFinallyStatement *enclosingtry; 263 TryFinallyStatement *enclosingtryfinally;
264 264
265 DoStatement(Loc loc, Statement *b, Expression *c); 265 DoStatement(Loc loc, Statement *b, Expression *c);
266 Statement *syntaxCopy(); 266 Statement *syntaxCopy();
267 Statement *semantic(Scope *sc); 267 Statement *semantic(Scope *sc);
268 int hasBreak(); 268 int hasBreak();
282 { 282 {
283 Statement *init; 283 Statement *init;
284 Expression *condition; 284 Expression *condition;
285 Expression *increment; 285 Expression *increment;
286 Statement *body; 286 Statement *body;
287 TryFinallyStatement *enclosingtry; 287 TryFinallyStatement *enclosingtryfinally;
288 288
289 ForStatement(Loc loc, Statement *init, Expression *condition, Expression *increment, Statement *body); 289 ForStatement(Loc loc, Statement *init, Expression *condition, Expression *increment, Statement *body);
290 Statement *syntaxCopy(); 290 Statement *syntaxCopy();
291 Statement *semantic(Scope *sc); 291 Statement *semantic(Scope *sc);
292 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally); 292 void scopeCode(Statement **sentry, Statement **sexit, Statement **sfinally);
307 { 307 {
308 enum TOK op; // TOKforeach or TOKforeach_reverse 308 enum TOK op; // TOKforeach or TOKforeach_reverse
309 Arguments *arguments; // array of Argument*'s 309 Arguments *arguments; // array of Argument*'s
310 Expression *aggr; 310 Expression *aggr;
311 Statement *body; 311 Statement *body;
312 TryFinallyStatement *enclosingtry; 312 TryFinallyStatement *enclosingtryfinally;
313 313
314 VarDeclaration *key; 314 VarDeclaration *key;
315 VarDeclaration *value; 315 VarDeclaration *value;
316 316
317 FuncDeclaration *func; // function we're lexically in 317 FuncDeclaration *func; // function we're lexically in
404 struct SwitchStatement : Statement 404 struct SwitchStatement : Statement
405 { 405 {
406 Expression *condition; 406 Expression *condition;
407 Statement *body; 407 Statement *body;
408 DefaultStatement *sdefault; 408 DefaultStatement *sdefault;
409 TryFinallyStatement *enclosingtry; 409 TryFinallyStatement *enclosingtryfinally;
410 410
411 Array gotoCases; // array of unresolved GotoCaseStatement's 411 Array gotoCases; // array of unresolved GotoCaseStatement's
412 Array *cases; // array of CaseStatement's 412 Array *cases; // array of CaseStatement's
413 int hasNoDefault; // !=0 if no default statement 413 int hasNoDefault; // !=0 if no default statement
414 414
478 }; 478 };
479 479
480 struct GotoDefaultStatement : Statement 480 struct GotoDefaultStatement : Statement
481 { 481 {
482 SwitchStatement *sw; 482 SwitchStatement *sw;
483 TryFinallyStatement *enclosingtry; 483 TryFinallyStatement *enclosingtryfinally;
484 484
485 GotoDefaultStatement(Loc loc); 485 GotoDefaultStatement(Loc loc);
486 Statement *syntaxCopy(); 486 Statement *syntaxCopy();
487 Statement *semantic(Scope *sc); 487 Statement *semantic(Scope *sc);
488 Expression *interpret(InterState *istate); 488 Expression *interpret(InterState *istate);
494 494
495 struct GotoCaseStatement : Statement 495 struct GotoCaseStatement : Statement
496 { 496 {
497 Expression *exp; // NULL, or which case to goto 497 Expression *exp; // NULL, or which case to goto
498 CaseStatement *cs; // case statement it resolves to 498 CaseStatement *cs; // case statement it resolves to
499 TryFinallyStatement *enclosingtry; 499 TryFinallyStatement *enclosingtryfinally;
500 SwitchStatement *sw; 500 SwitchStatement *sw;
501 501
502 GotoCaseStatement(Loc loc, Expression *exp); 502 GotoCaseStatement(Loc loc, Expression *exp);
503 Statement *syntaxCopy(); 503 Statement *syntaxCopy();
504 Statement *semantic(Scope *sc); 504 Statement *semantic(Scope *sc);
519 }; 519 };
520 520
521 struct ReturnStatement : Statement 521 struct ReturnStatement : Statement
522 { 522 {
523 Expression *exp; 523 Expression *exp;
524 TryFinallyStatement *enclosingtry; 524 TryFinallyStatement *enclosingtryfinally;
525 525
526 ReturnStatement(Loc loc, Expression *exp); 526 ReturnStatement(Loc loc, Expression *exp);
527 Statement *syntaxCopy(); 527 Statement *syntaxCopy();
528 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 528 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
529 Statement *semantic(Scope *sc); 529 Statement *semantic(Scope *sc);
540 }; 540 };
541 541
542 struct BreakStatement : Statement 542 struct BreakStatement : Statement
543 { 543 {
544 Identifier *ident; 544 Identifier *ident;
545 TryFinallyStatement *enclosingtry; 545 TryFinallyStatement *enclosingtryfinally;
546 546
547 BreakStatement(Loc loc, Identifier *ident); 547 BreakStatement(Loc loc, Identifier *ident);
548 Statement *syntaxCopy(); 548 Statement *syntaxCopy();
549 Statement *semantic(Scope *sc); 549 Statement *semantic(Scope *sc);
550 Expression *interpret(InterState *istate); 550 Expression *interpret(InterState *istate);
558 }; 558 };
559 559
560 struct ContinueStatement : Statement 560 struct ContinueStatement : Statement
561 { 561 {
562 Identifier *ident; 562 Identifier *ident;
563 TryFinallyStatement *enclosingtry; 563 TryFinallyStatement *enclosingtryfinally;
564 564
565 ContinueStatement(Loc loc, Identifier *ident); 565 ContinueStatement(Loc loc, Identifier *ident);
566 Statement *syntaxCopy(); 566 Statement *syntaxCopy();
567 Statement *semantic(Scope *sc); 567 Statement *semantic(Scope *sc);
568 Expression *interpret(InterState *istate); 568 Expression *interpret(InterState *istate);
650 650
651 struct TryFinallyStatement : Statement 651 struct TryFinallyStatement : Statement
652 { 652 {
653 Statement *body; 653 Statement *body;
654 Statement *finalbody; 654 Statement *finalbody;
655 TryFinallyStatement *enclosingtry; 655 TryFinallyStatement *enclosingtryfinally;
656 656
657 TryFinallyStatement(Loc loc, Statement *body, Statement *finalbody); 657 TryFinallyStatement(Loc loc, Statement *body, Statement *finalbody);
658 Statement *syntaxCopy(); 658 Statement *syntaxCopy();
659 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 659 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
660 Statement *semantic(Scope *sc); 660 Statement *semantic(Scope *sc);
717 struct GotoStatement : Statement 717 struct GotoStatement : Statement
718 { 718 {
719 Identifier *ident; 719 Identifier *ident;
720 LabelDsymbol *label; 720 LabelDsymbol *label;
721 TryFinallyStatement *tf; 721 TryFinallyStatement *tf;
722 TryFinallyStatement *enclosingtry; 722 TryFinallyStatement *enclosingtryfinally;
723 723
724 GotoStatement(Loc loc, Identifier *ident); 724 GotoStatement(Loc loc, Identifier *ident);
725 Statement *syntaxCopy(); 725 Statement *syntaxCopy();
726 Statement *semantic(Scope *sc); 726 Statement *semantic(Scope *sc);
727 int fallOffEnd(); 727 int fallOffEnd();
735 struct LabelStatement : Statement 735 struct LabelStatement : Statement
736 { 736 {
737 Identifier *ident; 737 Identifier *ident;
738 Statement *statement; 738 Statement *statement;
739 TryFinallyStatement *tf; 739 TryFinallyStatement *tf;
740 TryFinallyStatement *enclosingtry; 740 TryFinallyStatement *enclosingtryfinally;
741 block *lblock; // back end 741 block *lblock; // back end
742 int isReturnLabel; 742 int isReturnLabel;
743 743
744 LabelStatement(Loc loc, Identifier *ident, Statement *statement); 744 LabelStatement(Loc loc, Identifier *ident, Statement *statement);
745 Statement *syntaxCopy(); 745 Statement *syntaxCopy();