backported some stuff
[sbp.git] / src / edu / berkeley / sbp / Union.java
index df6c374..1d4841f 100644 (file)
@@ -36,6 +36,9 @@ public class Union extends Element implements Iterable<Sequence> {
         this.synthetic = synthetic;
     }
 
+    public static Union epsilon = new Union("()");
+    static { epsilon.add(Sequence.empty); }
+
     private Forest.Ref epsilonForm = null;
     Forest epsilonForm() {
         if (epsilonForm != null) return epsilonForm;
@@ -50,7 +53,7 @@ public class Union extends Element implements Iterable<Sequence> {
 
     public String toString() { return shortForm; }
     private static String pad(int i,String s) { return s.length() >= i ? s : pad(i-1,s)+" "; }
-    void toString(StringBuffer sb) {
+    public void toString(StringBuffer sb) {
         if (synthetic) return;
         boolean first = true;
         if (alternatives.size()==0) {