diff src/ast/Stmt.d @ 206:d3c148ca429b

Major moving of files. all src now goes into src, all docs in docs.
author Anders Johnsen <skabet@gmail.com>
date Tue, 12 Aug 2008 18:14:56 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ast/Stmt.d	Tue Aug 12 18:14:56 2008 +0200
@@ -0,0 +1,127 @@
+module ast.Stmt;
+
+/**
+  The base class for all Statements.
+  */
+class Stmt
+{
+    bool isCompoundStmt() { return false; }
+    CompoundStmt asCompoundStmt() { return null; }
+
+    bool isDeclStmt() { return false; }
+    DeclStmt asDeclStmt() { return null; }
+
+    bool isExpStmt() { return false; }
+    ExpStmt asExpStmt() { return null; }
+
+    bool isReturnStmt() { return false; }
+    ReturnStmt asReturnStmt() { return null; }
+
+    bool isIfStmt() { return false; }
+    IfStmt asIfStmt() { return null; }
+
+    bool isWhileStmt() { return false; }
+    WhileStmt asWhileStmt() { return null; }
+
+    bool isForStmt() { return false; }
+    ForStmt asForStmt() { return null; }
+
+    bool isSwitchStmt() { return false; }
+    SwitchStmt asSwitchStmt() { return null; }
+
+    bool isForeachStmt() { return false; }
+    ForeachStmt asForeachStmt() { return null; }
+
+    bool isAssertStmt() { return false; }
+    AssertStmt asAssertStmt() { return null; }
+}
+
+/**
+  CompoundStmt
+  */
+class CompoundStmt : Stmt
+{
+    override bool isCompoundStmt() { return true; }
+    override CompoundStmt asCompoundStmt() { return this; }
+}
+
+/**
+  DeclStmt
+  */
+class DeclStmt : Stmt
+{
+    override bool isDeclStmt() { return true; }
+    override DeclStmt asDeclStmt() { return this; }
+}
+
+/**
+  ExpStmt
+  */
+class ExpStmt : Stmt
+{
+    override bool isExpStmt() { return true; }
+    override ExpStmt asExpStmt() { return this; }
+}
+
+/**
+  ReturnStmt
+  */
+class ReturnStmt : Stmt
+{
+    override bool isReturnStmt() { return true; }
+    override ReturnStmt asReturnStmt() { return this; }
+}
+
+/**
+  IfStmt
+  */
+class IfStmt : Stmt
+{
+    override bool isIfStmt() { return true; }
+    override IfStmt asIfStmt() { return this; }
+}
+
+/**
+  WhileStmt
+  */
+class WhileStmt : Stmt
+{
+    override bool isWhileStmt() { return true; }
+    override WhileStmt asWhileStmt() { return this; }
+}
+
+/**
+  ForStmt
+  */
+class ForStmt : Stmt
+{
+    override bool isForStmt() { return true; }
+    override ForStmt asForStmt() { return this; }
+}
+
+/**
+  SwitchStmt
+  */
+class SwitchStmt : Stmt
+{
+    override bool isSwitchStmt() { return true; }
+    override SwitchStmt asSwitchStmt() { return this; }
+}
+
+/**
+  ForeachStmt
+  */
+class ForeachStmt : Stmt
+{
+    override bool isForeachStmt() { return true; }
+    override ForeachStmt asForeachStmt() { return this; }
+}
+
+/**
+  AssertStmt
+  */
+class AssertStmt : Stmt
+{
+    override bool isAssertStmt() { return true; }
+    override AssertStmt asAssertStmt() { return this; }
+}