Mercurial > projects > dang
diff basic/Attribute.d @ 126:c3b24e7e8cf8
Carius changes to the parser. Parsing attributes, lexing many keywords(not all yet).
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 27 May 2008 10:32:31 +0200 |
parents | |
children | 2be29b296081 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/basic/Attribute.d Tue May 27 10:32:31 2008 +0200 @@ -0,0 +1,40 @@ +module basic.Attribute; + +enum Protection : uint +{ + Private = 1<<0, + Public = 1<<1, + Package = 1<<2, + Protected = 1<<3, + Export = 1<<4, +} + +struct Attribute +{ + + void setProtection(Protection p) + { + att &= 0xFFFFFFE0; + att |= ~p; + } + + void setStatic() { att &= ~Static; } + void setFinal() { att &= ~Final; } + void setConst() { att &= ~Const; } + void setAbstract() { att &= ~Abstract; } + void setOverride() { att &= ~Override; } + void setDepracted() { att &= ~Depracted; } + void setAuto() { att &= ~Auto; } + +private: + uint att; + + + static const uint Static = 1<<5; + static const uint Final = 1<<6; + static const uint Const = 1<<7; + static const uint Abstract = 1<<8; + static const uint Override = 1<<9; + static const uint Depracted = 1<<10; + static const uint Auto = 1<<11; +}