- boolean hit = false;
- for(Tree<T> r : tokens[i].expand(toss)) {
- hit = true;
- int old = toks.size();
- toks.add(r);
- expand(toss, toks, i+1, h);
- while(toks.size() > old) toks.remove(toks.size()-1);
+ HashSet<Tree<T>> ht2 = new HashSet<Tree<T>>();
+ children[i].expand(ht2, ignore, bogus);
+ for(Tree<T> tc : ht2) {
+ ta[i] = tc;
+ expand(i+1, ta, ht, ignore, bogus);
+ ta[i] = null;
+ }
+ }
+ }
+
+ // GraphViz, ToInt //////////////////////////////////////////////////////////////////////////////
+
+ public boolean isTransparent() { return false; }
+ public boolean isHidden() { return false; }
+ public GraphViz.Node toGraphViz(GraphViz gv) {
+ if (gv.hasNode(this)) return gv.createNode(this);
+ GraphViz.Node n = gv.createNode(this);
+ n.label = headToString()==null?"":headToString();
+ n.directed = true;
+ edges(n);
+ return n;
+ }
+ boolean edges = false; // FIXME ??
+ public void edges(GraphViz.Node n) {
+ if (edges) return;
+ edges = true;
+ for(int i=0; i<children.length; i++) {
+ if (i==children.length-1 && lift && !children[i].ambiguous()) {
+ children[i].edges(n);
+ } else {
+ n.edge(children[i], null);