return false;
}
public Object repeatTag() {
- return new Functor<Iterable<Tree>,Object>() {
- public String toString() { return ""; }
- public Object invoke(Iterable<Tree> t) {
- ArrayList ret = new ArrayList();
- for(Tree tc : t) {
- if (tc.head() != null && tc.head() instanceof Functor)
- ret.add(((Functor<Iterable<Tree>,Object>)tc.head()).invoke(tc.children()));
- else if (tc.numChildren() == 0)
- ret.add(tc.head());
- else {
- System.err.println("FIXME: don't know what to do about " + tc);
- ret.add(null);
- }
- }
- return ret.toArray(new Object[0]);
- }
- };
+ return new Tree.ArrayBuildingTreeFunctor<Object>();
}
public Sequence tryResolveTag(String tag, String nonTerminalName, Element[] els, Object[] labels, boolean[] drops) {
Production p = new Production(tag, nonTerminalName, els, labels, drops);