cpp: handle function macros with no arguments
[neatcc.git] / tok.h
blob1a56a45f1791ce21efd69e9b254efe621d92c8cf
1 #define BUFSIZE (1 << 18)
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(char *path);
42 int tok_see(void);
43 int tok_get(void);
44 char *tok_id(void);
45 int tok_num(long *n);
46 int tok_str(char *out);
47 long tok_addr(void);
48 void tok_jump(long addr);
50 int cpp_init(char *path);
51 void cpp_addpath(char *s);
52 void cpp_define(char *name, char *def);
53 int cpp_loc(char *s, long offset);
54 int cpp_read(char *s);
56 void die(char *msg);