- TreeMaker<T> ret = new TreeMaker<T>();
- invoke(ret, new Boolean(toss), null);
- if (toss && ret.size() > 1) throw new Ambiguous(this);
- return ret;
+ final HashSet<Tree<T>> hs = new HashSet<Tree<T>>();
+ TreeMaker<T> ret = new TreeMaker<T>(toss) {
+ public void add(Input.Location loc) {
+ hs.add(new Tree<T>(loc, head, toks.toArray(tree_hint)));
+ }
+ };
+ visit(ret, null, null);
+ if (toss && hs.size() > 1) throw new Ambiguous(this);
+ return hs;