18 typedef std::map<std::string, graphmlt::node_indext>
name_mapt;
21 const std::string &name,
25 std::pair<name_mapt::iterator, bool> entry=
26 name_to_node.insert(std::make_pair(name, 0));
28 entry.first->second=graph.
add_node();
30 return entry.first->second;
36 std::map<std::string, std::map<std::string, std::string> > &defaults,
38 std::string &entrynode)
45 add_node(node_name, name_to_node, dest);
52 for(xmlt::elementst::const_iterator
59 if(e_it->get_attribute(
"key")==
"violation" &&
62 else if(e_it->get_attribute(
"key")==
"entry" &&
78 std::map<std::string, std::string> &edge_defaults=defaults[
"edge"];
79 for(std::map<std::string, std::string>::const_iterator
80 it=edge_defaults.begin();
81 it!=edge_defaults.end();
85 for(xmlt::elementst::const_iterator
99 dest[s].
out[t].xml_node=xml_w_defaults;
100 dest[t].
in[s].xml_node=xml_w_defaults;
105 for(xmlt::elementst::const_iterator
120 for(xmlt::elementst::const_iterator
124 if(e_it->name==
"default")
149 std::map<std::string, std::map<std::string, std::string> > defaults;
150 std::string entrynode;
161 for(std::size_t i=0; !
err && i<dest.
size(); ++i)
168 name_mapt::const_iterator it=name_to_node.find(entrynode);
190 const std::string &filename,
205 xmlt graphml(
"graphml");
208 "http://www.w3.org/2001/XMLSchema-instance");
211 "http://graphml.graphdrawing.org/xmlns");
497 bool entry_done=
false;
539 for(graphmlt::edgest::const_iterator
546 os <<
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
const edgest & in(node_indext n) const
nodet::node_indext node_indext
node_indext add_node(arguments &&... values)
const edgest & out(node_indext n) const
std::string get_attribute(const std::string &attribute) const
void set_attribute(const std::string &attribute, unsigned value)
xmlt & new_element(const std::string &key)
void err(int eval, const char *fmt,...)
bool read_graphml(std::istream &is, graphmlt &dest, graphmlt::node_indext &entry, message_handlert &message_handler)
static graphmlt::node_indext add_node(const std::string &name, name_mapt &name_to_node, graphmlt &graph)
bool write_graphml(const graphmlt &src, std::ostream &os)
std::map< std::string, graphmlt::node_indext > name_mapt
static bool build_graph(const xmlt &xml, graphmlt &dest, graphmlt::node_indext &entry)
static bool build_graph_rec(const xmlt &xml, name_mapt &name_to_node, std::map< std::string, std::map< std::string, std::string > > &defaults, graphmlt &dest, std::string &entrynode)
Read/write graphs as GraphML.
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
std::string invariant_scope
bool parse_xml(std::istream &in, const std::string &filename, message_handlert &message_handler, xmlt &dest)