diff options
Diffstat (limited to 'include/lexer')
| -rw-r--r-- | include/lexer/lexer.hpp | 27 | ||||
| -rw-r--r-- | include/lexer/token.hpp | 17 | ||||
| -rw-r--r-- | include/lexer/token_type.hpp | 25 |
3 files changed, 0 insertions, 69 deletions
diff --git a/include/lexer/lexer.hpp b/include/lexer/lexer.hpp deleted file mode 100644 index 2c165b6..0000000 --- a/include/lexer/lexer.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef LEXER_H -#define LEXER_H - -#include "token.hpp" - -#include <vector> -#include <string> - -class Lexer { -public: - explicit Lexer (const std::string& src); - - std::vector<Token> tokenise(); - -private: - int line; - int column; - int position; - std::string src; - std::vector<Token> tokens; - - char advance(); - void skipWhitespace(); - void skipComment(); -}; - -#endif diff --git a/include/lexer/token.hpp b/include/lexer/token.hpp deleted file mode 100644 index 86a41f6..0000000 --- a/include/lexer/token.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef TOKEN_H -#define TOKEN_H - -#include "token_type.hpp" - -#include <string> - -struct Token { - TokenType type; - std::string value; - int line; - int column; - - Token(TokenType t, const std::string& val, int line, int col) : type{t}, value{val}, line{line}, column{col} {}; -}; - -#endif diff --git a/include/lexer/token_type.hpp b/include/lexer/token_type.hpp deleted file mode 100644 index f83c6d6..0000000 --- a/include/lexer/token_type.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef TOKEN_TYPE_H -#define TOKEN_TYPE_H - -enum class TokenType { - INT, - STRING, - - NUMBER, - IDENTIFIER, - - PLUS, - MINUS, - MULTIPLY, - DIVIDE, - - ASSIGN, - - SEMICOLON, - - END_OF_FILE, - INVALID - -}; - -#endif |
