File: tradsl.f

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (1462 lines) | stat: -rw-r--r-- 30,265 bytes parent folder | download | duplicates (2)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
      subroutine tradsl(ilfun,funnam,illist,nlist)
c     
c!but 
c     convert compiled macros to lst structure
c!calling sequence
c     subroutine tradsl(ilfun,id,illist,nlist)
c     kmac  : variable number of the compiled macro in the scilab stack
c!    
c
c
c     Copyright INRIA
      include '../stack.h'
c     
      integer nops,funnam(nsiz)
      parameter (nops=32)
      character*40 strg
      character*40 form
      double precision x,xx
      integer op,ix(2),fptr
      equivalence (x,ix(1))
c

      integer id(nsiz),iadr,sadr,cmplxt,pt0
c
      integer for(3),while(5),iff(2),sel(6),try(3)
      integer ops(nops)
      external getendian
      integer getendian

      data for/15,24,27/
      data iff/18,15/
      data while/32,17,18,21,14/
      data sel/28,14,21,14,12,29/
      data try/29,27,34/
c                            +  -  * .*  *. .*.  / ./  /. ./.  
      data (ops(i),i=1,10) /45,46,47,98,200,149,48,99,201,150/
c                            \ .\   \. .\. ** =  <  >  <=  >=  <>
      data (ops(i),i=11,21)/49,100,202,151,62,50,59,60,109,110,119/
c                             : [,] ins ext '  [;]  | &   ~  .^  .'
      data (ops(i),i=22,nops)/44,01, 02 ,03,53,04, 57,58, 61,113,104/
c
      iadr(l)=l+l-1
      sadr(l)=(l/2)+1
