| 151 | } |
| 152 | |
| 153 | void DotGraphPrinter::print_nodes(const Graph &g, std::ostream &os) |
| 154 | { |
| 155 | for (const auto &n : g.nodes()) |
| 156 | { |
| 157 | if (n) |
| 158 | { |
| 159 | // Output node id |
| 160 | std::string node_id = std::string("n") + support::cpp11::to_string(n->id()); |
| 161 | os << node_id << " "; |
| 162 | |
| 163 | // Output label |
| 164 | n->accept(_dot_node_visitor); |
| 165 | |
| 166 | std::string name = n->name().empty() ? node_id : n->name(); |
| 167 | auto node_description = _dot_node_visitor.info(); |
| 168 | |
| 169 | os << R"([label = ")" << name << R"( \n )" << n->assigned_target() << R"( \n )" << node_description |
| 170 | << R"("])"; |
| 171 | os << ";\n"; |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | void DotGraphPrinter::print_edges(const Graph &g, std::ostream &os) |
| 177 | { |