annotate src/dil/ast/Declaration.d @ 839:4063da6f3edd default tip

Refactored the config file and how it is loaded.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Thu, 21 Aug 2008 17:51:04 +0200
parents bcb74c9b895c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
654
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
1 /++
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
2 Author: Aziz Köksal
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
3 License: GPL3
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
4 +/
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
5 module dil.ast.Declaration;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
6
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
7 import dil.ast.Node;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
8 import dil.Enums;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
9
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
10 /// The root class of all declarations.
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
11 abstract class Declaration : Node
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
12 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
13 bool hasBody;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
14 this()
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
15 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
16 super(NodeCategory.Declaration);
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
17 }
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
18
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
19 // Members relevant to semantic phase.
786
3b34f6a95a27 Added and revised documenation comments.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 654
diff changeset
20 StorageClass stc; /// The storage classes of this declaration.
654
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
21 Protection prot; /// The protection attribute of this declaration.
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
22
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
23 final bool isStatic()
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
24 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
25 return !!(stc & StorageClass.Static);
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
26 }
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
27
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
28 final bool isPublic()
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
29 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
30 return !!(prot & Protection.Public);
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
31 }
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
32
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
33 final void setStorageClass(StorageClass stc)
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
34 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
35 this.stc = stc;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
36 }
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
37
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
38 final void setProtection(Protection prot)
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
39 {
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
40 this.prot = prot;
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
41 }
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
42
791
5fe89bb8cbdd Implemented syntax tree copying.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents: 786
diff changeset
43 override abstract Declaration copy();
654
2a71e2f50e13 Moved class Declaration to its own module.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
diff changeset
44 }