diff 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
line wrap: on
line diff
--- a/ast/Stmt.d	Mon Jul 21 21:30:44 2008 +0200
+++ b/ast/Stmt.d	Mon Jul 21 21:32:20 2008 +0200
@@ -21,6 +21,7 @@
     Return,
     If,
     While,
+    For,
     Switch,
 }
 
@@ -180,6 +181,27 @@
     Stmt whileBody;
 }
 
+class ForStmt : Stmt
+{
+    this(Stmt init, Exp cond, Exp incre, Stmt stmts)
+    {
+        super(StmtType.For);
+        this.init = init;
+        this.cond = cond;
+        this.incre = incre;
+        this.forBody = stmts;
+    }
+
+    override void simplify()
+    {
+        cond = cond.simplify();
+        forBody.simplify();
+    }
+
+    Exp cond, incre;
+    Stmt init, forBody;
+}
+
 class SwitchStmt : Stmt
 {
     this(SourceLocation loc, Exp target)