c
c     mode debug

      if (ddt .eq. 4) then
         write(buf(1:8),'(2i4)') pt,rstk(pt)
         call basout(io,wte,' tradsl pt:'//buf(1:4)//' rstk(pt):'
     &        //buf(5:8))
      endif
c
c
      pt0=pt
      pt=pt+1
      if(pt.gt.psiz) then
         call error(26)
         return
      endif
      rstk(pt)=0
c

      lc=ilfun
      ilk=lc

c
c     on scrute une premiere fois l'ensemble de la macro pour determiner
c     sa complexite
c
      lc = lc +1
      lc = lc + nsiz*istk(lc) + 1
      lc = lc + nsiz*istk(lc) + 1
      long = istk(lc)
      lc = lc+1
      icount=cmplxt(istk(lc),long) 
      if(icount.lt.0) then
         pt=pt0
         call error(37)
         return
      endif

c
c     premiers elements de la liste resultat
c
      ilr=illist
      istk(ilr)=15
      istk(ilr+1)=icount+3
      istk(ilr+2)=1
      lr=sadr(ilr+3+icount+3)
      ilr=ilr+3
c
c     nom de la macro
      il=iadr(lr)
      call basnms(funnam,1,istk(il),ni)
      l=sadr(il+ni)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1

c     nom des parametres de sortie
      lc=ilk+1
      nc=istk(lc)
      il=iadr(lr)
      call basnms(istk(lc+1),nc,istk(il),ni)
      l=sadr(il+ni)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1

c     nom des parametres d'entree
      lc=lc+nsiz*nc+1
      nc=istk(lc)
      il=iadr(lr)
      call basnms(istk(lc+1),nc,istk(il),ni)
      l=sadr(il+ni)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+nsiz*nc+1
c
c
      l0=0
      nc=0
C     pointeur sur le tableau de travail : pointe sur la premiere adresse libre
c     
c     debut du texte proprement dit de la macro
c
C     lc : pointeur sur l'instruction de la macro en cours de traduction
c     lr : pointeur dans stk sur l'element courant de la liste courante
c     ilr: pointeur dans istk sur la position de  l'element courant dans
c          la liste courante
C     
      Lc = lc+1
      lcf=lc+long-1
c     
c     nouvelle 'operation'
 10   continue
      if(lc.gt.lcf) then
         goto(11,11,11,46,47,11,51,54,55,11,61,63,64,65,11,
     $        121,122),rstk(pt)
 11      nlist=iadr(lr)-illist
         pt=pt0
         return
      endif
      op=istk(lc)
c     
      if(ddt.lt.-1) write(6,'(i7)') op
      goto(20,25,40,42,30,41,45,50,50,60,
     &     120,90,90,90,90,100,12,101,102,90,
     &     103,104,105,106,107,108,110,90,115,116,
     &     117) ,op
c     
c     
c     matfns
      if(op.ge.100)   goto 80
      if(op.eq.0) then
c     "deleted op"
         lc=lc+istk(lc+1)
         goto 10
      endif
c     
 12   if(op.ne.99) then
         call error(44)
         return
      endif
c
c     return
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
c     type 99
      istk(l)=9
      istk(l+1)=9
      istk(il+5)=3
      l=l+2
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+1
      goto 10
c     
c     
 15   continue
      call error(60)
      return
c 
c     stackp
c     
c     affectation d'une valeur a une variable
c     de par le fonctionnement de la pile , la valeur a affecter est 
c     en premiere  position
c
 20   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type 1
      istk(l)=1
      istk(il+5)=2
      l=l+1
c     nom de la variable
      call namstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+1+nsiz
      goto 10
c     
c     stackg
c
 25   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=4
      istk(il+3)=0
      istk(il+4)=1
      l=il+9
c     type 2
      istk(l)=2
      istk(il+5)=2
      l=l+1
c     nom de la variable
      call namstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     rhs
      call intstr(istk(lc+nsiz+1),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni
c     fin
      call intstr(istk(lc+nsiz+2),istk(l),ni,1)
      istk(il+8)=istk(il+7)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+nsiz+3
      goto 10
c     
c     allops => operation sur les operandes de la pile
c     
 30   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=4
      istk(il+3)=0
      istk(il+4)=1
      l=il+9
c     type 5
      istk(l)=5
      istk(il+5)=2
      l=l+1
c     op
      iop=istk(lc+1)
      ii=0
 31   ii=ii+1
      if(ii.gt.nops) then
         buf='Unmanaged operation'
         call error(999)
         return
      endif
      if(ops(ii).ne.iop) goto 31
      call intstr(ii,istk(l),ni,1)
c      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     rhs
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni
c     lhs
      call intstr(istk(lc+3),istk(l),ni,1)
      istk(il+8)=istk(il+7)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+4
      goto 10
c     
c     string
c     
 40   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type 3
      istk(l)=3
      istk(il+5)=2
      l=l+1
c     str
      ni=istk(lc+1)
      call icopy(ni,istk(lc+2),1,istk(l),1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c      
      lc=lc+2+ni
      goto 10
c     
c     num
c     
 41   continue
      il=iadr(lr)
      if(getendian().eq.1) then
         ix(1)=istk(lc+1)
         ix(2)=istk(lc+2)
      else
         ix(2)=istk(lc+1)
         ix(1)=istk(lc+2)
      endif


      maxc=18
      isign=1
      if(x.lt.0)  isign=-1
      call fmt(abs(x),maxc,ifmt,n1,n2)
      if(ifmt.eq.-1) then
c     Inf
         ifl=3
         strg='Inf'
      elseif(ifmt.eq.-2) then
c     Nan
         ifl=3
         strg='Nan'
      elseif(ifmt.eq.1) then
         nf=1
         ifl=maxc
         n2=1
         if(abs(x).ge.1.d100.or.abs(x).lt.1.d-99) then
            ie=int(log10(abs(x)))
            if(ie.lt.0) ie=ie-1
            xx=x/(10.0d0**ie)
            nf=2
            write(form,200) maxc,15
            write(strg,form) xx
            ls=lnblnk(strg)
            if(abs(x).lt.1.d-99) then
               write(strg(ls+1:),'(''D'',i4)') ie
            else
               write(strg(ls+1:),'(''D'',i3)') ie
            endif
         else
            write(form,201) maxc,maxc-7
            write(strg,form) x
         endif
      elseif(ifmt.ge.0) then
         nf=2
         write(form,200) n1,n2
         write(strg,form) x
      endif
      i1=0
 410  i1=i1+1
      if(strg(i1:i1).eq.' ') goto 410

      i2=lnblnk(strg)+1
      if(ifmt.ge.0.and.ifmt.ne.1) then
 420     i2=i2-1
         if(i2.gt.2) then
            if(strg(i2:i2).eq.'0') goto 420
         endif
         if(strg(i2:i2).eq.'.') i2=i2-1
      else
         i2=i2-1
      endif

      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type 6
      istk(l)=6
      istk(il+5)=2
      l=l+1
c     nom de la variable
      ni=i2-i1+1
      call cvstr(ni,istk(l),strg(i1:i2),0)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+3
      goto 10
c     
c matrice vide
c
 42   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
c     type 4
      istk(l)=4
      istk(il+5)=2
      l=l+1
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+1
      goto 10

c     
c     for
c     
 45   continue
      if(ddt.le.-1) write(6,'(a10,5i5)') 'for',pt,lcf,ilr,lr,l-lr
      il=iadr(lr)
c     on preserve les pointeurs de la liste courante
      pt=pt+1
      rstk(pt)=3
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lcf
c
c     on cree les premiers elements de la liste "for"
      istk(il)=15
      istk(il+1)=3
      istk(il+2)=1
      lr=sadr(il+6)
      ilr=il+3
c
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type for
      call icopy(3,for,1,istk(l),1)
      istk(il+5)=istk(il+4)+3
      l=l+3
c     variable de boucle
      ni=istk(lc+1)
      li=lc+2+ni
      call namstr(istk(li+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
      lc=lc+1
c
c     expression de boucle
c
      il=iadr(lr)

c     ---- on preserve les pointeurs  de la liste "for" 
      pt=pt+1
      if(pt.gt.psiz) then
         call error(26)
         return
      endif
      rstk(pt)=4
      ids(1,pt)=ilr
      ids(2,pt)=lr
      long=istk(lc)
      lcf=lc+long
      lc=lc+1
c     ----   ----   ----   ----   ----  --
c     on cree la liste "code boucle"
      ni=cmplxt(istk(lc),long)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
c
      goto 10
 46   continue
c     fin code boucle
c     on rappelle les pointeurs de la liste "for"
      ilr=ids(1,pt)
      lr=ids(2,pt)
c     on complete la liste for
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
c     code du for
c     ---- on preserve les pointeurs  de la liste "for" 
      rstk(pt)=5
      ids(1,pt)=ilr
      ids(2,pt)=lr
      long=istk(lc)
      lc=lc+1+nsiz
c     on cree la liste "for code "
      ni=cmplxt(istk(lc),long)
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      ilr=il+3
c     on preserve les pointeurs de la liste "for code"
      goto 10
 47   continue
c     fin du code du for
c     fin du for
c     on recharge les pointeurs de la liste "for"
      ilr=ids(1,pt)
      lr=ids(2,pt)
      pt=pt-1
      lcf=istk(ilr)
c     on complete la liste "for"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c     on recharge les pointeurs de la liste courante
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lcf=istk(ilr)
c     on complete la liste "courante"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      pt=pt-1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin for',pt,lcf,ilr,lr,l-lr
      goto 10
c
c     if - while
 50   continue
      if(istk(lc+1).lt.0) goto 60
c     ce qui suit (jusqu'a l'etiquette 60 correspond a la traduction 
c     des if/while de  la version 3 et assure la compatibilite
      if(ddt.le.-1) write(6,'(a10,5i5)') 'if',pt,lcf,ilr,lr,l-lr
      il=iadr(lr)
c     on preserve les pointeurs de la liste courante
      pt=pt+1
      rstk(pt)=6
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lcf
      lc0=lc
c
c     on cree les premiers elements de la liste "if" ou "while"
      istk(il)=15
      istk(il+1)=4
      istk(il+2)=1
      lr=sadr(il+7)
      ilr=il+3
      istk(ilr+3)=lc0
c
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
c     type if ou while
      if(op.eq.8) then
         call icopy(2,iff,1,istk(l),1)
         istk(il+5)=istk(il+4)+2
         l=l+2
      else
         call icopy(5,while,1,istk(l),1)
         istk(il+5)=istk(il+4)+5
         l=l+5
      endif
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
      lc=lc+5
c
c     expression logique
c
      il=iadr(lr)

c     ---- on preserve les pointeurs  de la liste "if" ou "while"
      pt=pt+1
      if(pt.gt.psiz) then
         call error(26)
         return
      endif
      rstk(pt)=7
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lc
      long=istk(lc0+2)
      lcf=lc+long-1

c     ----   ----   ----   ----   ----  --
c     on cree la liste "code expression logique"
      ni=cmplxt(istk(lc),long)+1
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      ilr=il+3
c
      goto 10
 51   continue
c     fin "code expression logique"
c     on ajoute le code de l'op de comparaison
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=4
      istk(il+3)=0
      istk(il+4)=1
      l=il+9
c     type 5
      istk(l)=5
      istk(il+5)=2
      l=l+1
c     op
      ii=0
 52   ii=ii+1
      if(ii.gt.nops) then
         buf='Unmanaged operation'
         call error(999)
         return
      endif
      if(ops(ii).ne.istk(lc0+1)) goto 52
      call intstr(ii,istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     rhs
      istk(l)=2
      istk(il+7)=istk(il+6)+1
      l=l+1
c     lhs
      istk(l)=1
      istk(il+8)=istk(il+7)+1
      l=l+1
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
c     on rappelle les pointeurs de la liste "if" ou "while"
      ilr=ids(1,pt)
      lr=ids(2,pt)
c     on complete la liste "if" ou "while"
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
c     code du then
c     ---- on preserve les pointeurs  de la liste "if" ou "while"
      rstk(pt)=8
      ids(1,pt)=ilr
      ids(2,pt)=lr
c     on cree la liste "then"
      long=istk(lc0+3)
      ni=cmplxt(istk(lc),long)
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      goto 10
 54   continue
c     fin du code du then
c     on rappele les pointeur de la liste "if" ou "while"
      ilr=ids(1,pt)
      lr=ids(2,pt)
c     on complete la liste  "if" ou "while"
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
c     code du else
c     ---- on preserve les pointeurs  de la liste "if" ou "while"
      if(ddt.le.-1) write(6,'(a10,5i5)') 'else',pt,lcf,ilr,lr,l-lr
      rstk(pt)=9
      ids(1,pt)=ilr
      ids(2,pt)=lr
      lc0=istk(ilr)
      long=istk(lc0+4)
c     on cree la liste "else"
      ni=cmplxt(istk(lc),long)
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      goto 10
 55   continue
c     fin du else
c     on recharge les pointeurs de la liste "if" ou "while"
      ilr=ids(1,pt)
      lr=ids(2,pt)
      pt=pt-1
c     on complete la liste "if" ou "while"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin else',pt,lcf,ilr,lr,l-lr
c     on recharge les pointeurs de la liste courante
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lcf=istk(ilr)
c     on complete la liste "courante"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      pt=pt-1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin if',pt,lcf,ilr,lr,l-lr
      goto 10
c
c     select - case
 60   continue
      if(ddt.le.-1) write(6,'(a10,5i5)') 'sel',pt,lcf,ilr,lr,l-lr
      il=iadr(lr)
c     on preserve les pointeurs de la liste courante
      pt=pt+1
      rstk(pt)=10
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lcf
      lc0=lc
c
c     on cree les premiers elements de la liste  "select case"
      ncase=istk(lc0+2)
      istk(il)=15
      if(istk(lc).eq.10) then
         istk(il+1)=2*ncase+3
      else
         istk(il+1)=2*ncase+2
      endif
      istk(il+2)=1
      ilr=il+3
      lr=sadr(ilr+istk(il+1))
c
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
      if(istk(lc).eq.8) then
c     type if
         call icopy(2,iff,1,istk(l),1)
         istk(il+5)=istk(il+4)+2
         l=l+2
      elseif(istk(lc).eq.9) then
c     type while
         call icopy(5,while,1,istk(l),1)
         istk(il+5)=istk(il+4)+5
         l=l+5
      elseif(istk(lc).eq.10) then
c     type select
         call icopy(6,sel,1,istk(l),1)
         istk(il+5)=istk(il+4)+6
         l=l+6
      endif
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
      lc=lc+4
c
c     premiere expression 
c
      il=iadr(lr)

c     ---- on preserve les pointeurs  de la liste  "select case"
      pt=pt+1
      if(pt.gt.psiz) then
         call error(26)
         return
      endif
      rstk(pt)=11
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lc
      long=istk(lc0+3)
      lcf=lc+long-1

c     ----   ----   ----   ----   ----  --
      icase=ncase+1
      if(istk(lc0).ne.10) goto 62
c
c     on cree la liste "code premiere expression"
      ni=cmplxt(istk(lc),long)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      ilr=il+3
c
      goto 10
 61   continue
c     fin "code premiere expression"
c     on rappelle les pointeurs de la liste  "select case"
      ilr=ids(1,pt)
      lr=ids(2,pt)
c     on complete la liste  "select case"
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
c
c
 62   continue
c
      if(ddt.le.-1) write(6,'(a10,5i5)') 'case',pt,lcf,ilr,lr,l-lr
      icase=icase-1
      istk(ilr+1)=icase
c
c     code de l'expression du case
c     ---- on preserve les pointeurs  de la liste  "select case"
      rstk(pt)=12
      ids(1,pt)=ilr
      ids(2,pt)=lr
c     on cree la liste "case"
      long=istk(lc)
      lc=lc+1
      ni=cmplxt(istk(lc),long)
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      goto 10
 63   continue
c     fin du code de l'expression du case
c     on rappele les pointeur de la liste  "select case"
      ilr=ids(1,pt)
      lr=ids(2,pt)
c     on complete la liste "select case"
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l


c     code du then 
c     ---- on preserve les pointeurs  de la liste  "select case"
      rstk(pt)=13
      ids(1,pt)=ilr
      ids(2,pt)=lr
      long=istk(lc)
      lc=lc+1
c     on cree la liste "then"
      ni=cmplxt(istk(lc),long)
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      goto 10
 64   continue
c     fin du then
c     on recharge les pointeurs de la liste  "select case"
      ilr=ids(1,pt)
      lr=ids(2,pt)
      icase=istk(ilr)
c     on complete la liste  "select case"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin case',pt,lcf,ilr,lr,l-lr
c
      if(icase.gt.1) goto 62
      lc=lc+1
c     code du else
      if(ddt.le.-1) write(6,'(a10,5i5)') 'else',pt,lcf,ilr,lr,l-lr
c     ---- on preserve les pointeurs  de la liste  "select case"
      rstk(pt)=14
      ids(1,pt)=ilr
      ids(2,pt)=lr
      long=istk(lc)
      lc=lc+1
c     on cree la liste "else"
      ni=cmplxt(istk(lc),long)
      if(long.eq.0) lc=lc+1
      lcf=lc+long-1
      il=iadr(lr)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      goto 10
 65   continue
c     fin du else
c     on recharge les pointeurs de la liste  "select case"
      ilr=ids(1,pt)
      lr=ids(2,pt)
      pt=pt-1
c     on complete la liste  "select case"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin else',pt,lcf,ilr,lr,l-lr
c     on recharge les pointeurs de la liste courante
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lcf=istk(ilr)
c     on complete la liste "courante"
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      pt=pt-1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'fin sel',pt,lcf,ilr,lr,l-lr
      goto 10
c   
 80   continue
      fptr=op+istk(lc+3)
      call funtab(id,fptr,2)

      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=4
      istk(il+3)=0
      istk(il+4)=1
      l=il+9
c     type 20
      istk(l)=2
      istk(l+1)=0
      istk(il+5)=3
      l=l+2
c     nom de la variable
      call namstr(id,istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     rhs
      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni
c     lhs
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+8)=istk(il+7)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+4
      goto 10
c     
c     pause,break,abort,eol
 90   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
c     type >=12
      call intstr(op,istk(l),nw,0)
      istk(il+5)=3
      l=l+2
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+1
      goto 10
c
 100  continue
c     info sur numero de lignes
      lc=lc+2
      goto 10
c
 101  continue
c     mark named variable
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type 18
      istk(l)=1
      istk(l+1)=8
      istk(il+5)=3
      l=l+2
c     nom de la variable
      call namstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c     
      lc=lc+1+nsiz
      goto 10

 102  continue
c     mkindx
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=3
      istk(il+3)=0
      istk(il+4)=1
      l=il+8
c     type 19
      istk(l)=1
      istk(l+1)=9
      istk(il+5)=3
      l=l+2

c     n
      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     m
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+3
      goto 10

 103  continue
c     begrhs
      lc=lc+1
      goto 10

 104  continue
c     printmode (ignored)
      lc=lc+2
      goto 10
c
 105  continue
c     name2var
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      l=il+7
c     type 23
      istk(l)=2
      istk(l+1)=3
      istk(il+5)=3
      l=l+2
c     nom de la variable
      call namstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c     
      lc=lc+1+nsiz
      goto 10
c
106   continue
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
c     type 24
      istk(l)=2
      istk(l+1)=4
      istk(il+5)=3
      l=l+2
c
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+1
      goto 10
c
107   continue
c     profile
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=3
      istk(il+3)=0
      istk(il+4)=1
      l=il+8
c     type 25
      istk(l)=2
      istk(l+1)=5
      istk(il+5)=3
      l=l+2
c
c     n
      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     m
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni

      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+3
      goto 10
c
 108  continue
c     vector of string
      n=istk(lc+1)*istk(lc+2)
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=3+n
      istk(il+3)=0
      istk(il+4)=1
      l=il+5+(3+n)
c     type 26
      istk(l)=2
      istk(l+1)=6
      istk(il+5)=3
      l=l+2
c
c     n
      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     m
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni

      nc=istk(lc+4+n)-1
      do 109 ii=1,n
         istk(il+7+ii)=istk(il+6+ii)+istk(lc+4+ii)-istk(lc+3+ii)
 109  continue
      call icopy(nc,istk(lc+5+n),1,istk(l),1)
      l=l+nc

      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+5+n+nc
      goto 10

 110  continue
c     varfunptr
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=4
      istk(il+3)=0
      istk(il+4)=1
      l=il+9
c     type 27
      istk(l)=2
      istk(l+1)=7
      istk(il+5)=3
      l=l+2

c     fun
      call intstr(istk(lc+1),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c     fin
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+7)=istk(il+6)+ni
      l=l+ni
c
c     nom de la variable
      call namstr(istk(lc+3),istk(l),ni,1)
      istk(il+8)=istk(il+7)+ni
      l=l+ni

      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+3+nsiz
      goto 10
c
 115  continue
c     affectation
      nlhs=istk(lc+1)
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2+2*nlhs
      istk(il+3)=0
      istk(il+4)=1

      l=il+5+istk(il+2)
c     type 
      call intstr(istk(lc),istk(l),ni,1)
      istk(il+5)=istk(il+4)+ni
      l=l+ni
c     sym
      call intstr(istk(lc+2),istk(l),ni,1)
      istk(il+6)=istk(il+5)+ni
      l=l+ni
c
      li=lc+3
      do i=0,nlhs-1
c     .  namei
         call namstr(istk(li),istk(l),ni,1)
         istk(il+7+2*i)=istk(il+6+2*i)+ni
         l=l+ni
c     .  rhsi
         call intstr(istk(li+nsiz),istk(l),ni,1)
         istk(il+8+2*i)=istk(il+7+2*i)+ni
         l=l+ni

         li=li+nsiz+1
      enddo

      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1

      lc=li
      goto 10
 116  continue
c     skip logical evaluation
      lc=lc+3
      goto 10
 117  continue
c     comment
      n=istk(lc+1)
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=2
      istk(il+3)=0
      istk(il+4)=1
      istk(il+5)=istk(il+4)+2
      istk(il+6)=istk(il+5)+n
      l=il+7
c     type 31
      istk(l)=3
      istk(l+1)=1
      l=l+2
      call icopy(n,istk(lc+2),1,istk(l),1)
      l=l+n
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
c
      lc=lc+2+n
      goto 10
c
 120   continue
c     try/catch
      if(ddt.le.-1) write(6,'(a10,5i5)') 'try',pt,lcf,ilr,lr,l-lr
      il=iadr(lr)
c     on preserve les pointeurs de la liste courante
      pt=pt+1
      rstk(pt)=15
      ids(1,pt)=ilr
      ids(2,pt)=lr
      istk(ilr)=lcf
      lc0=lc
c
c     Initialize the   "try catch" list
c     list('try',try_instructions,catch_instructions)
      istk(il)=15
      istk(il+1)=3
      istk(il+2)=1
      lr=sadr(il+6)
      ilr=il+3

c     adding the string 'try'
      il=iadr(lr)
      istk(il)=10
      istk(il+1)=1
      istk(il+2)=1
      istk(il+3)=0
      istk(il+4)=1
      l=il+6
      call icopy(3,try,1,istk(l),1)
      istk(il+5)=istk(il+4)+3
      l=l+3
      l=sadr(l)
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l

c     adding  "try instructions"
      lc=lc+3
      il=iadr(lr)
c     preserve pointers on the   "try catch" list
      pt=pt+1
      if(pt.gt.psiz) then
         call error(26)
         return
      endif
      rstk(pt)=16
      ids(1,pt)=ilr
      ids(2,pt)=lr
      ids(3,pt)=lc0
      istk(ilr)=lc
      long=istk(lc0+1)
      lcf=lc+long-1
      ni=cmplxt(istk(lc),long)
c     Initialize the   "try_instructions" list : list(try_ops)
         
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      if(long.eq.0) then
c     . no try ops
         goto 121
      endif
c     re-enter tradsl for coding the try_ops
      goto 10
 121  continue
c     end of try_ops coding
c     recall the pointers on "try catch" list
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lc0=ids(3,pt)
c     add info on "try instruction" into  "try catch" list
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
c
c     adding  "catch instructions"
      il=iadr(lr)
c     preserve pointers on the   "try catch" list

      rstk(pt)=17
      ids(1,pt)=ilr
      ids(2,pt)=lr
      ids(3,pt)=lc0
      istk(ilr)=lc
      long=istk(lc0+2) 
      lcf=lc+long-1

      ni=cmplxt(istk(lc),long)
      istk(il)=15
      istk(il+1)=ni
      istk(il+2)=1
      lr=sadr(il+3+ni)
      l=lr
      ilr=il+3
      if(long.eq.0) then
c     . no catch ops
         goto 122
      endif
c     re-enter tradsl for coding the catch_ops
      goto 10

 122  continue
c     end of catch_ops coding
c     recall the pointers on the "try catch" list
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lc0=ids(3,pt)
c     add info on "catch instruction" into  "try catch" list
      istk(ilr)=istk(ilr-1)+l-lr
      ilr=ilr+1
      lr=l
      pt=pt-1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'catch end',pt,lcf,ilr,lr,l-lr
c     recall the pointers on the current list
      ilr=ids(1,pt)
      lr=ids(2,pt)
      lcf=istk(ilr)

c     add info on "try catch" into  current list
      istk(ilr)=istk(ilr-1)+l-lr
      lr=l
      ilr=ilr+1
      pt=pt-1
      if(ddt.le.-1) write(6,'(a10,5i5)') 'try end',pt,lcf,ilr,lr,l-lr
      goto 10
c   

c

  200 format('(f',i2,'.',i2,')')
  201 format('(1pd',i2,'.',i2,')')

c     
      end