blob: c950a584b8f142e9923e3a9124a19f2068d812d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef ENGINE_LEXER_H
#define ENGINE_LEXER_H
typedef enum token_flags token_flags;
enum token_flags
{
START_FL = 1 << 1,
END_FL = 1 << 2,
};
typedef enum token_type token_type;
enum token_type
{
// first 255 tokens for ascii characters
TOKEN_UNDEFINED = 255,
TOKEN_IDENTIFIER,
TOKEN_VALUE,
};
typedef struct token token;
struct token
{
string8 lexeme;
token_type type;
token_flags flags;
token *next;
};
#endif /* ENGINE_LEXER_H */
|