#pragma once #include "parser.h" #include "table.h" #include class Executor { private: public: Executor(); bool execute(Node& node); private: bool execute_create_table(CreateTableNode& node); bool execute_insert_into_table(InsertIntoTableNode& node); bool execute_select(SelectFromTableNode& node); Table* find_table(const std::string name); private: std::vector m_tables; bool evalWhere(const SelectFromTableNode &node, Table *table, std::vector>::iterator &row) const; std::unique_ptr evalNode(Table *table, std::vector>::iterator &row, Node *filter) const; bool evalRelationalOperator(const RelationalOperatorNode &filter, Table *table, std::vector>::iterator &row) const; };