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