From 524cfc23b15e1067076e45b056cb1d84e87e66cb Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 17 Feb 2022 16:42:31 -0400 Subject: igen: Did some more work on it. --- igen/lexer.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'igen/lexer.h') 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 +#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 -- cgit v1.2.3-13-gbd6f