minor cleanups to CharInput
[sbp.git] / src / edu / berkeley / sbp / chr / CharAtom.java
index c729b54..45c85b9 100644 (file)
@@ -33,7 +33,7 @@ public class CharAtom extends Atom<Character> {
     /** returns an element which exactly matches the string given */
     public static Element string(String s) { return string(s, true); }
     public static Element string(String s, boolean share) {
     /** returns an element which exactly matches the string given */
     public static Element string(String s) { return string(s, true); }
     public static Element string(String s, boolean share) {
-        if (share && s.length() == 0) return epsilon;
+        if (share && s.length() == 0) return emptyString;
         final String escapified = "\""+StringUtil.escapify(s, "\"\r\n\\")+"\"";
         Element ret;
         if (share && s.length() == 1) {
         final String escapified = "\""+StringUtil.escapify(s, "\"\r\n\\")+"\"";
         Element ret;
         if (share && s.length() == 1) {
@@ -51,8 +51,11 @@ public class CharAtom extends Atom<Character> {
         return ret;
     }
 
         return ret;
     }
 
-    private static Union epsilon = new Union("()");
-    static { epsilon.add(Sequence.create()); }
+    private static Union emptyString = new Union("()");
+    static {
+        // FIXME: force this to be dropped wherever used!
+        emptyString.add(Sequence.create(new Element[0], ""));
+    }
 
     public Topology<Atom<Character>>       unwrap() { return this; }
     public Topology<Atom<Character>>       empty()  { return new CharAtom(); }
 
     public Topology<Atom<Character>>       unwrap() { return this; }
     public Topology<Atom<Character>>       empty()  { return new CharAtom(); }