More code to implement tags
[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     TagDescriptor tag;
10
11     public TempDescriptor(String name) {
12         super(name);
13         id=currentid++;
14     }
15
16     public TempDescriptor(String name, TypeDescriptor td) {
17         this(name);
18         type=td;
19     }
20
21     public TempDescriptor(String name, TagDescriptor td) {
22         this(name);
23         tag=td;
24     }
25     
26     public static TempDescriptor tempFactory() {
27         return new TempDescriptor("temp_"+currentid);
28     }
29
30     public static TempDescriptor tempFactory(String name) {
31         return new TempDescriptor(name+currentid);
32     }
33
34     public static TempDescriptor tempFactory(String name, TypeDescriptor td) {
35         return new TempDescriptor(name+currentid,td);
36     }
37
38     public static TempDescriptor tempFactory(String name, TagDescriptor tag) {
39         return new TempDescriptor(name+currentid,tag);
40     }
41
42     public static TempDescriptor paramtempFactory(String name, TypeDescriptor td) {
43         return new TempDescriptor(name,td);
44     }
45
46     public static TempDescriptor paramtempFactory(String name, TagDescriptor tag) {
47         return new TempDescriptor(name,tag);
48     }
49
50     public String toString() {
51         return safename;
52     }
53
54     public void setType(TypeDescriptor td) {
55         type=td;
56     }
57
58     public TypeDescriptor getType() {
59         return type;
60     }
61
62     public TagDescriptor getTag() {
63         return tag;
64     }
65 }