-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexer.c
42 lines (32 loc) · 967 Bytes
/
lexer.c
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
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include "fatarena.h"
#include "token.h"
#include "lib/map.h"
#include "lex.h"
FatArena ftident = {0};
FatArena ftlit = {0};
FatArena ftimmed = {0};
FatArena fttmp = {0};
int
main(int argc, char *argv[])
{
(void) argc;
(void) argv;
POK(ftnew(&ftident, 1000000) != 0, "fail to create a FatArena");
ftalloc(&ftident, NKEYWORDS + 1);// burn significant int
POK(ftnew(&ftident, 1000000) != 0, "fail to create a FatArena");
ftalloc(&ftident, NKEYWORDS + 1);// burn significant int
POK(ftnew(&ftimmed, 1000000) != 0, "fail to create a FatArena");
ftalloc(&ftimmed, NKEYWORDS + 1);// burn significant int
POK(ftnew(&ftlit, 1000000) != 0, "fail to create a FatArena");
ftalloc(&ftlit, NKEYWORDS + 1);// burn significant int
POK(ftnew(&fttmp, 1000000) != 0, "fail to create a FatArena");
Tok t = {0};
do {
t = getnext();
printtok(stdout, t);
} while (t.type != EOI);
}