42 xmlt xml_functions=
xmlt(
"functions");
43 for(
const auto &function_entry : goto_functions.
function_map)
45 const irep_idt &function_name=function_entry.first;
51 "is_body_available",
function.body_available());
56 if(
function.body_available())
59 for(
const goto_programt::instructiont &instruction :
60 function.body.instructions)
65 "instruction_id", instruction.to_string());
67 if(instruction.code.source_location().is_not_nil())
70 xml(instruction.code.source_location()));
73 std::ostringstream instruction_builder;
74 function.body.output_instruction(
75 ns, function_name, instruction_builder, instruction);
77 xmlt &instruction_value=
79 instruction_value.
data=instruction_builder.str();
103 out <<
convert(goto_functions);
void set_attribute_bool(const std::string &attribute, bool value)
const std::string & id2string(const irep_idt &d)
void operator()(const goto_functionst &goto_functions, std::ostream &out, bool append=true)
Print the xml object generated by show_goto_functions_xmlt::show_goto_functions to the provided strea...
Goto Programs with Functions.
xmlt xml(const source_locationt &location)
static irep_idt entry_point()
void set_attribute(const std::string &attribute, unsigned value)
function_mapt function_map
xmlt & new_element(const std::string &name)
bool has_prefix(const std::string &s, const std::string &prefix)
show_goto_functions_xmlt(const namespacet &ns)
For outputting the GOTO program in a readable xml format.
xmlt convert(const goto_functionst &goto_functions)
Walks through all of the functions in the program and returns an xml object representing all their fu...