Go to the documentation of this file.
32 : ns(_ns), list_only(_list_only)
42 const json_irept no_comments_irep_converter(
false);
46 for(
const auto &function_entry :
sorted)
48 const irep_idt &function_name = function_entry->first;
54 json_function[
"isBodyAvailable"]=
66 if(
function.body_available())
71 function.body.instructions)
78 instruction_entry[
"sourceLocation"]=
82 std::ostringstream instruction_builder;
83 function.body.output_instruction(
84 ns, function_name, instruction_builder, instruction);
86 instruction_entry[
"instruction"]=
99 instruction_entry[
"operands"] = std::move(operand_array);
108 instruction_entry[
"guard"] = std::move(guard_object);
111 json_instruction_array.
push_back(std::move(instruction_entry));
114 json_function[
"instructions"] = std::move(json_instruction_array);
137 out <<
convert(goto_functions);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
show_goto_functions_jsont(const namespacet &_ns, bool _list_only=false)
For outputting the GOTO program in a readable JSON format.
std::string to_string() const
Base class for all expressions.
bool is_true() const
Return whether the expression is a constant representing true.
json_objectt & make_object()
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const std::string & id2string(const irep_idt &d)
codet code
Do not read or modify directly – use get_X() instead.
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
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...
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_from_irep(const irept &) const
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
::goto_functiont goto_functiont
A collection of goto functions.
exprt guard
Guard for gotos, assume, assert Use get_condition() to read, and set_condition(c) to write.
Goto Programs with Functions.
bool has_prefix(const std::string &s, const std::string &prefix)
This class represents an instruction in the GOTO intermediate representation.
std::vector< function_mapt::const_iterator > sorted() const
returns a vector of the iterators in alphabetical order
static jsont json_boolean(bool value)
const source_locationt & source_location() const
jsont & push_back(const jsont &json)