Mercurial > projects > dang
comparison ast/Stmt.d @ 203:28beb8b110ee
proper stub
author | dan amlund <danamlund@gmail.com> |
---|---|
date | Mon, 11 Aug 2008 19:43:17 +0200 |
parents | cba8d8c063f3 |
children | 227d6a8fb574 |
comparison
equal
deleted
inserted
replaced
202:cba8d8c063f3 | 203:28beb8b110ee |
---|---|
3 /** | 3 /** |
4 The base class for all Statements. | 4 The base class for all Statements. |
5 */ | 5 */ |
6 class Stmt | 6 class Stmt |
7 { | 7 { |
8 bool isCompoundStmt() { return false; } | 8 bool isCompundStmt() { return false; } |
9 CompoundStmt asCompoundStmt() { return null; } | |
10 | |
9 bool isDeclStmt() { return false; } | 11 bool isDeclStmt() { return false; } |
12 DeclStmt asDeclStmt() { return null; } | |
13 | |
10 bool isExpStmt() { return false; } | 14 bool isExpStmt() { return false; } |
15 ExpStmt asExpStmt() { return null; } | |
16 | |
11 bool isReturnStmt() { return false; } | 17 bool isReturnStmt() { return false; } |
18 ReturnStmt asReturnStmt() { return null; } | |
19 | |
12 bool isIfStmt() { return false; } | 20 bool isIfStmt() { return false; } |
21 IfStmt asIfStmt() { return null; } | |
22 | |
13 bool isWhileStmt() { return false; } | 23 bool isWhileStmt() { return false; } |
24 WhileStmt asWhileStmt() { return null; } | |
25 | |
14 bool isForStmt() { return false; } | 26 bool isForStmt() { return false; } |
27 ForStmt asForStmt() { return null; } | |
28 | |
15 bool isSwitchStmt() { return false; } | 29 bool isSwitchStmt() { return false; } |
30 SwitchStmt asSwitchStmt() { return null; } | |
31 | |
16 bool isForeachStmt() { return false; } | 32 bool isForeachStmt() { return false; } |
33 ForeachStmt asForeachStmt() { return null; } | |
34 | |
17 bool isAssertStmt() { return false; } | 35 bool isAssertStmt() { return false; } |
36 AssertStmt asAssertStmt() { return null; } | |
18 } | 37 } |
19 | 38 |
20 /** | 39 /** |
21 CompoundStmt | 40 CompoundStmt |
22 */ | 41 */ |
23 class CompoundStmt : Stmt | 42 class CompoundStmt : Stmt |
24 { | 43 { |
25 override bool isCompoundStmt() { return true; } | 44 override bool isCompoundStmt() { return true; } |
45 override CompoundStmt asCompoundStmt() { return this; } | |
26 } | 46 } |
27 | 47 |
28 /** | 48 /** |
29 DeclStmt | 49 DeclStmt |
30 */ | 50 */ |
31 class DeclStmt : Stmt | 51 class DeclStmt : Stmt |
32 { | 52 { |
33 override bool isDeclStmt() { return true; } | 53 override bool isDeclStmt() { return true; } |
54 override DeclStmt asDeclStmt() { return this; } | |
34 } | 55 } |
35 | 56 |
36 /** | 57 /** |
37 ExpStmt | 58 ExpStmt |
38 */ | 59 */ |
39 class ExpStmt : Stmt | 60 class ExpStmt : Stmt |
40 { | 61 { |
41 override bool isExpStmt() { return true; } | 62 override bool isExpStmt() { return true; } |
63 override ExpStmt asExpStmt() { return this; } | |
42 } | 64 } |
43 | 65 |
44 /** | 66 /** |
45 ReturnStmt | 67 ReturnStmt |
46 */ | 68 */ |
47 class ReturnStmt : Stmt | 69 class ReturnStmt : Stmt |
48 { | 70 { |
49 override bool isReturnStmt() { return true; } | 71 override bool isReturnStmt() { return true; } |
72 override ReturnStmt asReturnStmt() { return this; } | |
50 } | 73 } |
51 | 74 |
52 /** | 75 /** |
53 IfStmt | 76 IfStmt |
54 */ | 77 */ |
55 class IfStmt : Stmt | 78 class IfStmt : Stmt |
56 { | 79 { |
57 override bool isIfStmt() { return true; } | 80 override bool isIfStmt() { return true; } |
81 override IfStmt asIfStmt() { return this; } | |
58 } | 82 } |
59 | 83 |
60 /** | 84 /** |
61 WhileStmt | 85 WhileStmt |
62 */ | 86 */ |
63 class WhileStmt : Stmt | 87 class WhileStmt : Stmt |
64 { | 88 { |
65 override bool isWhileStmt() { return true; } | 89 override bool isWhileStmt() { return true; } |
90 override WhileStmt asWhileStmt() { return this; } | |
66 } | 91 } |
67 | 92 |
68 /** | 93 /** |
69 ForStmt | 94 ForStmt |
70 */ | 95 */ |
71 class ForStmt : Stmt | 96 class ForStmt : Stmt |
72 { | 97 { |
73 override bool isForStmt() { return true; } | 98 override bool isForStmt() { return true; } |
99 override ForStmt asForStmt() { return this; } | |
74 } | 100 } |
75 | 101 |
76 /** | 102 /** |
77 SwitchStmt | 103 SwitchStmt |
78 */ | 104 */ |
79 class SwitchStmt : Stmt | 105 class SwitchStmt : Stmt |
80 { | 106 { |
81 override bool isSwitchStmt() { return true; } | 107 override bool isSwitchStmt() { return true; } |
108 override SwitchStmt asSwitchStmt() { return this; } | |
82 } | 109 } |
83 | 110 |
84 /** | 111 /** |
85 ForeachStmt | 112 ForeachStmt |
86 */ | 113 */ |
87 class ForeachStmt : Stmt | 114 class ForeachStmt : Stmt |
88 { | 115 { |
89 override bool isForeachStmt() { return true; } | 116 override bool isForeachStmt() { return true; } |
117 override ForeachStmt asForeachStmt() { return this; } | |
90 } | 118 } |
91 | 119 |
92 /** | 120 /** |
93 AssertStmt | 121 AssertStmt |
94 */ | 122 */ |
95 class AssertStmt : Stmt | 123 class AssertStmt : Stmt |
96 { | 124 { |
97 override bool isAssertStmt() { return true; } | 125 override bool isAssertStmt() { return true; } |
126 override AssertStmt asAssertStmt() { return this; } | |
98 } | 127 } |