summaryrefslogtreecommitdiff
path: root/lexer.h
diff options
context:
space:
mode:
authorCarson Fleming <[email protected]>2026-03-15 19:25:26 -0400
committerCarson Fleming <[email protected]>2026-03-15 19:25:26 -0400
commit66e278b0752eaa9808687c0dc214b49d7b58e8eb (patch)
treecca09f74ab439c3d54913bc1b4355b8208a5824f /lexer.h
parent1f85b418dd7960c28f16de21c44dcb4e2e05e694 (diff)
downloadccc-66e278b0752eaa9808687c0dc214b49d7b58e8eb.tar.gz
functional lexer
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lexer.h b/lexer.h
index 24fb22d..30848a8 100644
--- a/lexer.h
+++ b/lexer.h
@@ -2,8 +2,10 @@
#define LEXER_H
enum token_type {
+ NOT_FOUND,
IDENTIFIER,
INT_LIT,
+ FLOAT_LIT, // TODO
CHAR_LIT,
STR_LIT,
HASHTAG,
@@ -52,13 +54,15 @@ enum token_type {
SHL_EQ
};
-typedef unsigned long long intlit_t;
+typedef unsigned long long int_lit_t;
+typedef double float_lit_t;
struct token {
enum token_type type;
union {
char* identifier;
- intlit_t int_lit;
+ int_lit_t int_lit;
+ float_lit_t float_lit;
char char_lit;
char* str_lit;
void* unused;
@@ -66,6 +70,7 @@ struct token {
};
void lexer_load(const char* path);
+void lexer_close();
bool lexer_peek(struct token* p_token);
bool lexer_pop(struct token* p_token);