| 1 | /// @file |
|---|---|
| 2 | /// @brief Dump syntax trees as GraphML |
| 3 | #ifndef DUMP_HH |
| 4 | #define DUMP_HH |
| 5 | |
| 6 | #include <fstream> |
| 7 | #include <iostream> |
| 8 | #include <string> |
| 9 | |
| 10 | #include "log.hh" |
| 11 | #include "prod.hh" |
| 12 | |
| 13 | struct graphml_dumper : prod_visitor { |
| 14 | std::ostream &o; |
| 15 | virtual void visit(struct prod *p); |
| 16 | graphml_dumper(std::ostream &out); |
| 17 | std::string id(prod *p); |
| 18 | std::string type(struct prod *p); |
| 19 | virtual ~graphml_dumper(); |
| 20 | }; |
| 21 | |
| 22 | struct ast_logger : logger { |
| 23 | int queries = 0; |
| 24 | virtual void generated(prod &query); |
| 25 | }; |
| 26 | |
| 27 | #endif |
| 28 |