view trunk/src/dil/ast/Declaration.d @ 797:cf2ad5df025c

Added documentation comments. Removed Lexer.loadKeywords() and revised Lexer.isReservedIdentifier(). Also removed Lexer.getTokens(). Renamed keywords to g_reservedIds. Renamed classNames to g_classNames. Added PRE and DMDBUG macros.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 29 Feb 2008 22:51:24 +0100
parents 5fe89bb8cbdd
children
line wrap: on
line source

/++
  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();
}