#include #include #include #include #include "gen_parser.hpp" #include "gen_lexer.hpp" namespace pslang::parser { ast::statement_list_ptr parse(std::string_view path) { yyin = fopen(path.data(), "r"); if (!yyin) throw std::system_error(std::make_error_code(static_cast(errno))); ast::location location{.begin = {.filename = path}, .end = {.filename = path}}; indented_statement_list result; context ctx{location, result}; bison::parser parser(ctx); parser.parse(); fclose(yyin); return finalize(std::move(result)); } }