#include <string.h>#include <stdio.h>#include "stack-c.h"#include "parse.h"#include "timer.h"Include dependency graph for parse.c:

Go to the source code of this file.
Defines | |
| #define | comma 52 |
| #define | lparen 41 |
| #define | rparen 42 |
| #define | left 54 |
| #define | right 55 |
| #define | less 59 |
| #define | great 60 |
| #define | dot 51 |
| #define | name 1 |
| #define | num 0 |
| #define | cmt 2 |
| #define | insert 2 |
| #define | extrac 3 |
| #define | blank 40 |
| #define | semi 43 |
| #define | slash 48 |
| #define | equal 50 |
| #define | eol 99 |
| #define | max(x, y) (((x)>(y))?(x):(y)) |
| #define | Pt (C2F(recu).pt) |
Functions | |
| int C2F() | clause () |
| int C2F() | fact () |
| int C2F() | expr () |
| int C2F() | terme () |
| int C2F() | stackp () |
| int C2F() | stackg () |
| int C2F() | macro () |
| int C2F() | getsym () |
| int C2F() | putid () |
| logical C2F() | eqid () |
| logical C2F() | ptover () |
| int C2F() | funs () |
| int C2F() | sxevents () |
| int C2F() | bexec () |
| int C2F() | ismenu () |
| int C2F() | getmen () |
| int C2F() | tksynchro () |
| int C2F() | checkevts () |
| int C2F() | findequal () |
| int C2F() | print () |
| int C2F() | cvstr () |
| int C2F() | createref1 () |
| int C2F() | comand () |
| int C2F() | cvname () |
| int C2F() | getlin () |
| int C2F() | mrknmd () |
| int C2F() | stimer () |
| int C2F() | basout () |
| int C2F() | mkindx () |
| int C2F() | whatln () |
| int C2F() | prompt () |
| int C2F() | seteol () |
| int C2F() | allops () |
| int C2F() | run () |
| int C2F() | name2var () |
| void C2F() | parsecomment () |
| int C2F() | msgs () |
| int C2F() | error () |
| logical C2F() | compil () |
| logical C2F() | eptover () |
| logical C2F() | Ptover () |
| void | handle_onprompt (int *n) |
| void | Msgs (int n, int ierr) |
| void | SciError (int n) |
| logical | Compil (int code, int *val1, int val2, int val3, int val4) |
| logical | Eptover (int n) |
| logical | Ptover (int n) |
| int C2F() | parse () |
| int C2F() | syncexec (char *str, int *ns, int *ierr, int *seq, long int str_len) |
Variables | |
| struct { | |
| logical iflag | |
| logical interruptible | |
| } | basbrk |
| static int | c__1 = 1 |
| static int | c__0 = 0 |
| static int | c_n1 = -1 |
| #define comma 52 |
Definition at line 30 of file parse.c.
Referenced by do_string(), parse(), proto(), putop(), ref_defs(), wr_equiv_init(), write_assigned_fmts(), and write_namelists().
| #define eol 99 |
Definition at line 48 of file parse.c.
Referenced by codetoascii(), CreateEOLList(), getcode(), InsertNewCRs(), parse(), and SaltTextAway().
| #define equal 50 |
Definition at line 47 of file parse.c.
Referenced by ChooseOtherOperation(), gencheck(), parse(), and run().
| #define great 60 |
| #define insert 2 |
| #define left 54 |
Definition at line 33 of file parse.c.
Referenced by Evaluate(), LoadPieces(), md5_append(), MoveChart(), parse(), PositionHScrollBar(), ReadbdfFont(), and same_ident().
| #define less 59 |
Definition at line 35 of file parse.c.
Referenced by ChooseOtherOperation(), gencheck(), and parse().
| #define name 1 |
Definition at line 38 of file parse.c.
Referenced by addfile(), AddNewMenu(), badconnection(), C2F(), CheckCreateOrder(), connection(), CreateEqualTList(), createreffromname(), excall(), ffeval(), funnum(), get_optionals(), getalufunction(), GetControlInstruction(), getfftwlibname(), GetInstruction(), GetValuesHook(), GSciString(), gw_arnoldi(), gw_boolean(), gw_cacsd0(), gw_cacsd1(), gw_cacsd2(), gw_cacsd3(), gw_core(), gw_cscicos(), gw_differential_equations1(), gw_differential_equations2(), gw_differential_equations3(), gw_differential_equations4(), gw_differential_equations5(), gw_differential_equations6(), gw_elementaries_functions(), gw_fftw(), gw_fileio(), gw_graphics(), gw_gui(), gw_integer(), gw_interpolation(), gw_io(), gw_linear_algebra(), gw_localization(), gw_metanet(), gw_optim(), gw_polynomials(), gw_pvm(), gw_randlib(), gw_scicos(), gw_signal(), gw_sound(), gw_sparse(), gw_special_functions1(), gw_special_functions2(), gw_statistics(), gw_symbolic(), gw_tclsci(), gw_time(), gw_wintools(), gwdatastructures1(), gwdatastructures2(), idfromname(), inffic(), InitFigureModel(), InitializeQuarks(), interf1(), intex11c(), intex7c(), main(), MenuSelect(), Message(), MissileGCGetorSet(), oneof_stg(), out_call(), parse(), ReadFunction(), rhs_opt_print_names(), saveg(), Sci_Delsym(), sci_demo(), Sci_dlsym(), sciExecCallback(), scig_2dzoom(), scig_3drot(), scig_erase(), scig_expose(), scig_replay(), scig_replay_hdc(), scig_resize(), scig_toPs(), scig_unzoom(), SciLink(), scipvmconfig(), scipvmtasks(), sciSetName(), SearchComp(), SearchFandS(), SearchInDynLinks(), SetValues(), SetValuesHook(), ShowDynLinks(), wr_one_init(), write_namelists(), WriteFortranCall(), WriteFunctionCode(), WriteInfoCode(), XmuConvertStandardSelection(), XmuCvtStringToBackingStore(), XmuCvtStringToBitmap(), XmuCvtStringToCursor(), XmuCvtStringToGravity(), XmuCvtStringToJustify(), XmuCvtStringToOrientation(), XmuCvtStringToShapeStyle(), XmuCvtStringToWidget(), and XmuNewCvtStringToWidget().
| #define num 0 |
Definition at line 39 of file parse.c.
Referenced by AllGraphWinDelete(), C2F(), CreatePredefVar(), DoLine(), FindFreeGraphicWindow(), get_figure_size_property(), Java_javasci_Scilab_HaveAGraph(), MenuSelect(), NumFromRk2(), PositionInChild(), savewave(), sci_delete(), sci_set(), sci_winsid(), sci_xlfont(), sciGetScreenPosition(), sciInitScreenPosition(), ScilabHaveAGraph(), set_current_axes_property(), test_xgc(), transc(), and xendgraphicGif().
| #define Pt (C2F(recu).pt) |
Definition at line 53 of file parse.c.
Referenced by adjustrhs(), handle_onprompt(), parse(), run(), and syncexec().
| #define right 55 |
Definition at line 34 of file parse.c.
Referenced by Evaluate(), parse(), same_ident(), and UpdateTextInRectangle().
| #define slash 48 |
| int C2F() allops | ( | ) |
| int C2F() basout | ( | ) |
| int C2F() bexec | ( | ) |
| int C2F() checkevts | ( | ) |
| int C2F() createref1 | ( | ) |
| int C2F() cvname | ( | ) |
| int C2F() cvstr | ( | ) |
| logical C2F() eqid | ( | ) |
| int C2F() error | ( | ) |
| int C2F() expr | ( | ) |
Referenced by do_p1_asgoto(), elif_out(), Evaluate(), exarif(), out_and_free_statement(), out_asgoto(), out_if(), p1_elif(), p1_expr(), p1_if(), parse(), and prolog().
Here is the caller graph for this function:

| int C2F() fact | ( | ) |
Referenced by drawarcGif(), drawarcXfig(), fillarcGif(), fillarcXfig(), and parse().
Here is the caller graph for this function:

| int C2F() funs | ( | ) |
Referenced by handle_onprompt(), intscicosimc(), parse(), run(), scibuiltin(), scifunction(), scirun(), scistring(), and syncexec().
Here is the caller graph for this function:

| int C2F() getmen | ( | ) |
| void handle_onprompt | ( | int * | n | ) |
Definition at line 1478 of file parse.c.
References C2F, err, fin, fun, funs(), Lhs, Lstk, Pt, Rhs, and Top.
Referenced by parse().
01479 { 01480 /* Initialized data */ 01481 01482 static int onprompt[6] = { 420943928,420878363,673720349,673720360, 01483 673720360,673720360 }; 01484 static int *Rstk = C2F(recu).rstk-1; 01485 static int *Pstk = C2F(recu).pstk-1; 01486 static int *Lstk = C2F(vstk).lstk-1; 01487 01488 *where = 0; 01489 if (Pt > 0) { 01490 /* back from %onprompt */ 01491 C2F(errgst).errct = Pstk[Pt]; 01492 --Pt; 01493 C2F(errgst).err2 = 0; 01494 Top = 0; 01495 C2F(com).fin = 0; 01496 C2F(com).fun = 0; 01497 } 01498 else { 01499 /* on prompt implicit execution */ 01500 C2F(com).fun = 0; 01501 C2F(funs)(onprompt); 01502 if (C2F(iop).err > 0) return; 01503 if (C2F(com).fun <= 0 && C2F(com).fin == 0) return; 01504 /* %onprompt function exists */ 01505 Rhs = 0; 01506 Lhs = 1; 01507 ++Pt; 01508 Pstk[Pt] = C2F(errgst).errct; 01509 Rstk[Pt] = 710; 01510 /* set error catch with mode continue */ 01511 C2F(errgst).errct = -100001; 01512 C2F(errgst).errpt = 1; 01513 if (C2F(com).fun > 0) { 01514 /* %onprompt is a primitive *call* matfns */ 01515 *where = 1; 01516 } else { 01517 /* %onprompt is a Scilab function *call* macro */ 01518 C2F(com).fin = Lstk[C2F(com).fin]; 01519 *where = 2; 01520 } 01521 } 01522 } /* handleonprompt */
Here is the call graph for this function:

