blob: ef20cefce46d3ea315b307a6bdc8b1c5c4e35f1d (
plain) (
blame)
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
|
#ifndef AHOY_C8ASM_LEXER_H
#define AHOY_C8ASM_LEXER_H
#include <mbstring.h>
typedef enum [[clang::flag_enum]] {
T_COLON = 1 << 0,
T_EOL = 1 << 1,
T_IDENT = 1 << 2,
T_NUMBER = 1 << 3,
T_STRING = 1 << 4,
} tokkind;
struct token {
tokkind kind;
struct u8view sv;
int base; /* For number literals */
};
struct tokens {
struct token *buf;
size_t len, cap;
};
const char *tokrepr(tokkind);
struct tokens lexfile(struct u8view);
#endif /* !AHOY_C8ASM_LEXER_H */
|