/* PIA - Lenguajes Modernos de Programación * FACULTAD DE CIENCIAS FÍSICO MATEMÁTICAS * Luis Sebastián Martínez Vega - LCC */ #ifndef LEXER_H #define LEXER_H #include enum token_type{ sum, substraction, division, multiplication, power, variable, number, function, left_parens, right_parens, nil }; struct Token{ token_type type; std::string value; Token(token_type type, const std::string &value) : type(type), value(value){} }; class Lexer{ private: std::string text; size_t current_char; Token current_token; std::string createNumber(); bool matchFunction(const std::string &function_name); public: Lexer(std::string text = {}); void setText(std::string text); Token getCurrentToken(); Token match(); Token nextToken(); }; #endif /* LEXER_H */