checkpoint
[sbp.git] / src / edu / berkeley / sbp / Ambiguous.java
index 56e1af7..cb55ffa 100644 (file)
@@ -7,13 +7,13 @@ import java.util.*;
 
 /** if ambiguity checking is enabled, this exception is thrown to signal that the parse was ambiguous */
 public class Ambiguous extends RuntimeException {
 
 /** if ambiguity checking is enabled, this exception is thrown to signal that the parse was ambiguous */
 public class Ambiguous extends RuntimeException {
-    public final Forest ambiguity;
-    public Ambiguous(Forest ambiguity) { this.ambiguity = ambiguity; }
+    public final Forest<?> ambiguity;
+    public Ambiguous(Forest<?> ambiguity) { this.ambiguity = ambiguity; }
     public String toString() {
         StringBuffer sb = new StringBuffer();
         sb.append("unresolved ambiguity "/*"at " + ambiguity.getLocation() + ":"*/);
     public String toString() {
         StringBuffer sb = new StringBuffer();
         sb.append("unresolved ambiguity "/*"at " + ambiguity.getLocation() + ":"*/);
-        for(Object result : ambiguity.expand(false))
-            sb.append("\n    " + result);
+        for(Tree<?> result : ambiguity.expand(false))
+            sb.append("\n\n" + result.toPrettyString());
         return sb.toString();
     }
 }
         return sb.toString();
     }
 }