|
|
|
@ -54,6 +54,48 @@ int BuildDepTree(DepTree* deptree,std::set<std::string>& used)
|
|
|
|
|
return deptree->CreateGlobalTree(used); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CheckFunctions() |
|
|
|
|
{ |
|
|
|
|
std::set<std::string> funcs; |
|
|
|
|
|
|
|
|
|
for(auto& i:G_tosave) |
|
|
|
|
{ |
|
|
|
|
i->UsedFuncs(funcs); |
|
|
|
|
for(auto& f:funcs) if(G_funcs.find(f)==G_funcs.end()) |
|
|
|
|
{ |
|
|
|
|
COUT(ERROR)<<"Unknown function "<<f<<" in directive save"<<i->Dump()<<std::endl; |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
funcs.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(auto& i:G_toprint) |
|
|
|
|
{ |
|
|
|
|
i->UsedFuncs(funcs); |
|
|
|
|
for(auto& f:funcs) if(G_funcs.find(f)==G_funcs.end()) |
|
|
|
|
{ |
|
|
|
|
COUT(ERROR)<<"Unknown function "<<f<<" in directive print"<<i->Dump()<<std::endl; |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
funcs.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(auto& i:G_vars) |
|
|
|
|
{ |
|
|
|
|
i.second->UsedFuncs(funcs); |
|
|
|
|
for(auto& f:funcs) if(G_funcs.find(f)==G_funcs.end()) |
|
|
|
|
{ |
|
|
|
|
COUT(ERROR)<<"Unknown function "<<f<<" in definition of variable "<<i.first<<std::endl; |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
funcs.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DumpConfig() |
|
|
|
|
{ |
|
|
|
|
for(auto& i: G_vars) COUT(INFO)<<i.first<<"="+i.second->Dump()<<";"<<std::endl; |
|
|
|
|