Mercurial > projects > dil
diff trunk/src/dil/semantic/Symbols.d @ 707:efa5fcb9aa14
Added semantic code related to enums.
Added member symbol to EnumMemberDeclaration.
Added genAnonEnumID() to IdTable.
Added class EnumMember.
Wrote code for SemanticPass2.visit(EnumDeclaration).
Revised code in SemanticPass1.visit(EnumDeclaration).
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 29 Jan 2008 01:07:39 +0100 |
parents | 839c0c61af2b |
children | 00f872d949ea |
line wrap: on
line diff
--- a/trunk/src/dil/semantic/Symbols.d Mon Jan 28 21:39:08 2008 +0100 +++ b/trunk/src/dil/semantic/Symbols.d Tue Jan 29 01:07:39 2008 +0100 @@ -4,6 +4,7 @@ +/ module dil.semantic.Symbols; +import dil.ast.Expression; import dil.semantic.Symbol; import dil.semantic.SymbolTable; import dil.semantic.Types; @@ -136,6 +137,7 @@ LinkageType linkType; /// The linkage type. Type type; /// The type of this variable. + Expression value; /// The value of this variable. this(Identifier* name, Protection prot, StorageClass stc, LinkageType linkType, @@ -143,11 +145,23 @@ { super(SYM.Variable, name, variableNode); + this.prot = prot; this.stc = stc; this.linkType = linkType; } } +class EnumMember : Variable +{ + this(Identifier* name, + Protection prot, StorageClass stc, LinkageType linkType, + Node enumMemberNode) + { + super(name, prot, stc, linkType, enumMemberNode); + this.sid = SYM.EnumMember; + } +} + class Alias : Symbol { this(Identifier* name, Node aliasNode)