diff ast/Exp.d @ 78:ad956143dcdc new_gen

Parse and gen for dereferences
author Anders Halager <halager@gmail.com>
date Fri, 02 May 2008 16:38:31 +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:38:31 2008 +0200
@@ -15,6 +15,7 @@
 {
     Binary,
     Negate,
+    Deref,
     IntegerLit,
     MemberReference,
     ArrayReference,
@@ -210,6 +211,26 @@
         super(ExpType.Negate);
         this.exp = exp;
     }
+
+    Exp simplify()
+    {
+        exp = exp.simplify;
+        return this;
+    }
+
+    override DType type() { return exp.type(); }
+
+    public Exp exp;
+}
+
+class DerefExp : Exp
+{
+    this(Exp exp)
+    {
+        super(ExpType.Deref);
+        this.exp = exp;
+    }
+
     Exp simplify()
     {
         exp = exp.simplify;