Mercurial > projects > dang
view ast/Module.d @ 140:927ae00bd9d2
Added support for extern keyword. Being ignored atm though. Also changed ast/Module, so that you can get a list of only vars, functions or structs.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Sun, 20 Jul 2008 23:23:56 +0200 |
parents | 2be29b296081 |
children | 6e6355fb5f0f |
line wrap: on
line source
module ast.Module; import sema.Scope, sema.Symbol; import ast.Decl; class Module { this(char[] moduleName) { this.moduleName = moduleName; } void addDecl(Decl decl) { switch(decl.declType) { case DeclType.FuncDecl: functions ~= cast(FuncDecl)decl; break; case DeclType.VarDecl: vars ~= cast(VarDecl)decl; break; case DeclType.StructDecl: structs ~= cast(StructDecl)decl; break; default: assert(0, "DeclType not implemented"); } decls ~= decl; } VarDecl[] vars; FuncDecl[] functions; StructDecl[] structs; Decl[] decls; char[] moduleName; Scope env; Symbol symbol; bool outputModule = true; }