diff ast/Exp.d @ 28:69464d465284 new_gen

Now supporting structs - both read and write. Still a few errors though, so watch out.
author Anders Johnsen <skabet@gmail.com>
date Sun, 20 Apr 2008 11:20:28 +0200
parents 2f493057cf17
children 495188f9078e
line wrap: on
line diff
--- a/ast/Exp.d	Sun Apr 20 01:08:50 2008 +0200
+++ b/ast/Exp.d	Sun Apr 20 11:20:28 2008 +0200
@@ -11,6 +11,8 @@
     Binary,
     Negate,
     IntegerLit,
+    MemberLookup,
+    ArrayLookup,
     Identifier,
     AssignExp,
     CallExp,
@@ -42,14 +44,14 @@
 
 class AssignExp : Exp
 {
-    this(Identifier identifier, Exp exp)
+    this(Exp identifier, Exp exp)
     {
         super(ExpType.AssignExp);
         this.identifier = identifier;
         this.exp = exp;
     }
 
-    Identifier identifier;
+    Exp identifier;
     Exp exp;
 }
 
@@ -105,6 +107,32 @@
     Token token;
 }
 
+class MemberLookup : Exp
+{
+    this(Exp target, Identifier child)
+    {
+        super(ExpType.MemberLookup);
+        this.target = target;
+        this.child = child;
+    }
+
+    Identifier child;
+    Exp target;
+}
+
+class ArrayLookup : Exp
+{
+    this(Exp target, IntegerLit pos)
+    {
+        super(ExpType.ArrayLookup);
+        this.target = target;
+        this.pos = pos;
+    }
+
+    Exp target;
+    IntegerLit pos;
+}
+
 class Identifier : Exp
 {
     this(Token t)