diff options
Diffstat (limited to 'source/lexer/lexer.h')
| -rw-r--r-- | source/lexer/lexer.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/lexer/lexer.h b/source/lexer/lexer.h new file mode 100644 index 0000000..86f8427 --- /dev/null +++ b/source/lexer/lexer.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef ENGINE_LEXER_H | ||
| 2 | #define ENGINE_LEXER_H | ||
| 3 | |||
| 4 | typedef enum token_type token_type; | ||
| 5 | enum token_type | ||
| 6 | { | ||
| 7 | // first 255 tokens for ascii characters | ||
| 8 | TOKEN_UNDEFINED = 255, | ||
| 9 | TOKEN_IDENTIFIER, | ||
| 10 | TOKEN_VALUE, | ||
| 11 | |||
| 12 | }; | ||
| 13 | |||
| 14 | typedef struct token token; | ||
| 15 | struct token | ||
| 16 | { | ||
| 17 | string8 lexeme; | ||
| 18 | token_type type; | ||
| 19 | |||
| 20 | }; | ||
| 21 | |||
| 22 | |||
| 23 | #endif /* ENGINE_LEXER_H */ | ||
