diff options
author | HombreLaser <luisvg440@fedora.email> | 2022-03-05 18:00:18 -0600 |
---|---|---|
committer | HombreLaser <luisvg440@fedora.email> | 2022-03-05 18:00:18 -0600 |
commit | b7494212646ab49a4e8fd7bade83f26a15cc8ff9 (patch) | |
tree | a456fdb3b75d239aafe724696385a45dbeda209e /include |
Commit inicial
Diffstat (limited to 'include')
-rw-r--r-- | include/lexer.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/lexer.hpp b/include/lexer.hpp new file mode 100644 index 0000000..73c5717 --- /dev/null +++ b/include/lexer.hpp @@ -0,0 +1,41 @@ +#include <string> + +#ifndef LEXER_H +#define LEXER_H + +const std::string EMPTY_STRING = ""; + +enum token_type{ + sum, + substraction, + division, + multiplication, + power, + variable, + number, + sin, + cos, + tan, + function, + left_parens, + right_parens +}; + +struct Token{ + token_type type; + std::string value; +}; + +class Lexer{ +private: + std::string text; + size_t txt_ptr; + Token current_token; + void setCurrentToken(Token val); +public: + Lexer(std::string text); + void nextToken(); + Token getCurrentToken(); +}; + +#endif /* LEXER_H */ |