diff options
author | kartofen <mladenovnasko0@gmail.com> | 2024-09-01 00:44:56 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2024-09-01 00:44:56 +0300 |
commit | 329166705de225bc766e56cc77765430065c456d (patch) | |
tree | 050b12b3a202cf43e9850903bd5b8bcc8ec67d7c /src/lexer.h | |
parent | e1ceef73192f0300ff9b10ba9a16475fbebeaa5f (diff) |
linked list and macros
Diffstat (limited to 'src/lexer.h')
-rw-r--r-- | src/lexer.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lexer.h b/src/lexer.h index e40ab05..6a14050 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -2,6 +2,7 @@ #define LEXER_H #include <stdio.h> +#include "list.h" #define TOKEN_TYPES(X) \ X(TOKEN_LP) \ @@ -11,11 +12,13 @@ X(TOKEN_INT) \ X(TOKEN_DOT) \ X(TOKEN_QUOTE) \ + X(TOKEN_QUASI) \ X(TOKEN_UNQUOTE) \ X(TOKEN_LAMBDA) \ X(TOKEN_DEFINE) \ X(TOKEN_QUOTE_FORM) \ X(TOKEN_IF) \ + X(TOKEN_DEFMACRO) \ X(TOKEN_NONE) #define TO_ENUM(type) type, @@ -35,6 +38,13 @@ struct token { } value; }; +struct toklist { + struct token *tokens; + size_t tokens_len; + + struct list_head list; +}; + typedef struct lexer * lexer_t; #define LEXER_EMPTY NULL @@ -59,5 +69,6 @@ int token_value_string(struct token *token, size_t buf_sz, char *buf); void token_clone(struct token *dest, struct token *src); void token_dealloc(struct token *token); +void toklist_destroy(struct toklist *toklist); #endif |