X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=645850b00c397339ed658b306abcacb680967eb6;hp=1c8fbc5b6f8290bb0c6540a37fd2925900e7b89a;hb=9b7ce1d3e4ac84ecd2d0f5f461b42c40f38e4783;hpb=d86c2344f6f5b958d56e2aa55e84af2dc76ab487 diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index 1c8fbc5..645850b 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -19,8 +19,8 @@ public abstract class Forest implements GraphViz.ToGraphViz { 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 unwrap) { - return new One(loc, head, children, unwrap); + public static Forest create(Input.Region loc, T head, Forest[] children, boolean lift) { + return new One(loc, head, children, lift); } // Package-Private ////////////////////////////////////////////////////////////////////////////// @@ -42,21 +42,21 @@ public abstract class Forest implements GraphViz.ToGraphViz { private final Forest[] children; /** if true, the last child's children are considered children of this node */ - private final boolean unwrap; + private final boolean lift; - private One(Input.Region loc, T head, Forest[] children, boolean unwrap) { + private One(Input.Region loc, T head, Forest[] children, boolean lift) { this.location = loc; this.head = head; this.children = children==null ? emptyForestArray : new Forest[children.length]; if (children != null) System.arraycopy(children, 0, this.children, 0, children.length); if (children != null) for(int i=0; i expand1() throws Ambiguous { Tree[] ret = new Tree[children.length]; for(int i=0; i(location, head, ret, unwrap); + return new Tree(location, head, ret, lift); } void gather(HashSet> hf) { @@ -69,7 +69,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { } private void expand(final int i, Tree[] ta, HashSet> ht, HashSet> ignore, Tree bogus) { if (i==children.length) { - ht.add(new Tree(location, head, ta, unwrap)); + ht.add(new Tree(location, head, ta, lift)); } else { HashSet> ht2 = new HashSet>(); children[i].expand(ht2, ignore, bogus); @@ -98,7 +98,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { if (edges) return; edges = true; for(int i=0; i