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