many changes towards classpath...
[IRC.git] / Robust / src / IR / Flat / FlatCastNode.java
1 package IR.Flat;
2 import IR.TypeDescriptor;
3
4 public class FlatCastNode extends FlatNode {
5   TempDescriptor src;
6   TempDescriptor dst;
7   TypeDescriptor type;
8
9   public FlatCastNode(TypeDescriptor type, TempDescriptor src, TempDescriptor dst) {
10     this.type=type;
11     this.src=src;
12     this.dst=dst;
13   }
14
15   public FlatNode clone(TempMap t) {
16     return new FlatCastNode(type, t.tempMap(src), t.tempMap(dst));
17   }
18   public void rewriteUse(TempMap t) {
19     src=t.tempMap(src);
20   }
21   public void rewriteDef(TempMap t) {
22     dst=t.tempMap(dst);
23   }
24
25   public String toString() {
26     return "FlatCastNode_"+dst.toString()+"=("+type.toString()+")"+src.toString();
27   }
28
29   public int kind() {
30     return FKind.FlatCastNode;
31   }
32
33   public TypeDescriptor getType() {
34     return type;
35   }
36
37   public TempDescriptor getSrc() {
38     return src;
39   }
40
41   public TempDescriptor getDst() {
42     return dst;
43   }
44
45   public TempDescriptor [] writesTemps() {
46     return new TempDescriptor[] {dst};
47   }
48
49   public TempDescriptor [] readsTemps() {
50     return new TempDescriptor[] {src};
51   }
52
53 }