aboutsummaryrefslogtreecommitdiff
path: root/include/lexer.h
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-01-20 02:34:32 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-01-20 02:34:32 +0300
commitc0cd4e5f199e8567ec3b5e216fbee27837d21bea (patch)
treec78eee02932fc6e85413e367d27ec5b5627e1534 /include/lexer.h
downloadcmonkey-c0cd4e5f199e8567ec3b5e216fbee27837d21bea.tar.gz
cmonkey-c0cd4e5f199e8567ec3b5e216fbee27837d21bea.zip
init
Diffstat (limited to 'include/lexer.h')
-rw-r--r--include/lexer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/lexer.h b/include/lexer.h
new file mode 100644
index 0000000..d693354
--- /dev/null
+++ b/include/lexer.h
@@ -0,0 +1,25 @@
+#ifndef CMONKEY_LEXER_H
+#define CMONKEY_LEXER_H
+
+#include "slice.h"
+#include "token.h"
+
+#include <sys/types.h>
+
+struct lexer {
+ const char *input;
+ size_t len;
+ struct slice word;
+};
+
+struct lexer *lexer_new();
+
+void lexer_reset(struct lexer *, const char *input);
+
+void lexer_read_char(struct lexer *);
+
+struct token lexer_next_token(struct lexer *);
+
+void lexer_destroy(struct lexer *);
+
+#endif