Here is the caller graph for this function:

| int C2F() ismenu | ( | ) |
Definition at line 191 of file dynamic_menus.c.
00192 { 00193 /* Do not manage comands while compiling scilab function */ 00194 if ( (commandQueue == NULL) || (C2F(com).comp[0] != 0)) 00195 return(0) ; 00196 else 00197 return(1); 00198 }
| int C2F() msgs | ( | ) |
Referenced by Msgs(), sci_besselh(), sci_besseli(), sci_besselj(), sci_besselk(), sci_bessely(), sci_xget(), sci_xset(), and scicos().
Here is the caller graph for this function:

| int C2F() name2var | ( | ) |
| int C2F() parse | ( | void | ) |
Definition at line 128 of file parse.c.
References abs, allops(), basbrk, basout(), bexec(), blank, bptlg, buf, C2F, c__0, c__1, c_n1, char1, checkevts(), clause(), cmt, comand(), comma, comp, Compil(), createref1(), cvname(), ddt, dot, eol, Eptover(), eqid(), equal, err, Err, err1, err2, errct, errpt, expr(), extrac, fact(), FALSE_, fin, findequal(), fun, funs(), getlin(), getmen(), getsym(), great, handle_onprompt(), icall, idstk, ierr, ifin, iflag, insert, interruptible, ir, ismenu(), job, krec, L, left, less, lgptrs, Lhs, lparen, Lstk, macnms, macr, macro(), max, mkindx(), mrknmd(), Msgs(), name, name2var(), nentry, niv, nmacs, nsiz, p, parsecomment(), paus, print(), prompt, Pt, putid(), Rhs, right, rio, rparen, rte, run(), SciError(), scilab_timer_check(), semi, seteol(), stackg(), stackp(), sxevents(), sym, syn, terme(), tksynchro(), Top, topk, TRUE_, whatln(), and where.
Referenced by scibuiltin(), scifunction(), scirun(), and syncexec().
00129 { 00130 /* Initialized data */ 00131 static int ans[6] = { 672929546,673720360,673720360,673720360, 00132 673720360,673720360 }; 00133 static int varargout[6] = { 169544223,504893467,673720349,673720360, 00134 673720360,673720360 }; 00135 /* static int catch[6] = {203229708,673720337,673720360,673720360, 673720360,673720360 };*/ 00136 00137 static int *Ids = C2F(recu).ids-nsiz-1; 00138 static int *Rstk = C2F(recu).rstk-1; 00139 static int *Pstk = C2F(recu).pstk-1; 00140 static int *Lstk = C2F(vstk).lstk-1; 00141 static int *Lin = C2F(iop).lin-1; 00142 static int *Lpt = C2F(iop).lpt-1; 00143 static int *Lct = C2F(iop).lct-1; 00144 /*static double *Stk = C2F(stack).Stk-1;*/ 00145 /*static int *Istk = (int *)( C2F(stack).Stk)-1;*/ 00146 00147 /* System generated locals */ 00148 int i__2, i__3; 00149 00150 /* Local variables */ 00151 static int iesc, ndel, ifin, ibpt; 00152 static int iret; 00153 static int topk; 00154 static int lpts, next; 00155 static int ierr; 00156 static int k, p, r; 00157 static int imode, schar; 00158 static int itime, where; 00159 static logical found; 00160 static int excnt; 00161 static int l1; 00162 static int id[6], lb, io, ir; 00163 static int inxsci; 00164 static logical dotsep; 00165 static int icount; 00166 static int nentry, lastindpos; 00167 static int job, nlc, pts; 00168 static char tmp[80]; 00169 00170 00171 itime = 10000; 00172 C2F(checkevts)(&inxsci); 00173 L1: 00174 r = 0; 00175 if (Pt > 0) { 00176 r = Rstk[Pt]; 00177 } 00178 if (C2F(iop).ddt == 4) { 00179 sprintf(tmp," TOP pt:%d rstk(pt):%d icall: %d niv: %d err:%d", 00180 Pt,Rstk[Pt], C2F(recu).icall, C2F(recu).niv,C2F(iop).err); 00181 C2F(basout)(&io, &C2F(iop).wte,tmp, strlen(tmp)); 00182 } 00183 00184 if (C2F(recu).icall == 5) { 00185 goto L88; 00186 } 00187 if (Pt > 0) { 00188 goto L86; 00189 } 00190 if (C2F(iop).err > 0) { 00191 goto L98; 00192 } 00193 /* initialization */ 00194 /* ------------------- */ 00195 L5: 00196 C2F(com).sym = eol; 00197 job = 0; 00198 if (C2F(iop).rio == -1) { 00199 job = -1; 00200 } 00201 Top = 0; 00202 C2F(com).fin = 0; 00203 C2F(recu).macr = 0; 00204 C2F(recu).paus = 0; 00205 C2F(recu).icall = 0; 00206 C2F(iop).rio = C2F(iop).rte; 00207 Lct[3] = 0; 00208 Lct[4] = 2; 00209 Lpt[1] = 1; 00210 if (job == -1) { 00211 goto L13; 00212 } 00213 00214 L10: 00215 if (C2F(com).sym != eol) { 00216 goto L15; 00217 } 00218 if (C2F(com).comp[0] == 0) { 00219 goto L12; 00220 } 00221 if (Lin[Lpt[4]+1] == eol) { 00222 goto L88; 00223 } 00224 00225 /* get a new line */ 00226 /* ------------------- */ 00227 L12: 00228 if (Lct[4] <= -10) { 00229 Lct[4] = -Lct[4] - 11; 00230 } else { 00231 if (Lct[4] / 2 % 2 == 1) { 00232 i__2 = Lct[4] / 4; 00233 C2F(prompt)(&i__2, &iesc); 00234 if (iesc == 1) { 00235 /* interrupted line acquisition (mode=7) */ 00236 iret = 3; 00237 goto L96; 00238 } 00239 Lct[1] = 0; 00240 if (C2F(recu).paus == 0 && 00241 C2F(iop).rio == C2F(iop).rte && 00242 C2F(recu).macr == 0) { 00243 if (Pt != 0) { 00244 Msgs(30,0); 00245 Pt = 0; 00246 } 00247 if (Top != 0) { 00248 Msgs(31,0); 00249 Top = 0; 00250 } 00251 } 00252 } 00253 } 00254 L13: 00255 C2F(tksynchro)(&C2F(recu).paus); 00256 C2F(getlin)(&job, &c__1); 00257 C2F(tksynchro)(&c_n1); 00258 if (C2F(com).fin == -3) { 00259 /* interrupted line acquisition */ 00260 iret = 2; 00261 goto L96; 00262 } else if (C2F(com).fin == -1) { 00263 /* Continuation line handling when scilab is called as a routine */ 00264 C2F(com).fun = 99; 00265 return 0; 00266 } 00267 job = 0; 00268 C2F(iop).err = 0; 00269 00270 if (Pt != 0) { 00271 goto L15; 00272 } 00273 L14: 00274 handle_onprompt(&where); 00275 if (C2F(iop).err > 0) { 00276 goto L98; 00277 } 00278 switch ((int)where) { 00279 case 1: goto L85; 00280 case 2: goto L88; 00281 } 00282 /* Beginning of a new statement, clause expression or command */ 00283 /* ------------------------------------------------------------ */ 00284 L15: 00285 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)(); 00286 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) { 00287 iret = 1; 00288 goto L96; 00289 } 00290 00291 r = 0; 00292 if (Pt > 0) { 00293 r = Rstk[Pt]; 00294 } 00295 if (C2F(iop).ddt == 4) { 00296 sprintf(tmp," parse pt:%d rstk(pt):%d top: %d niv: %d err:%d", 00297 Pt,r,Top, C2F(recu).niv,C2F(iop).err); 00298 C2F(basout)(&io, &C2F(iop).wte,tmp, strlen(tmp)); 00299 } 00300 00301 excnt = 0; 00302 if (! C2F(basbrk).iflag || C2F(com).comp[0] != 0 ) { 00303 goto L18; 00304 } 00305 /* Handling of pauses */ 00306 L16: 00307 if (Eptover(1)) { 00308 goto L98; 00309 } 00310 Pstk[Pt] = C2F(iop).rio; 00311 Ids[2 + Pt * nsiz] = Top; 00312 C2F(iop).rio = C2F(iop).rte; 00313 Rstk[Pt] = 701; 00314 C2F(basbrk).iflag = FALSE_; 00315 C2F(com).fin = 2; 00316 if (Lct[4] <= -10) { 00317 C2F(com).fin = -1; 00318 Lct[4] = -Lct[4] - 11; 00319 } 00320 /* *call* macro */ 00321 goto L88; 00322 /* pauses termination */ 00323 L17: 00324 C2F(iop).rio = Pstk[Pt]; 00325 Top = Ids[2 + Pt * nsiz]; 00326 --Pt; 00327 goto L15; 00328 L18: 00329 Lhs = 1; 00330 excnt = 0; 00331 C2F(putid)(id, ans); 00332 /* preserve current character position */ 00333 lpts = Lpt[4] - 1; 00334 pts = Pt; 00335 00336 C2F(getsym)(); 00337 if (C2F(com).sym == right || C2F(com).sym == rparen || C2F(com).sym == less || 00338 C2F(com).sym == great) { 00339 SciError(1); 00340 goto L98; 00341 } else if (C2F(com).sym == semi || C2F(com).sym == comma || C2F(com).sym == eol) { 00342 goto L77; 00343 } else if (C2F(com).sym == cmt) { 00344 C2F(parsecomment)(); 00345 goto L77; 00346 } else if (C2F(com).sym == name) { 00347 lpts = Lpt[3] - 1; 00348 /* try to avoid the comand call whenever it is possible */ 00349 if (C2F(com).char1 == equal) { 00350 goto L25; 00351 } 00352 /* if (char1 .eq. lparen) then */ 00353 /* one can get this case with "if ( ) then" */ 00354 /* endif */ 00355 if (Lpt[4] >= 2) { 00356 if (Lin[Lpt[4] - 2] == blank) { 00357 goto L20; 00358 } 00359 } 00360 if (C2F(com).char1 == dot) { 00361 /* name.x */ 00362 schar = C2F(com).char1; 00363 goto L30; 00364 } 00365 goto L20; 00366 } else if (C2F(com).sym == left) { 00367 /* is there an explicit affectation */ 00368 lpts = Lpt[3] - 1; 00369 Lpt[4] = lpts; 00370 Lpt[3] = lpts; 00371 C2F(com).char1 = blank; 00372 C2F(findequal)(&found); 00373 if (C2F(iop).err > 0) { 00374 goto L98; 00375 } 00376 if (found) { 00377 /* multiple lhs */ 00378 goto L40; 00379 } else { 00380 /* no ==> implicit lhs */ 00381 goto L50; 00382 } 00383 } else { 00384 /* not lhs defined */ 00385 /* set ans for lhs */ 00386 if (Eptover(1)) { 00387 goto L98; 00388 } 00389 C2F(putid)(&Ids[1 + Pt * nsiz], ans); 00390 Lhs = 1; 00391 Pstk[Pt] = 0; 00392 /* go to rhs analysis */ 00393 goto L60; 00394 } 00395 00396 /* lhs begins with name */ 00397 /* ------------------------- */ 00398 /* check if it is a simple command like clear,... */ 00399 L20: 00400 C2F(comand)(C2F(com).syn, &c__0); 00401 if (C2F(iop).err > 0) { 00402 goto L98; 00403 } 00404 if (C2F(com).fin == 0) { 00405 goto L21; 00406 } 00407 if (C2F(com).fun == 99) { 00408 return 0; 00409 } 00410 if (C2F(com).fun != 0) { 00411 goto L93; 00412 } 00413 if (C2F(com).fin < 0) { 00414 goto L80; 00415 } 00416 if (C2F(com).fin == 2) { 00417 goto L88; 00418 } 00419 if (C2F(com).fin == 3) { 00420 goto L16; 00421 } 00422 if (C2F(com).fin == 4) { 00423 goto L5; 00424 } 00425 if (C2F(com).fin > 0) { 00426 goto L77; 00427 } 00428 /* name is not a command */ 00429 L21: 00430 Rhs = 0; 00431 C2F(com).fin = -5; 00432 /* IL y a p avec fin=-5 (on ne trouve pas les macros parce que l'on ne */ 00433 /* veut pas que les macros sans arg soient vues comme des commandes */ 00434 /* mais pourquoi pas il suffirait de dire que pour visualiser une macro */ 00435 /* il faut faire disp() */ 00436 C2F(com).fun = 0; 00437 C2F(funs)(C2F(com).syn); 00438 if (C2F(com).fin > 0) { 00439 /* name is a builtin name */ 00440 if (C2F(com).char1 == equal) { 00441 /* fun=expr is not allowed */ 00442 C2F(putid)(&Ids[1 + (Pt + 1) * nsiz], C2F(com).syn); 00443 SciError(25); 00444 goto L98; 00445 } 00446 /* skip lhs analysis */ 00447 if (Eptover(1)) { 00448 goto L98; 00449 } 00450 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00451 Lhs = 1; 00452 Pstk[Pt] = 0; 00453 /* go to rhs analysis */ 00454 goto L60; 00455 } 00456 00457 /* peek one character ahead */ 00458 if (C2F(com).char1 == semi || C2F(com).char1 == comma || C2F(com).char1 == eol) { 00459 C2F(putid)(id, C2F(com).syn); 00460 } 00461 if (C2F(com).char1 == lparen) { 00462 schar = C2F(com).char1; 00463 goto L30; 00464 } 00465 /* instruction is just "name", skip lhs analysis */ 00466 /* record name as lhs */ 00467 if (Eptover(1)) { 00468 goto L98; 00469 } 00470 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00471 Lhs = 1; 00472 Pstk[Pt] = 0; 00473 /* go to rhs analysis */ 00474 goto L60; 00475 00476 /* name = expr or name == expr syntax */ 00477 /* ---------------------------------------- */ 00478 L25: 00479 C2F(putid)(id, C2F(com).syn); 00480 lpts = Lpt[2]; 00481 C2F(getsym)(); 00482 if (C2F(com).char1 == equal) { 00483 /* name == expr syntax ==> implicit lhs */ 00484 goto L50; 00485 } else { 00486 /* lhs found */ 00487 /* record it */ 00488 if (Eptover(1)) { 00489 goto L98; 00490 } 00491 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00492 Lhs = 1; 00493 Pstk[Pt] = 0; 00494 C2F(getsym)(); 00495 /* go to rhs analysis */ 00496 goto L60; 00497 } 00498 00499 /* lhs is name(...) or name.x... */ 00500 /* ----------------------------------- */ 00501 L30: 00502 Lpt[5] = Lpt[4]; 00503 C2F(putid)(id, C2F(com).syn); 00504 00505 /* looking for equal to check if it is really an lhs */ 00506 C2F(findequal)(&found); 00507 if (C2F(iop).err > 0) { 00508 goto L98; 00509 } 00510 if (! found) { 00511 goto L50; 00512 } 00513 /* It is really a lhs (insertion syntax) */ 00514 L32: 00515 Lpt[4] = Lpt[5]; 00516 C2F(com).char1 = schar; 00517 00518 /* 35 call parseindexlist(excnt) */ 00519 /* if(err.gt.0) goto 98 */ 00520 if (Compil(21, &c__0, 0, 0, 0)) { 00521 if (C2F(iop).err > 0) { 00522 return 0; 00523 } 00524 } 00525 /* begin the index lists */ 00526 icount = 0; 00527 C2F(getsym)(); 00528 00529 L33: 00530 /* begin a new index list (.,..) or .name */ 00531 ++icount; 00532 00533 dotsep = C2F(com).sym == dot; 00534 C2F(getsym)(); 00535 if (dotsep) { 00536 /* --> new index list is .name */ 00537 if (C2F(com).sym != name) { 00538 SciError(21); 00539 if (C2F(iop).err > 0) { 00540 return 0; 00541 } 00542 } 00543 00544 if (C2F(com).comp[0] != 0) { 00545 if (Compil(23, C2F(com).syn, 0, 0, 0)) { 00546 if (C2F(iop).err > 0) { 00547 return 0; 00548 } 00549 } 00550 } else { 00551 C2F(name2var)(C2F(com).syn); 00552 } 00553 C2F(getsym)(); 00554 /* icount=icount+1 */ 00555 if (C2F(com).sym == dot) { 00556 goto L33; 00557 } 00558 dotsep = FALSE_; 00559 excnt = 1; 00560 goto L36; 00561 } 00562 /* --> new index list is (.,..) */ 00563 L34: 00564 /* add a new index in index list (i,...) */ 00565 ++excnt; 00566 if (Eptover(1)) { 00567 goto L98; 00568 } 00569 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00570 Pstk[Pt] = excnt + icount * 1000; 00571 Rstk[Pt] = 702; 00572 /* *call* expr */ 00573 goto L81; 00574 L35: 00575 C2F(putid)(id, &Ids[1 + Pt * nsiz]); 00576 icount = Pstk[Pt] / 1000; 00577 excnt = Pstk[Pt] - icount * 1000; 00578 --Pt; 00579 00580 if (C2F(com).sym == comma) { 00581 /* current syntax is (i,j,..) */ 00582 C2F(getsym)(); 00583 goto L34; 00584 } 00585 00586 if (C2F(com).sym == rparen) { 00587 /* end of the current index list */ 00588 C2F(getsym)(); 00589 } else { 00590 SciError(3); 00591 if (C2F(iop).err > 0) { 00592 goto L98; 00593 } 00594 } 00595 00596 L36: 00597 if (C2F(com).sym == lparen || C2F(com).sym == dot) { 00598 /* begining of a a new index list */ 00599 /* first memorize the previous one */ 00600 if (excnt > 1) { 00601 /* previously analysed syntax is (i,j,..)( */ 00602 if (C2F(com).comp[0] == 0) { 00603 /* form list with individual indexes i,j,.. */ 00604 C2F(mkindx)(&c__0, &excnt); 00605 if (C2F(iop).err > 0) { 00606 return 0; 00607 } 00608 } else { 00609 if (Compil(19, &c__0, excnt, 0, 0)) { 00610 if (C2F(iop).err > 0) { 00611 return 0; 00612 } 00613 } 00614 } 00615 excnt = 1; 00616 } 00617 /* open a new index list */ 00618 excnt = 0; 00619 /* icount=icount+1 */ 00620 goto L33; 00621 } 00622 /* end of all the index lists */ 00623 if (icount > 1) { 00624 /* form list with individual indexes */ 00625 if (C2F(com).comp[0] == 0) { 00626 C2F(mkindx)(&icount, &excnt); 00627 if (C2F(iop).err > 0) { 00628 return 0; 00629 } 00630 } else { 00631 if (Compil(19, &icount, excnt, 0, 0)) { 00632 if (C2F(iop).err > 0) { 00633 return 0; 00634 } 00635 } 00636 } 00637 excnt = 1; 00638 } 00639 /* end of code for recursive index */ 00640 if (Rstk[Pt] == 711) { 00641 goto L42; 00642 } 00643 00644 if (C2F(com).sym == equal) { 00645 /* name(...) = expr syntax */ 00646 /* record name as lhs */ 00647 if (Eptover(1)) { 00648 goto L98; 00649 } 00650 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00651 Pstk[Pt] = excnt; 00652 Lhs = 1; 00653 C2F(getsym)(); 00654 /* go to rhs analysis */ 00655 goto L60; 00656 } else { 00657 /* this should never happen. this case has been detected above */ 00658 /* when lookin for equal sign */ 00659 /* name(...) syntax ==> really an rhs */ 00660 if (Eptover(1)) { 00661 goto L98; 00662 } 00663 C2F(putid)(&Ids[1 + Pt * nsiz], ans); 00664 Lhs = 1; 00665 Pstk[Pt] = 0; 00666 goto L60; 00667 } 00668 00669 /* multiple lhs [a,...]= or [a(..),..] */ 00670 /* ---------------------------------------- */ 00671 L40: 00672 Lpt[4] = lpts; 00673 Lpt[3] = lpts; 00674 C2F(com).char1 = blank; 00675 Lhs = 0; 00676 C2F(getsym)(); 00677 /* start lhs arguments list */ 00678 C2F(getsym)(); 00679 L41: 00680 /* begin analysis of a new lhs argument */ 00681 if (C2F(com).sym != name) { 00682 SciError(274); 00683 goto L98; 00684 } 00685 if (C2F(eqid)(C2F(com).syn, varargout)) { 00686 SciError(275); 00687 goto L98; 00688 } 00689 C2F(putid)(id, C2F(com).syn); 00690 excnt = 0; 00691 next = Lin[Lpt[4] - 2]; 00692 if (next == blank || C2F(com).char1 == comma || C2F(com).char1 == right) { 00693 /* argument followed by a blank, a comma or a ] ==> it is a simple name */ 00694 C2F(getsym)(); 00695 goto L44; 00696 } else if (C2F(com).char1 != lparen && C2F(com).char1 != dot) { 00697 /* invalid lhs */ 00698 SciError(273); 00699 goto L98; 00700 } 00701 /* lhs argument is name(..) or name.xx */ 00702 if (Eptover(1)) { 00703 goto L98; 00704 } 00705 Rstk[Pt] = 711; 00706 Lpt[5] = Lpt[4]; 00707 schar = C2F(com).char1; 00708 goto L32; 00709 /* *parse* index */ 00710 L42: 00711 --Pt; 00712 goto L44; 00713 L44: 00714 /* record current lhs arg */ 00715 if (Eptover(1)) { 00716 goto L98; 00717 } 00718 C2F(putid)(&Ids[1 + Pt * nsiz], id); 00719 ++Lhs; 00720 Pstk[Pt] = excnt; 00721 Rstk[Pt] = 0; 00722 /* end analysis of a current lhs arg */ 00723 if (C2F(com).sym == right) { 00724 goto L46; 00725 } 00726 if (C2F(com).sym == comma) { 00727 C2F(getsym)(); 00728 } 00729 /* loop on lhs args */ 00730 goto L41; 00731 00732 L46: 00733 C2F(getsym)(); 00734 if (C2F(com).sym == equal && C2F(com).char1 != equal) { 00735 /* really found a lhs go to the rhs analysis part */ 00736 C2F(getsym)(); 00737 goto L60; 00738 } 00739 /* lhs revealed to be an rhs */ 00740 /* ------------------------------------- */ 00741 L50: 00742 /* no equal symbol */ 00743 goto L51; 00744 L51: 00745 /* lhs is in fact an rhs */ 00746 /* 1 - reinititialise the parser at the instruction beginning */ 00747 Pt = pts; 00748 Lpt[4] = lpts; 00749 Lpt[3] = lpts; 00750 C2F(com).char1 = blank; 00751 /* L52: */ 00752 C2F(getsym)(); 00753 /* if(sym.eq.comma.or.sym.eq.semi) goto 52 */ 00754 /* 2 - make "ans" the lhs */ 00755 if (Eptover(1)) { 00756 goto L98; 00757 } 00758 C2F(putid)(&Ids[1 + Pt * nsiz], ans); 00759 Pstk[Pt] = 0; 00760 Lhs = 1; 00761 /* 3 - go to the rhs analysis part */ 00762 goto L60; 00763 00764 /* lhs finished, start rhs */ 00765 /* ---------------------------- */ 00766 L60: 00767 Rstk[Pt] = 703; 00768 /* *call* expr */ 00769 goto L81; 00770 L65: 00771 if (Rstk[Pt - Lhs] == 313) { 00772 /* store new variable as "named" at the top of the stack */ 00773 if (C2F(com).sym == rparen || C2F(com).sym == comma) { 00774 C2F(mrknmd)(); 00775 if (C2F(iop).err > 0) { 00776 goto L98; 00777 } 00778 goto L83; 00779 } else { 00780 SciError(40); 00781 goto L98; 00782 } 00783 } 00784 if (C2F(com).sym == semi || C2F(com).sym == comma || C2F(com).sym == eol|| C2F(com).sym == cmt) { 00785 goto L70; 00786 } 00787 if (Rstk[Pt - Lhs] == 808) {/* syntax error while in try */ 00788 /* set back the standard error handling ++++*/ 00789 Pt=Pt-Lhs; 00790 C2F(errgst).errct = Ids[2 + Pt * nsiz]; 00791 C2F(errgst).errpt = Ids[5 + Pt * nsiz]; 00792 /* forgot the catch error */ 00793 C2F(errgst).err1 = Ids[3 + Pt * nsiz]; 00794 C2F(errgst).err2 = Ids[4 + Pt * nsiz]; 00795 C2F(com).comp[0] = 0; 00796 Lpt[2] = Lpt[3]+1; 00797 SciError(276); 00798 Pt = Pt - 1; 00799 goto L98; 00800 } else { 00801 Lpt[2] = Lpt[3]+1; 00802 SciError(276); 00803 goto L98; 00804 } 00805 00806 /* store results */ 00807 /* ------------------- */ 00808 L70: 00809 Lhs = max(Lhs,1); 00810 if (Compil(29, &(Lhs), C2F(com).sym, 0, 0)) { 00811 if (C2F(iop).err > 0) { 00812 return 0; 00813 } 00814 Pt -= Lhs; 00815 Lhs = 0; 00816 goto L77; 00817 } 00818 ndel = 0; 00819 L71: 00820 Rhs = Pstk[Pt]; 00821 lastindpos = Top - Lhs - ndel; 00822 if (C2F(errgst).err1 != 0) { 00823 goto L76; 00824 } 00825 if (Rhs == 0) { 00826 /* goto simple affectation */ 00827 C2F(stackp)(&Ids[1 + Pt * nsiz], &c__0); 00828 if (C2F(iop).err > 0) { 00829 goto L98; 00830 } 00831 if (C2F(errgst).err1 > 0) { 00832 --Pt; 00833 --Lhs; 00834 goto L98; 00835 } 00836 /* topk points on the newly saved variable */ 00837 topk = C2F(com).fin; 00838 /* go to print */ 00839 goto L73; 00840 } 00841 /* partial variable affectation (insertion) */ 00842 if (lastindpos + 1 != Top) { 00843 /* create reference variables to get index1,...,indexn, value at */ 00844 /* the top of the stack in this order */ 00845 /* create reference variables pointing to the indices */ 00846 i__2 = Rhs; 00847 for (ir = 1; ir <= i__2; ++ir) { 00848 i__3 = lastindpos - Rhs + ir; 00849 C2F(createref1)(&i__3); 00850 } 00851 /* create reference variable pointing to the value */ 00852 i__2 = Top - Rhs; 00853 C2F(createref1)(&i__2); 00854 /* remind to remove the original indices */ 00855 ndel += Rhs; 00856 } 00857 lastindpos -= Rhs; 00858 /* put a reference to the lhs variable */ 00859 C2F(com).fin = -3; 00860 C2F(stackg)(&Ids[1 + Pt * nsiz]); 00861 if (C2F(iop).err > 0) { 00862 goto L98; 00863 } 00864 /* perform insertion operation */ 00865 /* index1,...,indexn, value ==> updated lhs value (or pointer to) */ 00866 if (Eptover(1)) { 00867 goto L98; 00868 } 00869 Pstk[Pt] = Lhs; 00870 C2F(putid)(&Ids[1 + Pt * nsiz], &Ids[1 + (Pt - 1) * nsiz]); 00871 Ids[1 + (Pt - 1) * nsiz] = ndel; 00872 Ids[2 + (Pt - 1) * nsiz] = lastindpos; 00873 Rstk[Pt] = 704; 00874 Rhs += 2; 00875 Lhs = 1; 00876 C2F(com).fin = insert; 00877 /* *call* allops(insert) */ 00878 goto L91; 00879 L72: 00880 Lhs = Pstk[Pt]; 00881 ndel = Ids[1 + (Pt - 1) * nsiz]; 00882 lastindpos = Ids[2 + (Pt - 1) * nsiz]; 00883 C2F(putid)(&Ids[1 + (Pt - 1) * nsiz], &Ids[1 + Pt * nsiz]); 00884 --Pt; 00885 /* store the updated value */ 00886 C2F(stackp)(&Ids[1 + Pt * nsiz], &c__0); 00887 if (C2F(iop).err > 0) { 00888 goto L98; 00889 } 00890 if (C2F(errgst).err1 > 0) { 00891 --Pt; 00892 --Lhs; 00893 goto L98; 00894 } 00895 /* topk points on the newly saved variable */ 00896 topk = C2F(com).fin; 00897 /* remove variable containing the value if required */ 00898 if (lastindpos != Top) { 00899 --Top; 00900 } 00901 L73: 00902 /* print if required */ 00903 /* ---------------------- */ 00904 if (Lct[4] < 0 || C2F(com).fin == 0) { 00905 goto L76; 00906 } 00907 if (! ((C2F(com).sym != semi && Lct[3] == 0) || (C2F(com).sym == semi && 00908 Lct[3] == 1))) { 00909 goto L76; 00910 } 00911 L74: 00912 C2F(print)(&Ids[1 + Pt * nsiz], &topk, &C2F(iop).wte); 00913 if (C2F(iop).err > 0) { 00914 goto L98; 00915 } 00916 if (topk == 0) { 00917 goto L76; 00918 } 00919 /* overloaded display, call a macro */ 00920 if (Eptover(1)) { 00921 goto L98; 00922 } 00923 Rstk[Pt] = 708; 00924 Pstk[Pt] = C2F(com).sym; 00925 Ids[1 + Pt * nsiz] = C2F(com).sym; 00926 Ids[2 + Pt * nsiz] = ndel; 00927 Ids[3 + Pt * nsiz] = Lhs; 00928 if (C2F(com).fun == 0) { 00929 goto L88; 00930 } 00931 goto L85; 00932 L75: 00933 C2F(com).sym = Pstk[Pt]; 00934 ndel = Ids[2 + Pt * nsiz]; 00935 Lhs = Ids[3 + Pt * nsiz]; 00936 --Pt; 00937 goto L74; 00938 00939 L76: 00940 --Pt; 00941 --Lhs; 00942 if (Lhs > 0) { 00943 goto L71; 00944 } 00945 Top -= ndel; 00946 00947 /* finish statement */ 00948 /* --------------------- */ 00949 L77: 00950 C2F(com).fin = 0; 00951 p = 0; 00952 r = 0; 00953 if (Pt > 0) p = Pstk[Pt]; 00954 if (Pt > 0) r = Rstk[Pt]; 00955 if (C2F(iop).ddt == 4) { 00956 sprintf(tmp," finish pt:%d rstk(pt):%d pstk(pt):%d lpt(1): %d niv: %d macr:%d, paus:%d", 00957 Pt,r,p, Lpt[1],C2F(recu).niv,C2F(recu).macr,C2F(recu).paus); 00958 C2F(basout)(&io, &C2F(iop).wte,tmp, strlen(tmp)); 00959 } 00960 if (C2F(errgst).err1 != 0) { 00961 /* a catched error has occured */ 00962 if (r == 808) { 00963 /* in try instructions */ 00964 goto L80; 00965 } else if (Ids[1 + (Pt - 1) * nsiz] != 0) { 00966 /* execution is explicitly required to be stopped */ 00967 if (r == 502 && Rstk[Pt - 1] == 903) { 00968 /* in an execstr(...,'errcatch') instruction */ 00969 goto L88; 00970 } else if (r == 502 && Rstk[Pt - 1] == 909) { 00971 /* in an exec(function,'errcatch') instruction */ 00972 goto L88; 00973 } else if (r == 503 && Rstk[Pt - 1] == 902) { 00974 /* in an exec(file,'errcatch') instruction */ 00975 goto L88; 00976 } 00977 } 00978 if (C2F(errgst).err2 == 0) { 00979 C2F(errgst).err2 = C2F(errgst).err1; 00980 } 00981 if (C2F(errgst).errcatch == 1) { 00982 /* running under errcatch(num,....) */ 00983 C2F(errgst).err1 = 0; 00984 if (Pt<C2F(errgst).errpt) C2F(errgst).errcatch = 0; 00985 } 00986 00987 imode = (i__2 = C2F(errgst).errct / 100000, abs(i__2)); 00988 if (imode - (imode / 8 << 3) == 2) { 00989 C2F(basbrk).iflag = TRUE_; 00990 } 00991 } 00992 C2F(errgst).toperr = Top; 00993 /* fin instruction */ 00994 if (C2F(com).sym != eol) { 00995 if (C2F(com).sym == cmt){ 00996 C2F(parsecomment)();} 00997 else 00998 goto L15; 00999 } 01000 01001 /* gestion des points d'arrets dynamiques */ 01002 if (C2F(dbg).nmacs != 0) { /* there are breakpoints set */ 01003 int kfin=C2F(dbg).wmac-1; /*the stack index of the current function*/ 01004 /* first test if the function has breakpoints */ 01005 int kmac; 01006 for (kmac=0;kmac<C2F(dbg).nmacs;kmac++) { /* loop on table of functions containing breakpoints */ 01007 /* does the name of the current funtion fit the registered name*/ 01008 if (C2F(eqid)(&(C2F(vstk).idstk[kfin * nsiz]), &(C2F(dbg).macnms[kmac * nsiz]))) {/* yes */ 01009 /* test if there is a registered breakpoint at the current line*/ 01010 i__2 = Lpt[2] - 1; 01011 C2F(whatln)(&Lpt[1], &i__2, &Lpt[6], &nlc, &l1, &ifin); 01012 i__2 = C2F(dbg).lgptrs[kmac+1] - 1; 01013 for (ibpt = C2F(dbg).lgptrs[kmac]; ibpt <= i__2; ++ibpt) { 01014 if (Lct[8] - nlc == C2F(dbg).bptlg[ibpt - 1]) { /* yes */ 01015 /* display a message */ 01016 C2F(cvname)(&C2F(dbg).macnms[kmac * nsiz], tmp, &c__1, 24L); 01017 sprintf(C2F(cha1).buf,"%s %5d",tmp, Lct[8] - nlc); 01018 Msgs(32, 0); 01019 /* raise the interruption flag */ 01020 C2F(basbrk).iflag = TRUE_; 01021 goto L79; 01022 } 01023 } 01024 break; 01025 } 01026 } 01027 } 01028 L79: 01029 01030 if (C2F(com).comp[0] != 0) { 01031 C2F(seteol)(); 01032 } 01033 /* EOL */ 01034 if (r / 100 != 8) { 01035 goto L10; 01036 } 01037 /* end of an instruction or a clause */ 01038 if (C2F(com).comp[0] != 0) { 01039 k = Lpt[6]; 01040 if (Lin[k - 1] == eol && Lin[k] == eol) { 01041 SciError(47); 01042 goto L98; 01043 } 01044 } 01045 if (Lpt[4] == Lpt[6]) { 01046 /* call getlin(1,0) */ 01047 goto L13; 01048 } else { 01049 ++Lpt[4]; 01050 C2F(getsym)(); 01051 } 01052 goto L15; 01053 01054 /* simulate recursion */ 01055 /* ----------------------- */ 01056 L80: 01057 C2F(recu).icall = 0; 01058 C2F(clause)(); 01059 if (C2F(iop).err > 0) { 01060 goto L98; 01061 } 01062 switch ((int)C2F(recu).icall) { 01063 case 1: goto L81; 01064 case 2: goto L82; 01065 case 3: goto L83; 01066 case 4: goto L91; 01067 case 5: goto L88; 01068 case 6: goto L90; 01069 case 7: goto L15; 01070 case 8: goto L80; 01071 case 9: goto L85; 01072 } 01073 if (Pt <= 0) { 01074 goto L15; 01075 } 01076 r = Rstk[Pt] / 100; 01077 switch ((int)r) { 01078 case 1: goto L81; 01079 case 2: goto L82; 01080 case 3: goto L83; 01081 case 4: goto L91; 01082 case 5: goto L88; 01083 case 6: goto L90; 01084 case 7: goto L92; 01085 case 8: goto L80; 01086 case 9: goto L85; 01087 } 01088 goto L99; 01089 01090 L81: 01091 C2F(recu).icall = 0; 01092 C2F(expr)(); 01093 if (C2F(iop).err > 0) { 01094 goto L98; 01095 } 01096 switch ((int)C2F(recu).icall) { 01097 case 1: goto L81; 01098 case 2: goto L82; 01099 case 3: goto L83; 01100 case 4: goto L91; 01101 case 5: goto L88; 01102 case 6: goto L90; 01103 case 7: goto L15; 01104 case 8: goto L80; 01105 case 9: goto L85; 01106 } 01107 r = Rstk[Pt] / 100; 01108 switch ((int)r) { 01109 case 1: goto L81; 01110 case 2: goto L82; 01111 case 3: goto L83; 01112 case 4: goto L91; 01113 case 5: goto L88; 01114 case 6: goto L90; 01115 case 7: goto L92; 01116 case 8: goto L80; 01117 case 9: goto L85; 01118 } 01119 goto L99; 01120 01121 L82: 01122 C2F(recu).icall = 0; 01123 C2F(terme)(); 01124 if (C2F(iop).err > 0) { 01125 goto L98; 01126 } 01127 switch ((int)C2F(recu).icall) { 01128 case 1: goto L81; 01129 case 2: goto L82; 01130 case 3: goto L83; 01131 case 4: goto L91; 01132 case 5: goto L88; 01133 case 6: goto L90; 01134 case 7: goto L15; 01135 case 8: goto L80; 01136 case 9: goto L85; 01137 } 01138 r = Rstk[Pt] / 100; 01139 switch ((int)r) { 01140 case 1: goto L81; 01141 case 2: goto L82; 01142 case 3: goto L83; 01143 case 4: goto L91; 01144 case 5: goto L88; 01145 case 6: goto L90; 01146 case 7: goto L92; 01147 case 8: goto L80; 01148 case 9: goto L85; 01149 } 01150 goto L99; 01151 01152 L83: 01153 C2F(recu).icall = 0; 01154 C2F(fact)(); 01155 if (C2F(iop).err > 0) { 01156 goto L98; 01157 } 01158 switch ((int)C2F(recu).icall) { 01159 case 1: goto L81; 01160 case 2: goto L82; 01161 case 3: goto L83; 01162 case 4: goto L91; 01163 case 5: goto L88; 01164 case 6: goto L90; 01165 case 7: goto L15; 01166 case 8: goto L80; 01167 case 9: goto L85; 01168 } 01169 r = Rstk[Pt] / 100; 01170 switch ((int)r) { 01171 case 1: goto L81; 01172 case 2: goto L82; 01173 case 3: goto L83; 01174 case 4: goto L91; 01175 case 5: goto L88; 01176 case 6: goto L90; 01177 case 7: goto L92; 01178 case 8: goto L80; 01179 case 9: goto L85; 01180 } 01181 goto L99; 01182 01183 L85: 01184 C2F(recu).icall = 0; 01185 if (C2F(com).fun == C2F(recu).krec) { 01186 if (C2F(com).fun > 0) { 01187 SciError(22); 01188 goto L98; 01189 } 01190 } 01191 if (C2F(errgst).err1 != 0) { 01192 if (Rstk[Pt] / 100 == 9) { 01193 if (Rstk[Pt] >= 901 && Rstk[Pt] <= 909) { 01194 /* *call* matfns */ 01195 return 0; 01196 } else { 01197 --Pt; 01198 goto L86; 01199 } 01200 } else { 01201 goto L86; 01202 } 01203 } 01204 /* compilation matfns: <100*fun rhs lhs fin> */ 01205 if (Compil( C2F(com).fun * 100, &(Rhs), Lhs, C2F(com).fin, 0)) { 01206 if (C2F(iop).err > 0) { 01207 goto L98; 01208 } 01209 goto L86; 01210 } else { 01211 /* *call* matfns */ 01212 return 0; 01213 } 01214 L86: 01215 if (C2F(iop).err > 0) { 01216 goto L98; 01217 } 01218 switch ((int)C2F(recu).icall) { 01219 case 1: goto L81; 01220 case 2: goto L82; 01221 case 3: goto L83; 01222 case 4: goto L91; 01223 case 5: goto L88; 01224 case 6: goto L90; 01225 case 7: goto L15; 01226 case 8: goto L80; 01227 case 9: goto L85; 01228 } 01229 r = Rstk[Pt] / 100; 01230 switch ((int)r) { 01231 case 1: goto L81; 01232 case 2: goto L82; 01233 case 3: goto L83; 01234 case 4: goto L91; 01235 case 5: goto L88; 01236 case 6: goto L90; 01237 case 7: goto L92; 01238 case 8: goto L80; 01239 case 9: goto L85; 01240 } 01241 goto L98; 01242 01243 L88: 01244 C2F(recu).icall = 0; 01245 C2F(macro)(); 01246 if (C2F(iop).err > 0) { 01247 goto L98; 01248 } 01249 switch ((int)C2F(recu).icall) { 01250 case 1: goto L81; 01251 case 2: goto L82; 01252 case 3: goto L83; 01253 case 4: goto L91; 01254 case 5: goto L88; 01255 case 6: goto L90; 01256 case 7: goto L10; 01257 case 8: goto L80; 01258 case 9: goto L85; 01259 } 01260 r = Rstk[Pt] / 100; 01261 switch ((int)r) { 01262 case 1: goto L81; 01263 case 2: goto L82; 01264 case 3: goto L83; 01265 case 4: goto L91; 01266 case 5: goto L88; 01267 case 6: goto L90; 01268 case 7: goto L92; 01269 case 8: goto L80; 01270 case 9: goto L85; 01271 case 10: goto L89; 01272 } 01273 goto L99; 01274 L89: 01275 C2F(com).fun = 99; 01276 return 0; 01277 01278 L90: 01279 C2F(recu).icall = 0; 01280 C2F(run)(); 01281 if (C2F(iop).err > 0) { 01282 goto L98; 01283 } 01284 if (C2F(com).fun == 99) { 01285 return 0; 01286 } 01287 /* last label is used to handle return from abort */ 01288 switch ((int)C2F(recu).icall) { 01289 case 1: goto L81; 01290 case 2: goto L82; 01291 case 3: goto L83; 01292 case 4: goto L91; 01293 case 5: goto L88; 01294 case 6: goto L90; 01295 case 7: goto L15; 01296 case 8: goto L80; 01297 case 9: goto L85; 01298 case 10: goto L5; 01299 } 01300 r = Rstk[Pt] / 100; 01301 switch ((int)r) { 01302 case 1: goto L81; 01303 case 2: goto L82; 01304 case 3: goto L83; 01305 case 4: goto L91; 01306 case 5: goto L88; 01307 case 6: goto L90; 01308 case 7: goto L92; 01309 case 8: goto L80; 01310 case 9: goto L85; 01311 case 10: goto L89; 01312 } 01313 goto L99; 01314 01315 L91: 01316 C2F(recu).icall = 0; 01317 C2F(allops)(); 01318 if (C2F(iop).err > 0) { 01319 goto L98; 01320 } 01321 switch ((int)C2F(recu).icall) { 01322 case 1: goto L81; 01323 case 2: goto L82; 01324 case 3: goto L83; 01325 case 4: goto L91; 01326 case 5: goto L88; 01327 case 6: goto L90; 01328 case 7: goto L15; 01329 case 8: goto L80; 01330 case 9: goto L85; 01331 } 01332 r = Rstk[Pt] / 100; 01333 switch ((int)r) { 01334 case 1: goto L81; 01335 case 2: goto L82; 01336 case 3: goto L83; 01337 case 4: goto L91; 01338 case 5: goto L88; 01339 case 6: goto L90; 01340 case 7: goto L92; 01341 case 8: goto L80; 01342 case 9: goto L85; 01343 } 01344 goto L98; 01345 01346 L92: 01347 switch ((int)(Rstk[Pt] - 700)) { 01348 case 1: goto L17; 01349 case 2: goto L35; 01350 case 3: goto L65; 01351 case 4: goto L72; 01352 case 5: goto L65; 01353 case 6: goto L97; 01354 case 7: goto L94; 01355 case 8: goto L75; 01356 case 9: goto L99; 01357 case 10: goto L14; 01358 } 01359 goto L99; 01360 01361 L93: 01362 /* command like function and macro call */ 01363 /* store ans as lhs */ 01364 if (Eptover(1)) { 01365 goto L98; 01366 } 01367 C2F(putid)(&Ids[1 + Pt * nsiz], ans); 01368 Pstk[Pt] = 0; 01369 01370 Rstk[Pt] = 707; 01371 if (C2F(com).fun > 0) { 01372 /* *call* matfns */ 01373 goto L85; 01374 } else { 01375 if (C2F(com).comp[0] != 0) { 01376 ++Rhs; 01377 C2F(com).fin = extrac; 01378 /* *call* allops(extrac) */ 01379 goto L91; 01380 } else { 01381 C2F(com).fin = Lstk[C2F(com).fin]; 01382 /* *call* macro */ 01383 goto L88; 01384 } 01385 } 01386 L94: 01387 /* go to store code */ 01388 goto L70; 01389 01390 L96: 01391 /* asynchronous events handling */ 01392 C2F(basbrk).interruptible = C2F(getmen)(C2F(cha1).buf, &lb, &nentry) == 0; 01393 C2F(bexec)(C2F(cha1).buf, &lb, &ierr); 01394 if (ierr != 0) { 01395 goto L15; 01396 } 01397 if (Eptover(1)) { 01398 goto L98; 01399 } 01400 Pstk[Pt] = Top; 01401 Rstk[Pt] = 706; 01402 Ids[1 + Pt * nsiz] = iret; 01403 /* *call* macro */ 01404 goto L88; 01405 L97: 01406 Top = Pstk[Pt] - 1; 01407 C2F(basbrk).interruptible = TRUE_; 01408 iret = Ids[1 + Pt * nsiz]; 01409 --Pt; 01410 if (iret == 1) { 01411 goto L15; 01412 } else if (iret == 2) { 01413 if (Lpt[6] == Lpt[1]) { 01414 job = 0; 01415 } else { 01416 /* go ahead with interrupted continuation line */ 01417 job = 3; 01418 } 01419 C2F(com).sym = eol; 01420 goto L13; 01421 } else if (iret == 3) { 01422 job = 0; 01423 goto L12; 01424 } else if (iret == 4) { 01425 return 0; 01426 } 01427 L98: 01428 C2F(basbrk).interruptible = TRUE_; 01429 /* error recovery */ 01430 /* ------------------- */ 01431 imode = abs(C2F(errgst).errct) / 100000; 01432 imode -= imode / 8 << 3; 01433 if (imode == 3) { 01434 C2F(com).fun = 99; 01435 return 0; 01436 } 01437 01438 /* error in an external (niv), during compilation (comp) or in a pause */ 01439 if (Pt != 0) { 01440 if (Rstk[Pt] == 503 && C2F(iop).rio == C2F(iop).rte) { 01441 C2F(com).comp[0] = 0; 01442 goto L12; 01443 } 01444 if (C2F(errgst).err1 != 0 && Rstk[Pt] == 502) { /* catched error while compiling */ 01445 goto L88; 01446 } 01447 } 01448 01449 if (C2F(recu).niv > 0) { /* error in an external */ 01450 C2F(com).fun = 99; 01451 return 0; 01452 } 01453 else if (C2F(recu).paus>0) {/* error in a pause */ 01454 C2F(com).comp[0] = 0; 01455 goto L5; 01456 } 01457 else if (Err>0) { 01458 Pt=0; 01459 C2F(errgst).errct=-1; 01460 C2F(errgst).errpt=0; 01461 C2F(com).comp[0] = 0; 01462 goto L5; 01463 } 01464 else 01465 { 01466 C2F(com).comp[0] = 0; 01467 goto L5; 01468 } 01469 01470 L99: 01471 SciError(22); 01472 goto L1; 01473 01474 } /* C2F(parse) */
Here is the call graph for this function:

