{ ScriptVarArray sargs(namedArgs->length()); RStringArray names = new StringArray(namedArgs->length()); for (int i = 0; i < sargs.size(); ++i) { sargs[i] = *(namedArgs[i]->value); names[i] = namedArgs[i]->name; } DmiClient& dmiClient = AcdkStdWeakTypeDmiClient::getDmiClient(); if (_object != Nil) return new DmiObject(_object->invokeMethod(_methodName, sargs, dmiClient, names)); return new DmiObject(invokeStaticMethod(_class->getName(), _methodName, sargs, dmiClient, names)); } //foreign ScriptVar StdDmiDelegate::call(INOUT(ScriptVarArray) args) { if (_object != Nil) return _object->invokeMethod(_methodName, args); return invokeStaticMethod(_class->getName(), _methodName, args); } } // namespace dmi } // namespace lang } // namespace acdk
curNode->push_back(new SyntaxHideSubRule()); case GrammarCommit: { curNode->push_back(new SyntaxCommit()); break; } case RegExpToken: default: THROW1(Error, "unknown token in syntax grammar"); break; } } return curNode; } bool reduce(INOUT(RSyntaxNode) n) { bool bret = false; if (instanceof(n, SyntaxFollow) == true && n->childs->length() == 1) { n = n->childs[0]; bret = true; } if (instanceof(n, SyntaxOr) && n->childs->length() >= 2 && instanceof(n->childs[n->childs->length() - 1], SyntaxOr) == true) { RSyntaxNode c = n->childs[n->childs->length() - 1]; n->childs->remove(n->childs->length() - 1); for (int i = 0; i < c->childs->length(); ++i) n->childs->append(c->childs[i]); bret = true; }
void LEARN::learn (VS vf) { INFOGO *infop; SGFROOT *p; for (int v = 0; v < vf.size (); ++v) { n_zobrist = 0; ___.tic ("zobrist"); p = INOUT ().sgf2tree (vf[v]); // 16 种对称方式编码不一样 for (int k = 0; k < 2; ++k) { for (int i = 0; i < 8; ++i) { infop = new INFOGO; g_init.swap_id8_q8 (0, i); p->fuseki (infop); for (int j = 0; j < p->sons.size (); ++j) { visit (p->sons[j], infop, &LEARN::insert_zobrist); } g_init.swap_id8_q8 (0, i); infop->delfromroot (); } g_init.swap_xorand (); } /* // 16 种对称方式下编码都一样 infop = new INFOGO; p->fuseki(infop); for (int i = 0; i<p->sons.size(); ++i){ visit(p->sons[i], infop, &LEARN::insert_pemis); infop->delfromroot(); } */ delete p; ___.toc (); } for (int v = 0; v < vf.size (); ++v) { n_pemis = 0; ___.tic ("pemis"); p = INOUT ().sgf2tree (vf[v]); /* // 16 种对称方式编码不一样 for (int k = 0; k<2; ++k){ for (int i = 0; i<8; ++i) { infop = new INFOGO; g_init.swap_id8_q8(0, i); p->fuseki(infop); for (int j = 0; j<p->sons.size(); ++j){ visit(p->sons[j], infop, &LEARN::insert_zobrist); } g_init.swap_id8_q8 (0, i); infop->delfromroot(); } g_init.swap_xorand(); } */ // 16 种对称方式下编码都一样 infop = new INFOGO; p->fuseki (infop); for (int i = 0; i < p->sons.size (); ++i) { visit (p->sons[i], infop, &LEARN::insert_pemis); infop->delfromroot (); } delete p; ___.toc (); } INOUT ().save2txt (vf, "encodelib/filenames.txt"); }