本文整理汇总了C++中goto_functionst::entry_point方法的典型用法代码示例。如果您正苦于以下问题:C++ goto_functionst::entry_point方法的具体用法?C++ goto_functionst::entry_point怎么用?C++ goto_functionst::entry_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goto_functionst
的用法示例。
在下文中一共展示了goto_functionst::entry_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_goto_program
bool symex_parseoptionst::get_goto_program(
const optionst &options,
goto_functionst &goto_functions)
{
if(cmdline.args.empty())
{
error() << "Please provide a program to verify" << eom;
return true;
}
try
{
if(cmdline.args.size()==1 &&
is_goto_binary(cmdline.args[0]))
{
status() << "Reading GOTO program from file" << eom;
if(read_goto_binary(cmdline.args[0],
symbol_table, goto_functions, get_message_handler()))
return true;
config.ansi_c.set_from_symbol_table(symbol_table);
if(cmdline.isset("show-symbol-table"))
{
show_symbol_table();
return true;
}
irep_idt entry_point=goto_functions.entry_point();
if(symbol_table.symbols.find(entry_point)==symbol_table.symbols.end())
{
error() << "The goto binary has no entry point; please complete linking" << eom;
return true;
}
}
else if(cmdline.isset("show-parse-tree"))
{
if(cmdline.args.size()!=1)
{
error() << "Please give one source file only" << eom;
return true;
}
std::string filename=cmdline.args[0];
#ifdef _MSC_VER
std::ifstream infile(widen(filename).c_str());
#else
std::ifstream infile(filename.c_str());
#endif
if(!infile)
{
error() << "failed to open input file `" << filename << "'" << eom;
return true;
}
languaget *language=get_language_from_filename(filename);
if(language==NULL)
{
error() << "failed to figure out type of file `" << filename << "'" << eom;
return true;
}
status("Parsing", filename);
if(language->parse(infile, filename, get_message_handler()))
{
error() << "PARSING ERROR" << eom;
return true;
}
language->show_parse(std::cout);
return true;
}
else
{
if(parse()) return true;
if(typecheck()) return true;
if(final()) return true;
// we no longer need any parse trees or language files
clear_parse();
if(cmdline.isset("show-symbol-table"))
{
show_symbol_table();
return true;
}
irep_idt entry_point=goto_functions.entry_point();
if(symbol_table.symbols.find(entry_point)==symbol_table.symbols.end())
{
error() << "No entry point; please provide a main function" << eom;
return true;
//.........这里部分代码省略.........