comparison trunk/src/dil/ast/Declaration.d @ 654:2a71e2f50e13

Moved class Declaration to its own module.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 15 Jan 2008 16:22:49 +0100
parents
children 3b34f6a95a27
comparison
equal deleted inserted replaced
653:29cc5bf3ce89 654:2a71e2f50e13
1 /++
2 Author: Aziz Köksal
3 License: GPL3
4 +/
5 module dil.ast.Declaration;
6
7 import dil.ast.Node;
8 import dil.Enums;
9
10 /// The root class of all declarations.
11 abstract class Declaration : Node
12 {
13 bool hasBody;
14 this()
15 {
16 super(NodeCategory.Declaration);
17 }
18
19 // Members relevant to semantic phase.
20 StorageClass stc; /// The storage class of this declaration.
21 Protection prot; /// The protection attribute of this declaration.
22
23 final bool isStatic()
24 {
25 return !!(stc & StorageClass.Static);
26 }
27
28 final bool isPublic()
29 {
30 return !!(prot & Protection.Public);
31 }
32
33 final void setStorageClass(StorageClass stc)
34 {
35 this.stc = stc;
36 }
37
38 final void setProtection(Protection prot)
39 {
40 this.prot = prot;
41 }
42
43 }