- static <T> Forest<T> singleton(Input.Region loc, Position p) { return create(loc, null, new Forest[] { }, false, p); }
- static <T> Forest<T> singleton(Input.Region loc, Forest<T> body, Position p) { return body; }
static <T> Forest<T> leaf(Input.Region loc, T tag, Position p) { return create(loc, tag, null, false, p); }
public static <T> Forest<T> create(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap, Position p) {
static <T> Forest<T> leaf(Input.Region loc, T tag, Position p) { return create(loc, tag, null, false, p); }
public static <T> Forest<T> create(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap, Position p) {
- return new MyBody<T>(loc, tag, tokens, unwrap, p);
+ return new MyBody<T>(loc, tag, tokens, unwrap);
- private MyBody(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap, Position reduction) {
+ private MyBody(Input.Region loc, T tag, Forest<T>[] 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<tokens.length; i++) if (tokens[i]==null) throw new Error(i+"");
this.unwrap = 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<tokens.length; i++) if (tokens[i]==null) throw new Error(i+"");
this.unwrap = unwrap;
}
public void gather(TaskList tl, HashSet<Tree<T>>[] ht, HashSet<Tree<T>> target) {
gather(tl, ht, target, new Tree[ht.length], 0);
}
public void gather(TaskList tl, HashSet<Tree<T>>[] ht, HashSet<Tree<T>> target) {
gather(tl, ht, target, new Tree[ht.length], 0);