28 : ns(_ns), list_only(_list_only)
43 xmlt xml_functions=
xmlt(
"functions");
45 const auto sorted = goto_functions.
sorted();
47 for(
const auto &function_entry : sorted)
49 const irep_idt &function_name = function_entry->first;
55 "is_body_available", function.body_available());
66 if(function.body_available())
70 function.body.instructions)
75 "instruction_id", instruction.to_string());
77 if(instruction.get_code().source_location().is_not_nil())
80 xml(instruction.get_code().source_location()));
83 std::ostringstream instruction_builder;
84 function.body.output_instruction(
85 ns, function_name, instruction_builder, instruction);
87 xmlt &instruction_value=
89 instruction_value.
data=instruction_builder.str();
113 out <<
convert(goto_functions);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A collection of goto functions.
::goto_functiont goto_functiont
std::vector< function_mapt::const_iterator > sorted() const
returns a vector of the iterators in alphabetical order
This class represents an instruction in the GOTO intermediate representation.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
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...
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...
show_goto_functions_xmlt(const namespacet &_ns, bool _list_only=false)
For outputting the GOTO program in a readable xml format.
void set_attribute_bool(const std::string &attribute, bool value)
xmlt & new_element(const std::string &key)
void set_attribute(const std::string &attribute, unsigned value)
bool has_prefix(const std::string &s, const std::string &prefix)
Goto Programs with Functions.
const std::string & id2string(const irep_idt &d)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)