more code
[IRC.git] / Robust / src / IR / Flat / TempDescriptor.java
1 package IR.Flat;
2 import IR.*;
3
4 public class TempDescriptor extends Descriptor {
5     static int currentid=0;
6     int id;
7     //    String safename;
8     TypeDescriptor type;
9
10     public TempDescriptor(String name) {
11         super(name);
12         id=currentid++;
13     }
14
15     public TempDescriptor(String name, TypeDescriptor td) {
16         this(name);
17         type=td;
18     }
19     
20     public static TempDescriptor tempFactory() {
21         return new TempDescriptor("temp_"+currentid);
22     }
23
24     public static TempDescriptor tempFactory(String name) {
25         return new TempDescriptor(name+currentid);
26     }
27
28     public static TempDescriptor tempFactory(String name, TypeDescriptor td) {
29         return new TempDescriptor(name+currentid,td);
30     }
31
32
33     public String toString() {
34         return safename;
35     }
36
37     public void setType(TypeDescriptor td) {
38         type=td;
39     }
40
41     public TypeDescriptor getType() {
42         return type;
43     }
44 }