cprover
|
#include <xml_irep_hashing.h>
Classes | |
struct | irep_content_eq |
struct | irep_full_hash |
struct | ireps_containert |
struct | ul_eq |
struct | ul_hash |
Public Member Functions | |
xml_irep_convertt (ireps_containert &ic) | |
unsigned long | insert (unsigned long, const irept &) |
inserts an irep into the hashtable More... | |
unsigned long | insert (const std::string &, const irept &) |
inserts an irep into the hashtable More... | |
void | convert (const irept &irep, xmlt &xml) |
void | convert (const xmlt &xml, irept &irep) |
void | reference_convert (const irept &irep, xmlt &xml) |
void | resolve_references (const irept &cur) |
resolves references to ireps from an irep after reading an irep hash map into memory. More... | |
void | convert_map (xmlt &xml) |
converts the current hash map of ireps into the given xml structure More... | |
void | output_map (std::ostream &out, unsigned indent) |
converts the current hash map of ireps into xml nodes and outputs them to the stream More... | |
void | clear () |
Private Member Functions | |
ireps_containert::id_containert::const_iterator | find_irep_by_id (const unsigned int) |
finds an irep in the ireps hash set by its id More... | |
ireps_containert::content_containert::const_iterator | find_irep_by_content (const irept &irep) |
finds an irep in the ireps hash set by checking contents More... | |
std::string | long_to_string (const unsigned long) |
converts the hash value to a readable string More... | |
unsigned long | string_to_long (const std::string &) |
converts the string to an unsigned long that used to give a pointer to an irep in an old compilation More... | |
unsigned long | add_with_childs (const irept &) |
Private Attributes | |
ireps_containert & | ireps_container |
Definition at line 20 of file xml_irep_hashing.h.
|
inlineexplicit |
Definition at line 82 of file xml_irep_hashing.h.
|
private |
Definition at line 114 of file xml_irep_hashing.cpp.
References xml_irep_convertt::ireps_containert::content_container, find_irep_by_content(), forall_irep, forall_named_irep, insert(), and ireps_container.
Referenced by reference_convert().
|
inline |
Definition at line 97 of file xml_irep_hashing.h.
References xml_irep_convertt::ireps_containert::clear(), and ireps_container.
Definition at line 21 of file xml_irep_hashing.cpp.
References xmlt::data, forall_irep, forall_named_irep, irept::get_comments(), irept::get_named_sub(), irept::get_sub(), irept::id(), irept::id_string(), name2string(), xmlt::new_element(), reference_convert(), xmlt::set_attribute(), and xml().
Referenced by xml_goto_program_convertt::convert(), xml_symbol_convertt::convert(), convert(), convert_map(), output_map(), and read_goto_object().
Definition at line 49 of file xml_irep_hashing.cpp.
References convert(), xmlt::elements, irept::id(), irept::move_to_named_sub(), irept::move_to_sub(), r, irept::set(), and xml().
void xml_irep_convertt::convert_map | ( | xmlt & | xml | ) |
converts the current hash map of ireps into the given xml structure
Definition at line 263 of file xml_irep_hashing.cpp.
References convert(), xml_irep_convertt::ireps_containert::id_container, xml_irep_convertt::ireps_containert::id_replace_map, ireps_container, long_to_string(), xmlt::new_element(), xmlt::set_attribute(), and xml().
|
private |
finds an irep in the ireps hash set by checking contents
Definition at line 216 of file xml_irep_hashing.cpp.
References xml_irep_convertt::ireps_containert::content_container, and ireps_container.
Referenced by add_with_childs(), insert(), and reference_convert().
|
private |
finds an irep in the ireps hash set by its id
Definition at line 207 of file xml_irep_hashing.cpp.
References xml_irep_convertt::ireps_containert::id_container, and ireps_container.
Referenced by resolve_references().
unsigned long xml_irep_convertt::insert | ( | unsigned long | id, |
const irept & | i | ||
) |
inserts an irep into the hashtable
Definition at line 224 of file xml_irep_hashing.cpp.
References xml_irep_convertt::ireps_containert::content_container, find_irep_by_content(), xml_irep_convertt::ireps_containert::id_container, xml_irep_convertt::ireps_containert::id_replace_map, and ireps_container.
Referenced by add_with_childs(), insert(), and read_goto_object().
unsigned long xml_irep_convertt::insert | ( | const std::string & | id, |
const irept & | i | ||
) |
inserts an irep into the hashtable
Definition at line 253 of file xml_irep_hashing.cpp.
References insert(), and string_to_long().
|
private |
converts the hash value to a readable string
Definition at line 184 of file xml_irep_hashing.cpp.
Referenced by convert_map(), output_map(), and reference_convert().
void xml_irep_convertt::output_map | ( | std::ostream & | out, |
unsigned | indent | ||
) |
converts the current hash map of ireps into xml nodes and outputs them to the stream
Definition at line 281 of file xml_irep_hashing.cpp.
References convert(), xml_irep_convertt::ireps_containert::id_container, xml_irep_convertt::ireps_containert::id_replace_map, ireps_container, long_to_string(), xmlt::output(), and xmlt::set_attribute().
Definition at line 94 of file xml_irep_hashing.cpp.
References add_with_childs(), xml_irep_convertt::ireps_containert::content_container, xmlt::data, find_irep_by_content(), xml_irep_convertt::ireps_containert::id_replace_map, ireps_container, long_to_string(), xmlt::new_element(), and xml().
Referenced by xml_goto_program_convertt::convert(), xml_symbol_convertt::convert(), and convert().
void xml_irep_convertt::resolve_references | ( | const irept & | cur | ) |
resolves references to ireps from an irep after reading an irep hash map into memory.
Definition at line 153 of file xml_irep_hashing.cpp.
References find_irep_by_id(), forall_irep, forall_named_irep, irept::get(), irept::get_comments(), irept::get_named_sub(), irept::get_string(), irept::get_sub(), irept::id(), xml_irep_convertt::ireps_containert::id_container, ireps_container, and string_to_long().
Referenced by xml_goto_program_convertt::convert(), and xml_symbol_convertt::convert().
|
private |
converts the string to an unsigned long that used to give a pointer to an irep in an old compilation
Definition at line 195 of file xml_irep_hashing.cpp.
Referenced by insert(), and resolve_references().
|
private |
Definition at line 103 of file xml_irep_hashing.h.
Referenced by add_with_childs(), clear(), convert_map(), find_irep_by_content(), find_irep_by_id(), insert(), output_map(), reference_convert(), and resolve_references().