Mercurial > projects > dang
comparison ast/Stmt.d @ 153:ee202c72cd30
Merge
author | Anders Halager <halager@gmail.com> |
---|---|
date | Mon, 21 Jul 2008 21:32:20 +0200 |
parents | 6c5a3c0bb4fb 393a1f47a6d2 |
children | 8ea749b7da91 |
comparison
equal
deleted
inserted
replaced
152:893f23a9de93 | 153:ee202c72cd30 |
---|---|
19 Decl, | 19 Decl, |
20 Exp, | 20 Exp, |
21 Return, | 21 Return, |
22 If, | 22 If, |
23 While, | 23 While, |
24 For, | |
24 Switch, | 25 Switch, |
25 } | 26 } |
26 | 27 |
27 abstract class Stmt | 28 abstract class Stmt |
28 { | 29 { |
176 whileBody.simplify(); | 177 whileBody.simplify(); |
177 } | 178 } |
178 | 179 |
179 Exp cond; | 180 Exp cond; |
180 Stmt whileBody; | 181 Stmt whileBody; |
182 } | |
183 | |
184 class ForStmt : Stmt | |
185 { | |
186 this(Stmt init, Exp cond, Exp incre, Stmt stmts) | |
187 { | |
188 super(StmtType.For); | |
189 this.init = init; | |
190 this.cond = cond; | |
191 this.incre = incre; | |
192 this.forBody = stmts; | |
193 } | |
194 | |
195 override void simplify() | |
196 { | |
197 cond = cond.simplify(); | |
198 forBody.simplify(); | |
199 } | |
200 | |
201 Exp cond, incre; | |
202 Stmt init, forBody; | |
181 } | 203 } |
182 | 204 |
183 class SwitchStmt : Stmt | 205 class SwitchStmt : Stmt |
184 { | 206 { |
185 this(SourceLocation loc, Exp target) | 207 this(SourceLocation loc, Exp target) |