本文整理汇总了C++中SyntaxTree::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ SyntaxTree::addChild方法的具体用法?C++ SyntaxTree::addChild怎么用?C++ SyntaxTree::addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyntaxTree
的用法示例。
在下文中一共展示了SyntaxTree::addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PatSet
void
Context::buildAuto() {
SymTabEntry::buildAuto();
if (outSt_) {
for (SymTab::iterator it = outSt_->begin(); (it != outSt_->end()); ++it) {
OutParam* op = (OutParam*)*it;
const char* nm = op->name();
if ((strcmp(nm, "popen") == 0) || (strstr(nm, "sql") != NULL)) {
int i = op->index();
PatSet* positiveEx = new PatSet();
PatSet* negativeEx = new PatSet();
for (int j=0; j < ses_.size(); j++) {
Session *s = ses_[j];
vector<SyntaxTree*>* out = s->outputval(i);
if (out != NULL) {
SyntaxTree *st = new SyntaxTree(GRP);
for (int k=0 ; k < s->ninputs(); k++) {
char *ss = s->inputval(k);
if (ss == NULL) ss = "_NP_"; // Not present
unsigned sslen = strlen(ss);
if (sslen < 200) { // @@@@ hack
SyntaxTree* st1 = new SyntaxTree(INPUT_NODE, ss, sslen);
st->addChild(st1);
}
}
SyntaxTree* st2 = new SyntaxTree(OUTPUT_NODE);
for (vector<SyntaxTree*>::iterator it = out->begin();
it != out->end(); ++it) {
SyntaxTree* stt = *it;
assert(stt->nodeType()==ROOT_NODE);
stt = stt->shallowCopy();
stt->nodeType(GRP);
st2->addChild(stt);
}
SyntaxTree *st3 = new SyntaxTree(ROOT_NODE, st, st2);
SyntaxTree *st4 = st3->abstract();
//cout << "XXXXX";
//st4->print(cout);
if (s->attacksFound())
negativeEx->push_back(st4);
else positiveEx->push_back(st4);
}
}
op->inOuts(positiveEx);
op->inOutAtks(negativeEx);
}
op->buildAuto();
}
}
}