From 1b5d6cf8ab6963d50c168c9daeb7887b45a343ea Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 15 Jul 2006 02:33:14 -0400 Subject: [PATCH] checkpoint darcs-hash:20060715063314-5007d-4dc6e2bef200ee7ed89e7bde3e612fb3a38d043e.gz --- src/edu/berkeley/sbp/Ambiguous.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/edu/berkeley/sbp/Ambiguous.java b/src/edu/berkeley/sbp/Ambiguous.java index 1f7cc38..394aab6 100644 --- a/src/edu/berkeley/sbp/Ambiguous.java +++ b/src/edu/berkeley/sbp/Ambiguous.java @@ -7,13 +7,19 @@ import java.util.*; /** if ambiguity checking is enabled, this exception is thrown to signal that the parse was ambiguous */ public class Ambiguous extends Exception { - 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() { // FEATURE: more legible printout desperately needed StringBuffer sb = new StringBuffer(); sb.append("unresolved ambiguity "); - for(Tree result : ambiguity.expand(false)) { + HashSet hf = new HashSet(); + ambiguity.gather(hf); + HashSet ht = new HashSet(); + ambiguity.expand(ht, hf, new Tree(null, "...", null, false)); + for(Tree result : ht) { sb.append("\n\n"); result.toPrettyString(sb); } -- 1.7.10.4