1 // Copyright 2006 all rights reserved; see LICENSE file for BSD-style license
3 package edu.berkeley.sbp.util;
4 import edu.berkeley.sbp.*;
7 public abstract class TreeBuilder<T> /*implements Invokable<Forest.Body<T>,Boolean,Integer>*/ {
9 public ArrayList<Tree<T>> toks = new ArrayList<Tree<T>>();
12 public TreeBuilder(boolean toss) { this.toss = toss; }
13 public abstract void start(T head, Input.Region loc);
14 public abstract void finish(T head, Input.Region loc);
15 public abstract void addTree(Tree<T> t);
16 public void invoke(Forest.Body<T> bod, Boolean o, Integer i) {
18 ArrayList<Tree<T>> toks = this.toks;
19 this.toks = new ArrayList<Tree<T>>();