0
|
1 /* Micro-C header file */
|
|
2
|
195
|
3 #define FLOAT_CODE 1
|
237
|
4 #define LONGLONG_CODE 1
|
292
|
5 #define CASE_CODE 1
|
316
|
6 #define ASM_CODE 1
|
329
|
7 #define BIT_FIELD_CODE 1
|
195
|
8
|
164
|
9 /* reserved word start */
|
|
10
|
327
|
11 #define INT (-1)
|
|
12 #define UNSIGNED (-2)
|
|
13 #define CHAR (-3)
|
|
14 #define UCHAR (-4)
|
162
|
15 #define POINTER (-5)
|
327
|
16 #define ARRAY (-6)
|
|
17 #define STRUCT (-7)
|
|
18 #define UNION (-8)
|
|
19 #define FUNCTION (-9)
|
0
|
20
|
327
|
21 #define STATIC (-10)
|
|
22 #define GOTO (-11)
|
|
23 #define RETURN (-12)
|
|
24 #define BREAK (-13)
|
|
25 #define CONTINUE (-14)
|
|
26 #define IF (-15)
|
|
27 #define ELSE (-16)
|
|
28 #define FOR (-17)
|
|
29 #define DO (-18)
|
|
30 #define WHILE (-19)
|
|
31 #define SWITCH (-20)
|
|
32 #define CASE (-21)
|
0
|
33 #define DEFAULT (-22)
|
|
34 #define RESERVE (-23)
|
327
|
35 #define TAG (-24)
|
|
36 #define FIELD (-25)
|
|
37 #define IDENT (-26)
|
|
38 #define MACRO (-27)
|
|
39 #define BLABEL (-28)
|
|
40 #define FLABEL (-29)
|
164
|
41 #define TYPEDEF (-30)
|
327
|
42 #define SIZEOF (-31)
|
|
43 #define TYPE (-32)
|
|
44 #define LONG (-33)
|
|
45 #define SHORT (-34)
|
|
46 #define USHORT (-35)
|
|
47 #define EXTRN (-36)
|
|
48 #define EXTRN1 (-37)
|
|
49 #define VOID (-38)
|
|
50 #define INLINE (-39)
|
|
51 #define REGISTER (-40)
|
|
52 #define FREGISTER (-41)
|
|
53 #define DREGISTER (-42)
|
|
54 #define LREGISTER (-43)
|
|
55 #define CODE (-44)
|
|
56 #define ENVIRONMENT (-45)
|
|
57 #define DEFINED (-46)
|
|
58 #define ENUM (-47)
|
|
59 #define KONST (-48)
|
|
60 #define FMACRO (-49)
|
|
61 #define LMACRO (-50)
|
|
62 #define SIGNED (-51)
|
|
63 #define DOTS (-52)
|
0
|
64
|
327
|
65 #define FLOAT (-53)
|
|
66 #define DOUBLE (-54)
|
|
67 #define LONGLONG (-55)
|
|
68 #define ULONGLONG (-56)
|
|
69 #define VOLATILE (-57)
|
|
70 #define TYPEOF (-58)
|
363
|
71 #define ASM (-59)
|
164
|
72
|
|
73 /* reserved word end */
|
78
|
74
|
327
|
75 #define EMPTY (-99)
|
103
|
76
|
164
|
77 /* mode start */
|
327
|
78 #define TOP 0
|
|
79 #define GDECL 1
|
|
80 #define GSDECL 2
|
|
81 #define GUDECL 3
|
|
82 #define ADECL 4
|
|
83 #define LDECL 5
|
|
84 #define LSDECL 6
|
|
85 #define LUDECL 7
|
0
|
86 #define STADECL 8
|
327
|
87 #define STAT 9
|
|
88 #define GTDECL 10
|
|
89 #define LTDECL 11
|
|
90 #define IFDEF 12
|
|
91 #define MDECL 13
|
176
|
92 #define GEDECL 14
|
|
93 #define LEDECL 15
|
362
|
94 #define LLDECL 16
|
|
95 #define SFDINIT 17
|
164
|
96 /* mode end */
|
|
97
|
327
|
98 #define US 1
|
|
99 #define AS 10000
|
|
100 #define SOP 200
|
|
101 #define COP 400
|
|
102 #define DOP 600
|
|
103 #define FOP 800
|
|
104 #define LOP 1000
|
|
105 #define BOP 1200 // bit field
|
164
|
106
|
|
107 /* tree node tags start */
|
|
108
|
316
|
109 #define LIST_ARGS(i) (i==FUNCTION||i==CODE||i==ASM)
|
164
|
110
|
|
111 /* nullary argments */
|
0
|
112
|
327
|
113 #define GVAR 1
|
|
114 #define RGVAR 2
|
|
115 #define URGVAR 3
|
|
116 #define LVAR 4
|
|
117 #define RLVAR 5
|
|
118 #define URLVAR 6
|
|
119 #define CRGVAR (COP+RGVAR)
|
|
120 #define CURGVAR (COP+URGVAR)
|
|
121 #define CRLVAR (COP+RLVAR)
|
|
122 #define CURLVAR (COP+URLVAR)
|
|
123 #define FRGVAR (FOP+RGVAR)
|
|
124 #define FRLVAR (FOP+RLVAR)
|
|
125 #define DRGVAR (DOP+RGVAR)
|
|
126 #define DRLVAR (DOP+RLVAR)
|
|
127 #define SRGVAR (SOP+RGVAR)
|
|
128 #define SURGVAR (SOP+URGVAR)
|
|
129 #define SRLVAR (SOP+RLVAR)
|
|
130 #define SURLVAR (SOP+URLVAR)
|
|
131 #define LRGVAR (LOP+RGVAR)
|
|
132 #define LURGVAR (LOP+URGVAR)
|
|
133 #define LRLVAR (LOP+RLVAR)
|
|
134 #define LURLVAR (LOP+URLVAR)
|
|
135 #define BRGVAR (BOP+RGVAR)
|
|
136 #define BURGVAR (BOP+URGVAR)
|
|
137 #define BRLVAR (BOP+RLVAR)
|
|
138 #define BURLVAR (BOP+URLVAR)
|
164
|
139
|
327
|
140 #define CONST 7
|
|
141 #define DCONST (DOP+CONST)
|
|
142 #define FCONST (FOP+CONST)
|
|
143 #define LCONST (LOP+CONST)
|
|
144 #define STRING 8
|
|
145 #define FNAME 9
|
363
|
146 #define LABEL 10
|
164
|
147
|
363
|
148 #define NULLARY_ARGS(i) (i==REGISTER||i==DREGISTER||i==FREGISTER||i==LREGISTER||(GVAR<=(i%SOP)&&(i%SOP)<=LABEL))
|
164
|
149
|
|
150 /* unary argments */
|
|
151
|
363
|
152 #define ADDRESS 11
|
|
153 #define MINUS 12
|
|
154 #define LNOT 13
|
|
155 #define BNOT 14
|
|
156 #define INC 15
|
|
157 #define POSTINC 16
|
|
158 #define UPOSTINC 17
|
|
159 #define PREINC 18
|
|
160 #define UPREINC 19
|
|
161 #define POSTDEC 20
|
|
162 #define UPOSTDEC 21
|
|
163 #define PREDEC 22
|
|
164 #define UPREDEC 23
|
|
165 #define DEC 24
|
196
|
166 #define CPOSTINC (COP+POSTINC)
|
|
167 #define CUPOSTINC (COP+UPOSTINC)
|
|
168 #define CPREINC (COP+PREINC)
|
|
169 #define CUPREINC (COP+UPREINC)
|
|
170 #define CPOSTDEC (COP+POSTDEC)
|
|
171 #define CUPOSTDEC (COP+UPOSTDEC)
|
|
172 #define CPREDEC (COP+CPREDEC)
|
|
173 #define CUPREDEC (COP+UPREDEC)
|
|
174 #define SPOSTINC (SOP+POSTINC)
|
|
175 #define SUPOSTINC (SOP+UPOSTINC)
|
|
176 #define SPREINC (SOP+PREINC)
|
|
177 #define SUPREINC (SOP+UPREINC)
|
|
178 #define SPOSTDEC (SOP+POSTDEC)
|
|
179 #define SUPOSTDEC (SOP+UPOSTDEC)
|
|
180 #define SPREDEC (SOP+PREDEC)
|
|
181 #define SUPREDEC (SOP+UPREDEC)
|
327
|
182 #define FPOSTINC (FOP+POSTINC)
|
|
183 #define FPREINC (FOP+PREINC)
|
|
184 #define DPOSTINC (DOP+POSTINC)
|
|
185 #define DPREINC (DOP+PREINC)
|
|
186 #define LPOSTINC (LOP+POSTINC)
|
|
187 #define LPREINC (LOP+PREINC)
|
|
188 #define LUPOSTINC (LOP+UPOSTINC)
|
|
189 #define LUPREINC (LOP+UPREINC)
|
363
|
190 #define INDIRECT 25
|
|
191 #define RINDIRECT 26
|
|
192 #define URINDIRECT 27
|
327
|
193 #define CRINDIRECT (COP+RINDIRECT)
|
|
194 #define CURINDIRECT (COP+URINDIRECT)
|
|
195 #define SRINDIRECT (SOP+RINDIRECT)
|
|
196 #define SURINDIRECT (SOP+URINDIRECT)
|
|
197 #define FRINDIRECT (FOP+RINDIRECT)
|
|
198 #define DRINDIRECT (DOP+RINDIRECT)
|
|
199 #define LRINDIRECT (LOP+RINDIRECT)
|
|
200 #define LURINDIRECT (LOP+URINDIRECT)
|
363
|
201 #define RSTRUCT 28
|
|
202 #define ALLOCA 29
|
|
203 #define BIT_FIELD 30
|
|
204 #define RBIT_FIELD 31
|
|
205 #define BPREINC 32
|
|
206 #define BPOSTINC 33
|
|
207 #define CONV 34
|
164
|
208
|
|
209 #define UNARY_ARGS(i) (ADDRESS<=(i%SOP)&&(i%SOP)<=CONV)
|
|
210
|
|
211 /* binary argments */
|
|
212
|
363
|
213 #define MUL 35
|
|
214 #define UMUL 36
|
|
215 #define DIV 37
|
|
216 #define UDIV 38
|
|
217 #define MOD 39
|
|
218 #define UMOD 40
|
|
219 #define ADD 41
|
|
220 #define SUB 42
|
|
221 #define CMP 43
|
|
222 #define RSHIFT 44
|
|
223 #define URSHIFT 45
|
|
224 #define LSHIFT 46
|
|
225 #define ULSHIFT 47
|
|
226 #define GT 48
|
|
227 #define UGT 49
|
|
228 #define GE 50
|
|
229 #define UGE 51
|
|
230 #define LT 52
|
|
231 #define ULT 53
|
|
232 #define LE 54
|
|
233 #define ULE 55
|
|
234 #define EQ 56
|
|
235 #define NEQ 57
|
|
236 #define BAND 58
|
|
237 #define EOR 59
|
|
238 #define BOR 60
|
|
239 #define LAND 61
|
|
240 #define LOR 62
|
|
241 #define ASS 63
|
|
242 #define UCMP 64
|
|
243 #define UCMPGE 65
|
|
244 #define CMPGE 66
|
|
245 #define CMPEQ 67
|
|
246 #define CMPNEQ 68
|
|
247 #define ASSOP 69
|
|
248 #define COMMA 70
|
164
|
249
|
363
|
250 #define CASS 71
|
|
251 #define CASSOP 72
|
|
252 #define CUASSOP 73
|
0
|
253
|
327
|
254 #define SASS (SOP+CASS)
|
164
|
255 #define SASSOP (SOP+CASSOP)
|
|
256 #define SUASSOP (SOP+CUASSOP)
|
|
257
|
327
|
258 #define DASS (DOP+ASS)
|
|
259 #define DCMPGE (DOP+CMPGE)
|
|
260 #define DCMPEQ (DOP+CMPEQ)
|
|
261 #define DCMPNEQ (DOP+CMPNEQ)
|
|
262 #define DASSOP (DOP+ASSOP)
|
|
263 #define DCMP (DOP+CMP)
|
|
264 #define DMINUS (DOP+MINUS)
|
|
265 #define DMUL (DOP+MUL)
|
|
266 #define DDIV (DOP+DIV)
|
|
267 #define DADD (DOP+ADD)
|
|
268 #define DSUB (DOP+SUB)
|
164
|
269
|
327
|
270 #define FASS (FOP+ASS)
|
|
271 #define FCMPGE (FOP+CMPGE)
|
|
272 #define FCMPEQ (FOP+CMPEQ)
|
|
273 #define FCMPNEQ (FOP+CMPNEQ)
|
|
274 #define FASSOP (FOP+ASSOP)
|
|
275 #define FCMP (FOP+CMP)
|
|
276 #define FMINUS (FOP+MINUS)
|
|
277 #define FMUL (FOP+MUL)
|
|
278 #define FDIV (FOP+DIV)
|
|
279 #define FADD (FOP+ADD)
|
|
280 #define FSUB (FOP+SUB)
|
78
|
281
|
327
|
282 #define LASS (LOP+CASS)
|
|
283 #define LCMPGE (LOP+CMPGE)
|
|
284 #define LCMPEQ (LOP+CMPEQ)
|
|
285 #define LCMPNEQ (LOP+CMPNEQ)
|
195
|
286 #define LASSOP (LOP+CASSOP)
|
164
|
287 #define LUASSOP (LOP+CUASSOP)
|
327
|
288 #define LCMP (LOP+CMP)
|
|
289 #define LMINUS (LOP+MINUS)
|
|
290 #define LMUL (LOP+MUL)
|
|
291 #define LDIV (LOP+DIV)
|
|
292 #define LUMUL (LOP+UMUL)
|
|
293 #define LUDIV (LOP+UDIV)
|
|
294 #define LADD (LOP+ADD)
|
|
295 #define LSUB (LOP+SUB)
|
81
|
296
|
195
|
297
|
327
|
298 #define LMOD (LOP+MOD)
|
|
299 #define LUMOD (LOP+UMOD)
|
|
300 #define LLSHIFT (LOP+LSHIFT)
|
|
301 #define LULSHIFT (LOP+ULSHIFT)
|
|
302 #define LRSHIFT (LOP+RSHIFT)
|
|
303 #define LURSHIFT (LOP+URSHIFT)
|
|
304 #define LBAND (LOP+BAND)
|
|
305 #define LEOR (LOP+EOR)
|
|
306 #define LBOR (LOP+BOR)
|
195
|
307
|
363
|
308 #define BASS 74
|
|
309 #define BASSOP 75
|
|
310 #define BFD_REPL 76
|
195
|
311
|
363
|
312 #define STASS 77
|
326
|
313
|
164
|
314
|
|
315 #define BINARY_ARGS(i) (MUL<=(i%SOP)&&(i%SOP)<=STASS)
|
|
316
|
|
317 /* tarnary argments */
|
|
318
|
363
|
319 #define COND 78
|
327
|
320 #define SCOND (SOP+COND)
|
|
321 #define DCOND (DOP+COND)
|
|
322 #define FCOND (FOP+COND)
|
|
323 #define LCOND (LOP+COND)
|
164
|
324
|
|
325 #define TARNARY_ARGS(i) (COND==(i%SOP))
|
|
326
|
|
327 /* not appeared as tags */
|
81
|
328
|
363
|
329 #define LPAR 79
|
|
330 #define RPAR 80
|
|
331 #define LBRA 81
|
|
332 #define RBRA 82
|
|
333 #define LC 83
|
|
334 #define RC 84
|
|
335 #define COLON 85
|
|
336 #define SM 86
|
|
337 #define PERIOD 87
|
|
338 #define ARROW 88
|
|
339 #define CNAME 89
|
194
|
340
|
363
|
341 #define I2C 90
|
|
342 #define I2S 91
|
|
343 #define I2I 92
|
|
344 #define I2U 93
|
|
345 #define I2D 94
|
|
346 #define I2F 95
|
|
347 #define I2LL 96
|
|
348 #define I2ULL 97
|
353
|
349
|
363
|
350 #define U2UC 98
|
|
351 #define U2US 99
|
|
352 #define U2I 100
|
|
353 #define U2U 101
|
|
354 #define U2D 102
|
|
355 #define U2F 103
|
|
356 #define U2LL 104
|
|
357 #define U2ULL 105
|
353
|
358
|
194
|
359
|
327
|
360 #define D2I (DOP+I2I)
|
|
361 #define D2U (DOP+I2U)
|
|
362 #define D2D (DOP+I2D)
|
|
363 #define D2F (DOP+I2F)
|
|
364 #define D2LL (DOP+I2LL)
|
|
365 #define D2ULL (DOP+I2ULL)
|
164
|
366
|
327
|
367 #define F2I (FOP+I2I)
|
|
368 #define F2U (FOP+I2U)
|
|
369 #define F2D (FOP+I2D)
|
|
370 #define F2F (FOP+I2F)
|
|
371 #define F2LL (FOP+I2LL)
|
|
372 #define F2ULL (FOP+I2ULL)
|
194
|
373
|
327
|
374 #define LL2I (LOP+I2I)
|
|
375 #define LL2U (LOP+I2U)
|
|
376 #define LL2D (LOP+I2D)
|
|
377 #define LL2F (LOP+I2F)
|
|
378 #define LL2LL (LOP+I2LL)
|
|
379 #define LL2ULL (LOP+I2ULL)
|
194
|
380
|
327
|
381 #define ULL2I (LOP+U2I)
|
|
382 #define ULL2U (LOP+U2U)
|
|
383 #define ULL2D (LOP+U2D)
|
|
384 #define ULL2F (LOP+U2F)
|
|
385 #define ULL2LL (LOP+U2LL)
|
|
386 #define ULL2ULL (LOP+U2ULL)
|
194
|
387
|
164
|
388 /* tree node tags end */
|
|
389
|
|
390 /* error number start */
|
0
|
391
|
327
|
392 #define FILERR 1
|
|
393 #define DCERR 2
|
|
394 #define RDERR 3
|
|
395 #define STERR 4
|
|
396 #define EXERR 5
|
|
397 #define CNERR 6
|
|
398 #define CHERR 7
|
|
399 #define GSERR 8
|
|
400 #define LSERR 9
|
|
401 #define STRERR 10
|
|
402 #define LNERR 11
|
|
403 #define EOFERR 12
|
|
404 #define MCERR 13
|
|
405 #define INCERR 14
|
|
406 #define HPERR 15
|
|
407 #define TYERR 16
|
|
408 #define LVERR 17
|
|
409 #define UDERR 18
|
|
410 #define OPTION 19
|
|
411 #define REG_ERR 20
|
389
|
412 #define RGERR 21
|
|
413 #define CODE_ERR 22
|
|
414 #define MSERR 23
|
|
415 #define BTERR 24
|
|
416 #define HSERR 25
|
|
417 #define NMERR 26
|
|
418 #define MMERR 27
|
|
419 #define INERR 28
|
327
|
420
|
164
|
421 /* error number end */
|
0
|
422
|
25
|
423 #define FILES 10
|
327
|
424 #define MAX_INCLUDE_PATH_COUNT 10
|
0
|
425
|
348
|
426 #define GSYMS 8192
|
358
|
427 #define HEAPSIZE 30000
|
348
|
428 #define CHEAPSIZE (sizeof(NMTBL)*GSYMS)
|
327
|
429 #define LBUFSIZE 4096
|
347
|
430 #define STRSIZE 4096
|
254
|
431
|
0
|
432 typedef struct nametable {
|
327
|
433 char *nm;
|
348
|
434 struct nametable *next;
|
347
|
435 int sc,ty,dsp; } NMTBL;
|
0
|
436
|
357
|
437 extern int *heap;
|
348
|
438 extern NMTBL *global_list,*local_static_list;
|
0
|
439
|
195
|
440 #if FLOAT_CODE
|
81
|
441 extern int dlist2(int e1, double e2);
|
195
|
442 #endif
|
|
443 #if LONGLONG_CODE
|
|
444 extern int llist2(int e1, long long e2);
|
|
445 #endif
|
61
|
446 extern int list2(int e1, int e2);
|
|
447 extern int list3(int e1, int e2, int e3);
|
|
448 extern int list4(int e1, int e2, int e3,int e4);
|
318
|
449 extern int length(int e1);
|
|
450 extern int nth(int n,int e1);
|
61
|
451 extern int reverse0(int t1);
|
|
452 extern int append4(int p,int a1,int a2,int a3);
|
309
|
453 extern int insert_ascend(int p,int e,int eq());
|
61
|
454
|
347
|
455 extern void free_nptr(NMTBL *n);
|
|
456 extern NMTBL *get_nptr();
|
346
|
457
|
33
|
458 #define car(e) (heap[(int)(e)])
|
|
459
|
|
460 #define cadr(e) (heap[((int)(e))+1])
|
|
461
|
|
462 #define caddr(e) (heap[((int)(e))+2])
|
|
463
|
|
464 #define cadddr(e) (heap[((int)(e))+3])
|
|
465
|
195
|
466 #if FLOAT_CODE
|
81
|
467 #define dcadr(e) (*(double*)&heap[((int)(e))+1])
|
|
468 #define dcaddr(e) (*(double*)&heap[((int)(e))+2])
|
195
|
469 #endif
|
|
470
|
|
471 #if LONGLONG_CODE
|
|
472 #define lcadr(e) (*(long long*)&heap[((int)(e))+1])
|
|
473 #define lcaddr(e) (*(long long*)&heap[((int)(e))+2])
|
|
474 #endif
|
81
|
475
|
33
|
476 /* end */
|