comparison 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
comparison
equal deleted inserted replaced
125:d604152de1eb 126:c3b24e7e8cf8
1 module basic.Attribute;
2
3 enum Protection : uint
4 {
5 Private = 1<<0,
6 Public = 1<<1,
7 Package = 1<<2,
8 Protected = 1<<3,
9 Export = 1<<4,
10 }
11
12 struct Attribute
13 {
14
15 void setProtection(Protection p)
16 {
17 att &= 0xFFFFFFE0;
18 att |= ~p;
19 }
20
21 void setStatic() { att &= ~Static; }
22 void setFinal() { att &= ~Final; }
23 void setConst() { att &= ~Const; }
24 void setAbstract() { att &= ~Abstract; }
25 void setOverride() { att &= ~Override; }
26 void setDepracted() { att &= ~Depracted; }
27 void setAuto() { att &= ~Auto; }
28
29 private:
30 uint att;
31
32
33 static const uint Static = 1<<5;
34 static const uint Final = 1<<6;
35 static const uint Const = 1<<7;
36 static const uint Abstract = 1<<8;
37 static const uint Override = 1<<9;
38 static const uint Depracted = 1<<10;
39 static const uint Auto = 1<<11;
40 }