Fix tabbing.... Please fix your editors so they do tabbing correctly!!! (Spaces...
[IRC.git] / Robust / src / IR / Tree / OffsetNode.java
1 package IR.Tree;
2 import IR.FieldDescriptor;
3 import IR.TypeDescriptor;
4 import IR.ClassDescriptor;
5
6 public class OffsetNode extends ExpressionNode {
7   TypeDescriptor td;
8   FieldDescriptor fd;
9   String fieldname;
10
11   public OffsetNode(TypeDescriptor td, String fieldname) {
12     this.td = td;
13     this.fieldname = fieldname;
14     this.fd = null;
15   }
16
17   public void setField(FieldDescriptor fd) {
18     this.fd = fd;
19   }
20
21   public String getFieldName() {
22     return fieldname;
23   }
24
25   public FieldDescriptor getField() {
26     return fd;
27   }
28
29   public TypeDescriptor getClassType() {
30     return td;
31   }
32
33   public TypeDescriptor getType() {
34     return new TypeDescriptor(TypeDescriptor.SHORT);
35   }
36
37   public String printNode(int indent) {
38     return "getoffset {"+ td.toString() + " , " + fieldname + " } ";
39   }
40
41   public int kind() {
42     return Kind.OffsetNode;
43   }
44
45   public Long evaluate() {
46     eval = null;
47     return eval; //null;
48   }
49 }