repo.or.cz
/
neatcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
support more comparison operators
[neatcc.git]
/
tok.h
blob
762892ff92731f96aa10131c73aae93ff3da89f5
1
#define BUFSIZE (1 << 12)
2
#define NAMELEN (1 << 7)
3
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
4
5
#define TOK2(a) ((a)[0] << 16 | (a)[1] << 8)
6
#define TOK3(a) ((a)[0] << 16 | (a)[1] << 8 | (a)[2])
7
8
enum
tok
{
9
TOK_EOF
,
10
TOK_NAME
=
256
,
11
TOK_NUM
,
12
TOK_VOID
,
13
TOK_STATIC
,
14
TOK_RETURN
,
15
TOK_UNSIGNED
,
16
TOK_SIGNED
,
17
TOK_SHORT
,
18
TOK_LONG
,
19
TOK_INT
,
20
TOK_CHAR
,
21
TOK_STRUCT
,
22
TOK_ENUM
,
23
TOK_IF
,
24
TOK_ELSE
,
25
TOK_FOR
,
26
TOK_WHILE
,
27
TOK_DO
,
28
TOK_SWITCH
,
29
TOK_CASE
,
30
TOK_SIZEOF
,
31
};
32
33
void
tok_init
(
int
fd
);
34
int
tok_see
(
void
);
35
int
tok_get
(
void
);
36
char
*
tok_id
(
void
);