- public TreeMaker<T> expand(final int i, final TreeMaker<T> h) {
- if (singleton) {
- tokens[0].visit(h, null, i);
- return h;
- }
- if (i==0) h.start(tag, location);
-
+ public Tree<T> expand1() throws Ambiguous {
+ Tree<T>[] ret = new Tree[tokens.length];
+ for(int i=0; i<tokens.length; i++)
+ ret[i] = tokens[i].expand1();
+ return new Tree<T>(location, tag, ret, unwrap);
+ }
+ public void gather(HashSet<Forest<T>> hf) {
+ hf.add(this);
+ for(Forest<T> f : tokens) f.gather(hf);
+ }
+ public void expand(HashSet<Tree<T>> ht, HashSet<Forest<T>> ignore, Tree<T> bogus) {
+ if (ignore.contains(this)) { ht.add(bogus); return; }
+ expand(0, new Tree[tokens.length], ht, ignore, bogus);
+ }
+ public void expand(final int i, Tree<T>[] ta, HashSet<Tree<T>> ht, HashSet<Forest<T>> ignore, Tree<T> bogus) {