-
Notifications
You must be signed in to change notification settings - Fork 7
/
gencode_BM.c
5094 lines (4903 loc) · 220 KB
/
gencode_BM.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// file gencode_BM.c
// SPDX-License-Identifier: GPL-3.0-or-later
/***
BISMON
Copyright © 2018 - 2022 CEA (Commissariat à l'énergie atomique et aux énergies alternatives)
contributed by Basile Starynkevitch (working at CEA, LIST, France)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "bismon.h"
#include "gencode_BM.const.h"
#define MAXINTCASES_BM 16384
extern const char *asprintf_prev_module_BM (const char *srcdir,
objectval_tyBM * obmodule);
const char *
asprintf_prev_module_BM (const char *srcdir, objectval_tyBM * obmodule)
{
char *pathstr = NULL;
char modulidbuf[32];
objectval_tyBM *k_plain_temporary_module = BMK_1oEp0eAAyFN_4lsobepyr1T;
memset (modulidbuf, 0, sizeof (modulidbuf));
ASSERT_BM (srcdir && strlen (srcdir) > 0);
ASSERT_BM (isobject_BM (obmodule));
bool modulistemporary =
(objectisinstance_BM (obmodule, k_plain_temporary_module));
idtocbuf32_BM (objid_BM (obmodule), modulidbuf);
int as = -1;
if (modulistemporary)
as = asprintf (&pathstr, "%s/" TEMPMODULEPREFIX_BM "%s.c-prev%d~",
srcdir, modulidbuf, (int) getpid ());
else
as = asprintf (&pathstr, "%s/" MODULEPREFIX_BM "%s.c-prev%d~",
srcdir, modulidbuf, (int) getpid ());
if (as < 0)
FATAL_BM
("failed call to asprintf in asprintf_prev_module_BM srcdir=%s modulidbuf=%s (%m)",
srcdir, modulidbuf);
if (!pathstr)
FATAL_BM ("failed asprintf_prev_module srcdir %s obmodule %s - %m",
srcdir, objectdbg_BM (obmodule));
return pathstr;
} /* end asprintf_prev_module_BM */
////////////////
//// for the method prepare_routine°basiclo_minifunction
extern objrout_sigBM ROUTINEOBJNAME_BM (_07qYMXftJRR_9dde2ASz4e9);
value_tyBM
ROUTINEOBJNAME_BM (_07qYMXftJRR_9dde2ASz4e9) // prepare_routine°basiclo_minifunction
(struct stackframe_stBM * stkf, const value_tyBM arg1, // reciever
const value_tyBM arg2, // modgenob
const value_tyBM arg3, // prepvalset
const value_tyBM arg4_ __attribute__((unused)), //
const quasinode_tyBM * restargs_ __attribute__((unused))) //
{
LOCALFRAME_BM ( /*prev: */ stkf, /*descr: */ BMK_07qYMXftJRR_9dde2ASz4e9,
objectval_tyBM * modgenob; //
const setval_tyBM * prepvalset; //
objectval_tyBM * curprepob; //
objectval_tyBM * curtypob; //
objectval_tyBM * routprepob; //
objectval_tyBM * obhsetblock; //
objectval_tyBM * typob; //
objectval_tyBM * bodyob; //
objectval_tyBM * obmodhsetconst; //
objectval_tyBM * stmtpropob; //
value_tyBM recv; //
value_tyBM attrv; //
const tupleval_tyBM * tupargs; //
const tupleval_tyBM * tupclosed; //
objectval_tyBM * obresult; //
const setval_tyBM * setlocals; //
const setval_tyBM * setnumbers; //
const setval_tyBM * setscalars; //
const setval_tyBM * setconsts; //
objectval_tyBM * curvar; //
objectval_tyBM * scalctypob; //
value_tyBM curol; //
value_tyBM oldrol; //
value_tyBM bodyv; //
value_tyBM msblov; //
value_tyBM causev; //
value_tyBM errorv; //
);
objectval_tyBM *k_c_type = BMK_83kM1HtO8K3_6k0F2KYQT3W;
objectval_tyBM *k_arguments = BMK_0jFqaPPHgYH_5JpjOPxQ67p;
objectval_tyBM *k_constants = BMK_5l2zSKsFaVm_9zs6qDOP87i;
objectval_tyBM *k_result = BMK_7bD9VtDkGSn_7lxHeYuuFLR;
objectval_tyBM *k_closed = BMK_2TwOyPJxIz8_1rIeqaN7oRz;
objectval_tyBM *k_locals = BMK_24sSVIADeHm_0Sx34wQfG7W;
objectval_tyBM *k_numbers = BMK_32eKNcTZ9HN_80t0nk47Mha;
objectval_tyBM *k_body = BMK_7DQyvJFMOrC_9IfC3CtYknn;
objectval_tyBM *k_scalars = BMK_3pPxQecoSkC_7izL0jcxZiS;
objectval_tyBM *k_scalar_c_type = BMK_68ZSdtDWjWk_4Dex1apSdO7;
objectval_tyBM *k_simple_routine_preparation = BMK_80060zKi6Un_3isCStegT8A;
objectval_tyBM *k_hset_object = BMK_8c9otZ4pwR6_55k81qyyYV2;
objectval_tyBM *k_assoc_object = BMK_6ZQ05nCv3Ys_8LA6B5LkZgm;
objectval_tyBM *k_blocks = BMK_2lCuMosXupr_5GAoqVgJ8PZ;
objectval_tyBM *k_statement_properties = BMK_0OM3NoUpOBd_1nzwCJKw54A;
objectval_tyBM *k_prepare_routine = BMK_6qi1DW0Ygkl_4Aqdxq4n5IV;
objectval_tyBM *k_in = BMK_0eMGYofuNVh_8ZP2mXdhtHO;
objectval_tyBM *k_modgenob = BMK_0Bl5ro9usp6_1Hll14QwC8f;
objectval_tyBM *k_miniscan_block = BMK_2gthNYOWogO_4sVTU1JbmUH;
objectval_tyBM *k_basiclo_block = BMK_4bYUiDmxrKK_6nPPlEl8y8x;
// retrieve arguments
_.recv = objectcast_BM (arg1);
WEAKASSERT_BM (isobject_BM (_.recv));
_.modgenob = objectcast_BM (arg2);
_.prepvalset = setcast_BM (arg3); /// unneeded, set of all routines
WEAKASSERT_BM (_.modgenob != NULL);
_.obmodhsetconst = objectcast_BM (objgetattr_BM (_.modgenob, k_constants));
WEAKASSERT_BM (_.prepvalset != NULL);
unsigned nbprep = setcardinal_BM (_.prepvalset);
int failin = -1;
#define FAILHERE(Cause) do { failin = __LINE__ ; _.causev = (value_tyBM)(Cause); goto failure; } while(0)
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv=%s modgenob=%s nbprep=%u obmodhsetconst=%s",
objectdbg_BM (_.recv), objectdbg1_BM (_.modgenob), nbprep,
objectdbg2_BM (_.obmodhsetconst));
{
_.attrv = objgetattr_BM (_.recv, k_arguments);
_.tupargs = tuplecast_BM (_.attrv);
if (_.attrv && !_.tupargs)
FAILHERE (makenode1_BM (k_arguments, _.attrv));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_closed);
_.tupclosed = tuplecast_BM (_.attrv);
if (_.attrv && !_.tupclosed)
FAILHERE (makenode1_BM (k_closed, _.attrv));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_result);
_.obresult = objectcast_BM (_.attrv);
if (_.attrv && !_.obresult)
FAILHERE (makenode1_BM (k_result, _.attrv));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_locals);
_.setlocals = setcast_BM (_.attrv);
if (_.attrv && !_.setlocals)
FAILHERE (makenode1_BM (k_locals, _.attrv));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_numbers);
_.setnumbers = setcast_BM (_.attrv);
if (_.attrv && !_.setnumbers)
FAILHERE (makenode1_BM (k_numbers, _.attrv));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_scalars);
_.setscalars = setcast_BM (_.attrv);
if (_.attrv && !_.setscalars)
FAILHERE (makenode1_BM (k_scalars, _.attrv));
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv=%s setscalars %s",
objectdbg_BM (_.recv), OUTSTRVALUE_BM ((value_tyBM) _.setscalars));
_.attrv = NULL;
}
{
_.attrv = objgetattr_BM (_.recv, k_constants);
_.setconsts = setcast_BM (_.attrv);
if (_.attrv && !_.setconsts)
FAILHERE (makenode1_BM (k_constants, _.attrv));
_.attrv = NULL;
}
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv=%s tupargs=%s tupclosed=%s obresult=%s",
objectdbg_BM (_.recv), OUTSTRVALUE_BM ((value_tyBM) _.tupargs),
OUTSTRVALUE_BM ((value_tyBM) _.tupclosed), objectdbg2_BM (_.obresult));
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv=%s setlocals=%s, setnumbers=%s, setscalars=%s, setconsts=%s",
objectdbg_BM (_.recv),
OUTSTRVALUE_BM ((value_tyBM) _.setlocals),
OUTSTRVALUE_BM ((value_tyBM) _.setnumbers),
OUTSTRVALUE_BM ((value_tyBM) _.setscalars),
OUTSTRVALUE_BM ((value_tyBM) _.setconsts));
_.bodyv = objgetattr_BM (_.recv, k_body);
if (!isobject_BM (_.bodyv))
{
FAILHERE (makenode1_BM (k_body, _.bodyv));
}
_.bodyob = objectcast_BM (_.bodyv);
if (!isobject_BM (_.obresult))
FAILHERE (makenode1_BM (k_result, _.recv));
WEAKASSERT_BM (_.bodyob);
WEAKASSERT_BM (isobject_BM (_.obmodhsetconst)
&& objhashashsetpayl_BM (_.obmodhsetconst));
objhashsetaddpayl_BM (_.obmodhsetconst, _.recv);
_.routprepob = makeobj_BM ();
objputclass_BM (_.routprepob,
(objectval_tyBM *) k_simple_routine_preparation);
objputattr_BM (_.routprepob, k_in, _.recv);
objputattr_BM (_.routprepob, k_modgenob, _.modgenob);
unsigned nbargs = tuplesize_BM (_.tupargs);
unsigned nbclosed = tuplesize_BM (_.tupclosed);
unsigned nblocals = setcardinal_BM (_.setlocals);
unsigned nbnumbers = setcardinal_BM (_.setnumbers);
unsigned nbscalars = setcardinal_BM (_.setscalars);
unsigned nbconsts = setcardinal_BM (_.setconsts);
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv %s routprepob %s nbargs=%u nbclosed=%u nblocals=%u nbnumbers=%u nbscalars=%u nbconsts=%u",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob), nbargs, nbclosed,
nblocals, nbnumbers, nbscalars, nbconsts);
objputassocpayl_BM (_.routprepob,
2 + nbargs + nbclosed + nblocals + nbnumbers
+ nbscalars + nbconsts);
objtouchnow_BM (_.routprepob);
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv %s routprepob %s obresult %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.obresult));
//// check and bind the result
if (_.obresult)
{
objlock_BM (_.obresult);
_.typob = objectcast_BM (objgetattr_BM (_.obresult, k_c_type));
objunlock_BM (_.obresult);
if (_.typob != BMP_value && _.typob != BMP_object)
FAILHERE (makenode1_BM (k_result, _.obresult));
objassocaddattrpayl_BM (_.routprepob, _.obresult,
(value_tyBM) k_result);
}
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv %s routprepob %s tupargs %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
debug_outstr_value_BM ((value_tyBM) _.tupargs, CURFRAME_BM, 0));
/// bind the arguments
for (unsigned argix = 0; argix < nbargs; argix++)
{
_.curvar = tuplecompnth_BM (_.tupargs, argix);
_.curtypob = NULL;
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction argix=%u argum curvar=%s",
argix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
FAILHERE (makenode2_BM (k_arguments, _.curvar, _.oldrol));
objlock_BM (_.curvar);
_.curtypob = objectcast_BM (objgetattr_BM (_.curvar, k_c_type));
objunlock_BM (_.curvar);
if (!_.curtypob)
_.curtypob = BMP_value;
if (_.curtypob != BMP_value && _.curtypob != BMP_object)
FAILHERE (makenode2_BM (k_arguments, _.curvar, _.curtypob));
_.curol =
(value_tyBM) makenode2_BM (k_arguments, taggedint_BM (argix),
_.curtypob);
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
_.curol = NULL;
_.curtypob = NULL;
}
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv %s routprepob %s tupclosed %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
debug_outstr_value_BM ((value_tyBM) _.tupclosed, CURFRAME_BM, 0));
/// bind the closed
for (unsigned cloix = 0; cloix < nbclosed; cloix++)
{
_.curvar = tuplecompnth_BM (_.tupclosed, cloix);
_.curtypob = NULL;
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction cloix=%u closed curvar=%s",
cloix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
FAILHERE (makenode2_BM (k_closed, _.curvar, _.oldrol));
objlock_BM (_.curvar);
_.curtypob = objectcast_BM (objgetattr_BM (_.curvar, k_c_type));
objunlock_BM (_.curvar);
if (!_.curtypob)
_.curtypob = BMP_value;
if (_.curtypob != BMP_value && _.curtypob != BMP_object)
FAILHERE (makenode2_BM (k_arguments, _.curvar, _.curtypob));
_.curol =
(value_tyBM) makenode2_BM (k_closed, taggedint_BM (cloix),
_.curtypob);
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
_.curol = NULL;
_.curtypob = NULL;
}
/// bind the locals
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv %s routprepob %s setlocals %s nb#%d",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
OUTSTRVALUE_BM ((value_tyBM) _.setlocals), nblocals);
for (unsigned locix = 0; locix < nblocals; locix++)
{
_.curvar = setelemnth_BM (_.setlocals, locix);
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction locix=%u local curvar=%s",
locix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
{
FAILHERE (makenode2_BM (k_locals, _.curvar, _.oldrol));
}
objlock_BM (_.curvar);
_.curtypob = objectcast_BM (objgetattr_BM (_.curvar, k_c_type));
objunlock_BM (_.curvar);
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction recv %s, routprepob %s, curvar %s, curtypob %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.curvar), objectdbg3_BM (_.curtypob));
if (!_.curtypob)
_.curtypob = BMP_value;
if (_.curtypob != BMP_value && _.curtypob != BMP_object)
FAILHERE (makenode2_BM (k_locals, _.curvar, _.curtypob));
_.curol =
(value_tyBM) makenode2_BM (k_locals, taggedint_BM (locix),
_.curtypob);
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
_.curol = NULL;
}
/// bind the numbers
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv %s routprepob %s setnumbers %s nb#%u",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
OUTSTRVALUE_BM ((value_tyBM) _.setnumbers), nbnumbers);
// bind the number vars
for (unsigned numix = 0; numix < nbnumbers; numix++)
{
_.curvar = setelemnth_BM (_.setnumbers, numix);
DBGPRINTF_BM
("start prepare_routine°basiclo_minifunction numix=%u number curvar=%s",
numix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
{
FAILHERE (makenode2_BM (k_numbers, _.curvar, _.oldrol));
}
_.curol = (value_tyBM) makenode1_BM (k_numbers, taggedint_BM (numix));
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
_.curol = NULL;
}
///
/// bind the scalars
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv %s routprepob %s setscalars %s nb#%u",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
OUTSTRVALUE_BM ((value_tyBM) _.setscalars), nbscalars);
// bind the scalars vars
for (unsigned scalix = 0; scalix < nbscalars; scalix++)
{
_.curvar = setelemnth_BM (_.setscalars, scalix);
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction scalix=%u scalar curvar=%s",
scalix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
{
FAILHERE (makenode2_BM (k_scalars, _.curvar, _.oldrol));
};
{
objlock_BM (_.curvar);
_.curtypob = objectcast_BM (objgetattr_BM (_.curvar, k_c_type));
objunlock_BM (_.curvar);
DBGBACKTRACEPRINTF_BM
("prepare_routine°basiclo_minifunction scalix=%u scalar curvar=%s curtypob=%s",
scalix, objectdbg_BM (_.curvar), objectdbg1_BM (_.curtypob));
if (!_.curtypob)
{
FAILHERE (makenode2_BM (k_scalars, _.curvar, k_c_type));
};
_.scalctypob = NULL;
objlock_BM (_.curtypob);
_.scalctypob =
objectcast_BM (objgetattr_BM (_.curtypob, k_scalar_c_type));
objunlock_BM (_.curtypob);
DBGBACKTRACEPRINTF_BM
("start prepare_routine°basiclo_minifunction scalar curvar=%s curtypob=%s scalctypob=%s",
objectdbg_BM (_.curvar), objectdbg1_BM (_.curtypob),
objectdbg2_BM (_.scalctypob));
if (!_.scalctypob)
{
FAILHERE (makenode2_BM (k_scalar_c_type, _.curvar, _.curtypob));
}
}
_.curol =
(value_tyBM) makenode2_BM (k_scalars, taggedint_BM (scalix),
_.curtypob);
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
DBGBACKTRACEPRINTF_BM
("start prepare_routine°basiclo_minifunction scalar#%d routprepob=%s curvar=%s curol=%s",
scalix, objectdbg1_BM (_.routprepob), objectdbg1_BM (_.curvar),
OUTSTRVALUE_BM (_.curol));
_.curol = NULL;
}
///
///
// bind the constants
DBGPRINTF_BM
(" prepare_routine°basiclo_minifunction recv %s routprepob %s setconsts %s nb#%u",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
OUTSTRVALUE_BM ((value_tyBM) _.setconsts), nbconsts);
for (unsigned cstix = 0; cstix < nbconsts; cstix++)
{
_.curvar = setelemnth_BM (_.setconsts, cstix);
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction cstix=%u constant curvar=%s",
cstix, objectdbg_BM (_.curvar));
_.oldrol = objassocgetattrpayl_BM (_.routprepob, _.curvar);
if (_.oldrol)
{
FAILHERE (makenode2_BM (k_constants, _.curvar, _.oldrol));
}
_.curol = (value_tyBM) makenode1_BM (k_constants, taggedint_BM (cstix));
objassocaddattrpayl_BM (_.routprepob, _.curvar, _.curol);
objhashsetaddpayl_BM (_.obmodhsetconst, _.curvar);
_.curol = NULL;
}
_.obhsetblock = makeobj_BM ();
objputhashsetpayl_BM (_.obhsetblock, 15);
objputclass_BM (_.obhsetblock, (objectval_tyBM *) k_hset_object);
objputattr_BM (_.routprepob, k_blocks, _.obhsetblock);
objputattr_BM (_.routprepob, k_prepare_routine, _.recv);
objputattr_BM (_.routprepob, k_in, _.modgenob);
objputattr_BM (_.obhsetblock, k_in, _.routprepob);
_.stmtpropob = makeobj_BM ();
objputassocpayl_BM (_.stmtpropob, 15);
objputclass_BM (_.stmtpropob, (objectval_tyBM *) k_assoc_object);
objputattr_BM (_.stmtpropob, k_in, _.routprepob);
objputattr_BM (_.routprepob, k_statement_properties, _.stmtpropob);
objtouchnow_BM (_.obhsetblock);
objtouchnow_BM (_.routprepob);
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction before miniscan_block recv %s routprep %s bodyob %s of %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.bodyob), objectdbg3_BM (objclass_BM (_.bodyob)));
{
objlock_BM (_.bodyob);
if (!objectisinstance_BM (_.bodyob, k_basiclo_block))
{
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv %s bad bodyob %s of %s",
objectdbg_BM (_.recv), objectdbg_BM (_.bodyob),
objectdbg3_BM (objclass_BM (_.bodyob)));
FAILHERE (makenode2_BM (k_body, _.bodyob, _.recv));
}
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction recv %s before send miniscan_block to body %s routprepob %s",
objectdbg_BM (_.recv), objectdbg1_BM (_.bodyob),
objectdbg2_BM (_.routprepob));
_.msblov =
send3_BM (_.bodyob, k_miniscan_block, CURFRAME_BM, _.routprepob,
taggedint_BM (0), _.recv);
objunlock_BM (_.bodyob);
}
if (!_.msblov)
{
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction failed miniscan_block bodyob=%s of %s",
objectdbg_BM (_.bodyob), objectdbg1_BM (objclass_BM (_.bodyob)));
FAILHERE (makenode1_BM (k_miniscan_block, _.bodyob));
}
DBGPRINTF_BM
("prepare_routine°basiclo_minifunction after miniscan_block recv %s routprep %s bodyob=%s msblov=%s",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.bodyob),
debug_outstr_value_BM (_.msblov, CURFRAME_BM, 0));
LOCALRETURN_BM (_.routprepob);
failure:
_.errorv = (value_tyBM)
makenode4_BM (k_prepare_routine, _.recv, _.modgenob,
(value_tyBM) _.prepvalset, _.causev);
DBGPRINTF_BM
("failure prepare_routine°basiclo_minifunction failin %d errorv %s",
failin, debug_outstr_value_BM (_.errorv, CURFRAME_BM, 0));
PLAINFAILURE_BM (failin, _.errorv, CURFRAME_BM);
#undef FAILHERE
} /* end prepare_routine°basiclo_minifunction _07qYMXftJRR_9dde2ASz4e9 */
// return the ctype of a variable
extern objectval_tyBM *miniscan_var_BM (objectval_tyBM * varob,
objectval_tyBM * routprepob,
int depth, objectval_tyBM * fromob,
struct stackframe_stBM *stkf);
// return the ctype of an expression
extern objectval_tyBM *miniscan_expr_BM (value_tyBM expv,
objectval_tyBM * routprepob,
int depth, objectval_tyBM * fromob,
struct stackframe_stBM *stkf);
// test if two types are compatible and return their common supertype
extern objectval_tyBM *miniscan_compatype_BM (objectval_tyBM * typ1ob,
objectval_tyBM * typ2ob,
struct stackframe_stBM *stkf);
////////////////////////////////////////////////////////////////
objectval_tyBM *
miniscan_compatype_BM (objectval_tyBM * typ1ob, objectval_tyBM * typ2ob,
struct stackframe_stBM *stkf)
{
if (!typ1ob || !typ2ob)
return false;
WEAKASSERT_BM (isobject_BM (typ1ob));
WEAKASSERT_BM (isobject_BM (typ2ob));
if (typ1ob == typ2ob)
return typ1ob;
objectval_tyBM *k_miniscan_compatype = BMK_82pYC6bEP7E_3cfHx6ELZFi;
objectval_tyBM *k_object = BMK_7T9OwSFlgov_0wVJaK1eZbn;
objectval_tyBM *k_value = BMK_7bbeIqUSje9_4jVgC7ZJmvx;
//objectval_tyBM *k_int = BMK_0vgCFjXblkx_4zCMhMAWjVK;
//objectval_tyBM *k_string = BMK_4T8am97muLl_5969SR22Ecq;
LOCALFRAME_BM ( /*prev: */ stkf, /*descr: */ k_miniscan_compatype,
objectval_tyBM * typ1ob; objectval_tyBM * typ2ob;);
_.typ1ob = typ1ob;
_.typ2ob = typ2ob;
if ((_.typ1ob == k_object && _.typ2ob == k_value)
|| (_.typ1ob == k_value && _.typ2ob == k_object))
LOCALRETURN_BM (k_value);
LOCALRETURN_BM (NULL);
} /* end miniscan_compatype_BM */
objectval_tyBM *
miniscan_var_BM (objectval_tyBM * varob,
objectval_tyBM * routprepob, int depth,
objectval_tyBM * fromob, struct stackframe_stBM *stkf)
{
objectval_tyBM *k_arguments = BMK_0jFqaPPHgYH_5JpjOPxQ67p;
objectval_tyBM *k_closed = BMK_2TwOyPJxIz8_1rIeqaN7oRz;
objectval_tyBM *k_constants = BMK_5l2zSKsFaVm_9zs6qDOP87i;
objectval_tyBM *k_int = BMK_0vgCFjXblkx_4zCMhMAWjVK;
objectval_tyBM *k_locals = BMK_24sSVIADeHm_0Sx34wQfG7W;
objectval_tyBM *k_miniscan_var = BMK_6jh60mO0Cgd_84B0HiNphqA;
objectval_tyBM *k_numbers = BMK_32eKNcTZ9HN_80t0nk47Mha;
objectval_tyBM *k_scalars = BMK_3pPxQecoSkC_7izL0jcxZiS;
objectval_tyBM *k_result = BMK_7bD9VtDkGSn_7lxHeYuuFLR;
objectval_tyBM *k_simple_routine_preparation = BMK_80060zKi6Un_3isCStegT8A;
objectval_tyBM *k_value = BMK_7bbeIqUSje9_4jVgC7ZJmvx;
LOCALFRAME_BM ( /*prev: */ stkf, /*descr: */ k_miniscan_var,
objectval_tyBM * varob; //
objectval_tyBM * routprepob; //
objectval_tyBM * fromob; //
value_tyBM vrolv; //
objectval_tyBM * rolconnob; //
value_tyBM causev; value_tyBM errorv;);
int failin = -1;
#define FAILHERE(V) do { failin = __LINE__ ; _.causev = (value_tyBM)(V); \
goto failure; } while(0)
_.varob = objectcast_BM (varob);
_.routprepob = objectcast_BM (routprepob);
_.fromob = objectcast_BM (fromob);
if (!_.varob)
FAILHERE (NULL);
if (!_.routprepob)
FAILHERE (NULL);
if (!_.fromob)
FAILHERE (NULL);
DBGPRINTF_BM
("miniscan_var start varob=%s routprepob=%s depth#%d fromob=%s",
objectdbg_BM (_.varob), objectdbg1_BM (_.routprepob), depth,
objectdbg2_BM (_.fromob));
WEAKASSERT_BM (objhasassocpayl_BM (_.routprepob));
_.vrolv = objassocgetattrpayl_BM (_.routprepob, _.varob);
DBGPRINTF_BM ("miniscan_var vrol=%s", //
OUTSTRVALUE_BM (_.vrolv));
if (isnode_BM (_.vrolv))
{
_.rolconnob = nodeconn_BM (_.vrolv);
if (_.rolconnob == k_arguments || _.rolconnob == k_locals
|| _.rolconnob == k_closed)
{
if (nodewidth_BM (_.vrolv) == 2)
LOCALRETURN_BM (nodenthson_BM (_.vrolv, 1));
LOCALRETURN_BM (k_value);
}
else if (_.rolconnob == k_constants)
{
if (nodewidth_BM (_.vrolv) == 2)
LOCALRETURN_BM (nodenthson_BM (_.vrolv, 1));
LOCALRETURN_BM (BMP_object);
}
else if (_.rolconnob == k_numbers)
{
LOCALRETURN_BM (k_int);
}
else if (_.rolconnob == k_scalars)
{
DBGBACKTRACEPRINTF_BM
("scalar miniscan_var vrol=%s routprepob=%s depth#%d fromob=%s",
OUTSTRVALUE_BM (_.vrolv), objectdbg_BM (_.routprepob), depth,
objectdbg1_BM (_.fromob));
if (nodewidth_BM (_.vrolv) == 2)
{
DBGPRINTF_BM ("miniscan_var scalar varob=%s =gives %s",
objectdbg_BM (_.varob),
OUTSTRVALUE_BM (nodenthson_BM (_.vrolv, 1)));
LOCALRETURN_BM (nodenthson_BM (_.vrolv, 1));
}
FAILHERE (_.vrolv);
}
else
FAILHERE (_.vrolv);
}
else if (_.vrolv == k_result)
{
if (objectisinstance_BM (_.routprepob, k_simple_routine_preparation))
LOCALRETURN_BM (k_value);
else
FAILHERE (_.vrolv);
}
else
{
DBGBACKTRACEPRINTF_BM
("miniscan_var failing routprepob=%s varob=%s vrolv=%s",
objectdbg_BM (_.routprepob), objectdbg1_BM (_.varob),
OUTSTRVALUE_BM (_.vrolv));
FAILHERE (_.vrolv);
}
#warning incomplete miniscan_var_BM
DBGPRINTF_BM ("miniscan_var end varob=%s", objectdbg_BM (_.varob));
LOCALRETURN_BM (NULL);
failure:
_.errorv = (value_tyBM)
makenode5_BM (k_miniscan_var, _.varob, _.routprepob, taggedint_BM (depth),
_.fromob, _.causev);
PLAINFAILURE_BM (failin, _.errorv, CURFRAME_BM);
#undef FAILHERE
} /* end miniscan_var_BM */
objectval_tyBM *
miniscan_expr_BM (value_tyBM expv, objectval_tyBM * routpreparg,
int depth, objectval_tyBM * fromarg,
struct stackframe_stBM *stkf)
{
objectval_tyBM *k_miniscan_expr = BMK_7k3xb0vred0_9ZRHcZmhw77;
objectval_tyBM *k_miniscan_node_conn = BMK_5EGLdtUAQxA_1nebCsDKqOF;
objectval_tyBM *k_basiclo_constant_object = BMK_9bCobYhqBV5_5tIWuHnUPMX;
objectval_tyBM *k_int = BMK_0vgCFjXblkx_4zCMhMAWjVK;
objectval_tyBM *k_value = BMK_7bbeIqUSje9_4jVgC7ZJmvx;
objectval_tyBM *k_set = BMK_2mYaTh9kH4I_7ENiXcymRmy;
objectval_tyBM *k_tuple = BMK_6TmLNh9vtVY_0pwkHRtJ44k;
objectval_tyBM *k_string = BMK_4T8am97muLl_5969SR22Ecq;
objectval_tyBM *k_closure = BMK_93zjUzZVAaj_9ppXv7C34GR;
objectval_tyBM *k_depth = BMK_17YdW6dWrBA_2mn4QmBjMNs;
objectval_tyBM *k_basiclo_connective = BMK_3DQ7z3EuAiT_4faSRNsy2lr;
objectval_tyBM *k_exclam = BMK_0e54seiZEXF_1Myf620cHoB;
objectval_tyBM *k_constants = BMK_5l2zSKsFaVm_9zs6qDOP87i;
objectval_tyBM *k_unspecified = BMK_55eJRRPyZDz_4uW8bzq75PI;
objectval_tyBM *k_simple_routine_preparation = BMK_80060zKi6Un_3isCStegT8A;
objectval_tyBM *k_simple_module_generation = BMK_2HlKptD03wA_7JJCG7lN5nS;
objectval_tyBM *k_undefined = BMK_1z3DQ3EVAGs_3KlGdHJpWbX;
// objectval_tyBM *k_hset_object = BMK_8c9otZ4pwR6_55k81qyyYV2;
objectval_tyBM *k_current_closure = BMK_8zYmVLSwVrR_4o3f5Gbjkih;
objectval_tyBM *k_current_closure_size = BMK_2g7mdZfl2sa_80JC86F5fWc;
objectval_tyBM *k_current_module = BMK_9zefWWg5iwJ_7IDjDEU8ucb;
objectval_tyBM *k_current_routine = BMK_5oJ9QOQFfbX_6psQHyINASW;
objectval_tyBM *k_null_object = BMK_5wZJ5RA9Dww_2S0cGLDXup0;
objectval_tyBM *k_null_value = BMK_2rFOCfhpUXp_9z1SVC5OYo9;
objectval_tyBM *k_modgenob = BMK_0Bl5ro9usp6_1Hll14QwC8f;
objectval_tyBM *k_failure_miss = BMK_52XwytpOPVl_3ZjmQCtadbK;
LOCALFRAME_BM ( /*prev: */ stkf, /*descr: */ k_miniscan_expr,
objectval_tyBM * connob; //
objectval_tyBM * indirconnob; //
objectval_tyBM * consthsetobj; //
objectval_tyBM * exclamob; //
objectval_tyBM * expob; //
objectval_tyBM * fromob; //
objectval_tyBM * modgenob; //
objectval_tyBM * routprepob; //
objectval_tyBM * typob; //
value_tyBM avalv; //
value_tyBM errorv; //
value_tyBM causev; //
value_tyBM exclamsonv; //
value_tyBM expv; //
value_tyBM chunkv; //
value_tyBM resv; //
);
int failin = -1;
#define FAILHERE(Cause) do { failin = __LINE__ ; _.causev = (value_tyBM) (Cause); goto failure; } while(0)
_.expv = expv;
_.routprepob = objectcast_BM (routpreparg);
_.fromob = objectcast_BM (fromarg);
DBGPRINTF_BM ("miniscan_expr start expv=%s routprepob=%s depth#%d fromob=%s", //
debug_outstr_value_BM (_.expv, CURFRAME_BM, 0), //
objectdbg1_BM (_.routprepob), depth,
objectdbg2_BM (_.fromob));
if (!_.routprepob)
FAILHERE (routpreparg);
if (!_.fromob)
FAILHERE (fromarg);
WEAKASSERT_BM (objectisinstance_BM (_.routprepob,
k_simple_routine_preparation));
_.modgenob = objgetattr_BM (_.routprepob, k_modgenob);
WEAKASSERT_BM (objectisinstance_BM (_.modgenob,
k_simple_module_generation));
int ke = valtype_BM (_.expv);
if (depth > MAXDEPTHPARSE_BM || depth < 0)
FAILHERE (makenode1_BM (k_depth, taggedint_BM (depth)));
switch (ke)
{
case tyNone_BM:
LOCALRETURN_BM (k_value);
case tyInt_BM:
LOCALRETURN_BM (k_int);
case tyDouble_BM:
LOCALRETURN_BM (BMP_double_float);
case tyString_BM:
LOCALRETURN_BM (k_string);
case tySet_BM:
FAILHERE (k_set);
case tyTuple_BM:
FAILHERE (k_tuple);
case tyClosure_BM:
FAILHERE (k_closure);
case tyUnspecified_BM:
FAILHERE (k_unspecified);
case tyObject_BM:
{
_.expob = objectcast_BM (_.expv);
_.avalv = objassocgetattrpayl_BM (_.routprepob, _.expob);
DBGPRINTF_BM ("miniscan_expr expob=%s avalv=%s",
objectdbg_BM (_.expob),
debug_outstr_value_BM (_.avalv, CURFRAME_BM, 0));
if (_.expob == k_current_closure)
{
LOCALRETURN_BM (BMP_value);
}
else if (_.expob == k_null_value)
{
LOCALRETURN_BM (BMP_value);
}
else if (_.expob == k_null_object)
{
LOCALRETURN_BM (BMP_object);
}
else if (_.expob == k_current_routine)
{
LOCALRETURN_BM (BMP_object);
}
else if (_.expob == k_current_module)
{
LOCALRETURN_BM (BMP_object);
}
else if (_.expob == k_current_closure_size)
{
LOCALRETURN_BM (BMP_int);
}
if (_.avalv != NULL)
{
_.typob =
miniscan_var_BM (_.expob, _.routprepob, depth, _.fromob,
CURFRAME_BM);
DBGPRINTF_BM ("miniscan_expr var expob=%s typob=%s",
objectdbg_BM (_.expob), objectdbg1_BM (_.typob));
LOCALRETURN_BM (_.typob);
}
else if (objectisinstance_BM (_.expob, k_basiclo_constant_object))
{
/// actually, the _expob object should be locked till the
/// end of the compilation of the current module.
#warning an instance of basiclo_constant_object should be locked till end of compilation of module
objlock_BM (_.expob);
_.typob = objectcast_BM (objgetattr_BM (_.expob, BMP_c_type));
_.avalv = objgetattr_BM (_.expob, BMP_value);
_.chunkv = objgetattr_BM (_.expob, BMP_chunk);
objunlock_BM (_.expob);
DBGPRINTF_BM
("miniscan_expr constob expob=%s typob=%s avalv=%s chunkv=%s",
objectdbg_BM (_.expob), objectdbg1_BM (_.typob),
OUTSTRVALUE_BM (_.avalv), OUTSTRVALUE_BM (_.chunkv));
if (!_.typob)
FAILHERE (BMP_c_type); // no c_type in constant object
if (_.avalv && _.chunkv)
FAILHERE (k_failure_miss); // both chunk & value given in constant object
if (_.chunkv && nodeconn_BM (_.chunkv) != BMP_chunk)
FAILHERE (BMP_chunk); // invalid chunk in constant object
if (_.avalv)
{
if (_.typob == BMP_int && !istaggedint_BM (_.avalv))
FAILHERE (BMP_int);
if (_.typob == BMP_object && !isobject_BM (_.avalv))
FAILHERE (BMP_object);
}
LOCALRETURN_BM (_.typob);
}
else
FAILHERE (k_undefined);
if (_.avalv)
{
_.consthsetobj =
objectcast_BM (objgetattr_BM (_.modgenob, k_constants));
WEAKASSERT_BM (objhashashsetpayl_BM (_.consthsetobj));
DBGPRINTF_BM
("miniscan_expr constob expob=%s added to consthsetobj=%s",
objectdbg_BM (_.expob), objectdbg1_BM (_.consthsetobj));
objhashsetaddpayl_BM (_.consthsetobj, _.expob);
}
break;
}
case tyNode_BM:
{
_.connob = nodeconn_BM (_.expv);
unsigned arity = nodewidth_BM (_.expv);
DBGPRINTF_BM
("miniscan_expr node expv=%s connob=%s arity#%d",
debug_outstr_value_BM (_.expv, CURFRAME_BM, 0),
objectdbg_BM (_.connob), arity);
if (_.connob == k_exclam && arity == 1)
{
_.exclamsonv = nodenthson_BM (_.expv, 0);
_.exclamob = objectcast_BM (_.exclamsonv);
if (_.exclamob)
{
_.consthsetobj =
objectcast_BM (objgetattr_BM (_.modgenob, k_constants));
DBGPRINTF_BM
("miniscan_expr exclamob=%s routprepob=%s consthsetobj=%s",
objectdbg_BM (_.exclamob), objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.consthsetobj));
WEAKASSERT_BM (objhashashsetpayl_BM (_.consthsetobj));
objhashsetaddpayl_BM (_.consthsetobj, _.exclamob);
LOCALRETURN_BM (BMP_object);
}
else if (istaggedint_BM (_.exclamsonv))
LOCALRETURN_BM (BMP_value);
// we don't accept quotation of nil, since it is not a value
// else if (_.exclamsonv == NULL)
// LOCALRETURN_BM (BMP_value);
else
FAILHERE (k_undefined);
}
{
objlock_BM (_.connob);
if (objectisinstance_BM (_.connob, k_basiclo_connective))
{
DBGPRINTF_BM
("miniscan_expr miniscan_node_conn->%s arity %d routprepob %s fromob %s before",
objectdbg_BM (_.connob), arity, objectdbg1_BM (_.routprepob),
objectdbg2_BM (_.fromob));
_.resv = send4_BM (_.connob, k_miniscan_node_conn, //
CURFRAME_BM, //
_.routprepob,
taggedint_BM (depth), _.expv, _.fromob);
DBGPRINTF_BM ("miniscan_expr miniscan_node_conn->%s done resv=%s", //
objectdbg_BM (_.connob), //
debug_outstr_value_BM (_.resv, CURFRAME_BM, 0));
if (!_.resv)
FAILHERE (k_undefined);
{
objunlock_BM (_.connob);
_.connob = NULL;
LOCALRETURN_BM (_.resv);
}
};
_.indirconnob =
objectcast_BM (objgetattr_BM (_.connob, k_basiclo_connective));
if (_.indirconnob
&& objectisinstance_BM (_.indirconnob, k_basiclo_connective))
{
DBGPRINTF_BM
("miniscan_expr miniscan_node_conn indirect %s arity %d routprepob %s fromob %s before, depth %d",
objectdbg_BM (_.indirconnob), arity,
objectdbg1_BM (_.routprepob), objectdbg2_BM (_.fromob),
depth);
if (depth + 1 > MAXDEPTHPARSE_BM || depth < 0)
FAILHERE (makenode2_BM
(k_depth, taggedint_BM (depth), _.indirconnob));
objlock_BM (_.indirconnob);
_.resv = send4_BM (_.indirconnob, k_miniscan_node_conn, //
CURFRAME_BM, //
_.routprepob,
taggedint_BM (depth + 1), _.expv, _.fromob);
objunlock_BM (_.indirconnob);
DBGPRINTF_BM ("miniscan_expr miniscan_node_conn indirect %s done resv=%s", //
objectdbg_BM (_.indirconnob), //
debug_outstr_value_BM (_.resv, CURFRAME_BM, 0));
if (!_.resv)
FAILHERE (makenode1_BM (k_undefined, _.indirconnob));
{
objunlock_BM (_.connob);
_.connob = NULL;
LOCALRETURN_BM (_.resv);
}
}
objunlock_BM (_.connob);
}
break;
}
default:
FAILHERE (k_undefined);
}
#warning incomplete miniscan_expr_BM
DBGPRINTF_BM ("miniscan_expr end expv=%s", //
debug_outstr_value_BM (_.expv, CURFRAME_BM, 0));
LOCALRETURN_BM (NULL);
failure:
DBGPRINTF_BM ("miniscan_expr failin %d cause %s", failin,
debug_outstr_value_BM (_.causev, CURFRAME_BM, 0));
_.errorv = (value_tyBM)
makenode5_BM (k_miniscan_expr, _.expv, _.causev, _.routprepob,
taggedint_BM (depth), _.fromob);
PLAINFAILURE_BM (failin, _.errorv, CURFRAME_BM);
#undef FAILHERE
} /* end miniscan_expr_BM */
////////////////////////////////////////////////////////////////
// for the method miniscan_stmt°basiclo_cond
extern objrout_sigBM ROUTINEOBJNAME_BM (_0zzJJsAL6Qm_2uw3eoWQHEq);
value_tyBM
ROUTINEOBJNAME_BM (_0zzJJsAL6Qm_2uw3eoWQHEq) //
(struct stackframe_stBM * stkf, //
const value_tyBM arg1, // recieving cond
const value_tyBM arg2, // routine preparation
const value_tyBM arg3, // depth
const value_tyBM arg4, // containingblock
const quasinode_tyBM * restargs __attribute__((unused)))
{
LOCALFRAME_BM ( /*prev: */ stkf, /*descr: */ NULL,
objectval_tyBM * recv; //
objectval_tyBM * routprepob; //
objectval_tyBM * fromblockob; //
objectval_tyBM * compob; //
objectval_tyBM * seqcompob; //
value_tyBM seqcompv; //
value_tyBM compv; //
value_tyBM testexpv;
value_tyBM resv; value_tyBM errorv; value_tyBM causev;);
objectval_tyBM *k_basiclo_when = BMK_3fvdRZNCmJS_5bTAPr83mXg;
objectval_tyBM *k_test = BMK_2j84OTHlFdJ_1pMyQfgsmAz;
// objectval_tyBM *k_miniscan_expr = BMK_7k3xb0vred0_9ZRHcZmhw77;
objectval_tyBM *k_miniscan_block = BMK_2gthNYOWogO_4sVTU1JbmUH;
objectval_tyBM *k_miniscan_stmt = BMK_6DdZwyaWLyK_7tS2BmECOJ0;
objectval_tyBM *k_basiclo_block = BMK_4bYUiDmxrKK_6nPPlEl8y8x;
objectval_tyBM *k_basiclo_statement = BMK_4lKK08v9A0t_0GGsir35UxP;
objectval_tyBM *k_nb_conds = BMK_8dLpuaNoSGN_2tdmkpINCsu;
objectval_tyBM *k_curcomp = BMK_12cTZAaLTTx_4Bq4ez6eGJM;
int depth = 0;
_.recv = objectcast_BM (arg1);
_.routprepob = objectcast_BM (arg2);
depth = getint_BM (arg3);
_.fromblockob = objectcast_BM (arg4);
int failin = -1;
#define FAILHERE(Cause) do { failin = __LINE__ ; _.causev= (value_tyBM)(Cause); goto failure; } while(0)
DBGPRINTF_BM
("miniscan_stmt°basiclo_cond start recv=%s routprepob=%s depth#%d fromblockob=%s start",
objectdbg_BM (_.recv), objectdbg1_BM (_.routprepob), depth,
objectdbg2_BM (_.fromblockob));
objlock_BM (_.recv);
unsigned nbsons = objnbcomps_BM (_.recv);
int nbconds = getint_BM (objgetattr_BM (_.recv, k_nb_conds));
DBGPRINTF_BM
("miniscan_stmt°basiclo_cond recv=%s nbconds=%d nbsons=%u",
objectdbg_BM (_.recv), nbconds, nbsons);
WEAKASSERT_BM ((int) nbconds <= (int) nbsons);
for (int ix = 0; ix < nbconds; ix++)
{
_.compv = objgetcomp_BM (_.recv, ix);
_.compob = objectcast_BM (_.compv);
DBGPRINTF_BM
("miniscan_stmt°basiclo_cond recv=%s ix=%u compob=%s",
objectdbg_BM (_.recv), ix, objectdbg1_BM (_.compob));
if (!_.compob)
FAILHERE (makenode2_BM (k_curcomp, _.compv, taggedint_BM (ix)));
objlock_BM (_.compob);
if (objectisinstance_BM (_.compob, k_basiclo_when))
{
_.testexpv = objgetattr_BM (_.compob, k_test);
miniscan_expr_BM (_.testexpv, _.routprepob, depth + 1, _.recv,
CURFRAME_BM);
unsigned nbsubcomp = objnbcomps_BM (_.compob);