..
authorbdemsky <bdemsky>
Fri, 7 Apr 2006 20:33:55 +0000 (20:33 +0000)
committerbdemsky <bdemsky>
Fri, 7 Apr 2006 20:33:55 +0000 (20:33 +0000)
Robust/src/IR/Flat/FlatSetElementNode.java [new file with mode: 0644]
Robust/src/IR/Tree/ArrayAccessNode.java [new file with mode: 0644]

diff --git a/Robust/src/IR/Flat/FlatSetElementNode.java b/Robust/src/IR/Flat/FlatSetElementNode.java
new file mode 100644 (file)
index 0000000..aac90d3
--- /dev/null
@@ -0,0 +1,38 @@
+package IR.Flat;
+import IR.FieldDescriptor;
+
+public class FlatSetElementNode extends FlatNode {
+    TempDescriptor src;
+    TempDescriptor dst;
+    TempDescriptor index;
+    
+    public FlatSetElementNode(TempDescriptor dst, TempDescriptor index, TempDescriptor src) {
+       this.index=index;
+       this.src=src;
+       this.dst=dst;
+    }
+
+    public TempDescriptor getSrc() {
+       return src;
+    }
+
+    public TempDescriptor getIndex() {
+       return index;
+    }
+
+    public TempDescriptor getDst() {
+       return dst;
+    }
+
+    public String toString() {
+       return dst.toString()+"["+index.toString()+"]="+src.toString();
+    }
+
+    public int kind() {
+       return FKind.FlatSetElementNode;
+    }
+    
+    public TempDescriptor [] readsTemps() {
+       return new TempDescriptor [] {src,dst,index};
+    }
+}
diff --git a/Robust/src/IR/Tree/ArrayAccessNode.java b/Robust/src/IR/Tree/ArrayAccessNode.java
new file mode 100644 (file)
index 0000000..5b26e55
--- /dev/null
@@ -0,0 +1,33 @@
+package IR.Tree;
+import IR.FieldDescriptor;
+import IR.TypeDescriptor;
+
+public class ArrayAccessNode extends ExpressionNode {
+    ExpressionNode left;
+    ExpressionNode index;
+
+    public ArrayAccessNode(ExpressionNode l, ExpressionNode index) {
+       this.index=index;
+       left=l;
+    }
+
+    public ExpressionNode getIndex() {
+       return index;
+    }
+
+    public ExpressionNode getExpression() {
+       return left;
+    }
+
+    public String printNode(int indent) {
+       return left.printNode(indent)+"["+index.printNode(0)+"]";
+    }
+
+    public int kind() {
+       return Kind.ArrayAccessNode;
+    }
+
+    public TypeDescriptor getType() {
+       return left.getType().dereference();
+    }
+}