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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
typedef struct Line Line;
typedef struct Node Node;
typedef struct Symbol Symbol;
typedef struct Trie Trie;
typedef struct TrieHead TrieHead;
struct Line {
char *filen;
int lineno;
};
struct TrieHead {
uvlong hash;
int l;
};
enum { TRIEB = 4 };
struct Trie {
TrieHead;
Trie *n[1<<TRIEB];
};
struct Symbol {
TrieHead;
char *name;
int type;
int size;
int flags;
int *vars;
Symbol *next;
};
enum {
SYMNONE,
SYMBITS,
};
enum {
SYMFSIGNED = 1,
};
struct Node {
int type;
Line;
int op;
mpint *num;
Symbol *sym;
Node *n1, *n2, *n3;
int size;
int *vars;
};
enum {
ASTINVAL,
ASTSYM,
ASTNUM,
ASTBIN,
ASTUN,
ASTIDX,
ASTTERN,
ASTTEMP,
};
enum {
OPINVAL,
OPABS,
OPADD,
OPAND,
OPASS,
OPCOM,
OPCOMMA,
OPDIV,
OPEQ,
OPEQV,
OPGE,
OPGT,
OPIMP,
OPLAND,
OPLE,
OPLOR,
OPLSH,
OPLT,
OPMOD,
OPMUL,
OPNEG,
OPNEQ,
OPNOT,
OPOR,
OPRSH,
OPSUB,
OPXOR,
};
extern Symbol *syms;
#pragma varargck type "ε" Node*
#pragma varargck type "α" int
#pragma varargck type "O" int
|