#include "parser.hpp" #include int main() { std::istringstream inp("const world = 5, hello = 7;"); std::unique_ptr program; elna::syntax::FooLexer lexer(inp); yy::parser parser(lexer, program); auto result = parser(); for (auto& definition : program->definitions()) { auto const_definition = dynamic_cast(definition.get()); std::cout << "const " << const_definition->identifier() << " = " << const_definition->body().number() << std::endl; } return result; }