| 8 | #include <string> |
| 9 | |
| 10 | static inline void write(const std::string& filename, const std::ostringstream& content) { |
| 11 | std::ofstream file(filename, std::ios::out | std::ios::trunc); |
| 12 | if (file.is_open()) { |
| 13 | file << content.str(); |
| 14 | file.close(); |
| 15 | std::cout << "GenCode to " << filename << std::endl; |
| 16 | } else { |
| 17 | std::cout << "Fail to open" << filename << std::endl; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | int main() { |
| 22 | std::ostringstream os; |