diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-02-22 22:24:27 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-02-22 22:24:27 +0000 |
| commit | 5c1f937a7eb7a9cc9cd86cb69b3263f41f24408f (patch) | |
| tree | 46154166a56f9a074c5b75dbb1a1b9560908b8f1 /include/lexer | |
| parent | 2cfc45ff22cd9b6166de3cf963aceede21b358aa (diff) | |
Partially completed lots of changes, refactoring most of the files
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 |
