diff trunk/src/Types.d @ 94:0fe650a7a8d1

- Renamed Type enum to InfoType in module Information. - Changed 'TOK type' member of TypeDotIdExpression to 'Type type'. - Added module Types. - Implemented most of parseBasicType(). - Indented code of 'BasicType . Identifier' parser and creating Type instance.
author aziz
date Fri, 06 Jul 2007 15:23:04 +0000
parents
children 0eb4c8a5b32b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/Types.d	Fri Jul 06 15:23:04 2007 +0000
@@ -0,0 +1,47 @@
+/++
+  Author: Aziz Köksal
+  License: GPL2
++/
+module Types;
+import Token;
+import Expressions;
+
+class Type
+{
+  TOK type;
+  this(TOK type)
+  {
+    this.type = type;
+  }
+}
+
+class IdentifierType : Type
+{
+  string[] idents;
+
+  this(string[] idents)
+  {
+    super(TOK.Identifier);
+    this.idents = idents;
+  }
+
+  this(TOK type)
+  {
+    super(type);
+  }
+
+  void opCatAssign(string ident)
+  {
+    this.idents ~= ident;
+  }
+}
+
+class TypeofType : IdentifierType
+{
+  Expression e;
+  this(Expression e)
+  {
+    super(TOK.Typeof);
+    this.e = e;
+  }
+}