24 : list_only(_list_only)
34 const json_irept no_comments_irep_converter(
false);
36 const auto sorted = goto_functions.
sorted();
38 for(
const auto &function_entry : sorted)
40 const irep_idt &function_name = function_entry->first;
46 json_function[
"isBodyAvailable"]=
57 if(
function.body_available())
62 function.body.instructions)
69 instruction_entry[
"sourceLocation"] =
73 std::ostringstream instruction_builder;
74 instruction.
output(instruction_builder);
76 instruction_entry[
"instruction"]=
89 instruction_entry[
"operands"] = std::move(operand_array);
98 instruction_entry[
"guard"] = std::move(guard_object);
101 json_instruction_array.
push_back(std::move(instruction_entry));
104 json_function[
"instructions"] = std::move(json_instruction_array);
127 out <<
convert(goto_functions);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool starts_with(const char *s) const
equivalent of as_string().starts_with(s)
Base class for all expressions.
const source_locationt & source_location() const
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.
const exprt & condition() const
Get the condition of gotos, assume, assert.
bool has_condition() const
Does this instruction have a condition?
const goto_instruction_codet & code() const
Get the code represented by this instruction.
std::string to_string() const
std::ostream & output(std::ostream &) const
Output this instruction to the given stream.
jsont & push_back(const jsont &json)
json_objectt convert_from_irep(const irept &) const
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
json_objectt & make_object()
static jsont json_boolean(bool value)
void operator()(const goto_functionst &goto_functions, std::ostream &out, bool append=true)
Print the json object generated by show_goto_functions_jsont::show_goto_functions to the provided str...
json_objectt convert(const goto_functionst &goto_functions)
Walks through all of the functions in the program and returns a JSON object representing all their fu...
show_goto_functions_jsont(bool _list_only=false)
For outputting the GOTO program in a readable JSON format.
Goto Programs with Functions.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)