Mercurial > projects > dang
diff ast/Stmt.d @ 1:2168f4cb73f1
First push
author | johnsen@johnsen-desktop |
---|---|
date | Fri, 18 Apr 2008 02:01:38 +0200 |
parents | |
children | 2c5a8f4c254a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ast/Stmt.d Fri Apr 18 02:01:38 2008 +0200 @@ -0,0 +1,57 @@ +module ast.Stmt; + +import ast.Exp, + ast.Decl; + +import sema.SymbolTable; + +enum StmtType +{ + Stmt, + Decl, + Exp, + Return, +} + +class Stmt +{ + this(StmtType stmtType = StmtType.Stmt) + { + this.stmtType = stmtType; + } + + StmtType stmtType; + Scope env; +} + +class ReturnStmt : Stmt +{ + this() + { + super(StmtType.Return); + } + + public Exp exp; +} + +class DeclStmt : Stmt +{ + this(Decl decl) + { + super(StmtType.Decl); + this.decl = decl; + } + + public Decl decl; +} + +class ExpStmt : Stmt +{ + this(Exp exp) + { + super(StmtType.Exp); + this.exp = exp; + } + + public Exp exp; +}