cprover
|
#include <json_irep.h>
Public Member Functions | |
json_irept (bool include_comments) | |
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees. More... | |
void | convert_from_irep (const irept &irep, jsont &json) const |
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees. More... | |
void | convert_from_json (const jsont &, irept &) const |
Deserialize a JSON irep representation. More... | |
Private Member Functions | |
void | convert_sub_tree (const std::string &sub_tree_id, const irept::subt &sub_trees, json_objectt &parent) const |
To convert to JSON from a list of ireps that are in an unlabelled subtree. More... | |
void | convert_named_sub_tree (const std::string &sub_tree_id, const irept::named_subt &sub_trees, json_objectt &parent) const |
To convert to JSON from a map of ireps that are in a named subtree. More... | |
Private Attributes | |
bool | include_comments |
Definition at line 19 of file json_irep.h.
|
explicit |
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
include_comments | when writing JSON, should the comments sub tree be included. |
Definition at line 23 of file json_irep.cpp.
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
irep | The irep structure to turn into json |
json | The json object to be filled up. |
Definition at line 31 of file json_irep.cpp.
References convert_named_sub_tree(), convert_sub_tree(), irept::get_comments(), irept::get_named_sub(), irept::get_sub(), irept::id(), irept::id_string(), include_comments, and jsont::make_object().
Referenced by show_goto_functions_jsont::convert(), convert_named_sub_tree(), and convert_sub_tree().
Deserialize a JSON irep representation.
input | json object to convert |
Definition at line 97 of file json_irep.cpp.
References irept::add(), comment(), irept::get_sub(), irept::id(), and jsont::object.
|
private |
To convert to JSON from a map of ireps that are in a named subtree.
The parent JSON object will get a key called sub_tree_id and the value shall be a JSON object whose keys shall be the name of the sub tree and the value will be the object generated from the sub tree.
sub_tree_id | the name to give the subtree in the parent object |
sub_trees | the map of subtrees to parse |
parent | the parent JSON object who should be added to |
Definition at line 76 of file json_irep.cpp.
References convert_from_irep(), and id2string().
Referenced by convert_from_irep().
|
private |
To convert to JSON from a list of ireps that are in an unlabelled subtree.
The parent JSON object will get a key called sub_tree_id and the value shall be an array of JSON objects generated from each of the sub trees
sub_tree_id | the name to give the subtree in the parent object |
sub_trees | the list of subtrees to parse |
parent | the parent JSON object who should be added to |
Definition at line 51 of file json_irep.cpp.
References convert_from_irep(), and json_arrayt::push_back().
Referenced by convert_from_irep().
|
private |
Definition at line 37 of file json_irep.h.
Referenced by convert_from_irep().