2019-05-14 12:00:45 -07:00
|
|
|
#include <iostream>
|
|
|
|
#include <set>
|
2019-05-20 11:12:53 -07:00
|
|
|
#include "tree.hpp"
|
2019-05-14 12:00:45 -07:00
|
|
|
#include "parser.hpp"
|
|
|
|
|
|
|
|
extern int yylex();
|
|
|
|
|
2019-05-20 11:12:53 -07:00
|
|
|
extern stmt_ptr target_program;
|
2019-05-14 12:00:45 -07:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
if (!yylex()) {
|
2019-05-20 13:28:33 -07:00
|
|
|
std::vector<std::string> dest;
|
|
|
|
target_program->print_dot(dest, "start");
|
|
|
|
std::cout << "digraph G {" << std::endl;
|
|
|
|
for(auto& line : dest) {
|
|
|
|
std::cout << line << std::endl;
|
|
|
|
}
|
|
|
|
std::cout << "}" << std::endl;
|
2019-05-14 12:00:45 -07:00
|
|
|
delete target_program;
|
|
|
|
}
|
|
|
|
}
|