summaryrefslogtreecommitdiff
path: root/igen/lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'igen/lexer.h')
-rw-r--r--igen/lexer.h12
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