54 xmlt::elementst::const_iterator it=xml.
elements.begin();
55 for(; it != xml.
elements.end(); it++)
59 irep.
id(
"__REFERENCE__");
60 irep.
set(
"REF", it->data);
62 else if(it->name==
"id")
66 else if(it->name==
"ns")
70 std::string named_name=it->get_attribute(
"n");
73 else if(it->name==
"s")
79 else if(it->name==
"c")
83 std::string named_name=it->get_attribute(
"n");
89 std::cout <<
"Unknown sub found (" << it->name <<
"); malformed xml?\n";
100 ireps_containert::content_containert::const_iterator fi=
116 unsigned long id=
insert((
unsigned long)&iwi, iwi);
117 if(
id!=(
unsigned long)&iwi)
122 ireps_containert::content_containert::const_iterator fi=
131 ireps_containert::content_containert::const_iterator fi=
140 ireps_containert::content_containert::const_iterator fi=
155 if(cur.
id() ==
"__REFERENCE__")
158 ireps_containert::id_containert::const_iterator itr=
find_irep_by_id(
id);
161 std::cout <<
"Warning: can't resolve irep reference (sub " 162 << cur.
get(
"REF") <<
")\n";
197 std::stringstream ss(s);
199 ss >> std::hex >> res;
206 xml_irep_convertt::ireps_containert::id_containert::const_iterator
215 xml_irep_convertt::ireps_containert::content_containert::const_iterator
228 ireps_containert::content_containert::const_iterator sit;
233 std::pair<irept, unsigned long>(i,
id));
236 std::pair<unsigned long, irept>(
id, i)).second)
254 const std::string &
id,
265 ireps_containert::id_containert::iterator hit=
283 ireps_containert::id_containert::iterator hit=
292 xmlhe.
output(out, indent);
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 ...
ireps_containert::content_containert::const_iterator find_irep_by_content(const irept &irep)
finds an irep in the ireps hash set by checking contents
void move_to_sub(irept &irep)
void convert_map(xmlt &xml)
converts the current hash map of ireps into the given xml structure
ireps_containert::id_containert::const_iterator find_irep_by_id(const unsigned int)
finds an irep in the ireps hash set by its id
void reference_convert(const irept &irep, xmlt &xml)
#define forall_named_irep(it, irep)
xmlt xml(const source_locationt &location)
XML-irep conversions with hashing.
ireps_containert & ireps_container
void resolve_references(const irept &cur)
resolves references to ireps from an irep after reading an irep hash map into memory.
void convert(const irept &irep, xmlt &xml)
const irep_idt & id() const
const std::string & name2string(const irep_namet &n)
id_containert id_container
content_containert content_container
void set_attribute(const std::string &attribute, unsigned value)
const irep_idt & get(const irep_namet &name) const
id_replace_mapt id_replace_map
named_subt & get_comments()
Base class for tree-like data structures with sharing.
xmlt & new_element(const std::string &name)
unsigned long insert(unsigned long, const irept &)
inserts an irep into the hashtable
named_subt & get_named_sub()
const std::string & get_string(const irep_namet &name) const
const std::string & id_string() const
unsigned long add_with_childs(const irept &)
std::string long_to_string(const unsigned long)
converts the hash value to a readable string
void set(const irep_namet &name, const irep_idt &value)
void move_to_named_sub(const irep_namet &name, irept &irep)
void output_map(std::ostream &out, unsigned indent)
converts the current hash map of ireps into xml nodes and outputs them to the stream ...
#define forall_irep(it, irep)
void output(std::ostream &out, unsigned indent=0) const