X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=4d8b34f28c63e23c6cd1a098d27737378003227c;hp=645850b00c397339ed658b306abcacb680967eb6;hb=2cc11837a52505dd9863bcd366240a8f229af294;hpb=9b7ce1d3e4ac84ecd2d0f5f461b42c40f38e4783 diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index 645850b..4d8b34f 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -7,8 +7,10 @@ import java.util.*; import java.lang.reflect.*; /** + * * An efficient representation of a collection of trees (Tomita's * shared packed parse forest). + * */ public abstract class Forest implements GraphViz.ToGraphViz { @@ -18,19 +20,21 @@ public abstract class Forest implements GraphViz.ToGraphViz { /** expand this forest into a set of trees */ public void expand(HashSet> ht) { expand(ht, new HashSet>(), null); } - /** create a new forest */ - public static Forest create(Input.Region loc, T head, Forest[] children, boolean lift) { + static Forest create(Input.Region loc, T head, Forest[] children, boolean lift) { return new One(loc, head, children, lift); } + /** create a new forest */ + public static Forest create(Input.Region loc, T head, Forest[] children) { + return Forest.create(loc, head, children, false); } + // Package-Private ////////////////////////////////////////////////////////////////////////////// abstract void expand(HashSet> ht, HashSet> ignore, Tree bogus); abstract void gather(HashSet> ignore); + abstract void edges(GraphViz.Node n); boolean ambiguous() { return false; } - public abstract void edges(GraphViz.Node n); - // One //////////////////////////////////////////////////////////////////////////////