From f181a8f04dfdfd8829861e0d0d549f39e40081e6 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 13 May 2021 12:03:43 +0200 Subject: New layout --- src/inc/tokenize.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/inc/tokenize.h (limited to 'src/inc/tokenize.h') diff --git a/src/inc/tokenize.h b/src/inc/tokenize.h new file mode 100644 index 0000000..557da9c --- /dev/null +++ b/src/inc/tokenize.h @@ -0,0 +1,35 @@ +#ifndef TOKENIZE_H +#define TOKENIZE_H + +#include + +#define TOKENS_MAX 4096 + +enum token_type { + UNKNOWN, + + TYPE, + TYPEDELIM, + PARAM, + + IDENT, + OPERATOR, + + LPAREN, + RPAREN, + EQUAL, + + NEWLINE, + EOL, + END, +}; + +struct token { + enum token_type type; + size_t start, end; +}; + +void tokens_print(struct ctx *ctx); +void tokenize(struct ctx *ctx); + +#endif -- cgit v1.2.3