Mercurial > hg > CbC > old > device
annotate mc.h @ 635:e4fffa4bf9cf
Intel Mac complete
author | kono |
---|---|
date | Wed, 11 Oct 2006 17:09:48 +0900 |
parents | 2ba903c8e749 |
children | 0d7baf338fc2 |
rev | line source |
---|---|
0 | 1 /* Micro-C header file */ |
2 | |
607 | 3 |
4 /************************************************************************ | |
5 ** Copyright (C) 2006 Shinji Kono | |
6 ** 連絡先: 琉球大学情報工学科 河野 真治 | |
7 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp) | |
8 ** | |
9 ** このソースのいかなる複写,改変,修正も許諾します。ただし、 | |
10 ** その際には、誰が貢献したを示すこの部分を残すこと。 | |
11 ** 再配布や雑誌の付録などの問い合わせも必要ありません。 | |
12 ** 営利利用も上記に反しない範囲で許可します。 | |
13 ** バイナリの配布の際にはversion messageを保存することを条件とします。 | |
14 ** このプログラムについては特に何の保証もしない、悪しからず。 | |
15 ** | |
16 ** Everyone is permitted to do anything on this program | |
17 ** including copying, modifying, improving, | |
18 ** as long as you don't try to pretend that you wrote it. | |
19 ** i.e., the above copyright notice has to appear in all copies. | |
20 ** Binary distribution requires original version messages. | |
21 ** You don't have to ask before copying, redistribution or publishing. | |
22 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. | |
23 ***********************************************************************/ | |
24 | |
195 | 25 #define FLOAT_CODE 1 |
237 | 26 #define LONGLONG_CODE 1 |
292 | 27 #define CASE_CODE 1 |
316 | 28 #define ASM_CODE 1 |
329 | 29 #define BIT_FIELD_CODE 1 |
195 | 30 |
164 | 31 /* reserved word start */ |
32 | |
482 | 33 /* type ( keyword ) */ |
34 | |
327 | 35 #define INT (-1) |
36 #define UNSIGNED (-2) | |
37 #define CHAR (-3) | |
38 #define UCHAR (-4) | |
162 | 39 #define POINTER (-5) |
327 | 40 #define ARRAY (-6) |
41 #define STRUCT (-7) | |
42 #define UNION (-8) | |
43 #define FUNCTION (-9) | |
0 | 44 |
482 | 45 #define SIGNED (-10) |
46 #define LONG (-11) | |
47 #define SHORT (-12) | |
48 #define USHORT (-13) | |
49 #define VOID (-14) | |
50 #define CODE (-15) | |
51 #define ENUM (-16) | |
52 | |
53 #define FLOAT (-17) | |
54 #define DOUBLE (-18) | |
55 #define LONGLONG (-19) | |
56 #define ULONGLONG (-20) | |
57 | |
58 /* type qualifier */ | |
59 | |
60 #define KONST (-21) | |
61 #define STATIC (-22) | |
62 #define EXTRN (-23) | |
63 #define EXTRN1 (-24) | |
64 #define VOLATILE (-25) | |
65 #define RESTRICT (-26) | |
66 #define INLINE (-27) | |
67 #define REGISTER (-28) | |
68 #define FREGISTER (-29) | |
69 #define DREGISTER (-30) | |
70 #define LREGISTER (-31) | |
609 | 71 #define POSSIBLE_VALUES (-32) |
482 | 72 |
609 | 73 #define DOTS (-33) |
0 | 74 |
482 | 75 /* keyword */ |
76 | |
609 | 77 #define GOTO (-34) |
78 #define RETURN (-35) | |
79 #define BREAK (-36) | |
80 #define CONTINUE (-37) | |
81 #define IF (-38) | |
82 #define ELSE (-39) | |
83 #define FOR (-40) | |
84 #define DO (-41) | |
85 #define WHILE (-42) | |
86 #define SWITCH (-43) | |
87 #define CASE (-44) | |
88 #define DEFAULT (-45) | |
89 #define RESERVE (-46) | |
90 #define TAG (-47) | |
91 #define FIELD (-48) | |
92 #define IDENT (-49) | |
93 #define MACRO (-50) | |
94 #define BLABEL (-51) | |
95 #define FLABEL (-52) | |
96 #define TYPEDEF (-53) | |
97 #define SIZEOF (-54) | |
98 #define TYPE (-55) | |
99 #define DEFINED (-56) | |
482 | 100 |
609 | 101 #define ENVIRONMENT (-57) |
482 | 102 |
609 | 103 #define FMACRO (-58) |
104 #define LMACRO (-59) | |
482 | 105 |
609 | 106 #define TYPEOF (-60) |
107 #define ASM (-61) | |
164 | 108 |
609 | 109 #define C_FILE (-62) |
110 #define C_FUNCTION (-63) | |
111 #define C_LINE (-64) | |
544 | 112 |
164 | 113 /* reserved word end */ |
78 | 114 |
327 | 115 #define EMPTY (-99) |
103 | 116 |
164 | 117 /* mode start */ |
327 | 118 #define TOP 0 |
119 #define GDECL 1 | |
120 #define GSDECL 2 | |
121 #define GUDECL 3 | |
122 #define ADECL 4 | |
123 #define LDECL 5 | |
124 #define LSDECL 6 | |
125 #define LUDECL 7 | |
0 | 126 #define STADECL 8 |
327 | 127 #define STAT 9 |
128 #define GTDECL 10 | |
129 #define LTDECL 11 | |
130 #define IFDEF 12 | |
131 #define MDECL 13 | |
176 | 132 #define GEDECL 14 |
133 #define LEDECL 15 | |
362 | 134 #define LLDECL 16 |
135 #define SFDINIT 17 | |
164 | 136 /* mode end */ |
137 | |
327 | 138 #define US 1 |
139 #define AS 10000 | |
140 #define SOP 200 | |
141 #define COP 400 | |
142 #define DOP 600 | |
143 #define FOP 800 | |
144 #define LOP 1000 | |
164 | 145 |
146 /* tree node tags start */ | |
147 | |
316 | 148 #define LIST_ARGS(i) (i==FUNCTION||i==CODE||i==ASM) |
599 | 149 #define OP(i) (i%SOP) /* tag value without attribute */ |
150 #define OP_TAG(i) (((i)/SOP)*SOP) /* attribute of tag */ | |
164 | 151 |
152 /* nullary argments */ | |
0 | 153 |
327 | 154 #define GVAR 1 |
155 #define RGVAR 2 | |
156 #define URGVAR 3 | |
157 #define LVAR 4 | |
158 #define RLVAR 5 | |
159 #define URLVAR 6 | |
160 #define CRGVAR (COP+RGVAR) | |
161 #define CURGVAR (COP+URGVAR) | |
162 #define CRLVAR (COP+RLVAR) | |
163 #define CURLVAR (COP+URLVAR) | |
164 #define FRGVAR (FOP+RGVAR) | |
165 #define FRLVAR (FOP+RLVAR) | |
166 #define DRGVAR (DOP+RGVAR) | |
167 #define DRLVAR (DOP+RLVAR) | |
168 #define SRGVAR (SOP+RGVAR) | |
169 #define SURGVAR (SOP+URGVAR) | |
170 #define SRLVAR (SOP+RLVAR) | |
171 #define SURLVAR (SOP+URLVAR) | |
172 #define LRGVAR (LOP+RGVAR) | |
173 #define LURGVAR (LOP+URGVAR) | |
174 #define LRLVAR (LOP+RLVAR) | |
175 #define LURLVAR (LOP+URLVAR) | |
164 | 176 |
327 | 177 #define CONST 7 |
178 #define DCONST (DOP+CONST) | |
179 #define FCONST (FOP+CONST) | |
180 #define LCONST (LOP+CONST) | |
181 #define STRING 8 | |
182 #define FNAME 9 | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
183 #define LCALL 10 |
452 | 184 #define COMMENT 11 |
185 #define DECL 12 | |
186 #define COMP 13 | |
602 | 187 #define IVAR 14 |
188 #define RIVAR 15 | |
616 | 189 #define BUILTIN_INF 16 |
190 #define BUILTIN_INFF 17 | |
191 #define BUILTIN_INFL 18 | |
192 #define LABEL 19 | |
164 | 193 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
194 #define NULLARY_ARGS(i) (i==RETURN||i==ENVIRONMENT||i==LCALL||i==REGISTER||i==DREGISTER||i==FREGISTER||i==LREGISTER||(GVAR<=(i%SOP)&&(i%SOP)<=LABEL)) |
164 | 195 |
196 /* unary argments */ | |
197 | |
616 | 198 #define ADDRESS 20 |
199 #define MINUS 21 | |
200 #define LNOT 22 | |
201 #define BNOT 23 | |
202 #define INC 24 | |
203 #define PERIOD 25 | |
204 #define ARROW 26 | |
205 #define POSTINC 27 | |
206 #define UPOSTINC 28 | |
207 #define PREINC 29 | |
208 #define UPREINC 30 | |
209 #define POSTDEC 31 | |
210 #define UPOSTDEC 32 | |
211 #define PREDEC 33 | |
212 #define UPREDEC 34 | |
213 #define DEC 35 | |
196 | 214 #define CPOSTINC (COP+POSTINC) |
215 #define CUPOSTINC (COP+UPOSTINC) | |
216 #define CPREINC (COP+PREINC) | |
217 #define CUPREINC (COP+UPREINC) | |
218 #define CPOSTDEC (COP+POSTDEC) | |
219 #define CUPOSTDEC (COP+UPOSTDEC) | |
220 #define CPREDEC (COP+CPREDEC) | |
221 #define CUPREDEC (COP+UPREDEC) | |
222 #define SPOSTINC (SOP+POSTINC) | |
223 #define SUPOSTINC (SOP+UPOSTINC) | |
224 #define SPREINC (SOP+PREINC) | |
225 #define SUPREINC (SOP+UPREINC) | |
226 #define SPOSTDEC (SOP+POSTDEC) | |
227 #define SUPOSTDEC (SOP+UPOSTDEC) | |
228 #define SPREDEC (SOP+PREDEC) | |
229 #define SUPREDEC (SOP+UPREDEC) | |
327 | 230 #define FPOSTINC (FOP+POSTINC) |
231 #define FPREINC (FOP+PREINC) | |
232 #define DPOSTINC (DOP+POSTINC) | |
233 #define DPREINC (DOP+PREINC) | |
234 #define LPOSTINC (LOP+POSTINC) | |
235 #define LPREINC (LOP+PREINC) | |
236 #define LUPOSTINC (LOP+UPOSTINC) | |
237 #define LUPREINC (LOP+UPREINC) | |
616 | 238 #define INDIRECT 36 |
239 #define RINDIRECT 37 | |
240 #define URINDIRECT 38 | |
327 | 241 #define CRINDIRECT (COP+RINDIRECT) |
242 #define CURINDIRECT (COP+URINDIRECT) | |
243 #define SRINDIRECT (SOP+RINDIRECT) | |
244 #define SURINDIRECT (SOP+URINDIRECT) | |
245 #define FRINDIRECT (FOP+RINDIRECT) | |
246 #define DRINDIRECT (DOP+RINDIRECT) | |
247 #define LRINDIRECT (LOP+RINDIRECT) | |
248 #define LURINDIRECT (LOP+URINDIRECT) | |
616 | 249 #define RSTRUCT 39 |
250 #define ALLOCA 40 | |
251 #define BUILTINP 41 | |
252 #define BUILTIN_EXPECT 42 | |
253 #define BUILTIN_FABS 43 | |
254 #define BUILTIN_FABSF 44 | |
255 #define BUILTIN_FABSL 45 | |
256 #define ATTRIBUTE 46 | |
257 #define BIT_FIELD 47 | |
258 #define RBIT_FIELD 48 | |
259 #define BPREINC 49 | |
260 #define BPOSTINC 50 | |
261 #define CONV 51 | |
164 | 262 |
263 #define UNARY_ARGS(i) (ADDRESS<=(i%SOP)&&(i%SOP)<=CONV) | |
264 | |
265 /* binary argments */ | |
266 | |
616 | 267 #define MUL 52 |
268 #define UMUL 53 | |
269 #define DIV 54 | |
270 #define UDIV 55 | |
271 #define MOD 56 | |
272 #define UMOD 57 | |
273 #define ADD 58 | |
274 #define SUB 59 | |
275 #define CMP 60 | |
276 #define RSHIFT 61 | |
277 #define URSHIFT 62 | |
278 #define LSHIFT 63 | |
279 #define ULSHIFT 64 | |
280 #define GT 65 | |
281 #define UGT 66 | |
282 #define GE 67 | |
283 #define UGE 68 | |
284 #define LT 69 | |
285 #define ULT 70 | |
286 #define LE 71 | |
287 #define ULE 72 | |
288 #define EQ 73 | |
289 #define NEQ 74 | |
290 #define BAND 75 | |
291 #define EOR 76 | |
292 #define BOR 77 | |
293 #define LAND 78 | |
294 #define LOR 79 | |
295 #define ASS 80 | |
296 #define UCMP 81 | |
297 #define UCMPGE 82 | |
298 #define CMPGE 83 | |
299 #define CMPEQ 84 | |
300 #define CMPNEQ 85 | |
301 #define ASSOP 86 | |
302 #define UASSOP 87 | |
303 #define COMMA 88 | |
164 | 304 |
612 | 305 #define CASS (COP+ASS) |
306 #define CASSOP (COP+ASSOP) | |
307 #define CUASSOP (COP+UASSOP) | |
0 | 308 |
612 | 309 #define SASS (SOP+ASS) |
310 #define SASSOP (SOP+ASSOP) | |
311 #define SUASSOP (SOP+UASSOP) | |
164 | 312 |
327 | 313 #define DASS (DOP+ASS) |
314 #define DCMPGE (DOP+CMPGE) | |
315 #define DCMPEQ (DOP+CMPEQ) | |
316 #define DCMPNEQ (DOP+CMPNEQ) | |
317 #define DASSOP (DOP+ASSOP) | |
318 #define DCMP (DOP+CMP) | |
319 #define DMINUS (DOP+MINUS) | |
320 #define DMUL (DOP+MUL) | |
321 #define DDIV (DOP+DIV) | |
322 #define DADD (DOP+ADD) | |
323 #define DSUB (DOP+SUB) | |
164 | 324 |
327 | 325 #define FASS (FOP+ASS) |
326 #define FCMPGE (FOP+CMPGE) | |
327 #define FCMPEQ (FOP+CMPEQ) | |
328 #define FCMPNEQ (FOP+CMPNEQ) | |
329 #define FASSOP (FOP+ASSOP) | |
330 #define FCMP (FOP+CMP) | |
331 #define FMINUS (FOP+MINUS) | |
332 #define FMUL (FOP+MUL) | |
333 #define FDIV (FOP+DIV) | |
334 #define FADD (FOP+ADD) | |
335 #define FSUB (FOP+SUB) | |
78 | 336 |
327 | 337 #define LASS (LOP+CASS) |
338 #define LCMPGE (LOP+CMPGE) | |
339 #define LCMPEQ (LOP+CMPEQ) | |
340 #define LCMPNEQ (LOP+CMPNEQ) | |
195 | 341 #define LASSOP (LOP+CASSOP) |
164 | 342 #define LUASSOP (LOP+CUASSOP) |
327 | 343 #define LCMP (LOP+CMP) |
344 #define LMINUS (LOP+MINUS) | |
345 #define LMUL (LOP+MUL) | |
346 #define LDIV (LOP+DIV) | |
347 #define LUMUL (LOP+UMUL) | |
348 #define LUDIV (LOP+UDIV) | |
349 #define LADD (LOP+ADD) | |
350 #define LSUB (LOP+SUB) | |
81 | 351 |
195 | 352 |
327 | 353 #define LMOD (LOP+MOD) |
354 #define LUMOD (LOP+UMOD) | |
355 #define LLSHIFT (LOP+LSHIFT) | |
356 #define LULSHIFT (LOP+ULSHIFT) | |
357 #define LRSHIFT (LOP+RSHIFT) | |
358 #define LURSHIFT (LOP+URSHIFT) | |
359 #define LBAND (LOP+BAND) | |
360 #define LEOR (LOP+EOR) | |
361 #define LBOR (LOP+BOR) | |
195 | 362 |
616 | 363 #define BASS 89 |
364 #define BASSOP 90 | |
365 #define BFD_REPL 91 | |
195 | 366 |
616 | 367 #define JUMP 92 |
609 | 368 |
616 | 369 #define STASS 93 |
326 | 370 |
164 | 371 |
609 | 372 #define BINARY_ARGS(i) ((MUL<=(i%SOP)&&(i%SOP)<=STASS)) |
164 | 373 |
609 | 374 /* ternary argments */ |
164 | 375 |
616 | 376 #define COND 94 |
377 #define UCOND 95 | |
327 | 378 #define SCOND (SOP+COND) |
490 | 379 #define SUCOND (SOP+UCOND) |
327 | 380 #define DCOND (DOP+COND) |
381 #define FCOND (FOP+COND) | |
382 #define LCOND (LOP+COND) | |
490 | 383 #define LUCOND (LOP+UCOND) |
164 | 384 |
609 | 385 #define TERNARY_ARGS(i) (COND==(i%SOP)||UCOND==(i%SOP)) |
164 | 386 |
387 /* not appeared as tags */ | |
81 | 388 |
616 | 389 #define LPAR 96 |
390 #define RPAR 97 | |
391 #define LBRA 98 | |
392 #define RBRA 99 | |
393 #define LC 100 | |
394 #define RC 101 | |
395 #define COLON 102 | |
396 #define SM 103 | |
397 #define CNAME 104 | |
194 | 398 |
616 | 399 #define I2C 105 |
400 #define I2S 106 | |
401 #define I2I 107 | |
402 #define I2U 108 | |
403 #define I2D 109 | |
404 #define I2F 110 | |
405 #define I2LL 111 | |
406 #define I2ULL 112 | |
353 | 407 |
616 | 408 #define U2UC 113 |
409 #define U2US 114 | |
410 #define U2I 115 | |
411 #define U2U 116 | |
412 #define U2D 117 | |
413 #define U2F 118 | |
414 #define U2LL 119 | |
415 #define U2ULL 120 | |
353 | 416 |
194 | 417 |
327 | 418 #define D2I (DOP+I2I) |
419 #define D2U (DOP+I2U) | |
420 #define D2D (DOP+I2D) | |
421 #define D2F (DOP+I2F) | |
422 #define D2LL (DOP+I2LL) | |
423 #define D2ULL (DOP+I2ULL) | |
164 | 424 |
327 | 425 #define F2I (FOP+I2I) |
426 #define F2U (FOP+I2U) | |
427 #define F2D (FOP+I2D) | |
428 #define F2F (FOP+I2F) | |
429 #define F2LL (FOP+I2LL) | |
430 #define F2ULL (FOP+I2ULL) | |
194 | 431 |
327 | 432 #define LL2I (LOP+I2I) |
433 #define LL2U (LOP+I2U) | |
434 #define LL2D (LOP+I2D) | |
435 #define LL2F (LOP+I2F) | |
436 #define LL2LL (LOP+I2LL) | |
437 #define LL2ULL (LOP+I2ULL) | |
194 | 438 |
327 | 439 #define ULL2I (LOP+U2I) |
440 #define ULL2U (LOP+U2U) | |
441 #define ULL2D (LOP+U2D) | |
442 #define ULL2F (LOP+U2F) | |
443 #define ULL2LL (LOP+U2LL) | |
444 #define ULL2ULL (LOP+U2ULL) | |
194 | 445 |
164 | 446 /* tree node tags end */ |
447 | |
453 | 448 /* statement start */ |
449 | |
616 | 450 #define ST_DECL 121 |
451 #define ST_IF 122 | |
452 #define ST_DO 123 | |
453 #define ST_WHILE 124 | |
454 #define ST_FOR 125 | |
455 #define ST_SWITCH 126 | |
456 #define ST_COMP 127 | |
457 #define ST_BREAK 128 | |
458 #define ST_CONTINUE 129 | |
459 #define ST_CASE 130 | |
460 #define ST_DEFAULT 131 | |
461 #define ST_RETURN 132 | |
462 #define ST_GOTO 133 | |
463 #define ST_ASM 134 | |
464 #define ST_LABEL 135 | |
465 #define ST_OP 136 | |
466 #define ST_COMMENT 137 | |
453 | 467 |
509 | 468 #define IS_STATEMENT(i) (i==INLINE||(ST_DECL<=i&&i<=ST_COMMENT)) |
453 | 469 |
616 | 470 #define HAS_ADDRESS 138 |
526 | 471 |
453 | 472 /* statement end */ |
473 | |
164 | 474 /* error number start */ |
0 | 475 |
327 | 476 #define FILERR 1 |
477 #define DCERR 2 | |
478 #define RDERR 3 | |
479 #define STERR 4 | |
480 #define EXERR 5 | |
481 #define CNERR 6 | |
482 #define CHERR 7 | |
483 #define GSERR 8 | |
484 #define LSERR 9 | |
485 #define STRERR 10 | |
486 #define LNERR 11 | |
487 #define EOFERR 12 | |
488 #define MCERR 13 | |
489 #define INCERR 14 | |
490 #define HPERR 15 | |
491 #define TYERR 16 | |
492 #define LVERR 17 | |
493 #define UDERR 18 | |
494 #define OPTION 19 | |
495 #define REG_ERR 20 | |
389 | 496 #define RGERR 21 |
497 #define CODE_ERR 22 | |
498 #define MSERR 23 | |
499 #define BTERR 24 | |
500 #define HSERR 25 | |
501 #define NMERR 26 | |
502 #define MMERR 27 | |
503 #define INERR 28 | |
523 | 504 #define AGERR 29 |
505 #define ILERR 30 | |
558 | 506 #define CSERR 31 |
572 | 507 #define GTERR 32 |
508 #define FNERR 33 | |
509 #define UCERR 34 | |
510 #define UFERR 35 | |
574 | 511 #define ENERR 36 |
512 #define SIERR 37 | |
327 | 513 |
164 | 514 /* error number end */ |
0 | 515 |
526 | 516 /* ctmode bit */ |
517 | |
461 | 518 #define KONST_BIT 1 |
519 #define VOLATILE_BIT 2 | |
520 #define RESTRICT_BIT 4 | |
521 | |
25 | 522 #define FILES 10 |
327 | 523 #define MAX_INCLUDE_PATH_COUNT 10 |
448 | 524 /* |
525 For this comiler 8192*2 is Ok. Linux kernel requires 8192*4. | |
609 | 526 we need automatic increment of gsyms? |
448 | 527 */ |
609 | 528 #define GSYMS (8192*32) |
529 #define HEAPSIZE 120000 | |
452 | 530 #define CHEAPSIZE (sizeof(NMTBL)*8192) |
327 | 531 #define LBUFSIZE 4096 |
347 | 532 #define STRSIZE 4096 |
254 | 533 |
0 | 534 typedef struct nametable { |
327 | 535 char *nm; |
348 | 536 struct nametable *next; |
445 | 537 int sc,attr; |
538 int ty,dsp; } NMTBL; | |
0 | 539 |
452 | 540 extern int *heap; /* heap area (in cheap ) */ |
541 extern NMTBL *global_list; /* list of all global NMTBL */ | |
542 extern NMTBL *local_static_list; /* list of local static variable */ | |
0 | 543 |
195 | 544 #if FLOAT_CODE |
81 | 545 extern int dlist2(int e1, double e2); |
195 | 546 #endif |
547 #if LONGLONG_CODE | |
548 extern int llist2(int e1, long long e2); | |
549 #endif | |
61 | 550 extern int list2(int e1, int e2); |
551 extern int list3(int e1, int e2, int e3); | |
552 extern int list4(int e1, int e2, int e3,int e4); | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
553 extern int list5(int e1, int e2, int e3,int e4,int e5); |
318 | 554 extern int length(int e1); |
464 | 555 extern int getfree(int size); |
318 | 556 extern int nth(int n,int e1); |
61 | 557 extern int reverse0(int t1); |
558 extern int append4(int p,int a1,int a2,int a3); | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
559 extern int append5(int p,int a1,int a2,int a3,int a4); |
309 | 560 extern int insert_ascend(int p,int e,int eq()); |
61 | 561 |
347 | 562 extern void free_nptr(NMTBL *n); |
563 extern NMTBL *get_nptr(); | |
346 | 564 |
609 | 565 // mc-tree.c |
566 | |
567 extern void print_expr(int e, FILE *vout); | |
568 | |
590 | 569 #if 1 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
570 extern int heapsize; |
467 | 571 #define CHECK_HEAP(b) ({int _k=(int)(b);if(_k>heapsize||_k<0)error(-1);_k;}) |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
572 #else |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
573 #define CHECK_HEAP(b) (b) |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
574 #endif |
33 | 575 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
576 #define car(e) (heap[(int)(CHECK_HEAP(e))]) |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
577 |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
578 #define cadr(e) (heap[((int)(CHECK_HEAP(e)))+1]) |
33 | 579 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
580 #define caddr(e) (heap[((int)(CHECK_HEAP(e)))+2]) |
33 | 581 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
582 #define cadddr(e) (heap[((int)(CHECK_HEAP(e)))+3]) |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
583 |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
584 #define caddddr(e) (heap[((int)(CHECK_HEAP(e)))+4]) |
449 | 585 |
195 | 586 #if FLOAT_CODE |
81 | 587 #define dcadr(e) (*(double*)&heap[((int)(e))+1]) |
588 #define dcaddr(e) (*(double*)&heap[((int)(e))+2]) | |
195 | 589 #endif |
590 | |
591 #if LONGLONG_CODE | |
592 #define lcadr(e) (*(long long*)&heap[((int)(e))+1]) | |
593 #define lcaddr(e) (*(long long*)&heap[((int)(e))+2]) | |
594 #endif | |
81 | 595 |
33 | 596 /* end */ |