33 : ns(_ns), list_only(_list_only)
43 const json_irept no_comments_irep_converter(
false);
44 for(
const auto &function_entry : goto_functions.
function_map)
46 const irep_idt &function_name=function_entry.first;
52 json_function[
"isBodyAvailable"]=
64 if(
function.body_available())
69 function.body.instructions)
73 instruction_entry[
"instructionId"]=
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"]=operand_array;
108 instruction_entry[
"guard"]=guard_object;
111 json_instruction_array.
push_back(instruction_entry);
114 json_function[
"instructions"]=json_instruction_array;
119 json_result[
"functions"]=json_functions;
140 out <<
convert(goto_functions);
exprt guard
Guard for gotos, assume, assert.
const std::string & id2string(const irep_idt &d)
std::string to_string() const
Goto Programs with Functions.
static jsont json_boolean(bool value)
function_mapt function_map
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...
show_goto_functions_jsont(const namespacet &_ns, bool _list_only=false)
For outputting the GOTO program in a readable JSON format.
This class represents an instruction in the GOTO intermediate representation.
jsont & push_back(const jsont &json)
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...
::goto_functiont goto_functiont
bool has_prefix(const std::string &s, const std::string &prefix)
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...
Base class for all expressions.
const source_locationt & source_location() const
json_objectt & make_object()
json_objectt json(const source_locationt &location)