Here is the caller graph for this function:

| void C2F() parsecomment | ( | ) |
| int C2F() prompt | ( | ) |
| int C2F() putid | ( | ) |
Referenced by callscifun(), crebmatvar(), crematvar(), cresmatvar(), objptr(), parse(), and run().
Here is the caller graph for this function:

| int C2F() run | ( | ) |
Definition at line 94 of file run.c.
Referenced by parse(), and SciGUIConsole::PutString().
00095 { 00096 /* Initialized data */ 00097 /* Fortran common data equivalence */ 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 /* Local variables */ 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: /*Rstk[Pt]=1101;*/ goto L254; 00159 case 9: /*Rstk[Pt]=1101;*/ goto L240; 00160 00161 } 00162 00163 00164 L1: /* Start execution of a "compiled" function */ 00165 tref = clock(); 00166 C2F(errgst).toperr = Top; 00167 k = Lpt[1] - (13+nsiz); 00168 lc = Lin[k + 7]; 00169 00170 L10: /* Current opcode finished handle error, interruptions,...*/ 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 /* error under try catch */ 00180 Pt = C2F(errgst).errpt; 00181 goto L271; 00182 } 00183 /* errcatch in exec(function,'errcatch') 00184 * or catched error in an external 00185 * or errcatch in execstr('foo()','errcatch') */ 00186 if (C2F(errgst).errcatch == 0) goto L999; 00187 /* error under errcatch(....,'continue') */ 00188 if (Rstk[Pt - 1] == 903 || Rstk[Pt - 1] == 909 || Rstk[Pt] == 1001 || Rstk[Pt] == 1002) return 0; 00189 } 00190 if (lc - l0 == nc) { /* is current opcodes block (if, for, .. structure) finished ?*/ 00191 /* yes */ 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: /* next opcode */ 00207 op = Istk[lc]; 00208 /* label 49 retains to be able issue a compatibility error message */ 00209 switch ((int)op) { /* step to corresponding part*/ 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;/* try */ 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 /* ------------- primitive call (matfn's) -------------- */ 00245 goto L80; 00246 } 00247 00248 if (op == 99) { 00249 /* ------------- return -------------------------------- */ 00250 /* check if "return" occured in a for loop */ 00251 p = Pt + 1; 00252 L12: 00253 --p; 00254 if (Rstk[p] == 612) { 00255 /* yes, remove the for loop variable */ 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 /* ------------- nop ---------------------------------- */ 00267 lc += Istk[1 + lc]; 00268 goto L11; 00269 } 00270 00271 SciError(60); 00272 return 0; 00273 00274 L20: /* stackp, retplaced by assign */ 00275 /* retained for 2.7 and earlier versions compatibility */ 00276 C2F(stackp)(&Istk[1 + lc], &c__0); 00277 /* store info if printing is required see code 22 */ 00278 C2F(putid)(id, &Istk[1 + lc]); 00279 kid = C2F(com).fin; 00280 lc += 7; 00281 goto L10; 00282 00283 L25: /* stackg */ 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) {/* variable exists */ 00295 goto L28; 00296 } 00297 C2F(funs)(&Istk[1 + lc]); /* check if it is a function */ 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 /* referenced name was function at compile time it is now a 00313 * primitive. Modify the code for further use */ 00314 if (ifin != -4 && ifin != 0) { 00315 /* function call */ 00316 /* change current opcode to nop */ 00317 Istk[lc] = 0; 00318 Istk[1 + lc] = 9; 00319 lc += 9; 00320 /* change the following opcode to matfn opcode */ 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 /* only reference to a function */ 00329 /* stackg opcode replaced by varfun opcode */ 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 /* instruction reduced to <name> with name not a function, replace */ 00349 /* next two op code by a single store */ 00350 /* skip extract op-code <5 3 1 1> */ 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 /* skip assignment op_code <29 43 ans 0> */ 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 /* store */ 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 /* allops */ 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 /* pstk(pt) is used by allops to get the name of output variable (insertion) */ 00407 Pstk[Pt] = lc; 00408 /* *call* allops */ 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 /* string */ 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 /* num */ 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 /* for */ 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 /* fin for */ 00495 L48: 00496 lc += nc; 00497 C2F(errgst).toperr = Ids[4 + Pt * nsiz]; 00498 --Pt; 00499 goto L70; 00500 00501 /* Very old if - while (removed) */ 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 /* "select- case" or "if elseif else end" */ 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 /* first expression */ 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 /* expri */ 00535 L56: 00536 if (Istk[Pstk[Pt]] == 10) { 00537 /* copy first expression */ 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 /* instructions i */ 00554 L57: 00555 if (nc == 0) { 00556 /* if nc=0 the instruction correspond to the else */ 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 /* *call* allops(equal) */ 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 /* fin if while select/case */ 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 /* macro */ 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 /* Ids[1 + Pt * nsiz] = C2F(dbg).wmac; *//*moved into macro.f*/ 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 /* *call* macro */ 00646 return 0; 00647 L66: 00648 lc = Pstk[Pt]; 00649 /*C2F(dbg).wmac = Ids[1 + Pt * nsiz];*//*moved into macro.f*/ 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 /* re entering run to continue macro evaluation */ 00658 if (inxsci == 1 && scilab_timer_check() ) C2F(sxevents)(); 00659 if (C2F(ismenu)() == 1 && C2F(basbrk).interruptible) goto L115; 00660 00661 L71: 00662 /* reset proper values for l0 and nc if a control structure had been escaped*/ 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: /* back to a for */ 00670 j = Pstk[Pt]; 00671 l0 = Ids[1 + Pt * nsiz]; 00672 nc = Istk[l0 - 7]; 00673 goto L10; 00674 case 3: /* back to an if or a while */ 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 /* back to a select case */ 00694 l0 = Ids[1 + Pt * nsiz]; 00695 nc = Ids[2 + Pt * nsiz]; 00696 goto L10; 00697 case 8: /*back to a try*/ 00698 l0 = Ids[1 + Pt * nsiz]; 00699 nc = Istk[l0 - 2]; 00700 goto L10; 00701 case 9: /*back to a catch*/ 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 /* *call* matfns */ 00728 return 0; 00729 L82: 00730 /* warning if builtin is "resume" control is passed to macro and not here */ 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 /* pause */ 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 /* *call* macro */ 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 /* break */ 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 /* break in a for */ 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 /* break in a while */ 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 /* going outside a function an exec (break ignored) */ 00797 ++lc; 00798 goto L10; 00799 } else { 00800 goto L96; 00801 } 00802 /* continue */ 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 /* continue in a for */ 00813 l0 = Ids[1 + p * nsiz]; 00814 /* nc is required for the end of loop */ 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 /* continue in a while */ 00822 l0 = Pstk[p]; 00823 lc = l0; 00824 nc = Istk[lc]; 00825 Pt = p; 00826 goto L551; 00827 } else { 00828 goto L98; 00829 } 00830 /* abort */ 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 /* abort dans une pause*/ 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 /* abort dans un exec*/ 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 /* eol */ 00880 /* la gestion de la recuperation des erreurs devrait plutot se trouver */ 00881 /* a la fin de l'instruction (mais il n'y a pas actuellement d'indicateur */ 00882 /* de fin d'instruction dans les macros */ 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 /* running under errcatch(num,....) */ 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 /* gestion des points d'arrets dynamiques */ 00898 if (C2F(dbg).nmacs != 0) { /* there are breakpoints set */ 00899 int kfin=C2F(dbg).wmac-1; /*the stack index of the current function*/ 00900 /* first test if the function has breakpoints */ 00901 int kmac; 00902 for (kmac=0;kmac<C2F(dbg).nmacs;kmac++) { /* loop on table of functions containing breakpoints */ 00903 /* does the name of the current funtion fit the registered name*/ 00904 if (C2F(eqid)(&(C2F(vstk).idstk[kfin * nsiz]), &(C2F(dbg).macnms[kmac * nsiz]))) {/* yes */ 00905 /* test if there is a registered breakpoint at the current line*/ 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]) { /* yes */ 00909 /* display a message */ 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 /* raise the interruption flag */ 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 /* set line number. 00937 * 00938 * Au debut de chaque expression liee a un then et a la fin de 00939 * chaque clause, le compilateur (compcl) inscrit la valeur de la 00940 * ligne. ceci permet de mettre rapidement a jour le compteur de 00941 * ligne sans avoir a analyser la suite des codes operatoires */ 00942 00943 L110: 00944 Lct[8] = Istk[1 + lc]; 00945 lc += 2; 00946 goto L10; 00947 00948 /* gestion des evements asynchrones "interpretes" */ 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 /* *call* macro */ 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 /* r = Rstk[Pt] - 610; 00974 switch ((int)r) { 00975 case 1: goto L74; 00976 case 2: goto L71; 00977 case 3: goto L72; 00978 case 4: goto L73; 00979 case 5: goto L73; 00980 case 6: goto L73; 00981 } 00982 goto L10;*/ 00983 00984 /* quit */ 00985 00986 L120: 00987 C2F(com).fun = 99; 00988 return 0; 00989 00990 /* named variable */ 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 /* form recursive extraction list */ 00999 01000 L140: 01001 m = Istk[2 + lc]; 01002 if (Rstk[Pt] == 617) { 01003 /* runtime arg count (list extraction) */ 01004 m += Pstk[Pt]; 01005 Pstk[Pt] = 0; 01006 } 01007 C2F(mkindx)(&Istk[1 + lc], &m); 01008 lc += 3; 01009 goto L10; 01010 01011 /* exit */ 01012 01013 L150: 01014 ++lc; 01015 if (C2F(recu).niv > 0) { 01016 C2F(sciquit)(); 01017 exit(0); /* stop */ 01018 } 01019 C2F(com).fun = 99; 01020 goto L10; 01021 01022 /* begrhs - for run time rhs value computation */ 01023 /* syntax like: l=list(...); a(l(:)) */ 01024 01025 L160: 01026 ++lc; 01027 ++Pt; 01028 Rstk[Pt] = 617; 01029 Pstk[Pt] = 0; 01030 goto L10; 01031 01032 /* printmode */ 01033 01034 L170: 01035 /* print stored variable */ 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 /* name2var */ 01043 C2F(name2var)(&Istk[1 + lc]); 01044 lc += 7; 01045 goto L10; 01046 01047 L190: 01048 /* deffnull */ 01049 ++lc; 01050 ++Top; 01051 C2F(objvide)(" ", &Top, 1L); 01052 goto L10; 01053 01054 L200: 01055 /* profile */ 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 /* character string vector */ 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 /* varfun */ 01087 C2F(varfunptr)(&Istk[3 + lc], &Istk[1 + lc], &Istk[2 + lc]); 01088 lc += 9; 01089 goto L10; 01090 L230: 01091 /* affectation */ 01092 Lhs = Istk[1 + lc]; 01093 ip = Istk[2 + lc]; 01094 li = lc + 3; 01095 lc = li + Lhs * 7; 01096 /* following code is an adaptation of corresponding code in parse.f */ 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 /* goto simple affectation */ 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 /* fin points on the newly saved variable */ 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 /*goto L253;*/ 01140 goto L232; 01141 01142 } 01143 01144 /* take rhs (number of indices) computed at runtime into account */ 01145 C2F(adjustrhs)(); 01146 /* partial variable affectation (insertion) */ 01147 if (lastindpos + 1 != Top) { 01148 /* create reference variables to get index1,...,indexn, value at */ 01149 /* the top of the stack in this order */ 01150 /* create reference variables pointing to the indices */ 01151 for (ir = 1; ir <= Rhs; ++ir) { 01152 i2 = lastindpos - Rhs + ir; 01153 C2F(createref1)(&i2); 01154 } 01155 /* create reference variable pointing to the value */ 01156 i2 = Top - Rhs; 01157 C2F(createref1)(&i2); 01158 /* remind to remove the original indices */ 01159 ndel += Rhs; 01160 } 01161 lastindpos -= Rhs; 01162 /* put a reference to the lhs variable */ 01163 C2F(com).fin = -3; 01164 C2F(stackg)(&Istk[li]); 01165 if (Err > 0 || C2F(errgst).err1 > 0) { 01166 goto L10; 01167 } 01168 /* perform insertion operation */ 01169 /* index1,...,indexn, value ==> updated lhs value (or pointer to) */ 01170 if (Eptover(1)) { 01171 return 0; 01172 } 01173 /* pstk(pt) is used by allops to get the name of output variable */ 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 /* *call* allops(insert) */ 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 /* store the updated value */ 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 /* fin points on the newly saved variable */ 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 /* remove variable containing the value if required */ 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 /* logical expression shortcircuit */ 01250 L260: 01251 if (Istk[1 + lc] == 1) { 01252 /* | case */ 01253 if (C2F(gettype)(&Top) != 8 && Istrue(0)) { 01254 lc += Istk[2 + lc]; 01255 } 01256 } else { 01257 /* & case */ 01258 if (C2F(gettype)(&Top) != 8 && ! Istrue(0)) { 01259 lc += Istk[2 + lc]; 01260 } 01261 } 01262 lc += 3; 01263 goto L10; 01264 /* comment */ 01265 L261: 01266 01267 lc += 2+Istk[1 + lc]; 01268 goto L10; 01269 01270 /* try catch */ 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 /* preserve current error modes */ 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 /* set error recovery mode without message*/ 01289 C2F(errgst).errct = -(900000+1); 01290 C2F(errgst).errpt = Pt; 01291 Pstk[Pt] = Top; 01292 goto L10; 01293 L271: 01294 /* try op-codes finished*/ 01295 l0 = Ids[1 + Pt * nsiz]; 01296 /*check if an error occured*/ 01297 ok = max(C2F(errgst).err2,C2F(errgst).err1)<=0; 01298 /* restore preserved error modes */ 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 /* no error occured in the try part*/ 01307 nc = Istk[l0-1]; 01308 lc += nc; /*skip catch instructions*/ 01309 /* finish try catch context and continue*/ 01310 --Pt; 01311 goto L70; 01312 } 01313 /*an error occured in the try part*/ 01314 lc = l0+Istk[l0-2];/*skip remaining try instruction*/ 01315 nc = Istk[l0-1]; 01316 /*execute catch instructions (next op-codes)*/ 01317 l0 = lc; 01318 Rstk[Pt] = 619; 01319 goto L10; 01320 L272: 01321 /* catch op-codes finished*/ 01322 /* close "try catch" context and continue*/ 01323 --Pt; 01324 goto L70; 01325 01326 01327 L998: 01328 Lhs = 0; 01329 L999: 01330 /*remove context down to current running macro */ 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 }
Here is the caller graph for this function:

Definition at line 107 of file parse.c.
Referenced by CMatrix::CMatrix(), CMatrix::inv(), parse(), CMatrix::plus(), run(), CMatrix::scijob(), and syncexec().
Here is the caller graph for this function:

| int C2F() stackg | ( | ) |
Referenced by cmatbptr(), cmatcptr(), cmatptr(), cmatsptr(), creadbmat(), creadchain(), creadchains(), creadcmat(), creadmat(), getlengthchain(), Name2ptr(), Name2where(), objptr(), optvarget(), parse(), and run().
Here is the caller graph for this function:

| int C2F() stackp | ( | ) |
Referenced by cwritebmat(), cwritechain(), cwritecmat(), cwritemat(), parse(), putvar(), and run().
Here is the caller graph for this function:

| int C2F() stimer | ( | ) |
| int C2F() sxevents | ( | ) |
Definition at line 72 of file ScilabXloop.c.
00073 { 00074 if ( GetWITH_GUI() ) 00075 { 00076 #ifdef WITH_TK 00077 if (getINXscilab() == 1 || BasicScilab == 0 ) 00078 #else 00079 if (getINXscilab() == 1 ) 00080 #endif 00081 { 00082 TextMessage1 (1); 00083 } 00084 } 00085 return (0); 00086 }
Definition at line 1525 of file parse.c.
Referenced by scig_loadsg(), scig_savesg(), setlanguage(), and TCL_EvalScilabCmd().
01526 { 01527 01528 /* Local variables */ 01529 int Pts, Tops; 01530 extern int C2F(iset)(); 01531 extern int C2F(callinterf)(), C2F(ref2val)(); 01532 static int iflagint; 01533 static int k; 01534 static int ir; 01535 01536 static int *Ids = C2F(recu).ids-nsiz-1; 01537 static int *Rstk = C2F(recu).rstk-1; 01538 static int *Lstk = C2F(vstk).lstk-1; 01539 static int *Infstk = C2F(vstk).infstk-1; 01540 01541 Pt = max(Pt,0);Pts=Pt; 01542 Top = max(Top,0);Tops=Top; 01543 C2F(basbrk).interruptible = *seq != 0; 01544 C2F(bexec)(str, ns, ierr, (*ns)); 01545 if (*ierr != 0) { 01546 goto L9998; 01547 } 01548 /* + */ 01549 if (Eptover(1)) { 01550 goto L9998; 01551 } 01552 Ids[1 + Pt * nsiz] = Lhs; 01553 Ids[2 + Pt * nsiz] = Rhs; 01554 Ids[3 + Pt * nsiz] = C2F(com).sym; 01555 Rstk[Pt] = 1002; 01556 ++C2F(recu).niv; 01557 C2F(com).fun = 0; 01558 C2F(recu).icall = 5; 01559 01560 /* code translated from callinterf.h */ 01561 L60: 01562 01563 C2F(parse)(); 01564 if (C2F(iop).err > 0) { 01565 goto L9999; 01566 } 01567 01568 if (C2F(com).fun == 99) { 01569 C2F(com).fun = 0; 01570 goto L200; 01571 } 01572 01573 if (Rstk[Pt] / 100 == 9) { 01574 ir = Rstk[Pt] - 900; 01575 if (ir == 1) { 01576 /* back to matsys */ 01577 k = 13; 01578 } else if (ir >= 2 && ir <= 9) { 01579 /* back to matio */ 01580 k = 5; 01581 } else if (ir == 10) { 01582 /* end of overloaded function */ 01583 goto L96; 01584 } else if (ir > 40) { 01585 /* back to gw_user2 */ 01586 k = 24; 01587 } else if (ir > 20) { 01588 /* back to gw_user */ 01589 k = 14; 01590 } else { 01591 goto L89; 01592 } 01593 iflagint = 0; 01594 goto L95; 01595 } 01596 01597 L89: 01598 if (Top < Rhs) { 01599 SciError(22); 01600 goto L9999; 01601 } 01602 if (Top - Rhs + Lhs + 1 >= C2F(vstk).bot) { 01603 SciError(18); 01604 goto L9999; 01605 } 01606 goto L91; 01607 01608 L90: 01609 if (C2F(iop).err > 0) { 01610 goto L9999; 01611 } 01612 L91: 01613 k = C2F(com).fun; 01614 C2F(com).fun = 0; 01615 if (k == C2F(recu).krec) { 01616 C2F(recu).krec = -1; 01617 SciError(22); 01618 goto L9999; 01619 } 01620 C2F(recu).krec = -1; 01621 if (k == 0) { 01622 goto L60; 01623 } 01624 L95: 01625 if (! C2F(allowptr)(&k)) { 01626 C2F(ref2val)(); 01627 } 01628 C2F(recu).krec = k; 01629 C2F(callinterf)(&k, &iflagint); 01630 /* if (k.eq.krec) krec=99999 */ 01631 C2F(recu).krec = -1; 01632 if (C2F(com).fun >= 0) { 01633 if (Top - Lhs + 1 > 0) { 01634 C2F(iset)(&Rhs, &c__0, &Infstk[Top - Lhs+1], &c__1); 01635 } 01636 goto L90; 01637 } 01638 /* called interface ask for a scilab function to perform the function (fun=-1) */ 01639 /* the function name is given in ids(1,pt+1) */ 01640 C2F(ref2val)(); 01641 C2F(com).fun = 0; 01642 C2F(funs)(&Ids[1 + (Pt + 1) * nsiz]); 01643 if (C2F(iop).err > 0) { 01644 goto L9999; 01645 } 01646 if (C2F(com).fun > 0) { 01647 goto L91; 01648 } 01649 if (C2F(com).fin == 0) { 01650 SciError(246); 01651 if (C2F(iop).err > 0) { 01652 goto L9999; 01653 } 01654 goto L90; 01655 } 01656 ++Pt; 01657 C2F(com).fin = Lstk[C2F(com).fin]; 01658 Rstk[Pt] = 910; 01659 C2F(recu).icall = 5; 01660 C2F(com).fun = 0; 01661 /* *call* macro */ 01662 goto L60; 01663 L96: 01664 --Pt; 01665 goto L90; 01666 /* End of callinterf.h code */ 01667 01668 L200: 01669 Lhs = Ids[1 + Pt * nsiz]; 01670 Rhs = Ids[2 + Pt * nsiz]; 01671 C2F(com).sym = Ids[3 + Pt * nsiz]; 01672 --Pt; 01673 --Top; 01674 /* + */ 01675 --C2F(recu).niv; 01676 *ierr = 0; 01677 C2F(recu).icall = 0; 01678 C2F(com).fin = 3; 01679 C2F(basbrk).interruptible = TRUE_; 01680 return 0; 01681 L9998: 01682 *ierr = 1; 01683 Pt=Pts;Top=Tops; 01684 C2F(basbrk).interruptible = TRUE_; 01685 01686 return 0; 01687 L9999: 01688 /* Err == 9999999 arises if abort has been used to terminate the callback execution */ 01689 if (Err != 9999999) *ierr = 1; 01690 --Top; 01691 --C2F(recu).niv; 01692 Pt=Pts;Top=Tops; 01693 C2F(basbrk).interruptible = TRUE_; 01694 return 0; 01695 } /* syncexec */
Here is the caller graph for this function:

| int C2F() tksynchro | ( | ) |
| IMPORT { ... } basbrk |
Referenced by parse(), run(), and syncexec().
Definition at line 28 of file parse.c.
Referenced by bouncexy(), cmscope(), cossim(), cossimdaskr(), cresmatvar(), cscope(), parse(), run(), scicos(), and syncexec().
Definition at line 27 of file parse.c.
Referenced by bfrdr(), bouncexy(), cmscope(), cosini(), cossim(), cossimdaskr(), crebmatvar(), crematvar(), cscope(), ddoit(), dmmul1(), getGlobalNamefromId(), getLocalNamefromId(), parse(), readf4(), run(), syncexec(), writef4(), and zdoit().
1.5.1