diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-02-17 16:42:31 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-02-18 10:05:01 -0400 |
commit | 524cfc23b15e1067076e45b056cb1d84e87e66cb (patch) | |
tree | 03a1b91d23da653ec3e5b9703b0b1544238400d9 /igen/lexer.h | |
parent | 5f753ddee7d935e0ba4750a6a8c26fe056c77612 (diff) |
igen: Did some more work on it.
Diffstat (limited to 'igen/lexer.h')
-rw-r--r-- | igen/lexer.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/igen/lexer.h b/igen/lexer.h index 454d2e1..0c5fea4 100644 --- a/igen/lexer.h +++ b/igen/lexer.h @@ -2,15 +2,17 @@ #define LEXER_H #include <stdlib.h> +#include "preprocessor.h" typedef enum stmt_type stmt_type; typedef enum cond_type cond_type; +typedef struct source source; typedef struct alt_stmt alt_stmt; typedef struct cond_stmt cond_stmt; typedef struct stmt stmt; enum stmt_type { - STMT_DIR, + STMT_NONE, STMT_FUNC, STMT_EXPR, STMT_COND, @@ -19,17 +21,18 @@ enum stmt_type { }; enum cond_type { + COND_NONE, COND_IF, COND_FOR, COND_WHILE, - COND_DO_WHILE, + COND_DO, NUM_CONDS }; struct alt_stmt { int type; size_t offset; - void *(*lex)(char **str, int dbg); + void *(*lex)(source *src, int dbg); }; struct cond_stmt { @@ -41,7 +44,6 @@ struct cond_stmt { struct stmt { stmt_type type; union { - dir *dir; func *func; expr *expr; cond_stmt *cond_stmt; @@ -50,5 +52,5 @@ struct stmt { stmt *next; }; -extern int lex(char *str, int dbg); +extern int lex(source *src, int dbg); #endif |