X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=e7c0be4394c23d4951fc03f03be26cb2b44a80b3;hp=baf1265aafc33ead357e476c80c620d1c76fc8e7;hb=5ea3b9182192a0fbb7a0bd86b919384ddaeff29a;hpb=aaa5d101e054dc548e7ef7831b1fcb7913a4d4d4 diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index baf1265..e7c0be4 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -77,11 +77,9 @@ public abstract class Forest /*extends PrintableTree>*/ public InnerAmbiguous(Forest f) { this.f = f; } } - static Forest singleton(Input.Region loc, Position p) { return create(loc, null, new Forest[] { }, false, p); } - static Forest singleton(Input.Region loc, Forest body, Position p) { return body; } - static Forest leaf(Input.Region loc, T tag, Position p) { return create(loc, tag, null, false, p); } - public static Forest create(Input.Region loc, T tag, Forest[] tokens, boolean unwrap, Position p) { - return new MyBody(loc, tag, tokens, unwrap, p); + static Forest leaf(Input.Region loc, T tag) { return create(loc, tag, null, false); } + public static Forest create(Input.Region loc, T tag, Forest[] tokens, boolean unwrap) { + return new MyBody(loc, tag, tokens, unwrap); } // Body ////////////////////////////////////////////////////////////////////////////// @@ -99,7 +97,7 @@ public abstract class Forest /*extends PrintableTree>*/ GraphViz.Node n = gv.createNode(this); n.label = headToString()==null?"":headToString(); n.directed = true; - n.comment = reduction==null?null:reduction+""; + //n.comment = reduction==null?null:reduction+""; edges(n); return n; } @@ -124,16 +122,14 @@ public abstract class Forest /*extends PrintableTree>*/ private final T tag; private final Forest[] tokens; private final boolean unwrap; - private final Sequence.Position reduction; - private MyBody(Input.Region loc, T tag, Forest[] tokens, boolean unwrap, Position reduction) { + private MyBody(Input.Region loc, T tag, Forest[] tokens, boolean unwrap) { this.location = loc; this.tag = tag; this.tokens = tokens==null ? emptyForestArray : new Forest[tokens.length]; if (tokens != null) System.arraycopy(tokens, 0, this.tokens, 0, tokens.length); if (tokens != null) for(int i=0; i>[] ht, HashSet> target) { gather(tl, ht, target, new Tree[ht.length], 0);