diff ast/Exp.d @ 77:13eea2c4e60d new_gen

Now able of --ast-dump-code with Pointer types and also codeGen int* x;
author Anders Johnsen <skabet@gmail.com>
date Fri, 02 May 2008 16:37:13 +0200
parents 628cb46ab13b
children 81813366ef92
line wrap: on
line diff
--- a/ast/Exp.d	Fri May 02 15:48:57 2008 +0200
+++ b/ast/Exp.d	Fri May 02 16:37:13 2008 +0200
@@ -20,6 +20,7 @@
     ArrayReference,
     Identifier,
     ArrayIdentifier,
+    PointerIdentifier,
     AssignExp,
     CallExp,
     CastExp,
@@ -328,6 +329,28 @@
     Exp exp;
 }
 
+class PointerIdentifier : Identifier
+{
+    this(Identifier pointerOf)
+    {
+        super(ExpType.PointerIdentifier);
+        this.pointerOf = pointerOf;
+        this.name = pointerOf.name;
+    }
+
+    override DType type()
+    {
+        if (myType !is null)
+            return myType;
+        myType = new DPointer(pointerOf.type);
+        return myType;
+    }
+
+    Identifier pointerOf;
+
+    private DType myType;
+}
+
 class ArrayIdentifier : Identifier
 {
     this(Identifier arrayOf)