helpful progress reporting
[IRC.git] / Robust / src / IR / Descriptor.java
1 package IR;
2
3 /**
4  * Descriptor
5  *
6  * represents a symbol in the language (var name, function name, etc).
7  */
8
9 public abstract class Descriptor {
10
11   protected String name;
12   protected String safename;
13   static int count=0;
14   int uniqueid;
15
16   public Descriptor(String name) {
17     this.name = name;
18     this.safename = "___" + name + "___";
19     this.uniqueid=count++;
20   }
21
22   protected Descriptor(String name, String safename) {
23     this.name = name;
24     this.safename = safename;
25     this.uniqueid=count++;
26   }
27
28   public String toString() {
29     return name;
30   }
31
32   public String getSymbol() {
33     return name;
34   }
35
36   public String getSafeSymbol() {
37     return safename;
38   }
39   public int getNum() {
40     return uniqueid;
41   }
42
43   public String getCoreSafeSymbol(int num) {
44     return safename + "core" + num + "___";
45   }
46 }