- //boolean hit = false;
- //tokens[i].visit(this, h, i);
-
- for(Tree<T> r : tokens[i].expand(h.toss)) {
- //hit = true;
- int old = h.toks.size();
- h.toks.add(r);
- expand(i+1, h);
- while(h.toks.size() > old) h.toks.remove(h.toks.size()-1);
- }
-
- //if (!hit) throw new Error();
+ tokens[i].visit(new TreeMaker<T>(h.toss) {
+ public void add(Input.Location loc) {
+ int old = h.toks.size();
+ h.toks.add(new Tree<T>(loc, head, toks.toArray(tree_hint)));
+ expand(i+1, h);
+ while(h.toks.size() > old) h.toks.remove(h.toks.size()-1);
+ }
+ }, null, null);