#include #include #include "haopar.hh" int main(int argc, char *argv[]) { try { if (argc != 2) { std::cerr << "Usage error.\n"; return 1; } std::ifstream in(argv[1]); safe_ptr result = parse(in); } catch (std::string s) { std::cerr << "Exception: " << s << '\n'; } catch (parse_error) { std::cerr << "Parse error\n"; } catch (std::exception & e) { std::cerr << "Exception: " << e.what() << '\n'; } }