* expr.c (expand_expr) [MULT_EXPR]: Do not apply distributive law
[official-gcc.git] / gcc / f / bld.c
blob9161419bdc9ed68cd82eeb5ef33574a495a0ffbd
1 /* bld.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
3 Contributed by James Craig Burley.
5 This file is part of GNU Fortran.
7 GNU Fortran is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU Fortran is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Fortran; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
22 Related Modules:
23 None
25 Description:
26 The primary "output" of the FFE includes ffebld objects, which
27 connect expressions, operators, and operands together, along with
28 connecting lists of expressions together for argument or dimension
29 lists.
31 Modifications:
32 30-Aug-92 JCB 1.1
33 Change names of some things for consistency.
36 /* Include files. */
38 #include "proj.h"
39 #include "bld.h"
40 #include "bit.h"
41 #include "info.h"
42 #include "lex.h"
43 #include "malloc.h"
44 #include "target.h"
45 #include "where.h"
47 /* Externals defined here. */
49 const ffebldArity ffebld_arity_op_[(int) FFEBLD_op]
52 #define FFEBLD_OP(KWD,NAME,ARITY) ARITY,
53 #include "bld-op.def"
54 #undef FFEBLD_OP
56 struct _ffebld_pool_stack_ ffebld_pool_stack_;
58 /* Simple definitions and enumerations. */
61 /* Internal typedefs. */
64 /* Private include files. */
67 /* Internal structure definitions. */
70 /* Static objects accessed by functions in this module. */
72 #if FFEBLD_BLANK_
73 static struct _ffebld_ ffebld_blank_
77 {FFEINFO_basictypeNONE, FFEINFO_kindtypeNONE, 0, FFEINFO_kindNONE,
78 FFEINFO_whereNONE, FFETARGET_charactersizeNONE},
79 {NULL, NULL}
81 #endif
82 #if FFETARGET_okCHARACTER1
83 static ffebldConstant ffebld_constant_character1_;
84 #endif
85 #if FFETARGET_okCHARACTER2
86 static ffebldConstant ffebld_constant_character2_;
87 #endif
88 #if FFETARGET_okCHARACTER3
89 static ffebldConstant ffebld_constant_character3_;
90 #endif
91 #if FFETARGET_okCHARACTER4
92 static ffebldConstant ffebld_constant_character4_;
93 #endif
94 #if FFETARGET_okCHARACTER5
95 static ffebldConstant ffebld_constant_character5_;
96 #endif
97 #if FFETARGET_okCHARACTER6
98 static ffebldConstant ffebld_constant_character6_;
99 #endif
100 #if FFETARGET_okCHARACTER7
101 static ffebldConstant ffebld_constant_character7_;
102 #endif
103 #if FFETARGET_okCHARACTER8
104 static ffebldConstant ffebld_constant_character8_;
105 #endif
106 #if FFETARGET_okCOMPLEX1
107 static ffebldConstant ffebld_constant_complex1_;
108 #endif
109 #if FFETARGET_okCOMPLEX2
110 static ffebldConstant ffebld_constant_complex2_;
111 #endif
112 #if FFETARGET_okCOMPLEX3
113 static ffebldConstant ffebld_constant_complex3_;
114 #endif
115 #if FFETARGET_okCOMPLEX4
116 static ffebldConstant ffebld_constant_complex4_;
117 #endif
118 #if FFETARGET_okCOMPLEX5
119 static ffebldConstant ffebld_constant_complex5_;
120 #endif
121 #if FFETARGET_okCOMPLEX6
122 static ffebldConstant ffebld_constant_complex6_;
123 #endif
124 #if FFETARGET_okCOMPLEX7
125 static ffebldConstant ffebld_constant_complex7_;
126 #endif
127 #if FFETARGET_okCOMPLEX8
128 static ffebldConstant ffebld_constant_complex8_;
129 #endif
130 #if FFETARGET_okINTEGER1
131 static ffebldConstant ffebld_constant_integer1_;
132 #endif
133 #if FFETARGET_okINTEGER2
134 static ffebldConstant ffebld_constant_integer2_;
135 #endif
136 #if FFETARGET_okINTEGER3
137 static ffebldConstant ffebld_constant_integer3_;
138 #endif
139 #if FFETARGET_okINTEGER4
140 static ffebldConstant ffebld_constant_integer4_;
141 #endif
142 #if FFETARGET_okINTEGER5
143 static ffebldConstant ffebld_constant_integer5_;
144 #endif
145 #if FFETARGET_okINTEGER6
146 static ffebldConstant ffebld_constant_integer6_;
147 #endif
148 #if FFETARGET_okINTEGER7
149 static ffebldConstant ffebld_constant_integer7_;
150 #endif
151 #if FFETARGET_okINTEGER8
152 static ffebldConstant ffebld_constant_integer8_;
153 #endif
154 #if FFETARGET_okLOGICAL1
155 static ffebldConstant ffebld_constant_logical1_;
156 #endif
157 #if FFETARGET_okLOGICAL2
158 static ffebldConstant ffebld_constant_logical2_;
159 #endif
160 #if FFETARGET_okLOGICAL3
161 static ffebldConstant ffebld_constant_logical3_;
162 #endif
163 #if FFETARGET_okLOGICAL4
164 static ffebldConstant ffebld_constant_logical4_;
165 #endif
166 #if FFETARGET_okLOGICAL5
167 static ffebldConstant ffebld_constant_logical5_;
168 #endif
169 #if FFETARGET_okLOGICAL6
170 static ffebldConstant ffebld_constant_logical6_;
171 #endif
172 #if FFETARGET_okLOGICAL7
173 static ffebldConstant ffebld_constant_logical7_;
174 #endif
175 #if FFETARGET_okLOGICAL8
176 static ffebldConstant ffebld_constant_logical8_;
177 #endif
178 #if FFETARGET_okREAL1
179 static ffebldConstant ffebld_constant_real1_;
180 #endif
181 #if FFETARGET_okREAL2
182 static ffebldConstant ffebld_constant_real2_;
183 #endif
184 #if FFETARGET_okREAL3
185 static ffebldConstant ffebld_constant_real3_;
186 #endif
187 #if FFETARGET_okREAL4
188 static ffebldConstant ffebld_constant_real4_;
189 #endif
190 #if FFETARGET_okREAL5
191 static ffebldConstant ffebld_constant_real5_;
192 #endif
193 #if FFETARGET_okREAL6
194 static ffebldConstant ffebld_constant_real6_;
195 #endif
196 #if FFETARGET_okREAL7
197 static ffebldConstant ffebld_constant_real7_;
198 #endif
199 #if FFETARGET_okREAL8
200 static ffebldConstant ffebld_constant_real8_;
201 #endif
202 static ffebldConstant ffebld_constant_hollerith_;
203 static ffebldConstant ffebld_constant_typeless_[FFEBLD_constTYPELESS_LAST
204 - FFEBLD_constTYPELESS_FIRST + 1];
206 static const char *const ffebld_op_string_[]
209 #define FFEBLD_OP(KWD,NAME,ARITY) NAME,
210 #include "bld-op.def"
211 #undef FFEBLD_OP
214 /* Static functions (internal). */
217 /* Internal macros. */
219 #define integerdefault_ CATX(integer,FFETARGET_ktINTEGERDEFAULT)
220 #define logicaldefault_ CATX(logical,FFETARGET_ktLOGICALDEFAULT)
221 #define realdefault_ CATX(real,FFETARGET_ktREALDEFAULT)
222 #define realdouble_ CATX(real,FFETARGET_ktREALDOUBLE)
223 #define realquad_ CATX(real,FFETARGET_ktREALQUAD)
225 /* ffebld_constant_cmp -- Compare two constants a la strcmp
227 ffebldConstant c1, c2;
228 if (ffebld_constant_cmp(c1,c2) == 0)
229 // they're equal, else they're not.
231 Returns -1 if c1 < c2, 0 if c1 == c2, +1 if c1 == c2. */
234 ffebld_constant_cmp (ffebldConstant c1, ffebldConstant c2)
236 if (c1 == c2)
237 return 0;
239 assert (ffebld_constant_type (c1) == ffebld_constant_type (c2));
241 switch (ffebld_constant_type (c1))
243 #if FFETARGET_okINTEGER1
244 case FFEBLD_constINTEGER1:
245 return ffetarget_cmp_integer1 (ffebld_constant_integer1 (c1),
246 ffebld_constant_integer1 (c2));
247 #endif
249 #if FFETARGET_okINTEGER2
250 case FFEBLD_constINTEGER2:
251 return ffetarget_cmp_integer2 (ffebld_constant_integer2 (c1),
252 ffebld_constant_integer2 (c2));
253 #endif
255 #if FFETARGET_okINTEGER3
256 case FFEBLD_constINTEGER3:
257 return ffetarget_cmp_integer3 (ffebld_constant_integer3 (c1),
258 ffebld_constant_integer3 (c2));
259 #endif
261 #if FFETARGET_okINTEGER4
262 case FFEBLD_constINTEGER4:
263 return ffetarget_cmp_integer4 (ffebld_constant_integer4 (c1),
264 ffebld_constant_integer4 (c2));
265 #endif
267 #if FFETARGET_okINTEGER5
268 case FFEBLD_constINTEGER5:
269 return ffetarget_cmp_integer5 (ffebld_constant_integer5 (c1),
270 ffebld_constant_integer5 (c2));
271 #endif
273 #if FFETARGET_okINTEGER6
274 case FFEBLD_constINTEGER6:
275 return ffetarget_cmp_integer6 (ffebld_constant_integer6 (c1),
276 ffebld_constant_integer6 (c2));
277 #endif
279 #if FFETARGET_okINTEGER7
280 case FFEBLD_constINTEGER7:
281 return ffetarget_cmp_integer7 (ffebld_constant_integer7 (c1),
282 ffebld_constant_integer7 (c2));
283 #endif
285 #if FFETARGET_okINTEGER8
286 case FFEBLD_constINTEGER8:
287 return ffetarget_cmp_integer8 (ffebld_constant_integer8 (c1),
288 ffebld_constant_integer8 (c2));
289 #endif
291 #if FFETARGET_okLOGICAL1
292 case FFEBLD_constLOGICAL1:
293 return ffetarget_cmp_logical1 (ffebld_constant_logical1 (c1),
294 ffebld_constant_logical1 (c2));
295 #endif
297 #if FFETARGET_okLOGICAL2
298 case FFEBLD_constLOGICAL2:
299 return ffetarget_cmp_logical2 (ffebld_constant_logical2 (c1),
300 ffebld_constant_logical2 (c2));
301 #endif
303 #if FFETARGET_okLOGICAL3
304 case FFEBLD_constLOGICAL3:
305 return ffetarget_cmp_logical3 (ffebld_constant_logical3 (c1),
306 ffebld_constant_logical3 (c2));
307 #endif
309 #if FFETARGET_okLOGICAL4
310 case FFEBLD_constLOGICAL4:
311 return ffetarget_cmp_logical4 (ffebld_constant_logical4 (c1),
312 ffebld_constant_logical4 (c2));
313 #endif
315 #if FFETARGET_okLOGICAL5
316 case FFEBLD_constLOGICAL5:
317 return ffetarget_cmp_logical5 (ffebld_constant_logical5 (c1),
318 ffebld_constant_logical5 (c2));
319 #endif
321 #if FFETARGET_okLOGICAL6
322 case FFEBLD_constLOGICAL6:
323 return ffetarget_cmp_logical6 (ffebld_constant_logical6 (c1),
324 ffebld_constant_logical6 (c2));
325 #endif
327 #if FFETARGET_okLOGICAL7
328 case FFEBLD_constLOGICAL7:
329 return ffetarget_cmp_logical7 (ffebld_constant_logical7 (c1),
330 ffebld_constant_logical7 (c2));
331 #endif
333 #if FFETARGET_okLOGICAL8
334 case FFEBLD_constLOGICAL8:
335 return ffetarget_cmp_logical8 (ffebld_constant_logical8 (c1),
336 ffebld_constant_logical8 (c2));
337 #endif
339 #if FFETARGET_okREAL1
340 case FFEBLD_constREAL1:
341 return ffetarget_cmp_real1 (ffebld_constant_real1 (c1),
342 ffebld_constant_real1 (c2));
343 #endif
345 #if FFETARGET_okREAL2
346 case FFEBLD_constREAL2:
347 return ffetarget_cmp_real2 (ffebld_constant_real2 (c1),
348 ffebld_constant_real2 (c2));
349 #endif
351 #if FFETARGET_okREAL3
352 case FFEBLD_constREAL3:
353 return ffetarget_cmp_real3 (ffebld_constant_real3 (c1),
354 ffebld_constant_real3 (c2));
355 #endif
357 #if FFETARGET_okREAL4
358 case FFEBLD_constREAL4:
359 return ffetarget_cmp_real4 (ffebld_constant_real4 (c1),
360 ffebld_constant_real4 (c2));
361 #endif
363 #if FFETARGET_okREAL5
364 case FFEBLD_constREAL5:
365 return ffetarget_cmp_real5 (ffebld_constant_real5 (c1),
366 ffebld_constant_real5 (c2));
367 #endif
369 #if FFETARGET_okREAL6
370 case FFEBLD_constREAL6:
371 return ffetarget_cmp_real6 (ffebld_constant_real6 (c1),
372 ffebld_constant_real6 (c2));
373 #endif
375 #if FFETARGET_okREAL7
376 case FFEBLD_constREAL7:
377 return ffetarget_cmp_real7 (ffebld_constant_real7 (c1),
378 ffebld_constant_real7 (c2));
379 #endif
381 #if FFETARGET_okREAL8
382 case FFEBLD_constREAL8:
383 return ffetarget_cmp_real8 (ffebld_constant_real8 (c1),
384 ffebld_constant_real8 (c2));
385 #endif
387 #if FFETARGET_okCHARACTER1
388 case FFEBLD_constCHARACTER1:
389 return ffetarget_cmp_character1 (ffebld_constant_character1 (c1),
390 ffebld_constant_character1 (c2));
391 #endif
393 #if FFETARGET_okCHARACTER2
394 case FFEBLD_constCHARACTER2:
395 return ffetarget_cmp_character2 (ffebld_constant_character2 (c1),
396 ffebld_constant_character2 (c2));
397 #endif
399 #if FFETARGET_okCHARACTER3
400 case FFEBLD_constCHARACTER3:
401 return ffetarget_cmp_character3 (ffebld_constant_character3 (c1),
402 ffebld_constant_character3 (c2));
403 #endif
405 #if FFETARGET_okCHARACTER4
406 case FFEBLD_constCHARACTER4:
407 return ffetarget_cmp_character4 (ffebld_constant_character4 (c1),
408 ffebld_constant_character4 (c2));
409 #endif
411 #if FFETARGET_okCHARACTER5
412 case FFEBLD_constCHARACTER5:
413 return ffetarget_cmp_character5 (ffebld_constant_character5 (c1),
414 ffebld_constant_character5 (c2));
415 #endif
417 #if FFETARGET_okCHARACTER6
418 case FFEBLD_constCHARACTER6:
419 return ffetarget_cmp_character6 (ffebld_constant_character6 (c1),
420 ffebld_constant_character6 (c2));
421 #endif
423 #if FFETARGET_okCHARACTER7
424 case FFEBLD_constCHARACTER7:
425 return ffetarget_cmp_character7 (ffebld_constant_character7 (c1),
426 ffebld_constant_character7 (c2));
427 #endif
429 #if FFETARGET_okCHARACTER8
430 case FFEBLD_constCHARACTER8:
431 return ffetarget_cmp_character8 (ffebld_constant_character8 (c1),
432 ffebld_constant_character8 (c2));
433 #endif
435 default:
436 assert ("bad constant type" == NULL);
437 return 0;
441 /* ffebld_constant_is_magical -- Determine if integer is "magical"
443 ffebldConstant c;
444 if (ffebld_constant_is_magical(c))
445 // it is 2**(n-1), where n is # bits in ffetargetIntegerDefault type
446 // (this test is important for 2's-complement machines only). */
448 bool
449 ffebld_constant_is_magical (ffebldConstant c)
451 switch (ffebld_constant_type (c))
453 case FFEBLD_constINTEGERDEFAULT:
454 return ffetarget_integerdefault_is_magical (ffebld_constant_integer1 (c));
456 default:
457 return FALSE;
461 /* Determine if constant is zero. Used to ensure step count
462 for DO loops isn't zero, also to determine if values will
463 be binary zeros, so not entirely portable at this point. */
465 bool
466 ffebld_constant_is_zero (ffebldConstant c)
468 switch (ffebld_constant_type (c))
470 #if FFETARGET_okINTEGER1
471 case FFEBLD_constINTEGER1:
472 return ffebld_constant_integer1 (c) == 0;
473 #endif
475 #if FFETARGET_okINTEGER2
476 case FFEBLD_constINTEGER2:
477 return ffebld_constant_integer2 (c) == 0;
478 #endif
480 #if FFETARGET_okINTEGER3
481 case FFEBLD_constINTEGER3:
482 return ffebld_constant_integer3 (c) == 0;
483 #endif
485 #if FFETARGET_okINTEGER4
486 case FFEBLD_constINTEGER4:
487 return ffebld_constant_integer4 (c) == 0;
488 #endif
490 #if FFETARGET_okINTEGER5
491 case FFEBLD_constINTEGER5:
492 return ffebld_constant_integer5 (c) == 0;
493 #endif
495 #if FFETARGET_okINTEGER6
496 case FFEBLD_constINTEGER6:
497 return ffebld_constant_integer6 (c) == 0;
498 #endif
500 #if FFETARGET_okINTEGER7
501 case FFEBLD_constINTEGER7:
502 return ffebld_constant_integer7 (c) == 0;
503 #endif
505 #if FFETARGET_okINTEGER8
506 case FFEBLD_constINTEGER8:
507 return ffebld_constant_integer8 (c) == 0;
508 #endif
510 #if FFETARGET_okLOGICAL1
511 case FFEBLD_constLOGICAL1:
512 return ffebld_constant_logical1 (c) == 0;
513 #endif
515 #if FFETARGET_okLOGICAL2
516 case FFEBLD_constLOGICAL2:
517 return ffebld_constant_logical2 (c) == 0;
518 #endif
520 #if FFETARGET_okLOGICAL3
521 case FFEBLD_constLOGICAL3:
522 return ffebld_constant_logical3 (c) == 0;
523 #endif
525 #if FFETARGET_okLOGICAL4
526 case FFEBLD_constLOGICAL4:
527 return ffebld_constant_logical4 (c) == 0;
528 #endif
530 #if FFETARGET_okLOGICAL5
531 case FFEBLD_constLOGICAL5:
532 return ffebld_constant_logical5 (c) == 0;
533 #endif
535 #if FFETARGET_okLOGICAL6
536 case FFEBLD_constLOGICAL6:
537 return ffebld_constant_logical6 (c) == 0;
538 #endif
540 #if FFETARGET_okLOGICAL7
541 case FFEBLD_constLOGICAL7:
542 return ffebld_constant_logical7 (c) == 0;
543 #endif
545 #if FFETARGET_okLOGICAL8
546 case FFEBLD_constLOGICAL8:
547 return ffebld_constant_logical8 (c) == 0;
548 #endif
550 #if FFETARGET_okREAL1
551 case FFEBLD_constREAL1:
552 return ffetarget_iszero_real1 (ffebld_constant_real1 (c));
553 #endif
555 #if FFETARGET_okREAL2
556 case FFEBLD_constREAL2:
557 return ffetarget_iszero_real2 (ffebld_constant_real2 (c));
558 #endif
560 #if FFETARGET_okREAL3
561 case FFEBLD_constREAL3:
562 return ffetarget_iszero_real3 (ffebld_constant_real3 (c));
563 #endif
565 #if FFETARGET_okREAL4
566 case FFEBLD_constREAL4:
567 return ffetarget_iszero_real4 (ffebld_constant_real4 (c));
568 #endif
570 #if FFETARGET_okREAL5
571 case FFEBLD_constREAL5:
572 return ffetarget_iszero_real5 (ffebld_constant_real5 (c));
573 #endif
575 #if FFETARGET_okREAL6
576 case FFEBLD_constREAL6:
577 return ffetarget_iszero_real6 (ffebld_constant_real6 (c));
578 #endif
580 #if FFETARGET_okREAL7
581 case FFEBLD_constREAL7:
582 return ffetarget_iszero_real7 (ffebld_constant_real7 (c));
583 #endif
585 #if FFETARGET_okREAL8
586 case FFEBLD_constREAL8:
587 return ffetarget_iszero_real8 (ffebld_constant_real8 (c));
588 #endif
590 #if FFETARGET_okCOMPLEX1
591 case FFEBLD_constCOMPLEX1:
592 return ffetarget_iszero_real1 (ffebld_constant_complex1 (c).real)
593 && ffetarget_iszero_real1 (ffebld_constant_complex1 (c).imaginary);
594 #endif
596 #if FFETARGET_okCOMPLEX2
597 case FFEBLD_constCOMPLEX2:
598 return ffetarget_iszero_real2 (ffebld_constant_complex2 (c).real)
599 && ffetarget_iszero_real2 (ffebld_constant_complex2 (c).imaginary);
600 #endif
602 #if FFETARGET_okCOMPLEX3
603 case FFEBLD_constCOMPLEX3:
604 return ffetarget_iszero_real3 (ffebld_constant_complex3 (c).real)
605 && ffetarget_iszero_real3 (ffebld_constant_complex3 (c).imaginary);
606 #endif
608 #if FFETARGET_okCOMPLEX4
609 case FFEBLD_constCOMPLEX4:
610 return ffetarget_iszero_real4 (ffebld_constant_complex4 (c).real)
611 && ffetarget_iszero_real4 (ffebld_constant_complex4 (c).imaginary);
612 #endif
614 #if FFETARGET_okCOMPLEX5
615 case FFEBLD_constCOMPLEX5:
616 return ffetarget_iszero_real5 (ffebld_constant_complex5 (c).real)
617 && ffetarget_iszero_real5 (ffebld_constant_complex5 (c).imaginary);
618 #endif
620 #if FFETARGET_okCOMPLEX6
621 case FFEBLD_constCOMPLEX6:
622 return ffetarget_iszero_real6 (ffebld_constant_complex6 (c).real)
623 && ffetarget_iszero_real6 (ffebld_constant_complex6 (c).imaginary);
624 #endif
626 #if FFETARGET_okCOMPLEX7
627 case FFEBLD_constCOMPLEX7:
628 return ffetarget_iszero_real7 (ffebld_constant_complex7 (c).real)
629 && ffetarget_iszero_real7 (ffebld_constant_complex7 (c).imaginary);
630 #endif
632 #if FFETARGET_okCOMPLEX8
633 case FFEBLD_constCOMPLEX8:
634 return ffetarget_iszero_real8 (ffebld_constant_complex8 (c).real)
635 && ffetarget_iszero_real8 (ffebld_constant_complex8 (c).imaginary);
636 #endif
638 #if FFETARGET_okCHARACTER1
639 case FFEBLD_constCHARACTER1:
640 return ffetarget_iszero_character1 (ffebld_constant_character1 (c));
641 #endif
643 #if FFETARGET_okCHARACTER2 || FFETARGET_okCHARACTER3 /* ... */
644 #error "no support for these!!"
645 #endif
647 case FFEBLD_constHOLLERITH:
648 return ffetarget_iszero_hollerith (ffebld_constant_hollerith (c));
650 case FFEBLD_constBINARY_MIL:
651 case FFEBLD_constBINARY_VXT:
652 case FFEBLD_constOCTAL_MIL:
653 case FFEBLD_constOCTAL_VXT:
654 case FFEBLD_constHEX_X_MIL:
655 case FFEBLD_constHEX_X_VXT:
656 case FFEBLD_constHEX_Z_MIL:
657 case FFEBLD_constHEX_Z_VXT:
658 return ffetarget_iszero_typeless (ffebld_constant_typeless (c));
660 default:
661 return FALSE;
665 /* ffebld_constant_new_character1 -- Return character1 constant object from token
667 See prototype. */
669 #if FFETARGET_okCHARACTER1
670 ffebldConstant
671 ffebld_constant_new_character1 (ffelexToken t)
673 ffetargetCharacter1 val;
675 ffetarget_character1 (&val, t, ffebld_constant_pool());
676 return ffebld_constant_new_character1_val (val);
679 #endif
680 /* ffebld_constant_new_character1_val -- Return an character1 constant object
682 See prototype. */
684 #if FFETARGET_okCHARACTER1
685 ffebldConstant
686 ffebld_constant_new_character1_val (ffetargetCharacter1 val)
688 ffebldConstant c;
689 ffebldConstant nc;
690 int cmp;
692 ffetarget_verify_character1 (ffebld_constant_pool(), val);
694 for (c = (ffebldConstant) &ffebld_constant_character1_;
695 c->next != NULL;
696 c = c->next)
698 malloc_verify_kp (ffebld_constant_pool(),
699 c->next,
700 sizeof (*(c->next)));
701 ffetarget_verify_character1 (ffebld_constant_pool(),
702 ffebld_constant_character1 (c->next));
703 cmp = ffetarget_cmp_character1 (val,
704 ffebld_constant_character1 (c->next));
705 if (cmp == 0)
706 return c->next;
707 if (cmp > 0)
708 break;
711 nc = malloc_new_kp (ffebld_constant_pool(),
712 "FFEBLD_constCHARACTER1",
713 sizeof (*nc));
714 nc->next = c->next;
715 nc->consttype = FFEBLD_constCHARACTER1;
716 nc->u.character1 = val;
717 #ifdef FFECOM_constantHOOK
718 nc->hook = FFECOM_constantNULL;
719 #endif
720 c->next = nc;
722 return nc;
725 #endif
726 /* ffebld_constant_new_complex1 -- Return complex1 constant object from token
728 See prototype. */
730 #if FFETARGET_okCOMPLEX1
731 ffebldConstant
732 ffebld_constant_new_complex1 (ffebldConstant real,
733 ffebldConstant imaginary)
735 ffetargetComplex1 val;
737 val.real = ffebld_constant_real1 (real);
738 val.imaginary = ffebld_constant_real1 (imaginary);
739 return ffebld_constant_new_complex1_val (val);
742 #endif
743 /* ffebld_constant_new_complex1_val -- Return a complex1 constant object
745 See prototype. */
747 #if FFETARGET_okCOMPLEX1
748 ffebldConstant
749 ffebld_constant_new_complex1_val (ffetargetComplex1 val)
751 ffebldConstant c;
752 ffebldConstant nc;
753 int cmp;
755 for (c = (ffebldConstant) &ffebld_constant_complex1_;
756 c->next != NULL;
757 c = c->next)
759 cmp = ffetarget_cmp_real1 (val.real, ffebld_constant_complex1 (c->next).real);
760 if (cmp == 0)
761 cmp = ffetarget_cmp_real1 (val.imaginary,
762 ffebld_constant_complex1 (c->next).imaginary);
763 if (cmp == 0)
764 return c->next;
765 if (cmp > 0)
766 break;
769 nc = malloc_new_kp (ffebld_constant_pool(),
770 "FFEBLD_constCOMPLEX1",
771 sizeof (*nc));
772 nc->next = c->next;
773 nc->consttype = FFEBLD_constCOMPLEX1;
774 nc->u.complex1 = val;
775 #ifdef FFECOM_constantHOOK
776 nc->hook = FFECOM_constantNULL;
777 #endif
778 c->next = nc;
780 return nc;
783 #endif
784 /* ffebld_constant_new_complex2 -- Return complex2 constant object from token
786 See prototype. */
788 #if FFETARGET_okCOMPLEX2
789 ffebldConstant
790 ffebld_constant_new_complex2 (ffebldConstant real,
791 ffebldConstant imaginary)
793 ffetargetComplex2 val;
795 val.real = ffebld_constant_real2 (real);
796 val.imaginary = ffebld_constant_real2 (imaginary);
797 return ffebld_constant_new_complex2_val (val);
800 #endif
801 /* ffebld_constant_new_complex2_val -- Return a complex2 constant object
803 See prototype. */
805 #if FFETARGET_okCOMPLEX2
806 ffebldConstant
807 ffebld_constant_new_complex2_val (ffetargetComplex2 val)
809 ffebldConstant c;
810 ffebldConstant nc;
811 int cmp;
813 for (c = (ffebldConstant) &ffebld_constant_complex2_;
814 c->next != NULL;
815 c = c->next)
817 cmp = ffetarget_cmp_real2 (val.real, ffebld_constant_complex2 (c->next).real);
818 if (cmp == 0)
819 cmp = ffetarget_cmp_real2 (val.imaginary,
820 ffebld_constant_complex2 (c->next).imaginary);
821 if (cmp == 0)
822 return c->next;
823 if (cmp > 0)
824 break;
827 nc = malloc_new_kp (ffebld_constant_pool(),
828 "FFEBLD_constCOMPLEX2",
829 sizeof (*nc));
830 nc->next = c->next;
831 nc->consttype = FFEBLD_constCOMPLEX2;
832 nc->u.complex2 = val;
833 #ifdef FFECOM_constantHOOK
834 nc->hook = FFECOM_constantNULL;
835 #endif
836 c->next = nc;
838 return nc;
841 #endif
842 /* ffebld_constant_new_hollerith -- Return hollerith constant object from token
844 See prototype. */
846 ffebldConstant
847 ffebld_constant_new_hollerith (ffelexToken t)
849 ffetargetHollerith val;
851 ffetarget_hollerith (&val, t, ffebld_constant_pool());
852 return ffebld_constant_new_hollerith_val (val);
855 /* ffebld_constant_new_hollerith_val -- Return an hollerith constant object
857 See prototype. */
859 ffebldConstant
860 ffebld_constant_new_hollerith_val (ffetargetHollerith val)
862 ffebldConstant c;
863 ffebldConstant nc;
864 int cmp;
866 for (c = (ffebldConstant) &ffebld_constant_hollerith_;
867 c->next != NULL;
868 c = c->next)
870 cmp = ffetarget_cmp_hollerith (val, ffebld_constant_hollerith (c->next));
871 if (cmp == 0)
872 return c->next;
873 if (cmp > 0)
874 break;
877 nc = malloc_new_kp (ffebld_constant_pool(),
878 "FFEBLD_constHOLLERITH",
879 sizeof (*nc));
880 nc->next = c->next;
881 nc->consttype = FFEBLD_constHOLLERITH;
882 nc->u.hollerith = val;
883 #ifdef FFECOM_constantHOOK
884 nc->hook = FFECOM_constantNULL;
885 #endif
886 c->next = nc;
888 return nc;
891 /* ffebld_constant_new_integer1 -- Return integer1 constant object from token
893 See prototype.
895 Parses the token as a decimal integer constant, thus it must be an
896 FFELEX_typeNUMBER. */
898 #if FFETARGET_okINTEGER1
899 ffebldConstant
900 ffebld_constant_new_integer1 (ffelexToken t)
902 ffetargetInteger1 val;
904 assert (ffelex_token_type (t) == FFELEX_typeNUMBER);
906 ffetarget_integer1 (&val, t);
907 return ffebld_constant_new_integer1_val (val);
910 #endif
911 /* ffebld_constant_new_integer1_val -- Return an integer1 constant object
913 See prototype. */
915 #if FFETARGET_okINTEGER1
916 ffebldConstant
917 ffebld_constant_new_integer1_val (ffetargetInteger1 val)
919 ffebldConstant c;
920 ffebldConstant nc;
921 int cmp;
923 for (c = (ffebldConstant) &ffebld_constant_integer1_;
924 c->next != NULL;
925 c = c->next)
927 cmp = ffetarget_cmp_integer1 (val, ffebld_constant_integer1 (c->next));
928 if (cmp == 0)
929 return c->next;
930 if (cmp > 0)
931 break;
934 nc = malloc_new_kp (ffebld_constant_pool(),
935 "FFEBLD_constINTEGER1",
936 sizeof (*nc));
937 nc->next = c->next;
938 nc->consttype = FFEBLD_constINTEGER1;
939 nc->u.integer1 = val;
940 #ifdef FFECOM_constantHOOK
941 nc->hook = FFECOM_constantNULL;
942 #endif
943 c->next = nc;
945 return nc;
948 #endif
949 /* ffebld_constant_new_integer2_val -- Return an integer2 constant object
951 See prototype. */
953 #if FFETARGET_okINTEGER2
954 ffebldConstant
955 ffebld_constant_new_integer2_val (ffetargetInteger2 val)
957 ffebldConstant c;
958 ffebldConstant nc;
959 int cmp;
961 for (c = (ffebldConstant) &ffebld_constant_integer2_;
962 c->next != NULL;
963 c = c->next)
965 cmp = ffetarget_cmp_integer2 (val, ffebld_constant_integer2 (c->next));
966 if (cmp == 0)
967 return c->next;
968 if (cmp > 0)
969 break;
972 nc = malloc_new_kp (ffebld_constant_pool(),
973 "FFEBLD_constINTEGER2",
974 sizeof (*nc));
975 nc->next = c->next;
976 nc->consttype = FFEBLD_constINTEGER2;
977 nc->u.integer2 = val;
978 #ifdef FFECOM_constantHOOK
979 nc->hook = FFECOM_constantNULL;
980 #endif
981 c->next = nc;
983 return nc;
986 #endif
987 /* ffebld_constant_new_integer3_val -- Return an integer3 constant object
989 See prototype. */
991 #if FFETARGET_okINTEGER3
992 ffebldConstant
993 ffebld_constant_new_integer3_val (ffetargetInteger3 val)
995 ffebldConstant c;
996 ffebldConstant nc;
997 int cmp;
999 for (c = (ffebldConstant) &ffebld_constant_integer3_;
1000 c->next != NULL;
1001 c = c->next)
1003 cmp = ffetarget_cmp_integer3 (val, ffebld_constant_integer3 (c->next));
1004 if (cmp == 0)
1005 return c->next;
1006 if (cmp > 0)
1007 break;
1010 nc = malloc_new_kp (ffebld_constant_pool(),
1011 "FFEBLD_constINTEGER3",
1012 sizeof (*nc));
1013 nc->next = c->next;
1014 nc->consttype = FFEBLD_constINTEGER3;
1015 nc->u.integer3 = val;
1016 #ifdef FFECOM_constantHOOK
1017 nc->hook = FFECOM_constantNULL;
1018 #endif
1019 c->next = nc;
1021 return nc;
1024 #endif
1025 /* ffebld_constant_new_integer4_val -- Return an integer4 constant object
1027 See prototype. */
1029 #if FFETARGET_okINTEGER4
1030 ffebldConstant
1031 ffebld_constant_new_integer4_val (ffetargetInteger4 val)
1033 ffebldConstant c;
1034 ffebldConstant nc;
1035 int cmp;
1037 for (c = (ffebldConstant) &ffebld_constant_integer4_;
1038 c->next != NULL;
1039 c = c->next)
1041 cmp = ffetarget_cmp_integer4 (val, ffebld_constant_integer4 (c->next));
1042 if (cmp == 0)
1043 return c->next;
1044 if (cmp > 0)
1045 break;
1048 nc = malloc_new_kp (ffebld_constant_pool(),
1049 "FFEBLD_constINTEGER4",
1050 sizeof (*nc));
1051 nc->next = c->next;
1052 nc->consttype = FFEBLD_constINTEGER4;
1053 nc->u.integer4 = val;
1054 #ifdef FFECOM_constantHOOK
1055 nc->hook = FFECOM_constantNULL;
1056 #endif
1057 c->next = nc;
1059 return nc;
1062 #endif
1063 /* ffebld_constant_new_integerbinary -- Return binary constant object from token
1065 See prototype.
1067 Parses the token as a binary integer constant, thus it must be an
1068 FFELEX_typeNUMBER. */
1070 ffebldConstant
1071 ffebld_constant_new_integerbinary (ffelexToken t)
1073 ffetargetIntegerDefault val;
1075 assert ((ffelex_token_type (t) == FFELEX_typeNAME)
1076 || (ffelex_token_type (t) == FFELEX_typeNUMBER));
1078 ffetarget_integerbinary (&val, t);
1079 return ffebld_constant_new_integerdefault_val (val);
1082 /* ffebld_constant_new_integerhex -- Return hex constant object from token
1084 See prototype.
1086 Parses the token as a hex integer constant, thus it must be an
1087 FFELEX_typeNUMBER. */
1089 ffebldConstant
1090 ffebld_constant_new_integerhex (ffelexToken t)
1092 ffetargetIntegerDefault val;
1094 assert ((ffelex_token_type (t) == FFELEX_typeNAME)
1095 || (ffelex_token_type (t) == FFELEX_typeNUMBER));
1097 ffetarget_integerhex (&val, t);
1098 return ffebld_constant_new_integerdefault_val (val);
1101 /* ffebld_constant_new_integeroctal -- Return octal constant object from token
1103 See prototype.
1105 Parses the token as a octal integer constant, thus it must be an
1106 FFELEX_typeNUMBER. */
1108 ffebldConstant
1109 ffebld_constant_new_integeroctal (ffelexToken t)
1111 ffetargetIntegerDefault val;
1113 assert ((ffelex_token_type (t) == FFELEX_typeNAME)
1114 || (ffelex_token_type (t) == FFELEX_typeNUMBER));
1116 ffetarget_integeroctal (&val, t);
1117 return ffebld_constant_new_integerdefault_val (val);
1120 /* ffebld_constant_new_logical1 -- Return logical1 constant object from token
1122 See prototype.
1124 Parses the token as a decimal logical constant, thus it must be an
1125 FFELEX_typeNUMBER. */
1127 #if FFETARGET_okLOGICAL1
1128 ffebldConstant
1129 ffebld_constant_new_logical1 (bool truth)
1131 ffetargetLogical1 val;
1133 ffetarget_logical1 (&val, truth);
1134 return ffebld_constant_new_logical1_val (val);
1137 #endif
1138 /* ffebld_constant_new_logical1_val -- Return a logical1 constant object
1140 See prototype. */
1142 #if FFETARGET_okLOGICAL1
1143 ffebldConstant
1144 ffebld_constant_new_logical1_val (ffetargetLogical1 val)
1146 ffebldConstant c;
1147 ffebldConstant nc;
1148 int cmp;
1150 for (c = (ffebldConstant) &ffebld_constant_logical1_;
1151 c->next != NULL;
1152 c = c->next)
1154 cmp = ffetarget_cmp_logical1 (val, ffebld_constant_logical1 (c->next));
1155 if (cmp == 0)
1156 return c->next;
1157 if (cmp > 0)
1158 break;
1161 nc = malloc_new_kp (ffebld_constant_pool(),
1162 "FFEBLD_constLOGICAL1",
1163 sizeof (*nc));
1164 nc->next = c->next;
1165 nc->consttype = FFEBLD_constLOGICAL1;
1166 nc->u.logical1 = val;
1167 #ifdef FFECOM_constantHOOK
1168 nc->hook = FFECOM_constantNULL;
1169 #endif
1170 c->next = nc;
1172 return nc;
1175 #endif
1176 /* ffebld_constant_new_logical2_val -- Return a logical2 constant object
1178 See prototype. */
1180 #if FFETARGET_okLOGICAL2
1181 ffebldConstant
1182 ffebld_constant_new_logical2_val (ffetargetLogical2 val)
1184 ffebldConstant c;
1185 ffebldConstant nc;
1186 int cmp;
1188 for (c = (ffebldConstant) &ffebld_constant_logical2_;
1189 c->next != NULL;
1190 c = c->next)
1192 cmp = ffetarget_cmp_logical2 (val, ffebld_constant_logical2 (c->next));
1193 if (cmp == 0)
1194 return c->next;
1195 if (cmp > 0)
1196 break;
1199 nc = malloc_new_kp (ffebld_constant_pool(),
1200 "FFEBLD_constLOGICAL2",
1201 sizeof (*nc));
1202 nc->next = c->next;
1203 nc->consttype = FFEBLD_constLOGICAL2;
1204 nc->u.logical2 = val;
1205 #ifdef FFECOM_constantHOOK
1206 nc->hook = FFECOM_constantNULL;
1207 #endif
1208 c->next = nc;
1210 return nc;
1213 #endif
1214 /* ffebld_constant_new_logical3_val -- Return a logical3 constant object
1216 See prototype. */
1218 #if FFETARGET_okLOGICAL3
1219 ffebldConstant
1220 ffebld_constant_new_logical3_val (ffetargetLogical3 val)
1222 ffebldConstant c;
1223 ffebldConstant nc;
1224 int cmp;
1226 for (c = (ffebldConstant) &ffebld_constant_logical3_;
1227 c->next != NULL;
1228 c = c->next)
1230 cmp = ffetarget_cmp_logical3 (val, ffebld_constant_logical3 (c->next));
1231 if (cmp == 0)
1232 return c->next;
1233 if (cmp > 0)
1234 break;
1237 nc = malloc_new_kp (ffebld_constant_pool(),
1238 "FFEBLD_constLOGICAL3",
1239 sizeof (*nc));
1240 nc->next = c->next;
1241 nc->consttype = FFEBLD_constLOGICAL3;
1242 nc->u.logical3 = val;
1243 #ifdef FFECOM_constantHOOK
1244 nc->hook = FFECOM_constantNULL;
1245 #endif
1246 c->next = nc;
1248 return nc;
1251 #endif
1252 /* ffebld_constant_new_logical4_val -- Return a logical4 constant object
1254 See prototype. */
1256 #if FFETARGET_okLOGICAL4
1257 ffebldConstant
1258 ffebld_constant_new_logical4_val (ffetargetLogical4 val)
1260 ffebldConstant c;
1261 ffebldConstant nc;
1262 int cmp;
1264 for (c = (ffebldConstant) &ffebld_constant_logical4_;
1265 c->next != NULL;
1266 c = c->next)
1268 cmp = ffetarget_cmp_logical4 (val, ffebld_constant_logical4 (c->next));
1269 if (cmp == 0)
1270 return c->next;
1271 if (cmp > 0)
1272 break;
1275 nc = malloc_new_kp (ffebld_constant_pool(),
1276 "FFEBLD_constLOGICAL4",
1277 sizeof (*nc));
1278 nc->next = c->next;
1279 nc->consttype = FFEBLD_constLOGICAL4;
1280 nc->u.logical4 = val;
1281 #ifdef FFECOM_constantHOOK
1282 nc->hook = FFECOM_constantNULL;
1283 #endif
1284 c->next = nc;
1286 return nc;
1289 #endif
1290 /* ffebld_constant_new_real1 -- Return real1 constant object from token
1292 See prototype. */
1294 #if FFETARGET_okREAL1
1295 ffebldConstant
1296 ffebld_constant_new_real1 (ffelexToken integer, ffelexToken decimal,
1297 ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign,
1298 ffelexToken exponent_digits)
1300 ffetargetReal1 val;
1302 ffetarget_real1 (&val,
1303 integer, decimal, fraction, exponent, exponent_sign, exponent_digits);
1304 return ffebld_constant_new_real1_val (val);
1307 #endif
1308 /* ffebld_constant_new_real1_val -- Return an real1 constant object
1310 See prototype. */
1312 #if FFETARGET_okREAL1
1313 ffebldConstant
1314 ffebld_constant_new_real1_val (ffetargetReal1 val)
1316 ffebldConstant c;
1317 ffebldConstant nc;
1318 int cmp;
1320 for (c = (ffebldConstant) &ffebld_constant_real1_;
1321 c->next != NULL;
1322 c = c->next)
1324 cmp = ffetarget_cmp_real1 (val, ffebld_constant_real1 (c->next));
1325 if (cmp == 0)
1326 return c->next;
1327 if (cmp > 0)
1328 break;
1331 nc = malloc_new_kp (ffebld_constant_pool(),
1332 "FFEBLD_constREAL1",
1333 sizeof (*nc));
1334 nc->next = c->next;
1335 nc->consttype = FFEBLD_constREAL1;
1336 nc->u.real1 = val;
1337 #ifdef FFECOM_constantHOOK
1338 nc->hook = FFECOM_constantNULL;
1339 #endif
1340 c->next = nc;
1342 return nc;
1345 #endif
1346 /* ffebld_constant_new_real2 -- Return real2 constant object from token
1348 See prototype. */
1350 #if FFETARGET_okREAL2
1351 ffebldConstant
1352 ffebld_constant_new_real2 (ffelexToken integer, ffelexToken decimal,
1353 ffelexToken fraction, ffelexToken exponent, ffelexToken exponent_sign,
1354 ffelexToken exponent_digits)
1356 ffetargetReal2 val;
1358 ffetarget_real2 (&val,
1359 integer, decimal, fraction, exponent, exponent_sign, exponent_digits);
1360 return ffebld_constant_new_real2_val (val);
1363 #endif
1364 /* ffebld_constant_new_real2_val -- Return an real2 constant object
1366 See prototype. */
1368 #if FFETARGET_okREAL2
1369 ffebldConstant
1370 ffebld_constant_new_real2_val (ffetargetReal2 val)
1372 ffebldConstant c;
1373 ffebldConstant nc;
1374 int cmp;
1376 for (c = (ffebldConstant) &ffebld_constant_real2_;
1377 c->next != NULL;
1378 c = c->next)
1380 cmp = ffetarget_cmp_real2 (val, ffebld_constant_real2 (c->next));
1381 if (cmp == 0)
1382 return c->next;
1383 if (cmp > 0)
1384 break;
1387 nc = malloc_new_kp (ffebld_constant_pool(),
1388 "FFEBLD_constREAL2",
1389 sizeof (*nc));
1390 nc->next = c->next;
1391 nc->consttype = FFEBLD_constREAL2;
1392 nc->u.real2 = val;
1393 #ifdef FFECOM_constantHOOK
1394 nc->hook = FFECOM_constantNULL;
1395 #endif
1396 c->next = nc;
1398 return nc;
1401 #endif
1402 /* ffebld_constant_new_typeless_bm -- Return typeless constant object from token
1404 See prototype.
1406 Parses the token as a decimal integer constant, thus it must be an
1407 FFELEX_typeNUMBER. */
1409 ffebldConstant
1410 ffebld_constant_new_typeless_bm (ffelexToken t)
1412 ffetargetTypeless val;
1414 ffetarget_binarymil (&val, t);
1415 return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_MIL, val);
1418 /* ffebld_constant_new_typeless_bv -- Return typeless constant object from token
1420 See prototype.
1422 Parses the token as a decimal integer constant, thus it must be an
1423 FFELEX_typeNUMBER. */
1425 ffebldConstant
1426 ffebld_constant_new_typeless_bv (ffelexToken t)
1428 ffetargetTypeless val;
1430 ffetarget_binaryvxt (&val, t);
1431 return ffebld_constant_new_typeless_val (FFEBLD_constBINARY_VXT, val);
1434 /* ffebld_constant_new_typeless_hxm -- Return typeless constant object from token
1436 See prototype.
1438 Parses the token as a decimal integer constant, thus it must be an
1439 FFELEX_typeNUMBER. */
1441 ffebldConstant
1442 ffebld_constant_new_typeless_hxm (ffelexToken t)
1444 ffetargetTypeless val;
1446 ffetarget_hexxmil (&val, t);
1447 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_MIL, val);
1450 /* ffebld_constant_new_typeless_hxv -- Return typeless constant object from token
1452 See prototype.
1454 Parses the token as a decimal integer constant, thus it must be an
1455 FFELEX_typeNUMBER. */
1457 ffebldConstant
1458 ffebld_constant_new_typeless_hxv (ffelexToken t)
1460 ffetargetTypeless val;
1462 ffetarget_hexxvxt (&val, t);
1463 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_X_VXT, val);
1466 /* ffebld_constant_new_typeless_hzm -- Return typeless constant object from token
1468 See prototype.
1470 Parses the token as a decimal integer constant, thus it must be an
1471 FFELEX_typeNUMBER. */
1473 ffebldConstant
1474 ffebld_constant_new_typeless_hzm (ffelexToken t)
1476 ffetargetTypeless val;
1478 ffetarget_hexzmil (&val, t);
1479 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_MIL, val);
1482 /* ffebld_constant_new_typeless_hzv -- Return typeless constant object from token
1484 See prototype.
1486 Parses the token as a decimal integer constant, thus it must be an
1487 FFELEX_typeNUMBER. */
1489 ffebldConstant
1490 ffebld_constant_new_typeless_hzv (ffelexToken t)
1492 ffetargetTypeless val;
1494 ffetarget_hexzvxt (&val, t);
1495 return ffebld_constant_new_typeless_val (FFEBLD_constHEX_Z_VXT, val);
1498 /* ffebld_constant_new_typeless_om -- Return typeless constant object from token
1500 See prototype.
1502 Parses the token as a decimal integer constant, thus it must be an
1503 FFELEX_typeNUMBER. */
1505 ffebldConstant
1506 ffebld_constant_new_typeless_om (ffelexToken t)
1508 ffetargetTypeless val;
1510 ffetarget_octalmil (&val, t);
1511 return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_MIL, val);
1514 /* ffebld_constant_new_typeless_ov -- Return typeless constant object from token
1516 See prototype.
1518 Parses the token as a decimal integer constant, thus it must be an
1519 FFELEX_typeNUMBER. */
1521 ffebldConstant
1522 ffebld_constant_new_typeless_ov (ffelexToken t)
1524 ffetargetTypeless val;
1526 ffetarget_octalvxt (&val, t);
1527 return ffebld_constant_new_typeless_val (FFEBLD_constOCTAL_VXT, val);
1530 /* ffebld_constant_new_typeless_val -- Return a typeless constant object
1532 See prototype. */
1534 ffebldConstant
1535 ffebld_constant_new_typeless_val (ffebldConst type, ffetargetTypeless val)
1537 ffebldConstant c;
1538 ffebldConstant nc;
1539 int cmp;
1541 for (c = (ffebldConstant) &ffebld_constant_typeless_[type
1542 - FFEBLD_constTYPELESS_FIRST];
1543 c->next != NULL;
1544 c = c->next)
1546 cmp = ffetarget_cmp_typeless (val, ffebld_constant_typeless (c->next));
1547 if (cmp == 0)
1548 return c->next;
1549 if (cmp > 0)
1550 break;
1553 nc = malloc_new_kp (ffebld_constant_pool(),
1554 "FFEBLD_constTYPELESS",
1555 sizeof (*nc));
1556 nc->next = c->next;
1557 nc->consttype = type;
1558 nc->u.typeless = val;
1559 #ifdef FFECOM_constantHOOK
1560 nc->hook = FFECOM_constantNULL;
1561 #endif
1562 c->next = nc;
1564 return nc;
1567 /* ffebld_constantarray_get -- Get a value from an array of constants
1569 See prototype. */
1571 ffebldConstantUnion
1572 ffebld_constantarray_get (ffebldConstantArray array, ffeinfoBasictype bt,
1573 ffeinfoKindtype kt, ffetargetOffset offset)
1575 ffebldConstantUnion u;
1577 switch (bt)
1579 case FFEINFO_basictypeINTEGER:
1580 switch (kt)
1582 #if FFETARGET_okINTEGER1
1583 case FFEINFO_kindtypeINTEGER1:
1584 u.integer1 = *(array.integer1 + offset);
1585 break;
1586 #endif
1588 #if FFETARGET_okINTEGER2
1589 case FFEINFO_kindtypeINTEGER2:
1590 u.integer2 = *(array.integer2 + offset);
1591 break;
1592 #endif
1594 #if FFETARGET_okINTEGER3
1595 case FFEINFO_kindtypeINTEGER3:
1596 u.integer3 = *(array.integer3 + offset);
1597 break;
1598 #endif
1600 #if FFETARGET_okINTEGER4
1601 case FFEINFO_kindtypeINTEGER4:
1602 u.integer4 = *(array.integer4 + offset);
1603 break;
1604 #endif
1606 #if FFETARGET_okINTEGER5
1607 case FFEINFO_kindtypeINTEGER5:
1608 u.integer5 = *(array.integer5 + offset);
1609 break;
1610 #endif
1612 #if FFETARGET_okINTEGER6
1613 case FFEINFO_kindtypeINTEGER6:
1614 u.integer6 = *(array.integer6 + offset);
1615 break;
1616 #endif
1618 #if FFETARGET_okINTEGER7
1619 case FFEINFO_kindtypeINTEGER7:
1620 u.integer7 = *(array.integer7 + offset);
1621 break;
1622 #endif
1624 #if FFETARGET_okINTEGER8
1625 case FFEINFO_kindtypeINTEGER8:
1626 u.integer8 = *(array.integer8 + offset);
1627 break;
1628 #endif
1630 default:
1631 assert ("bad INTEGER kindtype" == NULL);
1632 break;
1634 break;
1636 case FFEINFO_basictypeLOGICAL:
1637 switch (kt)
1639 #if FFETARGET_okLOGICAL1
1640 case FFEINFO_kindtypeLOGICAL1:
1641 u.logical1 = *(array.logical1 + offset);
1642 break;
1643 #endif
1645 #if FFETARGET_okLOGICAL2
1646 case FFEINFO_kindtypeLOGICAL2:
1647 u.logical2 = *(array.logical2 + offset);
1648 break;
1649 #endif
1651 #if FFETARGET_okLOGICAL3
1652 case FFEINFO_kindtypeLOGICAL3:
1653 u.logical3 = *(array.logical3 + offset);
1654 break;
1655 #endif
1657 #if FFETARGET_okLOGICAL4
1658 case FFEINFO_kindtypeLOGICAL4:
1659 u.logical4 = *(array.logical4 + offset);
1660 break;
1661 #endif
1663 #if FFETARGET_okLOGICAL5
1664 case FFEINFO_kindtypeLOGICAL5:
1665 u.logical5 = *(array.logical5 + offset);
1666 break;
1667 #endif
1669 #if FFETARGET_okLOGICAL6
1670 case FFEINFO_kindtypeLOGICAL6:
1671 u.logical6 = *(array.logical6 + offset);
1672 break;
1673 #endif
1675 #if FFETARGET_okLOGICAL7
1676 case FFEINFO_kindtypeLOGICAL7:
1677 u.logical7 = *(array.logical7 + offset);
1678 break;
1679 #endif
1681 #if FFETARGET_okLOGICAL8
1682 case FFEINFO_kindtypeLOGICAL8:
1683 u.logical8 = *(array.logical8 + offset);
1684 break;
1685 #endif
1687 default:
1688 assert ("bad LOGICAL kindtype" == NULL);
1689 break;
1691 break;
1693 case FFEINFO_basictypeREAL:
1694 switch (kt)
1696 #if FFETARGET_okREAL1
1697 case FFEINFO_kindtypeREAL1:
1698 u.real1 = *(array.real1 + offset);
1699 break;
1700 #endif
1702 #if FFETARGET_okREAL2
1703 case FFEINFO_kindtypeREAL2:
1704 u.real2 = *(array.real2 + offset);
1705 break;
1706 #endif
1708 #if FFETARGET_okREAL3
1709 case FFEINFO_kindtypeREAL3:
1710 u.real3 = *(array.real3 + offset);
1711 break;
1712 #endif
1714 #if FFETARGET_okREAL4
1715 case FFEINFO_kindtypeREAL4:
1716 u.real4 = *(array.real4 + offset);
1717 break;
1718 #endif
1720 #if FFETARGET_okREAL5
1721 case FFEINFO_kindtypeREAL5:
1722 u.real5 = *(array.real5 + offset);
1723 break;
1724 #endif
1726 #if FFETARGET_okREAL6
1727 case FFEINFO_kindtypeREAL6:
1728 u.real6 = *(array.real6 + offset);
1729 break;
1730 #endif
1732 #if FFETARGET_okREAL7
1733 case FFEINFO_kindtypeREAL7:
1734 u.real7 = *(array.real7 + offset);
1735 break;
1736 #endif
1738 #if FFETARGET_okREAL8
1739 case FFEINFO_kindtypeREAL8:
1740 u.real8 = *(array.real8 + offset);
1741 break;
1742 #endif
1744 default:
1745 assert ("bad REAL kindtype" == NULL);
1746 break;
1748 break;
1750 case FFEINFO_basictypeCOMPLEX:
1751 switch (kt)
1753 #if FFETARGET_okCOMPLEX1
1754 case FFEINFO_kindtypeREAL1:
1755 u.complex1 = *(array.complex1 + offset);
1756 break;
1757 #endif
1759 #if FFETARGET_okCOMPLEX2
1760 case FFEINFO_kindtypeREAL2:
1761 u.complex2 = *(array.complex2 + offset);
1762 break;
1763 #endif
1765 #if FFETARGET_okCOMPLEX3
1766 case FFEINFO_kindtypeREAL3:
1767 u.complex3 = *(array.complex3 + offset);
1768 break;
1769 #endif
1771 #if FFETARGET_okCOMPLEX4
1772 case FFEINFO_kindtypeREAL4:
1773 u.complex4 = *(array.complex4 + offset);
1774 break;
1775 #endif
1777 #if FFETARGET_okCOMPLEX5
1778 case FFEINFO_kindtypeREAL5:
1779 u.complex5 = *(array.complex5 + offset);
1780 break;
1781 #endif
1783 #if FFETARGET_okCOMPLEX6
1784 case FFEINFO_kindtypeREAL6:
1785 u.complex6 = *(array.complex6 + offset);
1786 break;
1787 #endif
1789 #if FFETARGET_okCOMPLEX7
1790 case FFEINFO_kindtypeREAL7:
1791 u.complex7 = *(array.complex7 + offset);
1792 break;
1793 #endif
1795 #if FFETARGET_okCOMPLEX8
1796 case FFEINFO_kindtypeREAL8:
1797 u.complex8 = *(array.complex8 + offset);
1798 break;
1799 #endif
1801 default:
1802 assert ("bad COMPLEX kindtype" == NULL);
1803 break;
1805 break;
1807 case FFEINFO_basictypeCHARACTER:
1808 switch (kt)
1810 #if FFETARGET_okCHARACTER1
1811 case FFEINFO_kindtypeCHARACTER1:
1812 u.character1.length = 1;
1813 u.character1.text = array.character1 + offset;
1814 break;
1815 #endif
1817 #if FFETARGET_okCHARACTER2
1818 case FFEINFO_kindtypeCHARACTER2:
1819 u.character2.length = 1;
1820 u.character2.text = array.character2 + offset;
1821 break;
1822 #endif
1824 #if FFETARGET_okCHARACTER3
1825 case FFEINFO_kindtypeCHARACTER3:
1826 u.character3.length = 1;
1827 u.character3.text = array.character3 + offset;
1828 break;
1829 #endif
1831 #if FFETARGET_okCHARACTER4
1832 case FFEINFO_kindtypeCHARACTER4:
1833 u.character4.length = 1;
1834 u.character4.text = array.character4 + offset;
1835 break;
1836 #endif
1838 #if FFETARGET_okCHARACTER5
1839 case FFEINFO_kindtypeCHARACTER5:
1840 u.character5.length = 1;
1841 u.character5.text = array.character5 + offset;
1842 break;
1843 #endif
1845 #if FFETARGET_okCHARACTER6
1846 case FFEINFO_kindtypeCHARACTER6:
1847 u.character6.length = 1;
1848 u.character6.text = array.character6 + offset;
1849 break;
1850 #endif
1852 #if FFETARGET_okCHARACTER7
1853 case FFEINFO_kindtypeCHARACTER7:
1854 u.character7.length = 1;
1855 u.character7.text = array.character7 + offset;
1856 break;
1857 #endif
1859 #if FFETARGET_okCHARACTER8
1860 case FFEINFO_kindtypeCHARACTER8:
1861 u.character8.length = 1;
1862 u.character8.text = array.character8 + offset;
1863 break;
1864 #endif
1866 default:
1867 assert ("bad CHARACTER kindtype" == NULL);
1868 break;
1870 break;
1872 default:
1873 assert ("bad basictype" == NULL);
1874 break;
1877 return u;
1880 /* ffebld_constantarray_new -- Make an array of constants
1882 See prototype. */
1884 ffebldConstantArray
1885 ffebld_constantarray_new (ffeinfoBasictype bt,
1886 ffeinfoKindtype kt, ffetargetOffset size)
1888 ffebldConstantArray ptr;
1890 switch (bt)
1892 case FFEINFO_basictypeINTEGER:
1893 switch (kt)
1895 #if FFETARGET_okINTEGER1
1896 case FFEINFO_kindtypeINTEGER1:
1897 ptr.integer1 = malloc_new_zkp (ffebld_constant_pool(),
1898 "ffebldConstantArray",
1899 size *= sizeof (ffetargetInteger1),
1901 break;
1902 #endif
1904 #if FFETARGET_okINTEGER2
1905 case FFEINFO_kindtypeINTEGER2:
1906 ptr.integer2 = malloc_new_zkp (ffebld_constant_pool(),
1907 "ffebldConstantArray",
1908 size *= sizeof (ffetargetInteger2),
1910 break;
1911 #endif
1913 #if FFETARGET_okINTEGER3
1914 case FFEINFO_kindtypeINTEGER3:
1915 ptr.integer3 = malloc_new_zkp (ffebld_constant_pool(),
1916 "ffebldConstantArray",
1917 size *= sizeof (ffetargetInteger3),
1919 break;
1920 #endif
1922 #if FFETARGET_okINTEGER4
1923 case FFEINFO_kindtypeINTEGER4:
1924 ptr.integer4 = malloc_new_zkp (ffebld_constant_pool(),
1925 "ffebldConstantArray",
1926 size *= sizeof (ffetargetInteger4),
1928 break;
1929 #endif
1931 #if FFETARGET_okINTEGER5
1932 case FFEINFO_kindtypeINTEGER5:
1933 ptr.integer5 = malloc_new_zkp (ffebld_constant_pool(),
1934 "ffebldConstantArray",
1935 size *= sizeof (ffetargetInteger5),
1937 break;
1938 #endif
1940 #if FFETARGET_okINTEGER6
1941 case FFEINFO_kindtypeINTEGER6:
1942 ptr.integer6 = malloc_new_zkp (ffebld_constant_pool(),
1943 "ffebldConstantArray",
1944 size *= sizeof (ffetargetInteger6),
1946 break;
1947 #endif
1949 #if FFETARGET_okINTEGER7
1950 case FFEINFO_kindtypeINTEGER7:
1951 ptr.integer7 = malloc_new_zkp (ffebld_constant_pool(),
1952 "ffebldConstantArray",
1953 size *= sizeof (ffetargetInteger7),
1955 break;
1956 #endif
1958 #if FFETARGET_okINTEGER8
1959 case FFEINFO_kindtypeINTEGER8:
1960 ptr.integer8 = malloc_new_zkp (ffebld_constant_pool(),
1961 "ffebldConstantArray",
1962 size *= sizeof (ffetargetInteger8),
1964 break;
1965 #endif
1967 default:
1968 assert ("bad INTEGER kindtype" == NULL);
1969 break;
1971 break;
1973 case FFEINFO_basictypeLOGICAL:
1974 switch (kt)
1976 #if FFETARGET_okLOGICAL1
1977 case FFEINFO_kindtypeLOGICAL1:
1978 ptr.logical1 = malloc_new_zkp (ffebld_constant_pool(),
1979 "ffebldConstantArray",
1980 size *= sizeof (ffetargetLogical1),
1982 break;
1983 #endif
1985 #if FFETARGET_okLOGICAL2
1986 case FFEINFO_kindtypeLOGICAL2:
1987 ptr.logical2 = malloc_new_zkp (ffebld_constant_pool(),
1988 "ffebldConstantArray",
1989 size *= sizeof (ffetargetLogical2),
1991 break;
1992 #endif
1994 #if FFETARGET_okLOGICAL3
1995 case FFEINFO_kindtypeLOGICAL3:
1996 ptr.logical3 = malloc_new_zkp (ffebld_constant_pool(),
1997 "ffebldConstantArray",
1998 size *= sizeof (ffetargetLogical3),
2000 break;
2001 #endif
2003 #if FFETARGET_okLOGICAL4
2004 case FFEINFO_kindtypeLOGICAL4:
2005 ptr.logical4 = malloc_new_zkp (ffebld_constant_pool(),
2006 "ffebldConstantArray",
2007 size *= sizeof (ffetargetLogical4),
2009 break;
2010 #endif
2012 #if FFETARGET_okLOGICAL5
2013 case FFEINFO_kindtypeLOGICAL5:
2014 ptr.logical5 = malloc_new_zkp (ffebld_constant_pool(),
2015 "ffebldConstantArray",
2016 size *= sizeof (ffetargetLogical5),
2018 break;
2019 #endif
2021 #if FFETARGET_okLOGICAL6
2022 case FFEINFO_kindtypeLOGICAL6:
2023 ptr.logical6 = malloc_new_zkp (ffebld_constant_pool(),
2024 "ffebldConstantArray",
2025 size *= sizeof (ffetargetLogical6),
2027 break;
2028 #endif
2030 #if FFETARGET_okLOGICAL7
2031 case FFEINFO_kindtypeLOGICAL7:
2032 ptr.logical7 = malloc_new_zkp (ffebld_constant_pool(),
2033 "ffebldConstantArray",
2034 size *= sizeof (ffetargetLogical7),
2036 break;
2037 #endif
2039 #if FFETARGET_okLOGICAL8
2040 case FFEINFO_kindtypeLOGICAL8:
2041 ptr.logical8 = malloc_new_zkp (ffebld_constant_pool(),
2042 "ffebldConstantArray",
2043 size *= sizeof (ffetargetLogical8),
2045 break;
2046 #endif
2048 default:
2049 assert ("bad LOGICAL kindtype" == NULL);
2050 break;
2052 break;
2054 case FFEINFO_basictypeREAL:
2055 switch (kt)
2057 #if FFETARGET_okREAL1
2058 case FFEINFO_kindtypeREAL1:
2059 ptr.real1 = malloc_new_zkp (ffebld_constant_pool(),
2060 "ffebldConstantArray",
2061 size *= sizeof (ffetargetReal1),
2063 break;
2064 #endif
2066 #if FFETARGET_okREAL2
2067 case FFEINFO_kindtypeREAL2:
2068 ptr.real2 = malloc_new_zkp (ffebld_constant_pool(),
2069 "ffebldConstantArray",
2070 size *= sizeof (ffetargetReal2),
2072 break;
2073 #endif
2075 #if FFETARGET_okREAL3
2076 case FFEINFO_kindtypeREAL3:
2077 ptr.real3 = malloc_new_zkp (ffebld_constant_pool(),
2078 "ffebldConstantArray",
2079 size *= sizeof (ffetargetReal3),
2081 break;
2082 #endif
2084 #if FFETARGET_okREAL4
2085 case FFEINFO_kindtypeREAL4:
2086 ptr.real4 = malloc_new_zkp (ffebld_constant_pool(),
2087 "ffebldConstantArray",
2088 size *= sizeof (ffetargetReal4),
2090 break;
2091 #endif
2093 #if FFETARGET_okREAL5
2094 case FFEINFO_kindtypeREAL5:
2095 ptr.real5 = malloc_new_zkp (ffebld_constant_pool(),
2096 "ffebldConstantArray",
2097 size *= sizeof (ffetargetReal5),
2099 break;
2100 #endif
2102 #if FFETARGET_okREAL6
2103 case FFEINFO_kindtypeREAL6:
2104 ptr.real6 = malloc_new_zkp (ffebld_constant_pool(),
2105 "ffebldConstantArray",
2106 size *= sizeof (ffetargetReal6),
2108 break;
2109 #endif
2111 #if FFETARGET_okREAL7
2112 case FFEINFO_kindtypeREAL7:
2113 ptr.real7 = malloc_new_zkp (ffebld_constant_pool(),
2114 "ffebldConstantArray",
2115 size *= sizeof (ffetargetReal7),
2117 break;
2118 #endif
2120 #if FFETARGET_okREAL8
2121 case FFEINFO_kindtypeREAL8:
2122 ptr.real8 = malloc_new_zkp (ffebld_constant_pool(),
2123 "ffebldConstantArray",
2124 size *= sizeof (ffetargetReal8),
2126 break;
2127 #endif
2129 default:
2130 assert ("bad REAL kindtype" == NULL);
2131 break;
2133 break;
2135 case FFEINFO_basictypeCOMPLEX:
2136 switch (kt)
2138 #if FFETARGET_okCOMPLEX1
2139 case FFEINFO_kindtypeREAL1:
2140 ptr.complex1 = malloc_new_zkp (ffebld_constant_pool(),
2141 "ffebldConstantArray",
2142 size *= sizeof (ffetargetComplex1),
2144 break;
2145 #endif
2147 #if FFETARGET_okCOMPLEX2
2148 case FFEINFO_kindtypeREAL2:
2149 ptr.complex2 = malloc_new_zkp (ffebld_constant_pool(),
2150 "ffebldConstantArray",
2151 size *= sizeof (ffetargetComplex2),
2153 break;
2154 #endif
2156 #if FFETARGET_okCOMPLEX3
2157 case FFEINFO_kindtypeREAL3:
2158 ptr.complex3 = malloc_new_zkp (ffebld_constant_pool(),
2159 "ffebldConstantArray",
2160 size *= sizeof (ffetargetComplex3),
2162 break;
2163 #endif
2165 #if FFETARGET_okCOMPLEX4
2166 case FFEINFO_kindtypeREAL4:
2167 ptr.complex4 = malloc_new_zkp (ffebld_constant_pool(),
2168 "ffebldConstantArray",
2169 size *= sizeof (ffetargetComplex4),
2171 break;
2172 #endif
2174 #if FFETARGET_okCOMPLEX5
2175 case FFEINFO_kindtypeREAL5:
2176 ptr.complex5 = malloc_new_zkp (ffebld_constant_pool(),
2177 "ffebldConstantArray",
2178 size *= sizeof (ffetargetComplex5),
2180 break;
2181 #endif
2183 #if FFETARGET_okCOMPLEX6
2184 case FFEINFO_kindtypeREAL6:
2185 ptr.complex6 = malloc_new_zkp (ffebld_constant_pool(),
2186 "ffebldConstantArray",
2187 size *= sizeof (ffetargetComplex6),
2189 break;
2190 #endif
2192 #if FFETARGET_okCOMPLEX7
2193 case FFEINFO_kindtypeREAL7:
2194 ptr.complex7 = malloc_new_zkp (ffebld_constant_pool(),
2195 "ffebldConstantArray",
2196 size *= sizeof (ffetargetComplex7),
2198 break;
2199 #endif
2201 #if FFETARGET_okCOMPLEX8
2202 case FFEINFO_kindtypeREAL8:
2203 ptr.complex8 = malloc_new_zkp (ffebld_constant_pool(),
2204 "ffebldConstantArray",
2205 size *= sizeof (ffetargetComplex8),
2207 break;
2208 #endif
2210 default:
2211 assert ("bad COMPLEX kindtype" == NULL);
2212 break;
2214 break;
2216 case FFEINFO_basictypeCHARACTER:
2217 switch (kt)
2219 #if FFETARGET_okCHARACTER1
2220 case FFEINFO_kindtypeCHARACTER1:
2221 ptr.character1 = malloc_new_zkp (ffebld_constant_pool(),
2222 "ffebldConstantArray",
2223 size
2224 *= sizeof (ffetargetCharacterUnit1),
2226 break;
2227 #endif
2229 #if FFETARGET_okCHARACTER2
2230 case FFEINFO_kindtypeCHARACTER2:
2231 ptr.character2 = malloc_new_zkp (ffebld_constant_pool(),
2232 "ffebldConstantArray",
2233 size
2234 *= sizeof (ffetargetCharacterUnit2),
2236 break;
2237 #endif
2239 #if FFETARGET_okCHARACTER3
2240 case FFEINFO_kindtypeCHARACTER3:
2241 ptr.character3 = malloc_new_zkp (ffebld_constant_pool(),
2242 "ffebldConstantArray",
2243 size
2244 *= sizeof (ffetargetCharacterUnit3),
2246 break;
2247 #endif
2249 #if FFETARGET_okCHARACTER4
2250 case FFEINFO_kindtypeCHARACTER4:
2251 ptr.character4 = malloc_new_zkp (ffebld_constant_pool(),
2252 "ffebldConstantArray",
2253 size
2254 *= sizeof (ffetargetCharacterUnit4),
2256 break;
2257 #endif
2259 #if FFETARGET_okCHARACTER5
2260 case FFEINFO_kindtypeCHARACTER5:
2261 ptr.character5 = malloc_new_zkp (ffebld_constant_pool(),
2262 "ffebldConstantArray",
2263 size
2264 *= sizeof (ffetargetCharacterUnit5),
2266 break;
2267 #endif
2269 #if FFETARGET_okCHARACTER6
2270 case FFEINFO_kindtypeCHARACTER6:
2271 ptr.character6 = malloc_new_zkp (ffebld_constant_pool(),
2272 "ffebldConstantArray",
2273 size
2274 *= sizeof (ffetargetCharacterUnit6),
2276 break;
2277 #endif
2279 #if FFETARGET_okCHARACTER7
2280 case FFEINFO_kindtypeCHARACTER7:
2281 ptr.character7 = malloc_new_zkp (ffebld_constant_pool(),
2282 "ffebldConstantArray",
2283 size
2284 *= sizeof (ffetargetCharacterUnit7),
2286 break;
2287 #endif
2289 #if FFETARGET_okCHARACTER8
2290 case FFEINFO_kindtypeCHARACTER8:
2291 ptr.character8 = malloc_new_zkp (ffebld_constant_pool(),
2292 "ffebldConstantArray",
2293 size
2294 *= sizeof (ffetargetCharacterUnit8),
2296 break;
2297 #endif
2299 default:
2300 assert ("bad CHARACTER kindtype" == NULL);
2301 break;
2303 break;
2305 default:
2306 assert ("bad basictype" == NULL);
2307 break;
2310 return ptr;
2313 /* ffebld_constantarray_preparray -- Prepare for copy between arrays
2315 See prototype.
2317 Like _prepare, but the source is an array instead of a single-value
2318 constant. */
2320 void
2321 ffebld_constantarray_preparray (void **aptr, void **cptr, size_t *size,
2322 ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
2323 ffetargetOffset offset, ffebldConstantArray source_array,
2324 ffeinfoBasictype cbt, ffeinfoKindtype ckt)
2326 switch (abt)
2328 case FFEINFO_basictypeINTEGER:
2329 switch (akt)
2331 #if FFETARGET_okINTEGER1
2332 case FFEINFO_kindtypeINTEGER1:
2333 *aptr = array.integer1 + offset;
2334 break;
2335 #endif
2337 #if FFETARGET_okINTEGER2
2338 case FFEINFO_kindtypeINTEGER2:
2339 *aptr = array.integer2 + offset;
2340 break;
2341 #endif
2343 #if FFETARGET_okINTEGER3
2344 case FFEINFO_kindtypeINTEGER3:
2345 *aptr = array.integer3 + offset;
2346 break;
2347 #endif
2349 #if FFETARGET_okINTEGER4
2350 case FFEINFO_kindtypeINTEGER4:
2351 *aptr = array.integer4 + offset;
2352 break;
2353 #endif
2355 #if FFETARGET_okINTEGER5
2356 case FFEINFO_kindtypeINTEGER5:
2357 *aptr = array.integer5 + offset;
2358 break;
2359 #endif
2361 #if FFETARGET_okINTEGER6
2362 case FFEINFO_kindtypeINTEGER6:
2363 *aptr = array.integer6 + offset;
2364 break;
2365 #endif
2367 #if FFETARGET_okINTEGER7
2368 case FFEINFO_kindtypeINTEGER7:
2369 *aptr = array.integer7 + offset;
2370 break;
2371 #endif
2373 #if FFETARGET_okINTEGER8
2374 case FFEINFO_kindtypeINTEGER8:
2375 *aptr = array.integer8 + offset;
2376 break;
2377 #endif
2379 default:
2380 assert ("bad INTEGER akindtype" == NULL);
2381 break;
2383 break;
2385 case FFEINFO_basictypeLOGICAL:
2386 switch (akt)
2388 #if FFETARGET_okLOGICAL1
2389 case FFEINFO_kindtypeLOGICAL1:
2390 *aptr = array.logical1 + offset;
2391 break;
2392 #endif
2394 #if FFETARGET_okLOGICAL2
2395 case FFEINFO_kindtypeLOGICAL2:
2396 *aptr = array.logical2 + offset;
2397 break;
2398 #endif
2400 #if FFETARGET_okLOGICAL3
2401 case FFEINFO_kindtypeLOGICAL3:
2402 *aptr = array.logical3 + offset;
2403 break;
2404 #endif
2406 #if FFETARGET_okLOGICAL4
2407 case FFEINFO_kindtypeLOGICAL4:
2408 *aptr = array.logical4 + offset;
2409 break;
2410 #endif
2412 #if FFETARGET_okLOGICAL5
2413 case FFEINFO_kindtypeLOGICAL5:
2414 *aptr = array.logical5 + offset;
2415 break;
2416 #endif
2418 #if FFETARGET_okLOGICAL6
2419 case FFEINFO_kindtypeLOGICAL6:
2420 *aptr = array.logical6 + offset;
2421 break;
2422 #endif
2424 #if FFETARGET_okLOGICAL7
2425 case FFEINFO_kindtypeLOGICAL7:
2426 *aptr = array.logical7 + offset;
2427 break;
2428 #endif
2430 #if FFETARGET_okLOGICAL8
2431 case FFEINFO_kindtypeLOGICAL8:
2432 *aptr = array.logical8 + offset;
2433 break;
2434 #endif
2436 default:
2437 assert ("bad LOGICAL akindtype" == NULL);
2438 break;
2440 break;
2442 case FFEINFO_basictypeREAL:
2443 switch (akt)
2445 #if FFETARGET_okREAL1
2446 case FFEINFO_kindtypeREAL1:
2447 *aptr = array.real1 + offset;
2448 break;
2449 #endif
2451 #if FFETARGET_okREAL2
2452 case FFEINFO_kindtypeREAL2:
2453 *aptr = array.real2 + offset;
2454 break;
2455 #endif
2457 #if FFETARGET_okREAL3
2458 case FFEINFO_kindtypeREAL3:
2459 *aptr = array.real3 + offset;
2460 break;
2461 #endif
2463 #if FFETARGET_okREAL4
2464 case FFEINFO_kindtypeREAL4:
2465 *aptr = array.real4 + offset;
2466 break;
2467 #endif
2469 #if FFETARGET_okREAL5
2470 case FFEINFO_kindtypeREAL5:
2471 *aptr = array.real5 + offset;
2472 break;
2473 #endif
2475 #if FFETARGET_okREAL6
2476 case FFEINFO_kindtypeREAL6:
2477 *aptr = array.real6 + offset;
2478 break;
2479 #endif
2481 #if FFETARGET_okREAL7
2482 case FFEINFO_kindtypeREAL7:
2483 *aptr = array.real7 + offset;
2484 break;
2485 #endif
2487 #if FFETARGET_okREAL8
2488 case FFEINFO_kindtypeREAL8:
2489 *aptr = array.real8 + offset;
2490 break;
2491 #endif
2493 default:
2494 assert ("bad REAL akindtype" == NULL);
2495 break;
2497 break;
2499 case FFEINFO_basictypeCOMPLEX:
2500 switch (akt)
2502 #if FFETARGET_okCOMPLEX1
2503 case FFEINFO_kindtypeREAL1:
2504 *aptr = array.complex1 + offset;
2505 break;
2506 #endif
2508 #if FFETARGET_okCOMPLEX2
2509 case FFEINFO_kindtypeREAL2:
2510 *aptr = array.complex2 + offset;
2511 break;
2512 #endif
2514 #if FFETARGET_okCOMPLEX3
2515 case FFEINFO_kindtypeREAL3:
2516 *aptr = array.complex3 + offset;
2517 break;
2518 #endif
2520 #if FFETARGET_okCOMPLEX4
2521 case FFEINFO_kindtypeREAL4:
2522 *aptr = array.complex4 + offset;
2523 break;
2524 #endif
2526 #if FFETARGET_okCOMPLEX5
2527 case FFEINFO_kindtypeREAL5:
2528 *aptr = array.complex5 + offset;
2529 break;
2530 #endif
2532 #if FFETARGET_okCOMPLEX6
2533 case FFEINFO_kindtypeREAL6:
2534 *aptr = array.complex6 + offset;
2535 break;
2536 #endif
2538 #if FFETARGET_okCOMPLEX7
2539 case FFEINFO_kindtypeREAL7:
2540 *aptr = array.complex7 + offset;
2541 break;
2542 #endif
2544 #if FFETARGET_okCOMPLEX8
2545 case FFEINFO_kindtypeREAL8:
2546 *aptr = array.complex8 + offset;
2547 break;
2548 #endif
2550 default:
2551 assert ("bad COMPLEX akindtype" == NULL);
2552 break;
2554 break;
2556 case FFEINFO_basictypeCHARACTER:
2557 switch (akt)
2559 #if FFETARGET_okCHARACTER1
2560 case FFEINFO_kindtypeCHARACTER1:
2561 *aptr = array.character1 + offset;
2562 break;
2563 #endif
2565 #if FFETARGET_okCHARACTER2
2566 case FFEINFO_kindtypeCHARACTER2:
2567 *aptr = array.character2 + offset;
2568 break;
2569 #endif
2571 #if FFETARGET_okCHARACTER3
2572 case FFEINFO_kindtypeCHARACTER3:
2573 *aptr = array.character3 + offset;
2574 break;
2575 #endif
2577 #if FFETARGET_okCHARACTER4
2578 case FFEINFO_kindtypeCHARACTER4:
2579 *aptr = array.character4 + offset;
2580 break;
2581 #endif
2583 #if FFETARGET_okCHARACTER5
2584 case FFEINFO_kindtypeCHARACTER5:
2585 *aptr = array.character5 + offset;
2586 break;
2587 #endif
2589 #if FFETARGET_okCHARACTER6
2590 case FFEINFO_kindtypeCHARACTER6:
2591 *aptr = array.character6 + offset;
2592 break;
2593 #endif
2595 #if FFETARGET_okCHARACTER7
2596 case FFEINFO_kindtypeCHARACTER7:
2597 *aptr = array.character7 + offset;
2598 break;
2599 #endif
2601 #if FFETARGET_okCHARACTER8
2602 case FFEINFO_kindtypeCHARACTER8:
2603 *aptr = array.character8 + offset;
2604 break;
2605 #endif
2607 default:
2608 assert ("bad CHARACTER akindtype" == NULL);
2609 break;
2611 break;
2613 default:
2614 assert ("bad abasictype" == NULL);
2615 break;
2618 switch (cbt)
2620 case FFEINFO_basictypeINTEGER:
2621 switch (ckt)
2623 #if FFETARGET_okINTEGER1
2624 case FFEINFO_kindtypeINTEGER1:
2625 *cptr = source_array.integer1;
2626 *size = sizeof (*source_array.integer1);
2627 break;
2628 #endif
2630 #if FFETARGET_okINTEGER2
2631 case FFEINFO_kindtypeINTEGER2:
2632 *cptr = source_array.integer2;
2633 *size = sizeof (*source_array.integer2);
2634 break;
2635 #endif
2637 #if FFETARGET_okINTEGER3
2638 case FFEINFO_kindtypeINTEGER3:
2639 *cptr = source_array.integer3;
2640 *size = sizeof (*source_array.integer3);
2641 break;
2642 #endif
2644 #if FFETARGET_okINTEGER4
2645 case FFEINFO_kindtypeINTEGER4:
2646 *cptr = source_array.integer4;
2647 *size = sizeof (*source_array.integer4);
2648 break;
2649 #endif
2651 #if FFETARGET_okINTEGER5
2652 case FFEINFO_kindtypeINTEGER5:
2653 *cptr = source_array.integer5;
2654 *size = sizeof (*source_array.integer5);
2655 break;
2656 #endif
2658 #if FFETARGET_okINTEGER6
2659 case FFEINFO_kindtypeINTEGER6:
2660 *cptr = source_array.integer6;
2661 *size = sizeof (*source_array.integer6);
2662 break;
2663 #endif
2665 #if FFETARGET_okINTEGER7
2666 case FFEINFO_kindtypeINTEGER7:
2667 *cptr = source_array.integer7;
2668 *size = sizeof (*source_array.integer7);
2669 break;
2670 #endif
2672 #if FFETARGET_okINTEGER8
2673 case FFEINFO_kindtypeINTEGER8:
2674 *cptr = source_array.integer8;
2675 *size = sizeof (*source_array.integer8);
2676 break;
2677 #endif
2679 default:
2680 assert ("bad INTEGER ckindtype" == NULL);
2681 break;
2683 break;
2685 case FFEINFO_basictypeLOGICAL:
2686 switch (ckt)
2688 #if FFETARGET_okLOGICAL1
2689 case FFEINFO_kindtypeLOGICAL1:
2690 *cptr = source_array.logical1;
2691 *size = sizeof (*source_array.logical1);
2692 break;
2693 #endif
2695 #if FFETARGET_okLOGICAL2
2696 case FFEINFO_kindtypeLOGICAL2:
2697 *cptr = source_array.logical2;
2698 *size = sizeof (*source_array.logical2);
2699 break;
2700 #endif
2702 #if FFETARGET_okLOGICAL3
2703 case FFEINFO_kindtypeLOGICAL3:
2704 *cptr = source_array.logical3;
2705 *size = sizeof (*source_array.logical3);
2706 break;
2707 #endif
2709 #if FFETARGET_okLOGICAL4
2710 case FFEINFO_kindtypeLOGICAL4:
2711 *cptr = source_array.logical4;
2712 *size = sizeof (*source_array.logical4);
2713 break;
2714 #endif
2716 #if FFETARGET_okLOGICAL5
2717 case FFEINFO_kindtypeLOGICAL5:
2718 *cptr = source_array.logical5;
2719 *size = sizeof (*source_array.logical5);
2720 break;
2721 #endif
2723 #if FFETARGET_okLOGICAL6
2724 case FFEINFO_kindtypeLOGICAL6:
2725 *cptr = source_array.logical6;
2726 *size = sizeof (*source_array.logical6);
2727 break;
2728 #endif
2730 #if FFETARGET_okLOGICAL7
2731 case FFEINFO_kindtypeLOGICAL7:
2732 *cptr = source_array.logical7;
2733 *size = sizeof (*source_array.logical7);
2734 break;
2735 #endif
2737 #if FFETARGET_okLOGICAL8
2738 case FFEINFO_kindtypeLOGICAL8:
2739 *cptr = source_array.logical8;
2740 *size = sizeof (*source_array.logical8);
2741 break;
2742 #endif
2744 default:
2745 assert ("bad LOGICAL ckindtype" == NULL);
2746 break;
2748 break;
2750 case FFEINFO_basictypeREAL:
2751 switch (ckt)
2753 #if FFETARGET_okREAL1
2754 case FFEINFO_kindtypeREAL1:
2755 *cptr = source_array.real1;
2756 *size = sizeof (*source_array.real1);
2757 break;
2758 #endif
2760 #if FFETARGET_okREAL2
2761 case FFEINFO_kindtypeREAL2:
2762 *cptr = source_array.real2;
2763 *size = sizeof (*source_array.real2);
2764 break;
2765 #endif
2767 #if FFETARGET_okREAL3
2768 case FFEINFO_kindtypeREAL3:
2769 *cptr = source_array.real3;
2770 *size = sizeof (*source_array.real3);
2771 break;
2772 #endif
2774 #if FFETARGET_okREAL4
2775 case FFEINFO_kindtypeREAL4:
2776 *cptr = source_array.real4;
2777 *size = sizeof (*source_array.real4);
2778 break;
2779 #endif
2781 #if FFETARGET_okREAL5
2782 case FFEINFO_kindtypeREAL5:
2783 *cptr = source_array.real5;
2784 *size = sizeof (*source_array.real5);
2785 break;
2786 #endif
2788 #if FFETARGET_okREAL6
2789 case FFEINFO_kindtypeREAL6:
2790 *cptr = source_array.real6;
2791 *size = sizeof (*source_array.real6);
2792 break;
2793 #endif
2795 #if FFETARGET_okREAL7
2796 case FFEINFO_kindtypeREAL7:
2797 *cptr = source_array.real7;
2798 *size = sizeof (*source_array.real7);
2799 break;
2800 #endif
2802 #if FFETARGET_okREAL8
2803 case FFEINFO_kindtypeREAL8:
2804 *cptr = source_array.real8;
2805 *size = sizeof (*source_array.real8);
2806 break;
2807 #endif
2809 default:
2810 assert ("bad REAL ckindtype" == NULL);
2811 break;
2813 break;
2815 case FFEINFO_basictypeCOMPLEX:
2816 switch (ckt)
2818 #if FFETARGET_okCOMPLEX1
2819 case FFEINFO_kindtypeREAL1:
2820 *cptr = source_array.complex1;
2821 *size = sizeof (*source_array.complex1);
2822 break;
2823 #endif
2825 #if FFETARGET_okCOMPLEX2
2826 case FFEINFO_kindtypeREAL2:
2827 *cptr = source_array.complex2;
2828 *size = sizeof (*source_array.complex2);
2829 break;
2830 #endif
2832 #if FFETARGET_okCOMPLEX3
2833 case FFEINFO_kindtypeREAL3:
2834 *cptr = source_array.complex3;
2835 *size = sizeof (*source_array.complex3);
2836 break;
2837 #endif
2839 #if FFETARGET_okCOMPLEX4
2840 case FFEINFO_kindtypeREAL4:
2841 *cptr = source_array.complex4;
2842 *size = sizeof (*source_array.complex4);
2843 break;
2844 #endif
2846 #if FFETARGET_okCOMPLEX5
2847 case FFEINFO_kindtypeREAL5:
2848 *cptr = source_array.complex5;
2849 *size = sizeof (*source_array.complex5);
2850 break;
2851 #endif
2853 #if FFETARGET_okCOMPLEX6
2854 case FFEINFO_kindtypeREAL6:
2855 *cptr = source_array.complex6;
2856 *size = sizeof (*source_array.complex6);
2857 break;
2858 #endif
2860 #if FFETARGET_okCOMPLEX7
2861 case FFEINFO_kindtypeREAL7:
2862 *cptr = source_array.complex7;
2863 *size = sizeof (*source_array.complex7);
2864 break;
2865 #endif
2867 #if FFETARGET_okCOMPLEX8
2868 case FFEINFO_kindtypeREAL8:
2869 *cptr = source_array.complex8;
2870 *size = sizeof (*source_array.complex8);
2871 break;
2872 #endif
2874 default:
2875 assert ("bad COMPLEX ckindtype" == NULL);
2876 break;
2878 break;
2880 case FFEINFO_basictypeCHARACTER:
2881 switch (ckt)
2883 #if FFETARGET_okCHARACTER1
2884 case FFEINFO_kindtypeCHARACTER1:
2885 *cptr = source_array.character1;
2886 *size = sizeof (*source_array.character1);
2887 break;
2888 #endif
2890 #if FFETARGET_okCHARACTER2
2891 case FFEINFO_kindtypeCHARACTER2:
2892 *cptr = source_array.character2;
2893 *size = sizeof (*source_array.character2);
2894 break;
2895 #endif
2897 #if FFETARGET_okCHARACTER3
2898 case FFEINFO_kindtypeCHARACTER3:
2899 *cptr = source_array.character3;
2900 *size = sizeof (*source_array.character3);
2901 break;
2902 #endif
2904 #if FFETARGET_okCHARACTER4
2905 case FFEINFO_kindtypeCHARACTER4:
2906 *cptr = source_array.character4;
2907 *size = sizeof (*source_array.character4);
2908 break;
2909 #endif
2911 #if FFETARGET_okCHARACTER5
2912 case FFEINFO_kindtypeCHARACTER5:
2913 *cptr = source_array.character5;
2914 *size = sizeof (*source_array.character5);
2915 break;
2916 #endif
2918 #if FFETARGET_okCHARACTER6
2919 case FFEINFO_kindtypeCHARACTER6:
2920 *cptr = source_array.character6;
2921 *size = sizeof (*source_array.character6);
2922 break;
2923 #endif
2925 #if FFETARGET_okCHARACTER7
2926 case FFEINFO_kindtypeCHARACTER7:
2927 *cptr = source_array.character7;
2928 *size = sizeof (*source_array.character7);
2929 break;
2930 #endif
2932 #if FFETARGET_okCHARACTER8
2933 case FFEINFO_kindtypeCHARACTER8:
2934 *cptr = source_array.character8;
2935 *size = sizeof (*source_array.character8);
2936 break;
2937 #endif
2939 default:
2940 assert ("bad CHARACTER ckindtype" == NULL);
2941 break;
2943 break;
2945 default:
2946 assert ("bad cbasictype" == NULL);
2947 break;
2951 /* ffebld_constantarray_prepare -- Prepare for copy between value and array
2953 See prototype.
2955 Like _put, but just returns the pointers to the beginnings of the
2956 array and the constant and returns the size (the amount of info to
2957 copy). The idea is that the caller can use memcpy to accomplish the
2958 same thing as _put (though slower), or the caller can use a different
2959 function that swaps bytes, words, etc for a different target machine.
2960 Also, the type of the array may be different from the type of the
2961 constant; the array type is used to determine the meaning (scale) of
2962 the offset field (to calculate the array pointer), the constant type is
2963 used to determine the constant pointer and the size (amount of info to
2964 copy). */
2966 void
2967 ffebld_constantarray_prepare (void **aptr, void **cptr, size_t *size,
2968 ffebldConstantArray array, ffeinfoBasictype abt, ffeinfoKindtype akt,
2969 ffetargetOffset offset, ffebldConstantUnion *constant,
2970 ffeinfoBasictype cbt, ffeinfoKindtype ckt)
2972 switch (abt)
2974 case FFEINFO_basictypeINTEGER:
2975 switch (akt)
2977 #if FFETARGET_okINTEGER1
2978 case FFEINFO_kindtypeINTEGER1:
2979 *aptr = array.integer1 + offset;
2980 break;
2981 #endif
2983 #if FFETARGET_okINTEGER2
2984 case FFEINFO_kindtypeINTEGER2:
2985 *aptr = array.integer2 + offset;
2986 break;
2987 #endif
2989 #if FFETARGET_okINTEGER3
2990 case FFEINFO_kindtypeINTEGER3:
2991 *aptr = array.integer3 + offset;
2992 break;
2993 #endif
2995 #if FFETARGET_okINTEGER4
2996 case FFEINFO_kindtypeINTEGER4:
2997 *aptr = array.integer4 + offset;
2998 break;
2999 #endif
3001 #if FFETARGET_okINTEGER5
3002 case FFEINFO_kindtypeINTEGER5:
3003 *aptr = array.integer5 + offset;
3004 break;
3005 #endif
3007 #if FFETARGET_okINTEGER6
3008 case FFEINFO_kindtypeINTEGER6:
3009 *aptr = array.integer6 + offset;
3010 break;
3011 #endif
3013 #if FFETARGET_okINTEGER7
3014 case FFEINFO_kindtypeINTEGER7:
3015 *aptr = array.integer7 + offset;
3016 break;
3017 #endif
3019 #if FFETARGET_okINTEGER8
3020 case FFEINFO_kindtypeINTEGER8:
3021 *aptr = array.integer8 + offset;
3022 break;
3023 #endif
3025 default:
3026 assert ("bad INTEGER akindtype" == NULL);
3027 break;
3029 break;
3031 case FFEINFO_basictypeLOGICAL:
3032 switch (akt)
3034 #if FFETARGET_okLOGICAL1
3035 case FFEINFO_kindtypeLOGICAL1:
3036 *aptr = array.logical1 + offset;
3037 break;
3038 #endif
3040 #if FFETARGET_okLOGICAL2
3041 case FFEINFO_kindtypeLOGICAL2:
3042 *aptr = array.logical2 + offset;
3043 break;
3044 #endif
3046 #if FFETARGET_okLOGICAL3
3047 case FFEINFO_kindtypeLOGICAL3:
3048 *aptr = array.logical3 + offset;
3049 break;
3050 #endif
3052 #if FFETARGET_okLOGICAL4
3053 case FFEINFO_kindtypeLOGICAL4:
3054 *aptr = array.logical4 + offset;
3055 break;
3056 #endif
3058 #if FFETARGET_okLOGICAL5
3059 case FFEINFO_kindtypeLOGICAL5:
3060 *aptr = array.logical5 + offset;
3061 break;
3062 #endif
3064 #if FFETARGET_okLOGICAL6
3065 case FFEINFO_kindtypeLOGICAL6:
3066 *aptr = array.logical6 + offset;
3067 break;
3068 #endif
3070 #if FFETARGET_okLOGICAL7
3071 case FFEINFO_kindtypeLOGICAL7:
3072 *aptr = array.logical7 + offset;
3073 break;
3074 #endif
3076 #if FFETARGET_okLOGICAL8
3077 case FFEINFO_kindtypeLOGICAL8:
3078 *aptr = array.logical8 + offset;
3079 break;
3080 #endif
3082 default:
3083 assert ("bad LOGICAL akindtype" == NULL);
3084 break;
3086 break;
3088 case FFEINFO_basictypeREAL:
3089 switch (akt)
3091 #if FFETARGET_okREAL1
3092 case FFEINFO_kindtypeREAL1:
3093 *aptr = array.real1 + offset;
3094 break;
3095 #endif
3097 #if FFETARGET_okREAL2
3098 case FFEINFO_kindtypeREAL2:
3099 *aptr = array.real2 + offset;
3100 break;
3101 #endif
3103 #if FFETARGET_okREAL3
3104 case FFEINFO_kindtypeREAL3:
3105 *aptr = array.real3 + offset;
3106 break;
3107 #endif
3109 #if FFETARGET_okREAL4
3110 case FFEINFO_kindtypeREAL4:
3111 *aptr = array.real4 + offset;
3112 break;
3113 #endif
3115 #if FFETARGET_okREAL5
3116 case FFEINFO_kindtypeREAL5:
3117 *aptr = array.real5 + offset;
3118 break;
3119 #endif
3121 #if FFETARGET_okREAL6
3122 case FFEINFO_kindtypeREAL6:
3123 *aptr = array.real6 + offset;
3124 break;
3125 #endif
3127 #if FFETARGET_okREAL7
3128 case FFEINFO_kindtypeREAL7:
3129 *aptr = array.real7 + offset;
3130 break;
3131 #endif
3133 #if FFETARGET_okREAL8
3134 case FFEINFO_kindtypeREAL8:
3135 *aptr = array.real8 + offset;
3136 break;
3137 #endif
3139 default:
3140 assert ("bad REAL akindtype" == NULL);
3141 break;
3143 break;
3145 case FFEINFO_basictypeCOMPLEX:
3146 switch (akt)
3148 #if FFETARGET_okCOMPLEX1
3149 case FFEINFO_kindtypeREAL1:
3150 *aptr = array.complex1 + offset;
3151 break;
3152 #endif
3154 #if FFETARGET_okCOMPLEX2
3155 case FFEINFO_kindtypeREAL2:
3156 *aptr = array.complex2 + offset;
3157 break;
3158 #endif
3160 #if FFETARGET_okCOMPLEX3
3161 case FFEINFO_kindtypeREAL3:
3162 *aptr = array.complex3 + offset;
3163 break;
3164 #endif
3166 #if FFETARGET_okCOMPLEX4
3167 case FFEINFO_kindtypeREAL4:
3168 *aptr = array.complex4 + offset;
3169 break;
3170 #endif
3172 #if FFETARGET_okCOMPLEX5
3173 case FFEINFO_kindtypeREAL5:
3174 *aptr = array.complex5 + offset;
3175 break;
3176 #endif
3178 #if FFETARGET_okCOMPLEX6
3179 case FFEINFO_kindtypeREAL6:
3180 *aptr = array.complex6 + offset;
3181 break;
3182 #endif
3184 #if FFETARGET_okCOMPLEX7
3185 case FFEINFO_kindtypeREAL7:
3186 *aptr = array.complex7 + offset;
3187 break;
3188 #endif
3190 #if FFETARGET_okCOMPLEX8
3191 case FFEINFO_kindtypeREAL8:
3192 *aptr = array.complex8 + offset;
3193 break;
3194 #endif
3196 default:
3197 assert ("bad COMPLEX akindtype" == NULL);
3198 break;
3200 break;
3202 case FFEINFO_basictypeCHARACTER:
3203 switch (akt)
3205 #if FFETARGET_okCHARACTER1
3206 case FFEINFO_kindtypeCHARACTER1:
3207 *aptr = array.character1 + offset;
3208 break;
3209 #endif
3211 #if FFETARGET_okCHARACTER2
3212 case FFEINFO_kindtypeCHARACTER2:
3213 *aptr = array.character2 + offset;
3214 break;
3215 #endif
3217 #if FFETARGET_okCHARACTER3
3218 case FFEINFO_kindtypeCHARACTER3:
3219 *aptr = array.character3 + offset;
3220 break;
3221 #endif
3223 #if FFETARGET_okCHARACTER4
3224 case FFEINFO_kindtypeCHARACTER4:
3225 *aptr = array.character4 + offset;
3226 break;
3227 #endif
3229 #if FFETARGET_okCHARACTER5
3230 case FFEINFO_kindtypeCHARACTER5:
3231 *aptr = array.character5 + offset;
3232 break;
3233 #endif
3235 #if FFETARGET_okCHARACTER6
3236 case FFEINFO_kindtypeCHARACTER6:
3237 *aptr = array.character6 + offset;
3238 break;
3239 #endif
3241 #if FFETARGET_okCHARACTER7
3242 case FFEINFO_kindtypeCHARACTER7:
3243 *aptr = array.character7 + offset;
3244 break;
3245 #endif
3247 #if FFETARGET_okCHARACTER8
3248 case FFEINFO_kindtypeCHARACTER8:
3249 *aptr = array.character8 + offset;
3250 break;
3251 #endif
3253 default:
3254 assert ("bad CHARACTER akindtype" == NULL);
3255 break;
3257 break;
3259 default:
3260 assert ("bad abasictype" == NULL);
3261 break;
3264 switch (cbt)
3266 case FFEINFO_basictypeINTEGER:
3267 switch (ckt)
3269 #if FFETARGET_okINTEGER1
3270 case FFEINFO_kindtypeINTEGER1:
3271 *cptr = &constant->integer1;
3272 *size = sizeof (constant->integer1);
3273 break;
3274 #endif
3276 #if FFETARGET_okINTEGER2
3277 case FFEINFO_kindtypeINTEGER2:
3278 *cptr = &constant->integer2;
3279 *size = sizeof (constant->integer2);
3280 break;
3281 #endif
3283 #if FFETARGET_okINTEGER3
3284 case FFEINFO_kindtypeINTEGER3:
3285 *cptr = &constant->integer3;
3286 *size = sizeof (constant->integer3);
3287 break;
3288 #endif
3290 #if FFETARGET_okINTEGER4
3291 case FFEINFO_kindtypeINTEGER4:
3292 *cptr = &constant->integer4;
3293 *size = sizeof (constant->integer4);
3294 break;
3295 #endif
3297 #if FFETARGET_okINTEGER5
3298 case FFEINFO_kindtypeINTEGER5:
3299 *cptr = &constant->integer5;
3300 *size = sizeof (constant->integer5);
3301 break;
3302 #endif
3304 #if FFETARGET_okINTEGER6
3305 case FFEINFO_kindtypeINTEGER6:
3306 *cptr = &constant->integer6;
3307 *size = sizeof (constant->integer6);
3308 break;
3309 #endif
3311 #if FFETARGET_okINTEGER7
3312 case FFEINFO_kindtypeINTEGER7:
3313 *cptr = &constant->integer7;
3314 *size = sizeof (constant->integer7);
3315 break;
3316 #endif
3318 #if FFETARGET_okINTEGER8
3319 case FFEINFO_kindtypeINTEGER8:
3320 *cptr = &constant->integer8;
3321 *size = sizeof (constant->integer8);
3322 break;
3323 #endif
3325 default:
3326 assert ("bad INTEGER ckindtype" == NULL);
3327 break;
3329 break;
3331 case FFEINFO_basictypeLOGICAL:
3332 switch (ckt)
3334 #if FFETARGET_okLOGICAL1
3335 case FFEINFO_kindtypeLOGICAL1:
3336 *cptr = &constant->logical1;
3337 *size = sizeof (constant->logical1);
3338 break;
3339 #endif
3341 #if FFETARGET_okLOGICAL2
3342 case FFEINFO_kindtypeLOGICAL2:
3343 *cptr = &constant->logical2;
3344 *size = sizeof (constant->logical2);
3345 break;
3346 #endif
3348 #if FFETARGET_okLOGICAL3
3349 case FFEINFO_kindtypeLOGICAL3:
3350 *cptr = &constant->logical3;
3351 *size = sizeof (constant->logical3);
3352 break;
3353 #endif
3355 #if FFETARGET_okLOGICAL4
3356 case FFEINFO_kindtypeLOGICAL4:
3357 *cptr = &constant->logical4;
3358 *size = sizeof (constant->logical4);
3359 break;
3360 #endif
3362 #if FFETARGET_okLOGICAL5
3363 case FFEINFO_kindtypeLOGICAL5:
3364 *cptr = &constant->logical5;
3365 *size = sizeof (constant->logical5);
3366 break;
3367 #endif
3369 #if FFETARGET_okLOGICAL6
3370 case FFEINFO_kindtypeLOGICAL6:
3371 *cptr = &constant->logical6;
3372 *size = sizeof (constant->logical6);
3373 break;
3374 #endif
3376 #if FFETARGET_okLOGICAL7
3377 case FFEINFO_kindtypeLOGICAL7:
3378 *cptr = &constant->logical7;
3379 *size = sizeof (constant->logical7);
3380 break;
3381 #endif
3383 #if FFETARGET_okLOGICAL8
3384 case FFEINFO_kindtypeLOGICAL8:
3385 *cptr = &constant->logical8;
3386 *size = sizeof (constant->logical8);
3387 break;
3388 #endif
3390 default:
3391 assert ("bad LOGICAL ckindtype" == NULL);
3392 break;
3394 break;
3396 case FFEINFO_basictypeREAL:
3397 switch (ckt)
3399 #if FFETARGET_okREAL1
3400 case FFEINFO_kindtypeREAL1:
3401 *cptr = &constant->real1;
3402 *size = sizeof (constant->real1);
3403 break;
3404 #endif
3406 #if FFETARGET_okREAL2
3407 case FFEINFO_kindtypeREAL2:
3408 *cptr = &constant->real2;
3409 *size = sizeof (constant->real2);
3410 break;
3411 #endif
3413 #if FFETARGET_okREAL3
3414 case FFEINFO_kindtypeREAL3:
3415 *cptr = &constant->real3;
3416 *size = sizeof (constant->real3);
3417 break;
3418 #endif
3420 #if FFETARGET_okREAL4
3421 case FFEINFO_kindtypeREAL4:
3422 *cptr = &constant->real4;
3423 *size = sizeof (constant->real4);
3424 break;
3425 #endif
3427 #if FFETARGET_okREAL5
3428 case FFEINFO_kindtypeREAL5:
3429 *cptr = &constant->real5;
3430 *size = sizeof (constant->real5);
3431 break;
3432 #endif
3434 #if FFETARGET_okREAL6
3435 case FFEINFO_kindtypeREAL6:
3436 *cptr = &constant->real6;
3437 *size = sizeof (constant->real6);
3438 break;
3439 #endif
3441 #if FFETARGET_okREAL7
3442 case FFEINFO_kindtypeREAL7:
3443 *cptr = &constant->real7;
3444 *size = sizeof (constant->real7);
3445 break;
3446 #endif
3448 #if FFETARGET_okREAL8
3449 case FFEINFO_kindtypeREAL8:
3450 *cptr = &constant->real8;
3451 *size = sizeof (constant->real8);
3452 break;
3453 #endif
3455 default:
3456 assert ("bad REAL ckindtype" == NULL);
3457 break;
3459 break;
3461 case FFEINFO_basictypeCOMPLEX:
3462 switch (ckt)
3464 #if FFETARGET_okCOMPLEX1
3465 case FFEINFO_kindtypeREAL1:
3466 *cptr = &constant->complex1;
3467 *size = sizeof (constant->complex1);
3468 break;
3469 #endif
3471 #if FFETARGET_okCOMPLEX2
3472 case FFEINFO_kindtypeREAL2:
3473 *cptr = &constant->complex2;
3474 *size = sizeof (constant->complex2);
3475 break;
3476 #endif
3478 #if FFETARGET_okCOMPLEX3
3479 case FFEINFO_kindtypeREAL3:
3480 *cptr = &constant->complex3;
3481 *size = sizeof (constant->complex3);
3482 break;
3483 #endif
3485 #if FFETARGET_okCOMPLEX4
3486 case FFEINFO_kindtypeREAL4:
3487 *cptr = &constant->complex4;
3488 *size = sizeof (constant->complex4);
3489 break;
3490 #endif
3492 #if FFETARGET_okCOMPLEX5
3493 case FFEINFO_kindtypeREAL5:
3494 *cptr = &constant->complex5;
3495 *size = sizeof (constant->complex5);
3496 break;
3497 #endif
3499 #if FFETARGET_okCOMPLEX6
3500 case FFEINFO_kindtypeREAL6:
3501 *cptr = &constant->complex6;
3502 *size = sizeof (constant->complex6);
3503 break;
3504 #endif
3506 #if FFETARGET_okCOMPLEX7
3507 case FFEINFO_kindtypeREAL7:
3508 *cptr = &constant->complex7;
3509 *size = sizeof (constant->complex7);
3510 break;
3511 #endif
3513 #if FFETARGET_okCOMPLEX8
3514 case FFEINFO_kindtypeREAL8:
3515 *cptr = &constant->complex8;
3516 *size = sizeof (constant->complex8);
3517 break;
3518 #endif
3520 default:
3521 assert ("bad COMPLEX ckindtype" == NULL);
3522 break;
3524 break;
3526 case FFEINFO_basictypeCHARACTER:
3527 switch (ckt)
3529 #if FFETARGET_okCHARACTER1
3530 case FFEINFO_kindtypeCHARACTER1:
3531 *cptr = ffetarget_text_character1 (constant->character1);
3532 *size = ffetarget_length_character1 (constant->character1);
3533 break;
3534 #endif
3536 #if FFETARGET_okCHARACTER2
3537 case FFEINFO_kindtypeCHARACTER2:
3538 *cptr = ffetarget_text_character2 (constant->character2);
3539 *size = ffetarget_length_character2 (constant->character2);
3540 break;
3541 #endif
3543 #if FFETARGET_okCHARACTER3
3544 case FFEINFO_kindtypeCHARACTER3:
3545 *cptr = ffetarget_text_character3 (constant->character3);
3546 *size = ffetarget_length_character3 (constant->character3);
3547 break;
3548 #endif
3550 #if FFETARGET_okCHARACTER4
3551 case FFEINFO_kindtypeCHARACTER4:
3552 *cptr = ffetarget_text_character4 (constant->character4);
3553 *size = ffetarget_length_character4 (constant->character4);
3554 break;
3555 #endif
3557 #if FFETARGET_okCHARACTER5
3558 case FFEINFO_kindtypeCHARACTER5:
3559 *cptr = ffetarget_text_character5 (constant->character5);
3560 *size = ffetarget_length_character5 (constant->character5);
3561 break;
3562 #endif
3564 #if FFETARGET_okCHARACTER6
3565 case FFEINFO_kindtypeCHARACTER6:
3566 *cptr = ffetarget_text_character6 (constant->character6);
3567 *size = ffetarget_length_character6 (constant->character6);
3568 break;
3569 #endif
3571 #if FFETARGET_okCHARACTER7
3572 case FFEINFO_kindtypeCHARACTER7:
3573 *cptr = ffetarget_text_character7 (constant->character7);
3574 *size = ffetarget_length_character7 (constant->character7);
3575 break;
3576 #endif
3578 #if FFETARGET_okCHARACTER8
3579 case FFEINFO_kindtypeCHARACTER8:
3580 *cptr = ffetarget_text_character8 (constant->character8);
3581 *size = ffetarget_length_character8 (constant->character8);
3582 break;
3583 #endif
3585 default:
3586 assert ("bad CHARACTER ckindtype" == NULL);
3587 break;
3589 break;
3591 default:
3592 assert ("bad cbasictype" == NULL);
3593 break;
3597 /* ffebld_constantarray_put -- Put a value into an array of constants
3599 See prototype. */
3601 void
3602 ffebld_constantarray_put (ffebldConstantArray array, ffeinfoBasictype bt,
3603 ffeinfoKindtype kt, ffetargetOffset offset, ffebldConstantUnion constant)
3605 switch (bt)
3607 case FFEINFO_basictypeINTEGER:
3608 switch (kt)
3610 #if FFETARGET_okINTEGER1
3611 case FFEINFO_kindtypeINTEGER1:
3612 *(array.integer1 + offset) = constant.integer1;
3613 break;
3614 #endif
3616 #if FFETARGET_okINTEGER2
3617 case FFEINFO_kindtypeINTEGER2:
3618 *(array.integer2 + offset) = constant.integer2;
3619 break;
3620 #endif
3622 #if FFETARGET_okINTEGER3
3623 case FFEINFO_kindtypeINTEGER3:
3624 *(array.integer3 + offset) = constant.integer3;
3625 break;
3626 #endif
3628 #if FFETARGET_okINTEGER4
3629 case FFEINFO_kindtypeINTEGER4:
3630 *(array.integer4 + offset) = constant.integer4;
3631 break;
3632 #endif
3634 #if FFETARGET_okINTEGER5
3635 case FFEINFO_kindtypeINTEGER5:
3636 *(array.integer5 + offset) = constant.integer5;
3637 break;
3638 #endif
3640 #if FFETARGET_okINTEGER6
3641 case FFEINFO_kindtypeINTEGER6:
3642 *(array.integer6 + offset) = constant.integer6;
3643 break;
3644 #endif
3646 #if FFETARGET_okINTEGER7
3647 case FFEINFO_kindtypeINTEGER7:
3648 *(array.integer7 + offset) = constant.integer7;
3649 break;
3650 #endif
3652 #if FFETARGET_okINTEGER8
3653 case FFEINFO_kindtypeINTEGER8:
3654 *(array.integer8 + offset) = constant.integer8;
3655 break;
3656 #endif
3658 default:
3659 assert ("bad INTEGER kindtype" == NULL);
3660 break;
3662 break;
3664 case FFEINFO_basictypeLOGICAL:
3665 switch (kt)
3667 #if FFETARGET_okLOGICAL1
3668 case FFEINFO_kindtypeLOGICAL1:
3669 *(array.logical1 + offset) = constant.logical1;
3670 break;
3671 #endif
3673 #if FFETARGET_okLOGICAL2
3674 case FFEINFO_kindtypeLOGICAL2:
3675 *(array.logical2 + offset) = constant.logical2;
3676 break;
3677 #endif
3679 #if FFETARGET_okLOGICAL3
3680 case FFEINFO_kindtypeLOGICAL3:
3681 *(array.logical3 + offset) = constant.logical3;
3682 break;
3683 #endif
3685 #if FFETARGET_okLOGICAL4
3686 case FFEINFO_kindtypeLOGICAL4:
3687 *(array.logical4 + offset) = constant.logical4;
3688 break;
3689 #endif
3691 #if FFETARGET_okLOGICAL5
3692 case FFEINFO_kindtypeLOGICAL5:
3693 *(array.logical5 + offset) = constant.logical5;
3694 break;
3695 #endif
3697 #if FFETARGET_okLOGICAL6
3698 case FFEINFO_kindtypeLOGICAL6:
3699 *(array.logical6 + offset) = constant.logical6;
3700 break;
3701 #endif
3703 #if FFETARGET_okLOGICAL7
3704 case FFEINFO_kindtypeLOGICAL7:
3705 *(array.logical7 + offset) = constant.logical7;
3706 break;
3707 #endif
3709 #if FFETARGET_okLOGICAL8
3710 case FFEINFO_kindtypeLOGICAL8:
3711 *(array.logical8 + offset) = constant.logical8;
3712 break;
3713 #endif
3715 default:
3716 assert ("bad LOGICAL kindtype" == NULL);
3717 break;
3719 break;
3721 case FFEINFO_basictypeREAL:
3722 switch (kt)
3724 #if FFETARGET_okREAL1
3725 case FFEINFO_kindtypeREAL1:
3726 *(array.real1 + offset) = constant.real1;
3727 break;
3728 #endif
3730 #if FFETARGET_okREAL2
3731 case FFEINFO_kindtypeREAL2:
3732 *(array.real2 + offset) = constant.real2;
3733 break;
3734 #endif
3736 #if FFETARGET_okREAL3
3737 case FFEINFO_kindtypeREAL3:
3738 *(array.real3 + offset) = constant.real3;
3739 break;
3740 #endif
3742 #if FFETARGET_okREAL4
3743 case FFEINFO_kindtypeREAL4:
3744 *(array.real4 + offset) = constant.real4;
3745 break;
3746 #endif
3748 #if FFETARGET_okREAL5
3749 case FFEINFO_kindtypeREAL5:
3750 *(array.real5 + offset) = constant.real5;
3751 break;
3752 #endif
3754 #if FFETARGET_okREAL6
3755 case FFEINFO_kindtypeREAL6:
3756 *(array.real6 + offset) = constant.real6;
3757 break;
3758 #endif
3760 #if FFETARGET_okREAL7
3761 case FFEINFO_kindtypeREAL7:
3762 *(array.real7 + offset) = constant.real7;
3763 break;
3764 #endif
3766 #if FFETARGET_okREAL8
3767 case FFEINFO_kindtypeREAL8:
3768 *(array.real8 + offset) = constant.real8;
3769 break;
3770 #endif
3772 default:
3773 assert ("bad REAL kindtype" == NULL);
3774 break;
3776 break;
3778 case FFEINFO_basictypeCOMPLEX:
3779 switch (kt)
3781 #if FFETARGET_okCOMPLEX1
3782 case FFEINFO_kindtypeREAL1:
3783 *(array.complex1 + offset) = constant.complex1;
3784 break;
3785 #endif
3787 #if FFETARGET_okCOMPLEX2
3788 case FFEINFO_kindtypeREAL2:
3789 *(array.complex2 + offset) = constant.complex2;
3790 break;
3791 #endif
3793 #if FFETARGET_okCOMPLEX3
3794 case FFEINFO_kindtypeREAL3:
3795 *(array.complex3 + offset) = constant.complex3;
3796 break;
3797 #endif
3799 #if FFETARGET_okCOMPLEX4
3800 case FFEINFO_kindtypeREAL4:
3801 *(array.complex4 + offset) = constant.complex4;
3802 break;
3803 #endif
3805 #if FFETARGET_okCOMPLEX5
3806 case FFEINFO_kindtypeREAL5:
3807 *(array.complex5 + offset) = constant.complex5;
3808 break;
3809 #endif
3811 #if FFETARGET_okCOMPLEX6
3812 case FFEINFO_kindtypeREAL6:
3813 *(array.complex6 + offset) = constant.complex6;
3814 break;
3815 #endif
3817 #if FFETARGET_okCOMPLEX7
3818 case FFEINFO_kindtypeREAL7:
3819 *(array.complex7 + offset) = constant.complex7;
3820 break;
3821 #endif
3823 #if FFETARGET_okCOMPLEX8
3824 case FFEINFO_kindtypeREAL8:
3825 *(array.complex8 + offset) = constant.complex8;
3826 break;
3827 #endif
3829 default:
3830 assert ("bad COMPLEX kindtype" == NULL);
3831 break;
3833 break;
3835 case FFEINFO_basictypeCHARACTER:
3836 switch (kt)
3838 #if FFETARGET_okCHARACTER1
3839 case FFEINFO_kindtypeCHARACTER1:
3840 memcpy (array.character1 + offset,
3841 ffetarget_text_character1 (constant.character1),
3842 ffetarget_length_character1 (constant.character1));
3843 break;
3844 #endif
3846 #if FFETARGET_okCHARACTER2
3847 case FFEINFO_kindtypeCHARACTER2:
3848 memcpy (array.character2 + offset,
3849 ffetarget_text_character2 (constant.character2),
3850 ffetarget_length_character2 (constant.character2));
3851 break;
3852 #endif
3854 #if FFETARGET_okCHARACTER3
3855 case FFEINFO_kindtypeCHARACTER3:
3856 memcpy (array.character3 + offset,
3857 ffetarget_text_character3 (constant.character3),
3858 ffetarget_length_character3 (constant.character3));
3859 break;
3860 #endif
3862 #if FFETARGET_okCHARACTER4
3863 case FFEINFO_kindtypeCHARACTER4:
3864 memcpy (array.character4 + offset,
3865 ffetarget_text_character4 (constant.character4),
3866 ffetarget_length_character4 (constant.character4));
3867 break;
3868 #endif
3870 #if FFETARGET_okCHARACTER5
3871 case FFEINFO_kindtypeCHARACTER5:
3872 memcpy (array.character5 + offset,
3873 ffetarget_text_character5 (constant.character5),
3874 ffetarget_length_character5 (constant.character5));
3875 break;
3876 #endif
3878 #if FFETARGET_okCHARACTER6
3879 case FFEINFO_kindtypeCHARACTER6:
3880 memcpy (array.character6 + offset,
3881 ffetarget_text_character6 (constant.character6),
3882 ffetarget_length_character6 (constant.character6));
3883 break;
3884 #endif
3886 #if FFETARGET_okCHARACTER7
3887 case FFEINFO_kindtypeCHARACTER7:
3888 memcpy (array.character7 + offset,
3889 ffetarget_text_character7 (constant.character7),
3890 ffetarget_length_character7 (constant.character7));
3891 break;
3892 #endif
3894 #if FFETARGET_okCHARACTER8
3895 case FFEINFO_kindtypeCHARACTER8:
3896 memcpy (array.character8 + offset,
3897 ffetarget_text_character8 (constant.character8),
3898 ffetarget_length_character8 (constant.character8));
3899 break;
3900 #endif
3902 default:
3903 assert ("bad CHARACTER kindtype" == NULL);
3904 break;
3906 break;
3908 default:
3909 assert ("bad basictype" == NULL);
3910 break;
3914 /* ffebld_init_0 -- Initialize the module
3916 ffebld_init_0(); */
3918 void
3919 ffebld_init_0 ()
3921 assert (FFEBLD_op == ARRAY_SIZE (ffebld_op_string_));
3922 assert (FFEBLD_op == ARRAY_SIZE (ffebld_arity_op_));
3925 /* ffebld_init_1 -- Initialize the module for a file
3927 ffebld_init_1(); */
3929 void
3930 ffebld_init_1 ()
3932 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstFILE_
3933 int i;
3935 #if FFETARGET_okCHARACTER1
3936 ffebld_constant_character1_ = NULL;
3937 #endif
3938 #if FFETARGET_okCHARACTER2
3939 ffebld_constant_character2_ = NULL;
3940 #endif
3941 #if FFETARGET_okCHARACTER3
3942 ffebld_constant_character3_ = NULL;
3943 #endif
3944 #if FFETARGET_okCHARACTER4
3945 ffebld_constant_character4_ = NULL;
3946 #endif
3947 #if FFETARGET_okCHARACTER5
3948 ffebld_constant_character5_ = NULL;
3949 #endif
3950 #if FFETARGET_okCHARACTER6
3951 ffebld_constant_character6_ = NULL;
3952 #endif
3953 #if FFETARGET_okCHARACTER7
3954 ffebld_constant_character7_ = NULL;
3955 #endif
3956 #if FFETARGET_okCHARACTER8
3957 ffebld_constant_character8_ = NULL;
3958 #endif
3959 #if FFETARGET_okCOMPLEX1
3960 ffebld_constant_complex1_ = NULL;
3961 #endif
3962 #if FFETARGET_okCOMPLEX2
3963 ffebld_constant_complex2_ = NULL;
3964 #endif
3965 #if FFETARGET_okCOMPLEX3
3966 ffebld_constant_complex3_ = NULL;
3967 #endif
3968 #if FFETARGET_okCOMPLEX4
3969 ffebld_constant_complex4_ = NULL;
3970 #endif
3971 #if FFETARGET_okCOMPLEX5
3972 ffebld_constant_complex5_ = NULL;
3973 #endif
3974 #if FFETARGET_okCOMPLEX6
3975 ffebld_constant_complex6_ = NULL;
3976 #endif
3977 #if FFETARGET_okCOMPLEX7
3978 ffebld_constant_complex7_ = NULL;
3979 #endif
3980 #if FFETARGET_okCOMPLEX8
3981 ffebld_constant_complex8_ = NULL;
3982 #endif
3983 #if FFETARGET_okINTEGER1
3984 ffebld_constant_integer1_ = NULL;
3985 #endif
3986 #if FFETARGET_okINTEGER2
3987 ffebld_constant_integer2_ = NULL;
3988 #endif
3989 #if FFETARGET_okINTEGER3
3990 ffebld_constant_integer3_ = NULL;
3991 #endif
3992 #if FFETARGET_okINTEGER4
3993 ffebld_constant_integer4_ = NULL;
3994 #endif
3995 #if FFETARGET_okINTEGER5
3996 ffebld_constant_integer5_ = NULL;
3997 #endif
3998 #if FFETARGET_okINTEGER6
3999 ffebld_constant_integer6_ = NULL;
4000 #endif
4001 #if FFETARGET_okINTEGER7
4002 ffebld_constant_integer7_ = NULL;
4003 #endif
4004 #if FFETARGET_okINTEGER8
4005 ffebld_constant_integer8_ = NULL;
4006 #endif
4007 #if FFETARGET_okLOGICAL1
4008 ffebld_constant_logical1_ = NULL;
4009 #endif
4010 #if FFETARGET_okLOGICAL2
4011 ffebld_constant_logical2_ = NULL;
4012 #endif
4013 #if FFETARGET_okLOGICAL3
4014 ffebld_constant_logical3_ = NULL;
4015 #endif
4016 #if FFETARGET_okLOGICAL4
4017 ffebld_constant_logical4_ = NULL;
4018 #endif
4019 #if FFETARGET_okLOGICAL5
4020 ffebld_constant_logical5_ = NULL;
4021 #endif
4022 #if FFETARGET_okLOGICAL6
4023 ffebld_constant_logical6_ = NULL;
4024 #endif
4025 #if FFETARGET_okLOGICAL7
4026 ffebld_constant_logical7_ = NULL;
4027 #endif
4028 #if FFETARGET_okLOGICAL8
4029 ffebld_constant_logical8_ = NULL;
4030 #endif
4031 #if FFETARGET_okREAL1
4032 ffebld_constant_real1_ = NULL;
4033 #endif
4034 #if FFETARGET_okREAL2
4035 ffebld_constant_real2_ = NULL;
4036 #endif
4037 #if FFETARGET_okREAL3
4038 ffebld_constant_real3_ = NULL;
4039 #endif
4040 #if FFETARGET_okREAL4
4041 ffebld_constant_real4_ = NULL;
4042 #endif
4043 #if FFETARGET_okREAL5
4044 ffebld_constant_real5_ = NULL;
4045 #endif
4046 #if FFETARGET_okREAL6
4047 ffebld_constant_real6_ = NULL;
4048 #endif
4049 #if FFETARGET_okREAL7
4050 ffebld_constant_real7_ = NULL;
4051 #endif
4052 #if FFETARGET_okREAL8
4053 ffebld_constant_real8_ = NULL;
4054 #endif
4055 ffebld_constant_hollerith_ = NULL;
4056 for (i = FFEBLD_constTYPELESS_FIRST; i <= FFEBLD_constTYPELESS_LAST; ++i)
4057 ffebld_constant_typeless_[i - FFEBLD_constTYPELESS_FIRST] = NULL;
4058 #endif
4061 /* ffebld_init_2 -- Initialize the module
4063 ffebld_init_2(); */
4065 void
4066 ffebld_init_2 ()
4068 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
4069 int i;
4070 #endif
4072 ffebld_pool_stack_.next = NULL;
4073 ffebld_pool_stack_.pool = ffe_pool_program_unit ();
4074 #if FFEBLD_whereconstCURRENT_ == FFEBLD_whereconstPROGUNIT_
4075 #if FFETARGET_okCHARACTER1
4076 ffebld_constant_character1_ = NULL;
4077 #endif
4078 #if FFETARGET_okCHARACTER2
4079 ffebld_constant_character2_ = NULL;
4080 #endif
4081 #if FFETARGET_okCHARACTER3
4082 ffebld_constant_character3_ = NULL;
4083 #endif
4084 #if FFETARGET_okCHARACTER4
4085 ffebld_constant_character4_ = NULL;
4086 #endif
4087 #if FFETARGET_okCHARACTER5
4088 ffebld_constant_character5_ = NULL;
4089 #endif
4090 #if FFETARGET_okCHARACTER6
4091 ffebld_constant_character6_ = NULL;
4092 #endif
4093 #if FFETARGET_okCHARACTER7
4094 ffebld_constant_character7_ = NULL;
4095 #endif
4096 #if FFETARGET_okCHARACTER8
4097 ffebld_constant_character8_ = NULL;
4098 #endif
4099 #if FFETARGET_okCOMPLEX1
4100 ffebld_constant_complex1_ = NULL;
4101 #endif
4102 #if FFETARGET_okCOMPLEX2
4103 ffebld_constant_complex2_ = NULL;
4104 #endif
4105 #if FFETARGET_okCOMPLEX3
4106 ffebld_constant_complex3_ = NULL;
4107 #endif
4108 #if FFETARGET_okCOMPLEX4
4109 ffebld_constant_complex4_ = NULL;
4110 #endif
4111 #if FFETARGET_okCOMPLEX5
4112 ffebld_constant_complex5_ = NULL;
4113 #endif
4114 #if FFETARGET_okCOMPLEX6
4115 ffebld_constant_complex6_ = NULL;
4116 #endif
4117 #if FFETARGET_okCOMPLEX7
4118 ffebld_constant_complex7_ = NULL;
4119 #endif
4120 #if FFETARGET_okCOMPLEX8
4121 ffebld_constant_complex8_ = NULL;
4122 #endif
4123 #if FFETARGET_okINTEGER1
4124 ffebld_constant_integer1_ = NULL;
4125 #endif
4126 #if FFETARGET_okINTEGER2
4127 ffebld_constant_integer2_ = NULL;
4128 #endif
4129 #if FFETARGET_okINTEGER3
4130 ffebld_constant_integer3_ = NULL;
4131 #endif
4132 #if FFETARGET_okINTEGER4
4133 ffebld_constant_integer4_ = NULL;
4134 #endif
4135 #if FFETARGET_okINTEGER5
4136 ffebld_constant_integer5_ = NULL;
4137 #endif
4138 #if FFETARGET_okINTEGER6
4139 ffebld_constant_integer6_ = NULL;
4140 #endif
4141 #if FFETARGET_okINTEGER7
4142 ffebld_constant_integer7_ = NULL;
4143 #endif
4144 #if FFETARGET_okINTEGER8
4145 ffebld_constant_integer8_ = NULL;
4146 #endif
4147 #if FFETARGET_okLOGICAL1
4148 ffebld_constant_logical1_ = NULL;
4149 #endif
4150 #if FFETARGET_okLOGICAL2
4151 ffebld_constant_logical2_ = NULL;
4152 #endif
4153 #if FFETARGET_okLOGICAL3
4154 ffebld_constant_logical3_ = NULL;
4155 #endif
4156 #if FFETARGET_okLOGICAL4
4157 ffebld_constant_logical4_ = NULL;
4158 #endif
4159 #if FFETARGET_okLOGICAL5
4160 ffebld_constant_logical5_ = NULL;
4161 #endif
4162 #if FFETARGET_okLOGICAL6
4163 ffebld_constant_logical6_ = NULL;
4164 #endif
4165 #if FFETARGET_okLOGICAL7
4166 ffebld_constant_logical7_ = NULL;
4167 #endif
4168 #if FFETARGET_okLOGICAL8
4169 ffebld_constant_logical8_ = NULL;
4170 #endif
4171 #if FFETARGET_okREAL1
4172 ffebld_constant_real1_ = NULL;
4173 #endif
4174 #if FFETARGET_okREAL2
4175 ffebld_constant_real2_ = NULL;
4176 #endif
4177 #if FFETARGET_okREAL3
4178 ffebld_constant_real3_ = NULL;
4179 #endif
4180 #if FFETARGET_okREAL4
4181 ffebld_constant_real4_ = NULL;
4182 #endif
4183 #if FFETARGET_okREAL5
4184 ffebld_constant_real5_ = NULL;
4185 #endif
4186 #if FFETARGET_okREAL6
4187 ffebld_constant_real6_ = NULL;
4188 #endif
4189 #if FFETARGET_okREAL7
4190 ffebld_constant_real7_ = NULL;
4191 #endif
4192 #if FFETARGET_okREAL8
4193 ffebld_constant_real8_ = NULL;
4194 #endif
4195 ffebld_constant_hollerith_ = NULL;
4196 for (i = FFEBLD_constTYPELESS_FIRST; i <= FFEBLD_constTYPELESS_LAST; ++i)
4197 ffebld_constant_typeless_[i - FFEBLD_constTYPELESS_FIRST] = NULL;
4198 #endif
4201 /* ffebld_list_length -- Return # of opITEMs in list
4203 ffebld list; // Must be NULL or opITEM
4204 ffebldListLength length;
4205 length = ffebld_list_length(list);
4207 Returns 0 if list is NULL, 1 if it's ffebld_trail is NULL, and so on. */
4209 ffebldListLength
4210 ffebld_list_length (ffebld list)
4212 ffebldListLength length;
4214 for (length = 0; list != NULL; ++length, list = ffebld_trail (list))
4217 return length;
4220 /* ffebld_new_accter -- Create an ffebld object that is an array
4222 ffebld x;
4223 ffebldConstantArray a;
4224 ffebit b;
4225 x = ffebld_new_accter(a,b); */
4227 ffebld
4228 ffebld_new_accter (ffebldConstantArray a, ffebit b)
4230 ffebld x;
4232 x = ffebld_new ();
4233 #if FFEBLD_BLANK_
4234 *x = ffebld_blank_;
4235 #endif
4236 x->op = FFEBLD_opACCTER;
4237 x->u.accter.array = a;
4238 x->u.accter.bits = b;
4239 x->u.accter.pad = 0;
4240 return x;
4243 /* ffebld_new_arrter -- Create an ffebld object that is an array
4245 ffebld x;
4246 ffebldConstantArray a;
4247 ffetargetOffset size;
4248 x = ffebld_new_arrter(a,size); */
4250 ffebld
4251 ffebld_new_arrter (ffebldConstantArray a, ffetargetOffset size)
4253 ffebld x;
4255 x = ffebld_new ();
4256 #if FFEBLD_BLANK_
4257 *x = ffebld_blank_;
4258 #endif
4259 x->op = FFEBLD_opARRTER;
4260 x->u.arrter.array = a;
4261 x->u.arrter.size = size;
4262 x->u.arrter.pad = 0;
4263 return x;
4266 /* ffebld_new_conter_with_orig -- Create an ffebld object that is a constant
4268 ffebld x;
4269 ffebldConstant c;
4270 x = ffebld_new_conter_with_orig(c,NULL); */
4272 ffebld
4273 ffebld_new_conter_with_orig (ffebldConstant c, ffebld o)
4275 ffebld x;
4277 x = ffebld_new ();
4278 #if FFEBLD_BLANK_
4279 *x = ffebld_blank_;
4280 #endif
4281 x->op = FFEBLD_opCONTER;
4282 x->u.conter.expr = c;
4283 x->u.conter.orig = o;
4284 x->u.conter.pad = 0;
4285 return x;
4288 /* ffebld_new_item -- Create an ffebld item object
4290 ffebld x,y,z;
4291 x = ffebld_new_item(y,z); */
4293 ffebld
4294 ffebld_new_item (ffebld head, ffebld trail)
4296 ffebld x;
4298 x = ffebld_new ();
4299 #if FFEBLD_BLANK_
4300 *x = ffebld_blank_;
4301 #endif
4302 x->op = FFEBLD_opITEM;
4303 x->u.item.head = head;
4304 x->u.item.trail = trail;
4305 #ifdef FFECOM_itemHOOK
4306 x->u.item.hook = FFECOM_itemNULL;
4307 #endif
4308 return x;
4311 /* ffebld_new_labter -- Create an ffebld object that is a label
4313 ffebld x;
4314 ffelab l;
4315 x = ffebld_new_labter(c); */
4317 ffebld
4318 ffebld_new_labter (ffelab l)
4320 ffebld x;
4322 x = ffebld_new ();
4323 #if FFEBLD_BLANK_
4324 *x = ffebld_blank_;
4325 #endif
4326 x->op = FFEBLD_opLABTER;
4327 x->u.labter = l;
4328 return x;
4331 /* ffebld_new_labtok -- Create object that is a label's NUMBER token
4333 ffebld x;
4334 ffelexToken t;
4335 x = ffebld_new_labter(c);
4337 Like the other ffebld_new_ functions, the
4338 supplied argument is stored exactly as is: ffelex_token_use is NOT
4339 called, so the token is "consumed", if one is indeed supplied (it may
4340 be NULL). */
4342 ffebld
4343 ffebld_new_labtok (ffelexToken t)
4345 ffebld x;
4347 x = ffebld_new ();
4348 #if FFEBLD_BLANK_
4349 *x = ffebld_blank_;
4350 #endif
4351 x->op = FFEBLD_opLABTOK;
4352 x->u.labtok = t;
4353 return x;
4356 /* ffebld_new_none -- Create an ffebld object with no arguments
4358 ffebld x;
4359 x = ffebld_new_none(FFEBLD_opWHATEVER); */
4361 ffebld
4362 ffebld_new_none (ffebldOp o)
4364 ffebld x;
4366 x = ffebld_new ();
4367 #if FFEBLD_BLANK_
4368 *x = ffebld_blank_;
4369 #endif
4370 x->op = o;
4371 return x;
4374 /* ffebld_new_one -- Create an ffebld object with one argument
4376 ffebld x,y;
4377 x = ffebld_new_one(FFEBLD_opWHATEVER,y); */
4379 ffebld
4380 ffebld_new_one (ffebldOp o, ffebld left)
4382 ffebld x;
4384 x = ffebld_new ();
4385 #if FFEBLD_BLANK_
4386 *x = ffebld_blank_;
4387 #endif
4388 x->op = o;
4389 x->u.nonter.left = left;
4390 #ifdef FFECOM_nonterHOOK
4391 x->u.nonter.hook = FFECOM_nonterNULL;
4392 #endif
4393 return x;
4396 /* ffebld_new_symter -- Create an ffebld object that is a symbol
4398 ffebld x;
4399 ffesymbol s;
4400 ffeintrinGen gen; // Generic intrinsic id, if any
4401 ffeintrinSpec spec; // Specific intrinsic id, if any
4402 ffeintrinImp imp; // Implementation intrinsic id, if any
4403 x = ffebld_new_symter (s, gen, spec, imp); */
4405 ffebld
4406 ffebld_new_symter (ffesymbol s, ffeintrinGen gen, ffeintrinSpec spec,
4407 ffeintrinImp imp)
4409 ffebld x;
4411 x = ffebld_new ();
4412 #if FFEBLD_BLANK_
4413 *x = ffebld_blank_;
4414 #endif
4415 x->op = FFEBLD_opSYMTER;
4416 x->u.symter.symbol = s;
4417 x->u.symter.generic = gen;
4418 x->u.symter.specific = spec;
4419 x->u.symter.implementation = imp;
4420 x->u.symter.do_iter = FALSE;
4421 return x;
4424 /* ffebld_new_two -- Create an ffebld object with two arguments
4426 ffebld x,y,z;
4427 x = ffebld_new_two(FFEBLD_opWHATEVER,y,z); */
4429 ffebld
4430 ffebld_new_two (ffebldOp o, ffebld left, ffebld right)
4432 ffebld x;
4434 x = ffebld_new ();
4435 #if FFEBLD_BLANK_
4436 *x = ffebld_blank_;
4437 #endif
4438 x->op = o;
4439 x->u.nonter.left = left;
4440 x->u.nonter.right = right;
4441 #ifdef FFECOM_nonterHOOK
4442 x->u.nonter.hook = FFECOM_nonterNULL;
4443 #endif
4444 return x;
4447 /* ffebld_pool_pop -- Pop ffebld's pool stack
4449 ffebld_pool_pop(); */
4451 void
4452 ffebld_pool_pop ()
4454 ffebldPoolstack_ ps;
4456 assert (ffebld_pool_stack_.next != NULL);
4457 ps = ffebld_pool_stack_.next;
4458 ffebld_pool_stack_.next = ps->next;
4459 ffebld_pool_stack_.pool = ps->pool;
4460 malloc_kill_ks (malloc_pool_image (), ps, sizeof (*ps));
4463 /* ffebld_pool_push -- Push ffebld's pool stack
4465 ffebld_pool_push(); */
4467 void
4468 ffebld_pool_push (mallocPool pool)
4470 ffebldPoolstack_ ps;
4472 ps = malloc_new_ks (malloc_pool_image (), "Pool stack", sizeof (*ps));
4473 ps->next = ffebld_pool_stack_.next;
4474 ps->pool = ffebld_pool_stack_.pool;
4475 ffebld_pool_stack_.next = ps;
4476 ffebld_pool_stack_.pool = pool;
4479 /* ffebld_op_string -- Return short string describing op
4481 ffebldOp o;
4482 ffebld_op_string(o);
4484 Returns a short string (uppercase) containing the name of the op. */
4486 const char *
4487 ffebld_op_string (ffebldOp o)
4489 if (o >= ARRAY_SIZE (ffebld_op_string_))
4490 return "?\?\?";
4491 return ffebld_op_string_[o];
4494 /* ffebld_size_max -- Return maximum possible size of CHARACTER-type expr
4496 ffetargetCharacterSize sz;
4497 ffebld b;
4498 sz = ffebld_size_max (b);
4500 Like ffebld_size_known, but if that would return NONE and the expression
4501 is opSUBSTR, opCONVERT, opPAREN, or opCONCATENATE, returns ffebld_size_max
4502 of the subexpression(s). */
4504 ffetargetCharacterSize
4505 ffebld_size_max (ffebld b)
4507 ffetargetCharacterSize sz;
4509 recurse: /* :::::::::::::::::::: */
4511 sz = ffebld_size_known (b);
4513 if (sz != FFETARGET_charactersizeNONE)
4514 return sz;
4516 switch (ffebld_op (b))
4518 case FFEBLD_opSUBSTR:
4519 case FFEBLD_opCONVERT:
4520 case FFEBLD_opPAREN:
4521 b = ffebld_left (b);
4522 goto recurse; /* :::::::::::::::::::: */
4524 case FFEBLD_opCONCATENATE:
4525 sz = ffebld_size_max (ffebld_left (b))
4526 + ffebld_size_max (ffebld_right (b));
4527 return sz;
4529 default:
4530 return sz;