diff src/dil/ast/Declaration.d @ 806:bcb74c9b895c

Moved out files in the trunk folder to the root.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Mar 2008 00:12:19 +0100
parents trunk/src/dil/ast/Declaration.d@5fe89bb8cbdd
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/dil/ast/Declaration.d	Sun Mar 09 00:12:19 2008 +0100
@@ -0,0 +1,44 @@
+/++
+  Author: Aziz Köksal
+  License: GPL3
++/
+module dil.ast.Declaration;
+
+import dil.ast.Node;
+import dil.Enums;
+
+/// The root class of all declarations.
+abstract class Declaration : Node
+{
+  bool hasBody;
+  this()
+  {
+    super(NodeCategory.Declaration);
+  }
+
+  // Members relevant to semantic phase.
+  StorageClass stc; /// The storage classes of this declaration.
+  Protection prot;  /// The protection attribute of this declaration.
+
+  final bool isStatic()
+  {
+    return !!(stc & StorageClass.Static);
+  }
+
+  final bool isPublic()
+  {
+    return !!(prot & Protection.Public);
+  }
+
+  final void setStorageClass(StorageClass stc)
+  {
+    this.stc = stc;
+  }
+
+  final void setProtection(Protection prot)
+  {
+    this.prot = prot;
+  }
+
+  override abstract Declaration copy();
+}