X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=917fea588fd1dc37f1bdf02f5b45c72c3e2197c9;hp=dbcd3c06036df2727d53026031a1367beddb4380;hb=a22c5074e705e3ffcf03e9f9d174aed8ef79fc91;hpb=e14f41fe193ceef8dfd8b4bc2f327e3550231a4c diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index dbcd3c0..917fea5 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -10,9 +10,9 @@ import java.lang.reflect.*; public abstract class Forest { /** assume that this forest contains exactly one tree and return it; otherwise throw an exception */ - public final Tree expand1() throws Parser.Ambiguous, Parser.Failed { + public final Tree expand1() throws Ambiguous, ParseFailed { Iterator> it = expand(true).iterator(); - if (!it.hasNext()) throw new Parser.Failed(); + if (!it.hasNext()) throw new ParseFailed(); return it.next(); } @@ -143,7 +143,7 @@ public abstract class Forest { HashSet> ret = new HashSet>(); for(Body b : results) ret.addAll(b.expand(toss, new ArrayList>(), 0, new HashSet>())); - if (toss && ret.size() > 1) throw new Parser.Ambiguous(this); + if (toss && ret.size() > 1) throw new Ambiguous(this); return ret; }