checkpoint
[sbp.git] / src / edu / berkeley / sbp / Ambiguous.java
1 package edu.berkeley.sbp;
2 import edu.berkeley.sbp.*;
3 import edu.berkeley.sbp.util.*;
4 import edu.berkeley.sbp.Sequence.Position;
5 import java.io.*;
6 import java.util.*;
7
8 /** if ambiguity checking is enabled, this exception is thrown to signal that the parse was ambiguous */
9 public class Ambiguous extends Exception {
10     public final Forest<?> ambiguity;
11     public Ambiguous(Forest<?> ambiguity) { this.ambiguity = ambiguity; }
12     public String toString() {
13         // FEATURE: more legible printout desperately needed
14         StringBuffer sb = new StringBuffer();
15         sb.append("unresolved ambiguity ");
16         /*
17         for(Tree<?> result : ambiguity.expand(false)) {
18             sb.append("\n\n");
19             result.toPrettyString(sb);
20         }
21         */
22         return sb.toString();
23     }
24 }