handle extern variables
[neatcc/cc.git] / tok.h
blob28c00d844921797597bade6dded50e273cbd66e1
1 #define BUFSIZE (1 << 12)
2 #define NAMELEN (1 << 7)
3 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
5 #define TOK2(a) ((a)[0] << 16 | (a)[1] << 8)
6 #define TOK3(a) ((a)[0] << 16 | (a)[1] << 8 | (a)[2])
8 enum tok {
9 TOK_EOF,
10 TOK_NAME = 256,
11 TOK_NUM,
12 TOK_VOID,
13 TOK_STATIC,
14 TOK_EXTERN,
15 TOK_RETURN,
16 TOK_UNSIGNED,
17 TOK_SIGNED,
18 TOK_SHORT,
19 TOK_LONG,
20 TOK_INT,
21 TOK_CHAR,
22 TOK_STRUCT,
23 TOK_UNION,
24 TOK_ENUM,
25 TOK_TYPEDEF,
26 TOK_IF,
27 TOK_ELSE,
28 TOK_FOR,
29 TOK_WHILE,
30 TOK_DO,
31 TOK_SWITCH,
32 TOK_CASE,
33 TOK_SIZEOF,
34 TOK_STR,
35 TOK_BREAK,
36 TOK_CONTINUE,
37 TOK_DEFAULT,
38 TOK_GOTO,
41 void tok_init(int fd);
42 int tok_see(void);
43 int tok_get(void);
44 char *tok_id(void);
45 long tok_num(void);
46 int tok_str(char *out);