23 include_comments(_include_comments)
51 const std::string &sub_tree_id,
55 if(!sub_trees.empty())
58 for(
const irept &sub_tree : sub_trees)
63 parent[sub_tree_id]=sub_objects;
75 const std::string &sub_tree_id,
79 if(!sub_trees.empty())
82 for(
const auto &sub_tree : sub_trees)
86 sub_objects[
id2string(sub_tree.first)] = sub_object;
88 parent[sub_tree_id]=sub_objects;
100 "irep JSON representation must be an object");
108 const auto it = json_object.
find(
"id");
110 if(it != json_object.
end())
112 out.
id(it->second.value);
117 const auto it = json_object.
find(
"sub");
119 if(it != json_object.
end())
127 const auto it = json_object.
find(
"namedSub");
129 if(it != json_object.
end())
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
named_subt & get_named_sub()
const std::string & id_string() const
const irep_idt & id() const
static bool is_comment(const irep_idt &name)
irept & add(const irep_idt &name)
jsont & push_back(const jsont &json)
json_irept(bool include_comments)
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees.
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.
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.
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.
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.
iterator find(const std::string &key)
typename dt::named_subt named_subt
const irep_idt & get_function() const
const irep_idt & get_working_directory() const
const irep_idt & get_column() const
const irep_idt & get_java_bytecode_index() const
const irep_idt & get_line() const
const irep_idt & get_file() const
const std::string & id2string(const irep_idt &d)
json_arrayt & to_json_array(jsont &json)
json_objectt & to_json_object(jsont &json)
json_objectt json(const source_locationt &location)