summaryrefslogtreecommitdiff
path: root/lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lexer.h b/lexer.h
new file mode 100644
index 0000000..9c27d4d
--- /dev/null
+++ b/lexer.h
@@ -0,0 +1,12 @@
+/*!max:re2c*/
+#define BUFSIZE 50
+
+typedef struct {
+ FILE *file;
+ char buf[BUFSIZE + 1];
+ char *lim, *cur, *tok;
+ bool eof;
+} lexer_t;
+
+void init_lexer(lexer_t *in, FILE *file);
+int lex(lexer_t *in);