view 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 source

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;
}