# HG changeset patch # User Aziz K?ksal # Date 1200410569 -3600 # Node ID 2a71e2f50e13a95a8718826f677996d5247d6884 # Parent 29cc5bf3ce89eda9653a5af282501a08917944a2 Moved class Declaration to its own module. diff -r 29cc5bf3ce89 -r 2a71e2f50e13 trunk/src/dil/ast/Declaration.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/src/dil/ast/Declaration.d Tue Jan 15 16:22:49 2008 +0100 @@ -0,0 +1,43 @@ +/++ + 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 class 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; + } + +} diff -r 29cc5bf3ce89 -r 2a71e2f50e13 trunk/src/dil/ast/Declarations.d --- a/trunk/src/dil/ast/Declarations.d Tue Jan 15 16:05:42 2008 +0100 +++ b/trunk/src/dil/ast/Declarations.d Tue Jan 15 16:22:49 2008 +0100 @@ -4,6 +4,7 @@ +/ module dil.ast.Declarations; +public import dil.ast.Declaration; import dil.ast.Node; import dil.ast.Expressions; import dil.ast.Types; @@ -15,40 +16,6 @@ import dil.Enums; import common; -abstract class Declaration : Node -{ - bool hasBody; - this() - { - super(NodeCategory.Declaration); - } - - // Members relevant to semantic phase. - StorageClass stc; /// The storage class 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; - } - -} - class Declarations : Declaration { this() diff -r 29cc5bf3ce89 -r 2a71e2f50e13 trunk/src/dil/ast/Expressions.d --- a/trunk/src/dil/ast/Expressions.d Tue Jan 15 16:05:42 2008 +0100 +++ b/trunk/src/dil/ast/Expressions.d Tue Jan 15 16:22:49 2008 +0100 @@ -12,8 +12,6 @@ import dil.ast.Parameters; import dil.ast.BaseClass; import dil.lexer.Identifier; -import dil.parser.ExpressionParser; -import dil.semantic.Scope; import dil.semantic.Types; import common; diff -r 29cc5bf3ce89 -r 2a71e2f50e13 trunk/src/dil/ast/Parameters.d --- a/trunk/src/dil/ast/Parameters.d Tue Jan 15 16:05:42 2008 +0100 +++ b/trunk/src/dil/ast/Parameters.d Tue Jan 15 16:22:49 2008 +0100 @@ -6,7 +6,7 @@ import dil.ast.Node; import dil.ast.Types; -import dil.ast.Expressions; +import dil.ast.Expression; import dil.lexer.Identifier; import dil.Enums;