00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <string.h>
00010 #include <stdio.h>
00011 #ifdef _MSC_VER
00012 #include <stdlib.h>
00013 #endif
00014
00015 #include <time.h>
00016 #include "sciquit.h"
00017 #include "stack-c.h"
00018 #include "run.h"
00019 #include "timer.h"
00020
00021 #undef Lstk
00022 #undef Infstk
00023
00024 IMPORT struct {
00025 logical iflag, interruptible;
00026 } C2F(basbrk);
00027
00028
00029
00030
00031 static int c__1 = 1;
00032 static int c__0 = 0;
00033
00034 #define insert 2
00035 #define extrac 3
00036 #define semi 43
00037 #define equal 50
00038 #ifndef max
00039 #define max(x,y) (((x)>(y))?(x):(y))
00040 #endif
00041
00042 #define Pt (C2F(recu).pt)
00043
00044 extern int C2F(stackp)();
00045 extern int C2F(stackg)();
00046
00047 extern int C2F(putid)();
00048 extern logical C2F(eqid)();
00049 extern int C2F(funs)();
00050
00051 extern int C2F(sxevents)();
00052 extern int C2F(bexec)();
00053 extern int C2F(ismenu)();
00054 extern int C2F(getmen)();
00055 extern int C2F(tksynchro)();
00056 extern int C2F(checkevts)();
00057
00058 extern int C2F(print)();
00059 extern int C2F(createref1)();
00060 extern int C2F(cvname)();
00061 extern int C2F(stimer)();
00062 extern int C2F(basout)();
00063 extern int C2F(mkindx)();
00064 extern int C2F(whatln)();
00065 extern int C2F(prompt)();
00066 extern int C2F(seteol)();
00067 extern int C2F(name2var)();
00068 extern void handle_onprompt();
00069 extern int C2F(getendian)();
00070 extern int C2F(nextj)();
00071 extern int C2F(isafunptr)();
00072 extern int C2F(varfunptr)();
00073 extern int C2F(defmat)();
00074 extern int C2F(ref2val)();
00075 extern int C2F(objvide)();
00076
00077 extern int C2F(gettype)();
00078 extern int C2F(clunit)();
00079
00080 extern logical Eptover(int n);
00081 extern logical Ptover(int n);
00082 extern void Msgs(int n,int ierr);
00083 extern void SciError(int n);
00084 extern logical C2F(istrue)();
00085
00086 logical Istrue(int n)
00087 {
00088
00089 return C2F(istrue)(&n);
00090 }
00091
00092
00093
00094 int C2F(run)()
00095 {
00096
00097
00098 static int *Ids = C2F(recu).ids-nsiz-1;
00099 static int *Rstk = C2F(recu).rstk-1;
00100 static int *Pstk = C2F(recu).pstk-1;
00101 static int *Lstk = C2F(vstk).lstk-1;
00102 static int *Lin = C2F(iop).lin-1;
00103 static int *Lpt = C2F(iop).lpt-1;
00104 static int *Lct = C2F(iop).lct-1;
00105 static double *Stk = C2F(stack).Stk-1;
00106 static int *Istk = (int *)( C2F(stack).Stk)-1;
00107 static int *Infstk = C2F(vstk).infstk-1;
00108
00109 static double equiv_4[1];
00110 #define x (equiv_4)
00111 #define ix ((int *)equiv_4)
00112
00113
00114 static int ifin, iesc, ibpt, tref, ifun;
00115 static int ierr, ndel;
00116 static int j, k, m, n, p, r, t;
00117 static int lname, imode;
00118 static int l0;
00119 static int id[6], lc, kc, nc, lb, li, il, io, ip;
00120 static logical ok;
00121 static int ir, lr, op;
00122 static int inxsci;
00123 static int mm1;
00124 static int nn1;
00125 static int nentry, lastindpos;
00126 static int lcc, kid, nlr;
00127 int i2;
00128
00129 static char tmp[80];
00130
00131 tref = 0;
00132 C2F(checkevts)(&inxsci);
00133 if (C2F(iop).ddt == 4) {
00134 sprintf(tmp," run pt:%d rstk(pt):%d",Pt,Rstk[Pt]);
00135 C2F(basout)(&io, &C2F(iop).wte,tmp, strlen(tmp));
00136 }
00137
00138 l0 = 0;
00139 nc = 0;
00140
00141 if (Ptover(0)) {
00142 return 0;
00143 }
00144
00145 r = Rstk[Pt];
00146 ir = r / 100;
00147 if (ir != 6) {
00148 goto L1;
00149 }
00150 switch ((int)(r - 600)) {
00151 case 1: goto L33;
00152 case 2: goto L66;
00153 case 3: goto L82;
00154 case 4: goto L92;
00155 case 5: goto L58;
00156 case 6: goto L116;
00157 case 7: goto L250;
00158 case 8: goto L254;
00159 case 9: goto L240;
00160
00161 }
00162
00163
00164 L1:
00165 tref = clock();
00166 C2F(errgst).toperr = Top;
00167 k = Lpt[1] - (13+nsiz);
00168 lc = Lin[k + 7];
00169
00170 L10:
00171 if (Err > 0) return 0;
00172
00173 if (C2F(basbrk).iflag) {
00174 C2F(basbrk).iflag = FALSE_;
00175 goto L91;
00176 }
00177 if (C2F(errgst).err1 != 0 ) {
00178 if ((C2F(errgst).errpt >0) && (Pt >= C2F(errgst).errpt) && (Rstk[C2F(errgst).errpt]==618)) {
00179
00180 Pt = C2F(errgst).errpt;
00181 goto L271;
00182 }
00183
00184
00185
00186 if (C2F(errgst).errcatch == 0) goto L999;
00187
00188 if (Rstk[Pt - 1] == 903 || Rstk[Pt - 1] == 909 || Rstk[Pt] == 1001 || Rstk[Pt] == 1002) return 0;
00189 }
00190 if (lc - l0 == nc) {
00191
00192 r = Rstk[Pt] - 610;
00193 switch (r) {
00194 case 1: goto L46;
00195 case 2: goto L47;
00196 case 3: goto L52;
00197 case 4: goto L56;
00198 case 5: goto L57;
00199 case 6: goto L61;
00200 case 8: goto L271;
00201 case 9: goto L272;
00202 }
00203 }
00204
00205
00206 L11:
00207 op = Istk[lc];
00208
00209 switch ((int)op) {
00210 case 1: goto L20;
00211 case 2: goto L25;
00212 case 3: goto L40;
00213 case 4: goto L42;
00214 case 5: goto L30;
00215 case 6: goto L41;
00216 case 7: goto L45;
00217 case 8: goto L49;
00218 case 9: goto L49;
00219 case 10: goto L55;
00220 case 11: goto L270;
00221 case 12: goto L90;
00222 case 13: goto L95;
00223 case 14: goto L100;
00224 case 15: goto L105;
00225 case 16: goto L110;
00226 case 17: goto L120;
00227 case 18: goto L130;
00228 case 19: goto L140;
00229 case 20: goto L150;
00230 case 21: goto L160;
00231 case 22: goto L170;
00232 case 23: goto L180;
00233 case 24: goto L190;
00234 case 25: goto L200;
00235 case 26: goto L210;
00236 case 27: goto L220;
00237 case 28: goto L97;
00238 case 29: goto L230;
00239 case 30: goto L260;
00240 case 31: goto L261;
00241
00242 }
00243 if (op >= 100) {
00244
00245 goto L80;
00246 }
00247
00248 if (op == 99) {
00249
00250
00251 p = Pt + 1;
00252 L12:
00253 --p;
00254 if (Rstk[p] == 612) {
00255
00256 --Top;
00257 goto L12;
00258 } else if (Rstk[p] != 501) {
00259 goto L12;
00260 }
00261 C2F(com).fin = 2;
00262 goto L998;
00263 }
00264
00265 if (op <= 0) {
00266
00267 lc += Istk[1 + lc];
00268 goto L11;
00269 }
00270
00271 SciError(60);
00272 return 0;
00273
00274 L20:
00275
00276 C2F(stackp)(&Istk[1 + lc], &c__0);
00277
00278 C2F(putid)(id, &Istk[1 + lc]);
00279 kid = C2F(com).fin;
00280 lc += 7;
00281 goto L10;
00282
00283 L25:
00284 C2F(com).fin = Istk[7 + lc];
00285 ifin = C2F(com).fin;
00286 Rhs = Istk[8 + lc];
00287 lname = lc + 1;
00288 L26:
00289 C2F(stackg)(&Istk[lname]);
00290 if (Err > 0||C2F(errgst).err1 > 0) {
00291 lc += 9;
00292 goto L10;
00293 }
00294 if (C2F(com).fin != 0) {
00295 goto L28;
00296 }
00297 C2F(funs)(&Istk[1 + lc]);
00298 if (Err > 0||C2F(errgst).err1 > 0) {
00299 lc += 9;
00300 goto L10;
00301 }
00302 if (C2F(com).fun != -2) {
00303 C2F(putid)(&Ids[1 +(Pt + 1) * nsiz ], &Istk[1 + lc]);
00304 if (C2F(com).fun == 0) {
00305 --Top;
00306 SciError(4);
00307 if (Err > 0||C2F(errgst).err1 > 0) {
00308 lc += 9;
00309 goto L10;
00310 }
00311 } else {
00312
00313
00314 if (ifin != -4 && ifin != 0) {
00315
00316
00317 Istk[lc] = 0;
00318 Istk[1 + lc] = 9;
00319 lc += 9;
00320
00321 op = C2F(com).fun * 100;
00322 Istk[lc] = op;
00323 Istk[1 + lc] = Istk[2 + lc] - 1;
00324 Istk[2 + lc] = Istk[3 + lc];
00325 Istk[3 + lc] = C2F(com).fin;
00326 goto L80;
00327 } else {
00328
00329
00330 Istk[lc] = 27;
00331 Istk[1 + lc] = C2F(com).fun;
00332 Istk[2 + lc] = C2F(com).fin;
00333 C2F(putid)(&Istk[3 + lc], &Ids[1 + (Pt + 1) * nsiz]);
00334 goto L10;
00335 }
00336 }
00337 lc += 9;
00338 goto L10;
00339 }
00340 C2F(com).fin = Istk[7 + lc];
00341 goto L26;
00342 L28:
00343 if (Rhs == 0 && ((Istk[7 + lc] == -2)||(Istk[7 + lc] == -1)) && C2F(com).fin == -1) {
00344 lc += 9;
00345
00346 if (Istk[7 + lc-9] == -2) {
00347
00348
00349
00350
00351 if (Istk[lc] != 5 || Istk[1 + lc] != 3) {
00352 strcpy(C2F(cha1).buf,"Unexpected opcode, please report");
00353 SciError(9999);
00354 return 0;
00355 }
00356 lc += 4;
00357 }
00358
00359 if (Istk[lc] != 29) {
00360 strcpy(C2F(cha1).buf,"Unexpected opcode, please report");
00361 SciError(9999);
00362 return 0;
00363 }
00364 lc += 10;
00365
00366 Rhs = 1;
00367 C2F(ref2val)();
00368 C2F(stackp)(&Istk[lname], &c__0);
00369 if (Err > 0 ||C2F(errgst).err1 > 0) {
00370 goto L10;
00371 }
00372 goto L10;
00373 }
00374 lc += 9;
00375 if (C2F(com).fin > 0) {
00376 goto L65;
00377 }
00378 goto L10;
00379
00380
00381 L30:
00382 C2F(com).fin = Istk[1 + lc];
00383 Rhs = Istk[2 + lc];
00384 Lhs = Istk[3 + lc];
00385 lc += 4;
00386 if (C2F(com).fin == extrac) {
00387 C2F(isafunptr)(&Top, id, &ifun, &ifin);
00388 if (ifun != 0) {
00389 --Top;
00390 --Rhs;
00391 C2F(com).fun = ifun;
00392 C2F(com).fin = ifin;
00393 C2F(adjustrhs)();
00394 goto L81;
00395 }
00396 }
00397 if (C2F(com).fin == extrac || C2F(com).fin == insert) {
00398 C2F(adjustrhs)();
00399 }
00400 ++Pt;
00401 Rstk[Pt] = 601;
00402 Ids[1 + Pt * nsiz] = tref;
00403 Ids[3 + Pt * nsiz] = l0;
00404 Ids[4 + Pt * nsiz] = nc;
00405 C2F(recu).icall = 4;
00406
00407 Pstk[Pt] = lc;
00408
00409 return 0;
00410 L33:
00411 tref = Ids[1 + Pt * nsiz];
00412 l0 = Ids[3 + Pt * nsiz];
00413 nc = Ids[4 + Pt * nsiz];
00414 lc = Pstk[Pt];
00415 --Pt;
00416 goto L70;
00417
00418
00419 L40:
00420 n = Istk[1 + lc];
00421 if (C2F(errgst).err1 <= 0) {
00422 ++Top;
00423 if (C2F(cresmat)("run", &Top, &c__1, &c__1, &n, 3L)) {
00424 C2F(getsimat)("run", &Top, &Top, &mm1, &nn1, &c__1, &
00425 c__1, &lr, &nlr, 3L);
00426 C2F(icopy)(&n, &Istk[2 + lc], &c__1, &Istk[lr], &c__1);
00427 }
00428 }
00429 lc = lc + n + 2;
00430 goto L10;
00431
00432
00433 L41:
00434 if (C2F(errgst).err1 <= 0) {
00435 if (C2F(getendian)() == 1) {
00436 ix[0] = Istk[1 + lc];
00437 ix[1] = Istk[2 + lc];
00438 } else {
00439 ix[1] = Istk[1 + lc];
00440 ix[0] = Istk[2 + lc];
00441 }
00442 ++Top;
00443 if (C2F(cremat)("run", &Top, &c__0, &c__1, &c__1, &lr, &lcc, 3L)) {
00444 Stk[lr] = *x;
00445 }
00446 }
00447 lc += 3;
00448 goto L10;
00449
00450 L42:
00451 C2F(defmat)();
00452 ++lc;
00453 goto L10;
00454
00455
00456 L45:
00457 nc = Istk[1 + lc];
00458 lc += 2;
00459 l0 = lc;
00460 if (Ptover(1)) {
00461 lc += nc;
00462 lc = lc + nsiz + Istk[lc];
00463 goto L10;
00464 }
00465 Rstk[Pt] = 611;
00466 Ids[1 + Pt * nsiz] = l0;
00467 Ids[2 + Pt * nsiz] = nc;
00468 goto L10;
00469
00470 L46:
00471 nc = Istk[lc];
00472 l0 = lc + 7;
00473 Rstk[Pt] = 612;
00474 Pstk[Pt] = 0;
00475 Ids[1 + Pt * nsiz] = l0;
00476 Ids[2 + Pt * nsiz] = Lct[8];
00477 Ids[3 + Pt * nsiz] = Top;
00478 Ids[4 + Pt * nsiz] = C2F(errgst).toperr;
00479 C2F(errgst).toperr = Top;
00480 L47:
00481 lc = l0;
00482 if (Top != Ids[3 + Pt * nsiz]) {
00483 SciError(115);
00484 goto L48;
00485 }
00486 C2F(nextj)(&Istk[1 + l0 - 7], &Pstk[Pt]);
00487 if (Pstk[Pt] != 0) {
00488 Lct[8] = Ids[2 + Pt * nsiz];
00489
00490 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)();
00491 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) goto L115;
00492 goto L10;
00493 }
00494
00495 L48:
00496 lc += nc;
00497 C2F(errgst).toperr = Ids[4 + Pt * nsiz];
00498 --Pt;
00499 goto L70;
00500
00501
00502 L49:
00503 if (Istk[1 + lc] < 0) {
00504 goto L55;
00505 }
00506 L52:
00507 strcpy(C2F(cha1).buf, "Functions compiled with very old versions are no more handled");
00508 SciError(997);
00509 return 0;
00510
00511
00512 L55:
00513 if (Ptover(1)) {
00514 lc += (i2 = Istk[1 + lc], abs(i2));
00515 goto L10;
00516 }
00517 Pstk[Pt] = lc;
00518 Ids[3 + Pt * nsiz] = C2F(errgst).toperr;
00519
00520 L551:
00521 if (Istk[1 + lc] > 0) {
00522
00523 nc = Istk[3 + lc];
00524 Rstk[Pt] = 614;
00525 lc += 4;
00526 l0 = lc;
00527 Ids[1 + Pt * nsiz] = l0;
00528 Ids[2 + Pt * nsiz] = nc;
00529 goto L10;
00530 } else {
00531 lc += 4;
00532 }
00533
00534
00535 L56:
00536 if (Istk[Pstk[Pt]] == 10) {
00537
00538 i2 = Top + 1;
00539 if (! C2F(vcopyobj)("run", &Top, &i2,3L)) {
00540 return 0;
00541 }
00542 ++Top;
00543 }
00544
00545 nc = Istk[lc];
00546 Rstk[Pt] = 615;
00547 ++lc;
00548 l0 = lc;
00549 Ids[1 + Pt * nsiz] = l0;
00550 Ids[2 + Pt * nsiz] = nc;
00551 goto L10;
00552
00553
00554 L57:
00555 if (nc == 0) {
00556
00557 ok = TRUE_;
00558 if (Istk[Pstk[Pt]] == 10) {
00559 --Top;
00560 }
00561 goto L59;
00562 } else if (Istk[Pstk[Pt]] != 10) {
00563 ok = Istrue(1);
00564 if (Err > 0 || C2F(errgst).err1 > 0) {
00565 goto L10;
00566 }
00567 goto L59;
00568 }
00569 ++Pt;
00570 C2F(com).fin = equal;
00571 Rhs = 2;
00572 Lhs = 1;
00573 Rstk[Pt] = 605;
00574 C2F(recu).icall = 4;
00575 Pstk[Pt] = lc;
00576 Ids[1 + Pt * nsiz] = tref;
00577
00578 return 0;
00579
00580 L58:
00581 lc = Pstk[Pt];
00582 tref = Ids[1 + Pt * nsiz];
00583 --Pt;
00584 ok = Istrue(1);
00585 if (Err > 0 || C2F(errgst).err1 > 0) {
00586 goto L10;
00587 }
00588 L59:
00589 nc = Istk[lc];
00590 C2F(errgst).toperr = Top;
00591 if (ok) {
00592 ++lc;
00593 if (Istk[Pstk[Pt]] == 10) {
00594 --Top;
00595 }
00596 l0 = lc;
00597 Ids[1 + Pt * nsiz] = l0;
00598 Ids[2 + Pt * nsiz] = nc;
00599 Rstk[Pt] = 616;
00600 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)();
00601 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) goto L115;
00602 goto L10;
00603 } else {
00604 if (Istk[Pstk[Pt]] == 9) {
00605 goto L62;
00606 }
00607 lc = lc + nc + 1;
00608 goto L56;
00609 }
00610
00611 L61:
00612
00613 l0 = Pstk[Pt];
00614 if (Istk[Pstk[Pt]] == 9) {
00615 lc = l0 + 4;
00616 goto L56;
00617 }
00618 L62:
00619 l0 = Pstk[Pt];
00620 lc = l0 + (i2 = Istk[1 + l0], abs(i2));
00621 C2F(errgst).toperr = Ids[3 + Pt * nsiz];
00622 --Pt;
00623 goto L70;
00624
00625
00626 L65:
00627 i2 = Istk[2 + lc] - 1;
00628 Rhs = max(i2,0);
00629 C2F(adjustrhs)();
00630 Lhs = Istk[3 + lc];
00631
00632 lc += 4;
00633
00634 if (Ptover(1)) {
00635 goto L10;
00636 }
00637 Rstk[Pt] = 602;
00638 Pstk[Pt] = lc;
00639
00640 Ids[2 + Pt * nsiz] = tref;
00641 Ids[3 + Pt * nsiz] = l0;
00642 Ids[4 + Pt * nsiz] = nc;
00643 C2F(recu).icall = 5;
00644 C2F(com).fun = 0;
00645
00646 return 0;
00647 L66:
00648 lc = Pstk[Pt];
00649
00650 tref = Ids[2 + Pt * nsiz];
00651 l0 = Ids[3 + Pt * nsiz];
00652 nc = Ids[4 + Pt * nsiz];
00653 --Pt;
00654 goto L70;
00655
00656 L70:
00657
00658 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)();
00659 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) goto L115;
00660
00661 L71:
00662
00663 r = Rstk[Pt] - 610;
00664 switch ((int)r) {
00665 case 1:
00666 l0 = Ids[1 + Pt * nsiz];
00667 nc = Ids[2 + Pt * nsiz];
00668 goto L10;
00669 case 2:
00670 j = Pstk[Pt];
00671 l0 = Ids[1 + Pt * nsiz];
00672 nc = Istk[l0 - 7];
00673 goto L10;
00674 case 3:
00675 li = Ids[1 + Pt * nsiz];
00676 kc = Ids[2 + Pt * nsiz];
00677 nc = Istk[2 + li];
00678 l0 = li + 5;
00679 if (kc == 0) {
00680 goto L10;
00681 }
00682 l0 += nc;
00683 nc = Istk[3 + li];
00684 if (kc == 1) {
00685 goto L10;
00686 }
00687 l0 += nc;
00688 nc = Istk[4 + li];
00689 goto L10;
00690 case 4:
00691 case 5:
00692 case 6:
00693
00694 l0 = Ids[1 + Pt * nsiz];
00695 nc = Ids[2 + Pt * nsiz];
00696 goto L10;
00697 case 8:
00698 l0 = Ids[1 + Pt * nsiz];
00699 nc = Istk[l0 - 2];
00700 goto L10;
00701 case 9:
00702 l0 = Ids[1 + Pt * nsiz];
00703 nc = Istk[l0 - 1];
00704 l0 = l0 + Istk[l0 - 2];
00705 goto L10;
00706 default :
00707 goto L10;
00708 }
00709
00710 L80:
00711 C2F(com).fun = op / 100;
00712 Rhs = Istk[1 + lc];
00713 C2F(adjustrhs)();
00714 Lhs = Istk[2 + lc];
00715 C2F(com).fin = Istk[3 + lc];
00716 lc += 4;
00717
00718 L81:
00719 ++Pt;
00720 Rstk[Pt] = 603;
00721 Pstk[Pt] = lc;
00722 C2F(recu).icall = 9;
00723 Ids[2 + Pt * nsiz] = 0;
00724 Ids[3 + Pt * nsiz] = tref;
00725 Ids[4 + Pt * nsiz] = l0;
00726 Ids[5 + Pt * nsiz] = nc;
00727
00728 return 0;
00729 L82:
00730
00731 lc = Pstk[Pt];
00732 tref = Ids[3 + Pt * nsiz];
00733 l0 = Ids[4 + Pt * nsiz];
00734 nc = Ids[5 + Pt * nsiz];
00735 --Pt;
00736 goto L70;
00737
00738
00739 L90:
00740 ++lc;
00741 L91:
00742 if (Ptover(1)) {
00743 goto L10;
00744 }
00745 Pstk[Pt] = C2F(iop).rio;
00746 C2F(iop).rio = C2F(iop).rte;
00747 C2F(com).fin = 2;
00748 if (Lct[4] <= -10) {
00749 C2F(com).fin = -1;
00750 Lct[4] = -Lct[4] - 11;
00751 }
00752 Ids[1 + Pt * nsiz] = lc;
00753 Ids[2 + Pt * nsiz] = Top;
00754 Ids[3 + Pt * nsiz] = tref;
00755 Ids[4 + Pt * nsiz] = l0;
00756 Ids[5 + Pt * nsiz] = nc;
00757 Rstk[Pt] = 604;
00758 C2F(recu).icall = 5;
00759
00760 return 0;
00761 L92:
00762 lc = Ids[1 + Pt * nsiz];
00763 Top = Ids[2 + Pt * nsiz];
00764 tref = Ids[3 + Pt * nsiz];
00765 l0 = Ids[4 + Pt * nsiz];
00766 nc = Ids[5 + Pt * nsiz];
00767 C2F(iop).rio = Pstk[Pt];
00768 --Pt;
00769 goto L70;
00770
00771
00772 L95:
00773 p = Pt + 1;
00774 L96:
00775 --p;
00776 if (p == 0) {
00777 ++lc;
00778 goto L10;
00779 }
00780 if (Rstk[p] == 612) {
00781
00782 l0 = Ids[1 + p * nsiz];
00783 lc = l0 + Istk[1 + l0 - 8];
00784 Pt = p - 1;
00785 --Top;
00786 goto L70;
00787 } else if (Rstk[p] == 616 && Istk[1 + Pstk[p] - 1] == 9)
00788 {
00789
00790 l0 = Pstk[p];
00791 lc = l0 + (i2 = Istk[1 + l0], abs(i2));
00792 Pt = p - 1;
00793 goto L70;
00794 } else if (Rstk[p] == 501 || Rstk[p] == 502 ||
00795 Rstk[p] == 503) {
00796
00797 ++lc;
00798 goto L10;
00799 } else {
00800 goto L96;
00801 }
00802
00803 L97:
00804 p = Pt + 1;
00805 L98:
00806 --p;
00807 if (p == 0) {
00808 ++lc;
00809 goto L10;
00810 }
00811 if (Rstk[p] == 612) {
00812
00813 l0 = Ids[1 + p * nsiz];
00814
00815 lc = l0 - 7;
00816 nc = Istk[lc];
00817 Pt = p;
00818 goto L47;
00819 } else if (Rstk[p] == 616 && Istk[1 + Pstk[p] - 1] == 9)
00820 {
00821
00822 l0 = Pstk[p];
00823 lc = l0;
00824 nc = Istk[lc];
00825 Pt = p;
00826 goto L551;
00827 } else {
00828 goto L98;
00829 }
00830
00831 L100:
00832 ++Pt;
00833 L101:
00834 --Pt;
00835 if (Pt == 0) {
00836 goto L102;
00837 }
00838 if (Rstk[Pt] / 100 == 5) {
00839 k = Lpt[1] - (13 + nsiz);
00840 Lpt[1] = Lin[1 + k];
00841 Lpt[2] = Lin[2 + k];
00842 Lpt[3] = Lin[3 + k];
00843 Lpt[4] = Lin[4 + k];
00844 Lct[4] = Lin[6 + k ];
00845 Lpt[6] = k;
00846 if (Rstk[Pt] <= 502) {
00847 if (Pt>1) {
00848 if (Rstk[Pt-1] != 903 && Rstk[Pt-1] != 909 && Rstk[Pt-1] != 706)
00849 C2F(vstk).bot = Lin[5 + k];}
00850 else
00851 C2F(vstk).bot = Lin[5 + k];
00852 }
00853 else if (Rstk[Pt] == 503) {
00854 if (C2F(iop).rio == C2F(iop).rte) {
00855
00856 C2F(iop).rio = Pstk[Pt-1];
00857 C2F(recu).paus--;
00858 C2F(vstk).bot = Lin[5 + k];}
00859 else {
00860 int mode[3];
00861
00862 mode[0]=0;
00863 C2F(clunit)(-C2F(iop).rio,C2F(cha1).buf,mode);
00864 C2F(iop).rio = Pstk[Pt-1];
00865 }
00866 }
00867 }
00868 goto L101;
00869 L102:
00870 C2F(recu).icall = 10;
00871 Top = 0;
00872 C2F(com).comp[0] = 0;
00873 if (C2F(recu).niv > 1) {
00874 Err = 9999999;
00875 }
00876 return 0;
00877
00878 L105:
00879
00880
00881
00882
00883 if (C2F(errgst).err1 != 0) {
00884 if (C2F(errgst).err2 == 0) {
00885 C2F(errgst).err2 = C2F(errgst).err1;
00886 }
00887 if (C2F(errgst).errcatch == 1) {
00888
00889 C2F(errgst).err1 = 0;
00890 if (Pt<C2F(errgst).errpt) C2F(errgst).errcatch = 0;
00891 }
00892 imode = (i2 = C2F(errgst).errct / 100000, abs(i2));
00893 if (imode - (imode / 8 << 3) == 2) {
00894 C2F(basbrk).iflag = TRUE_;
00895 }
00896 }
00897
00898 if (C2F(dbg).nmacs != 0) {
00899 int kfin=C2F(dbg).wmac-1;
00900
00901 int kmac;
00902 for (kmac=0;kmac<C2F(dbg).nmacs;kmac++) {
00903
00904 if (C2F(eqid)(&(C2F(vstk).idstk[kfin * nsiz]), &(C2F(dbg).macnms[kmac * nsiz]))) {
00905
00906 i2 = C2F(dbg).lgptrs[kmac+1] - 1;
00907 for (ibpt = C2F(dbg).lgptrs[kmac]; ibpt <= i2; ++ibpt) {
00908 if (Lct[8] == C2F(dbg).bptlg[ibpt - 1]) {
00909
00910 C2F(cvname)(&C2F(dbg).macnms[kmac * nsiz], tmp, &c__1, 24L);
00911 sprintf(C2F(cha1).buf,"%s %5d",tmp, Lct[8]);
00912 Msgs(32, 0);
00913
00914 C2F(basbrk).iflag = TRUE_;
00915 goto L107;
00916 }
00917 }
00918 break;
00919 }
00920 }
00921 }
00922 L107:
00923
00924 if (Lct[4] / 2 % 2 == 1) {
00925 i2 = Lct[4] / 4;
00926 C2F(prompt)(&i2, &iesc);
00927 }
00928 ++Lct[8];
00929 ++lc;
00930
00931 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)();
00932 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) goto L115;
00933
00934 goto L10;
00935
00936
00937
00938
00939
00940
00941
00942
00943 L110:
00944 Lct[8] = Istk[1 + lc];
00945 lc += 2;
00946 goto L10;
00947
00948
00949 L115:
00950 C2F(basbrk).interruptible = C2F(getmen)(C2F(cha1).buf, &lb, &nentry) == 0;
00951 C2F(bexec)(C2F(cha1).buf, &lb, &ierr);
00952 if (ierr != 0) {
00953 goto L10;
00954 }
00955 ++Pt;
00956 Ids[1 + Pt * nsiz] = lc;
00957 Ids[2 + Pt * nsiz] = l0;
00958 Ids[3 + Pt * nsiz] = nc;
00959 Ids[4 + Pt * nsiz] = tref;
00960 Rstk[Pt] = 606;
00961 C2F(recu).icall = 5;
00962
00963 return 0;
00964 L116:
00965 C2F(basbrk).interruptible = TRUE_;
00966 lc = Ids[1 + Pt * nsiz];
00967 l0 = Ids[2 + Pt * nsiz];
00968 nc = Ids[3 + Pt * nsiz];
00969 tref = Ids[4 + Pt * nsiz];
00970 --Top;
00971 --Pt;
00972 goto L71;
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986 L120:
00987 C2F(com).fun = 99;
00988 return 0;
00989
00990
00991
00992 L130:
00993 Infstk[Top] = 1;
00994 C2F(putid)(&C2F(vstk).idstk[Top * nsiz - nsiz], &Istk[1 + lc]);
00995 lc += 7;
00996 goto L10;
00997
00998
00999
01000 L140:
01001 m = Istk[2 + lc];
01002 if (Rstk[Pt] == 617) {
01003
01004 m += Pstk[Pt];
01005 Pstk[Pt] = 0;
01006 }
01007 C2F(mkindx)(&Istk[1 + lc], &m);
01008 lc += 3;
01009 goto L10;
01010
01011
01012
01013 L150:
01014 ++lc;
01015 if (C2F(recu).niv > 0) {
01016 C2F(sciquit)();
01017 exit(0);
01018 }
01019 C2F(com).fun = 99;
01020 goto L10;
01021
01022
01023
01024
01025 L160:
01026 ++lc;
01027 ++Pt;
01028 Rstk[Pt] = 617;
01029 Pstk[Pt] = 0;
01030 goto L10;
01031
01032
01033
01034 L170:
01035
01036 if (Lct[4] >= 0 && Istk[1 + lc] != semi && kid != 0) {
01037 C2F(print)(id, &kid, &C2F(iop).wte);
01038 }
01039 lc += 2;
01040 goto L10;
01041 L180:
01042
01043 C2F(name2var)(&Istk[1 + lc]);
01044 lc += 7;
01045 goto L10;
01046
01047 L190:
01048
01049 ++lc;
01050 ++Top;
01051 C2F(objvide)(" ", &Top, 1L);
01052 goto L10;
01053
01054 L200:
01055
01056 ++Istk[1 + lc];
01057 t = clock();
01058 Istk[2 + lc] = Istk[2 + lc] + t - tref;
01059 tref = t;
01060 lc += 3;
01061 goto L10;
01062
01063 L210:
01064
01065 if (C2F(errgst).err1 <= 0) {
01066 n = Istk[1 + lc] * Istk[2 + lc];
01067 nc = Istk[lc + 4 + n] - 1;
01068 ++Top;
01069 il = Lstk[Top] + Lstk[Top] - 1;
01070 i2 = il + 5 + n + nc;
01071 Err = i2 / 2 + 1 - Lstk[Bot];
01072 if (Err > 0 || C2F(errgst).err1 > 0) {
01073 SciError(17);
01074 lc = lc + 5 + n + nc;
01075 goto L10;
01076 }
01077 i2 = n + 5 + nc;
01078 C2F(icopy)(&i2, &Istk[lc], &c__1, &Istk[il], &c__1);
01079 Istk[il] = 10;
01080 i2 = il + 5 + n + nc;
01081 Lstk[1 + Top] = i2 / 2 + 1;
01082 }
01083 lc = lc + 5 + n + nc;
01084 goto L10;
01085 L220:
01086
01087 C2F(varfunptr)(&Istk[3 + lc], &Istk[1 + lc], &Istk[2 + lc]);
01088 lc += 9;
01089 goto L10;
01090 L230:
01091
01092 Lhs = Istk[1 + lc];
01093 ip = Istk[2 + lc];
01094 li = lc + 3;
01095 lc = li + Lhs * 7;
01096
01097 ndel = 0;
01098 L231:
01099 Rhs = Istk[6 + li];
01100 lastindpos = Top - Lhs - ndel;
01101 if (C2F(errgst).err1 != 0) {
01102 goto L253;
01103 }
01104 if (Rhs == 0) {
01105
01106 C2F(stackp)(&Istk[li], &c__0);
01107 if (Err > 0 || C2F(errgst).err1 > 0) {
01108 goto L10;
01109 }
01110 if (C2F(errgst).err1 > 0) {
01111 goto L253;
01112 }
01113
01114 if (!(Lct[4] >= 0 && ip != semi && C2F(com).fin != 0)) goto L253;
01115 ifin=C2F(com).fin;
01116 L232:
01117 C2F(print)(&Istk[li], &ifin, &C2F(iop).wte);
01118 if (Rstk[Pt]!=1101) goto L253;
01119 ++Pt;
01120 Pstk[Pt] = li;
01121 Ids[1 + Pt * nsiz] = ndel;
01122 Ids[2 + Pt * nsiz] = lastindpos;
01123 Ids[3 + Pt * nsiz] = tref;
01124 Ids[4 + Pt * nsiz] = l0;
01125 Ids[5 + Pt * nsiz] = Lhs;
01126 Ids[6 + Pt * nsiz] = nc;
01127 Rstk[Pt]=609;
01128 return 0;
01129 L240:
01130 li = Pstk[Pt];
01131 ip = Istk[li-1];
01132 ndel = Ids[1 + Pt * nsiz];
01133 lastindpos = Ids[2 + Pt * nsiz];
01134 tref = Ids[3 + Pt * nsiz];
01135 l0 = Ids[4 + Pt * nsiz];
01136 Lhs = Ids[5 + Pt * nsiz];
01137 nc = Ids[6 + Pt * nsiz];
01138 --Pt;
01139
01140 goto L232;
01141
01142 }
01143
01144
01145 C2F(adjustrhs)();
01146
01147 if (lastindpos + 1 != Top) {
01148
01149
01150
01151 for (ir = 1; ir <= Rhs; ++ir) {
01152 i2 = lastindpos - Rhs + ir;
01153 C2F(createref1)(&i2);
01154 }
01155
01156 i2 = Top - Rhs;
01157 C2F(createref1)(&i2);
01158
01159 ndel += Rhs;
01160 }
01161 lastindpos -= Rhs;
01162
01163 C2F(com).fin = -3;
01164 C2F(stackg)(&Istk[li]);
01165 if (Err > 0 || C2F(errgst).err1 > 0) {
01166 goto L10;
01167 }
01168
01169
01170 if (Eptover(1)) {
01171 return 0;
01172 }
01173
01174 Pstk[Pt] = li;
01175 Ids[1 + Pt * nsiz] = ndel;
01176 Ids[2 + Pt * nsiz] = lastindpos;
01177 Ids[3 + Pt * nsiz] = tref;
01178 Ids[4 + Pt * nsiz] = l0;
01179 Ids[5 + Pt * nsiz] = Lhs;
01180 Ids[6 + Pt * nsiz] = nc;
01181 Rstk[Pt] = 607;
01182 Rhs += 2;
01183 Lhs = 1;
01184 C2F(recu).icall = 4;
01185 C2F(com).fin = insert;
01186
01187 return 0;
01188 L250:
01189 li = Pstk[Pt];
01190 ip = Istk[li-1];
01191 ndel = Ids[1 + Pt * nsiz];
01192 lastindpos = Ids[2 + Pt * nsiz];
01193 tref = Ids[3 + Pt * nsiz];
01194 l0 = Ids[4 + Pt * nsiz];
01195 Lhs = Ids[5 + Pt * nsiz];
01196 nc = Ids[6 + Pt * nsiz];
01197 --Pt;
01198
01199 C2F(stackp)(&Istk[li], &c__0);
01200
01201 if (Err > 0 || C2F(errgst).err1 > 0) {
01202 goto L10;
01203 }
01204 if (C2F(errgst).err1 > 0) {
01205 goto L253;
01206 }
01207
01208 if (!(Lct[4] >= 0 && ip != semi && C2F(com).fin != 0)) goto L252;
01209 ifin=C2F(com).fin;
01210 L251:
01211 C2F(print)(&Istk[li], &ifin, &C2F(iop).wte);
01212 if (Rstk[Pt]!=1101) goto L252;
01213 ++Pt;
01214 Pstk[Pt] = li;
01215 Ids[1 + Pt * nsiz] = ndel;
01216 Ids[2 + Pt * nsiz] = lastindpos;
01217 Ids[3 + Pt * nsiz] = tref;
01218 Ids[4 + Pt * nsiz] = l0;
01219 Ids[5 + Pt * nsiz] = Lhs;
01220 Ids[6 + Pt * nsiz] = nc;
01221 Rstk[Pt]=608;
01222 return 0;
01223 L254:
01224 li = Pstk[Pt];
01225 ip = Istk[li-1];
01226 ndel = Ids[1 + Pt * nsiz];
01227 lastindpos = Ids[2 + Pt * nsiz];
01228 tref = Ids[3 + Pt * nsiz];
01229 l0 = Ids[4 + Pt * nsiz];
01230 Lhs = Ids[5 + Pt * nsiz];
01231 nc = Ids[6 + Pt * nsiz];
01232 --Pt;
01233 goto L251;
01234
01235 L252:
01236
01237 if (lastindpos != Top) --Top;
01238
01239 L253:
01240 li += 7;
01241 --Lhs;
01242 if (Lhs > 0) {
01243 goto L231;
01244 }
01245 Top -= ndel;
01246 lc = li;
01247 goto L10;
01248
01249
01250 L260:
01251 if (Istk[1 + lc] == 1) {
01252
01253 if (C2F(gettype)(&Top) != 8 && Istrue(0)) {
01254 lc += Istk[2 + lc];
01255 }
01256 } else {
01257
01258 if (C2F(gettype)(&Top) != 8 && ! Istrue(0)) {
01259 lc += Istk[2 + lc];
01260 }
01261 }
01262 lc += 3;
01263 goto L10;
01264
01265 L261:
01266
01267 lc += 2+Istk[1 + lc];
01268 goto L10;
01269
01270
01271 L270:
01272 nc = Istk[1 + lc];
01273 lc += 3;
01274 l0 = lc;
01275 if (Ptover(1)) {
01276 lc += nc;
01277 lc += nsiz + Istk[lc];
01278 goto L10;
01279 }
01280 Rstk[Pt] = 618;
01281 Ids[1 + Pt * nsiz] = l0;
01282
01283 Ids[2 + Pt * nsiz] = C2F(errgst).errct;
01284 Ids[3 + Pt * nsiz] = C2F(errgst).err2;
01285 Ids[4 + Pt * nsiz] = C2F(errgst).err1;
01286 Ids[5 + Pt * nsiz] = C2F(errgst).errpt;
01287 Ids[6 + Pt * nsiz] = (Lct[4]+100)+10000*C2F(com).sym;
01288
01289 C2F(errgst).errct = -(900000+1);
01290 C2F(errgst).errpt = Pt;
01291 Pstk[Pt] = Top;
01292 goto L10;
01293 L271:
01294
01295 l0 = Ids[1 + Pt * nsiz];
01296
01297 ok = max(C2F(errgst).err2,C2F(errgst).err1)<=0;
01298
01299 C2F(errgst).errct = Ids[2 + Pt * nsiz];
01300 C2F(errgst).err2 = Ids[3 + Pt * nsiz];
01301 C2F(errgst).err1 = Ids[4 + Pt * nsiz];
01302 C2F(errgst).errpt = Ids[5 + Pt * nsiz];
01303 C2F(com).sym = Ids[6 + Pt * nsiz]/10000;
01304 Lct[4] = Ids[6 + Pt * nsiz]-10000*C2F(com).sym-100;
01305 if (ok) {
01306
01307 nc = Istk[l0-1];
01308 lc += nc;
01309
01310 --Pt;
01311 goto L70;
01312 }
01313
01314 lc = l0+Istk[l0-2];
01315 nc = Istk[l0-1];
01316
01317 l0 = lc;
01318 Rstk[Pt] = 619;
01319 goto L10;
01320 L272:
01321
01322
01323 --Pt;
01324 goto L70;
01325
01326
01327 L998:
01328 Lhs = 0;
01329 L999:
01330
01331 if (Rstk[Pt] != 501) {
01332 --Pt;
01333 goto L999;
01334 }
01335 C2F(com).fun = 0;
01336 return 0;
01337 #undef ix
01338 #undef x
01339 }
01340
01341
01342
01343 int C2F(adjustrhs)()
01344 {
01345
01346
01347
01348
01349
01350
01351 static int *Ids = C2F(recu).ids-nsiz-1;
01352 static int *Rstk = C2F(recu).rstk-1;
01353 static int *Pstk = C2F(recu).pstk-1;
01354
01355 if (Rstk[Pt] == 617) {
01356 Rhs += Pstk[Pt];
01357 --Pt;
01358 } else if (Rstk[Pt] == 501) {
01359
01360 Rhs += Ids[5 + Pt * nsiz];
01361 Ids[5 + Pt * nsiz] = 0;
01362 }
01363 return 0;
01364 }