diff trunk/src/Types.d @ 281:c1fcfbce9499

- BaseClass inherits from Node now. - Added types to enum NodeKind. - Added other class names to enum NodeKind. - Added mixin(set_kind) statement to every constructor that inherits from Type or Node.
author aziz
date Mon, 06 Aug 2007 19:23:03 +0000
parents 1eb54f6f392e
children c0e857931ff6
line wrap: on
line diff
--- a/trunk/src/Types.d	Mon Aug 06 18:54:01 2007 +0000
+++ b/trunk/src/Types.d	Mon Aug 06 19:23:03 2007 +0000
@@ -50,6 +50,7 @@
   this(Token* stcTok, Type type, Token* ident, Expression assignExpr)
   {
     super(NodeCategory.Other);
+    mixin(set_kind);
 
     StorageClass stc;
     if (stcTok !is null)
@@ -94,6 +95,7 @@
   this()
   {
     super(NodeCategory.Other);
+    mixin(set_kind);
   }
 
   bool hasVariadic()
@@ -121,12 +123,14 @@
   Export    = 1<<4
 }
 
-class BaseClass
+class BaseClass : Node
 {
   Protection prot;
   Type type;
   this(Protection prot, Type type)
   {
+    super(NodeCategory.Other);
+    mixin(set_kind);
     this.prot = prot;
     this.type = type;
   }
@@ -150,6 +154,7 @@
   this(TP tp, Type valueType, Token* ident, Type specType, Type defType, Expression specValue, Expression defValue)
   {
     super(NodeCategory.Other);
+    mixin(set_kind);
     this.tp = tp;
     this.valueType = valueType;
     this.ident = ident;
@@ -167,6 +172,7 @@
   this()
   {
     super(NodeCategory.Other);
+    mixin(set_kind);
   }
 
   void opCatAssign(TemplateParameter parameter)
@@ -182,6 +188,7 @@
   this()
   {
     super(NodeCategory.Other);
+    mixin(set_kind);
   }
 
   void opCatAssign(Node argument)
@@ -251,6 +258,7 @@
   this(TOK tok)
   {
     super(cast(TID)tok);
+    mixin(set_kind);
   }
 }
 
@@ -259,6 +267,7 @@
   this()
   {
     super(TID.Undefined);
+    mixin(set_kind);
   }
 }
 
@@ -268,6 +277,7 @@
   this(Type[] dotList)
   {
     super(TID.DotList);
+    mixin(set_kind);
     this.dotList = dotList;
   }
 }
@@ -278,6 +288,7 @@
   this(Token* ident)
   {
     super(TID.Identifier);
+    mixin(set_kind);
     this.ident = ident;
   }
 }
@@ -288,6 +299,7 @@
   this(Expression e)
   {
     super(TID.Typeof);
+    mixin(set_kind);
     this.e = e;
   }
 }
@@ -299,6 +311,7 @@
   this(Token* ident, TemplateArguments targs)
   {
     super(TID.TemplateInstance);
+    mixin(set_kind);
     this.ident = ident;
     this.targs = targs;
   }
@@ -309,6 +322,7 @@
   this(Type t)
   {
     super(TID.Pointer, t);
+    mixin(set_kind);
   }
 }
 
@@ -319,6 +333,7 @@
   this(Type t)
   {
     super(TID.Array, t);
+    mixin(set_kind);
   }
   this(Type t, Expression e, Expression e2)
   {
@@ -341,6 +356,7 @@
   this(Type returnType, Parameters parameters, TemplateParameters tparams = null)
   {
     super(TID.Function);
+    mixin(set_kind);
     this.returnType = returnType;
     this.parameters = parameters;
     this.tparams = tparams;
@@ -352,6 +368,7 @@
   this(Type func)
   {
     super(TID.Delegate, func);
+    mixin(set_kind);
   }
 }
 
@@ -363,6 +380,7 @@
   {
     // If t is null: cast(const)
     super(TID.Const, t);
+    mixin(set_kind);
   }
 }
 
@@ -372,6 +390,7 @@
   {
     // If t is null: cast(invariant)
     super(TID.Invariant, t);
+    mixin(set_kind);
   }
 }
 } // version(D2)