aboutsummaryrefslogtreecommitdiff
path: root/include/lexer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/lexer.hpp')
-rw-r--r--include/lexer.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/lexer.hpp b/include/lexer.hpp
new file mode 100644
index 0000000..2ef9700
--- /dev/null
+++ b/include/lexer.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#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();
+};