示例#1
0
void analyzeTargetFile(string target_file, std::vector<std::string>& vec_options, std::map< std::string, double >  entropy_dict){
	printf("targetfile: %s\n",target_file.c_str());

	FILE* fp = NULL;
	ifstream fin(target_file.c_str());
	if( ! fin){
		cerr<<" cannot open target file "<<target_file<<endl;
		return;
	}

	std::vector< std::string > buf;
	while( ! fin.eof()){
		string tmp;
		getline( fin, tmp);
		tmp += "\n";
		buf.push_back(tmp);
	}
	fin.close();

	vector<struct AnnotationRange> range;
	markAnnotation( buf, range);	//标记注释范围

	std::vector<struct Option_Info> options;
	options.clear();
	matchOptions( vec_options , options, buf , range, entropy_dict);

	infoAnalyze(options);
}
示例#2
0
bool TriggerFunction::match(Trigger* trigger, std::string parameter)
{
	return matchMark(trigger->get_mark()->get_name(), parameter) ||
		matchOptions(trigger->get_mark()->get_options(), parameter);
}