a start on error inject for SSJava
[IRC.git] / Robust / src / IR / Descriptor.java
index edafd624a5f716bf53b12dc5dcb9557911621417..1691b9e46a071d513a7db8bc5da916c31a9876a0 100644 (file)
@@ -1,42 +1,49 @@
 package IR;
 
 /**
- * Descriptor 
+ * Descriptor
  *
  * represents a symbol in the language (var name, function name, etc).
  */
 
 public abstract class Descriptor {
 
-    protected String name;
-    protected String safename;
-    static int count=0;
-    int uniqueid;
-    
-    public Descriptor(String name) {
-       this.name = name;
-        this.safename = "___" + name + "___";
-       this.uniqueid=count++;
-    }
-
-    protected Descriptor(String name, String safename) {
-       this.name = name;
-        this.safename = safename;
-       this.uniqueid=count++;
-    }
-    
-    public String toString() {
-       return name;
-    }
-    
-    public String getSymbol() {
-       return name;
-    }
-
-    public String getSafeSymbol() {
-        return safename;
-    }
-    public int getNum() {
-       return uniqueid;
-    }
+  protected String name;
+  protected String safename;
+  static int count=0;
+  int uniqueid;
+
+  public Descriptor(String name) {
+    this.name = name;
+    this.safename = "___" + name + "___";
+    this.uniqueid=count++;
+  }
+
+  protected Descriptor(String name, String safename) {
+    this.name = name;
+    this.safename = safename;
+    this.uniqueid=count++;
+  }
+
+  public String toString() {
+    return name;
+  }
+
+  public String getSymbol() {
+    return name;
+  }
+
+  //the text replacement is done here because SOMEWHERE someone
+  //modifies safename without going through the constructor...
+  public String getSafeSymbol() {
+    return safename;
+  }
+
+  public int getNum() {
+    return uniqueid;
+  }
+
+  public String getCoreSafeSymbol(int num) {
+    return safename + "core" + num + "___";
+  }
 }