/** */ public void visit(SafraTree tree, SafraTreeNode node) { if (_final_states.intersects(node.getLabeling()))//////////if this node has the state in accepting states of NBA { BitSet q_and_f = new BitSet(_final_states); q_and_f.Intersect(node.getLabeling());////////////////get the intersect of the label and the accepting states SafraTreeNode new_child = tree.newNode(); node.addAsYoungestChild(new_child); _tree_template.setRenameable(new_child.getID()); new_child.getLabeling().Assign(q_and_f); } }
/** * Copy the subtree (the children) of *other * to *top, becoming the children of *top */ public void copySubTree(SafraTreeNode top, SafraTreeNode other) { if (other == null) { return; } //for (SafraTreeNode::child_iterator it=other->children_begin();it!=other->children_end();++it) { // SafraTreeNode *n=_nodes[(*it)->getID()], *n_o=*it; // top->addAsYoungestChild(n); // copySubTree(n, n_o); //} SafraTreeNode it = other.children_begin(); while (it != other.children_end()) { SafraTreeNode n = _nodes[it.getID()]; top.addAsYoungestChild(n); copySubTree(n, it); it = it.increment(); } }