summaryrefslogtreecommitdiff
path: root/source/lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/lexer.h')
-rw-r--r--source/lexer.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/lexer.h b/source/lexer.h
new file mode 100644
index 0000000..7bafc0d
--- /dev/null
+++ b/source/lexer.h
@@ -0,0 +1,32 @@
1#ifndef ENGINE_LEXER_H
2#define ENGINE_LEXER_H
3
4typedef enum token_flags token_flags;
5enum token_flags
6{
7 START_FL = 1 << 1,
8 END_FL = 1 << 2,
9};
10
11
12typedef enum token_type token_type;
13enum token_type
14{
15 // first 255 tokens for ascii characters
16 TOKEN_UNDEFINED = 255,
17 TOKEN_IDENTIFIER,
18 TOKEN_VALUE,
19
20};
21
22typedef struct token token;
23struct token
24{
25 string8 lexeme;
26 token_type type;
27 token_flags flags;
28};
29
30
31
32#endif /* ENGINE_LEXER_H */