- static interface TreeConsumer<T> {
- public void addTree(Tree<T> t);
- }
- static class HashSetTreeConsumer<T> extends HashSet<Tree<T>> implements TreeConsumer<T> {
- public void addTree(Tree<T> t) {
- super.add(t);
- }
- }
-
- static <T> Forest<T> singleton(Input.Location loc, Position p) {
- return create(loc, null, new Forest[] { }, new Object[0], false, true, p); }
- static <T> Forest<T> singleton(Input.Location loc, Forest<T> body, Position p) {
- //return create(loc, null, new Forest[] { body }, false, true, p);
- return body;
- }
- static <T> Forest<T> leaf(Input.Location loc, T tag, Position p) { return create(loc, tag, null, null, false, false, p); }
- public static <T> Forest<T> create(Input.Location loc, T tag, Forest<T>[] tokens, Object[] labels, boolean unwrap, boolean singleton, Position p) {
- return new MyBody<T>(loc, tag, tokens, labels, unwrap, singleton, p);
+ static <T> Forest<T> leaf(Input.Region loc, T tag) { return create(loc, tag, null, false); }
+ public static <T> Forest<T> create(Input.Region loc, T tag, Forest<T>[] tokens, boolean unwrap) {
+ return new MyBody<T>(loc, tag, tokens, unwrap);