diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-02-09 11:59:14 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-02-09 11:59:14 +0000 |
| commit | b3f83360282bfe327c0ccbeecab706e0e7d2c050 (patch) | |
| tree | 1ab29e9ebbf3d3f2fb66f59cbbc687451f8da62e /include/lexer/lexer.hpp | |
| parent | 26738e6c932038ea309a5dbaa9e941fc1ce144b8 (diff) | |
Changed .h to .hpp
Diffstat (limited to 'include/lexer/lexer.hpp')
| -rw-r--r-- | include/lexer/lexer.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/lexer/lexer.hpp b/include/lexer/lexer.hpp new file mode 100644 index 0000000..2c165b6 --- /dev/null +++ b/include/lexer/lexer.hpp @@ -0,0 +1,27 @@ +#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 |
