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