#pragma once #include #include #include namespace lel { struct Cell { int x = 0; int y = 0; int w = 0; int h = 0; int max_w = 0; int max_h = 0; int col = 0; int row = 0; bool right = false; bool bottom = false; bool expand = false; bool center = false; Cell(int col, int row) : col(col), row(row) {} }; struct Parser { int grid_x = 0; int grid_y = 0; int grid_w = 0; int grid_h = 0; int rows = 0; int columns = 0; Cell cur; std::unordered_map cells; Parser(int x, int y, int width, int height); void col(); void ltab(); void align(char dir); void valign(char dir); void id(std::string name); void row(); void setwidth(int width); void setheight(int height); void expand(); void reset(); void center(); bool parse(std::string input); void finalize(); }; }