/* -order ] , { } ( ) : ; := * / '| + - '< '> = '<= '>= ^= a[ k[ K[ Ks be bn fl fs lb le sb se da dk dK dn en sn fak fka em fi fir fv fvr ff ffr fln sk J Kl Kb if ex ag cs pn p[ fmx fmn frs '|'| d mct emt emc -table ted_eval_t_.incl.pl1 -tl -alm -sem ted_eval_.incl.pl1 -parse */ ted_vtab_: proc(rule_number,alternative_number); goto rule( rule_number); alloc: proc; allocate catv in (cata); catv.link = val.temp; val.temp = cat_p; sr.pt = addr(catv.text); sr.loc = 1; sr.num = cat_l; sr.type = CAT; end; /* ::= ! */ /* ::= ! */ rule(0002): ex_sw = "1"b; return; dcl comp bit(3); dcl i fixed bin(21); dcl j fixed bin(21); dcl mc char(1); dcl cv char(24) var; /* ::= { } ! */; rule(0003): /* ::= { } ! */; rule(0004): /* ::= { } ! */; rule(0005): /* ::= { } ! */ rule(0006): /* release all temp variables */ dcl tp ptr; do while (val.temp ^= null()); tp = val.temp; val.temp = tp->catv.link; free tp->catv; end; goto finish; /* ::= ! */; /* ::= ! */ /* ::= : | : ! */; rule(0009): /* ::= ; | ; ! */; rule(0010): dcl NL char(1)int static init(" "); call make(CAT,lst-1); call iox_$put_chars(iox_$user_output,addr(ls.pt(lst-1)->ic(ls.loc(lst-1))),ls.num(lst-1),0); if (rule_number = 0010) then call iox_$put_chars(iox_$user_output,addr(NL),1,0); lgnc = nc; return; /* ::= | ! */; rule(0011): call make(CAT, lst); result = substr(ls.pt(lst)->is,ls.loc(lst),ls.num(lst)); return; /* ::= ; ! */; rule(0012): lgnc = nc; return; /* ::= da ; ! */; rule(0013): ns_string = "a"; call vdump; lgnc = nc; return; /* ::= dk ; ! */; rule(0014): ns_string = "k"; call vdump; lgnc = nc; return; /* ::= dK ; ! */; rule(0015): ns_string = "K"; call vdump; lgnc = nc; return; /* ::= d ( ) ; ! */ rule(0016): s1_ptr = addr(ls(lst-2)); ns_string = substr (s1.pt->is,s1.loc,s1.num); call vdump; lgnc = nc; return; vdump: proc; do ii = 1 to length(ns_string); ch2 = substr (ns_string, ii, 1); if (ch2 = "a") then do i = alb to aub; if (av(i) ^= 0) then call ioa_("a[^4d] = ^d",i,av(i)); end; else if (ch2 = "k") then do i = klb to kub; if (k(i) ^= "") then call ioa_("k[^4d] = ""^va""",i,length(k(i)),k(i)); end; else if (ch2 = "K") then do i = Klb to Kub; if (K(i) ^= "") then call ioa_("K[^4d] = ""^va""",i,length(K(i)),K(i)); end; else if (ch2 = "v") then do; next_avar = val.avar; do avar_ptr = pointer (lval_ptr, next_avar) repeat (pointer (lval_ptr, next_avar)) while (next_avar ^= "0"b); next_avar = avar.next; if (avar.type = AEXP) then call ioa_ ("^a = ^i", avar.name, avar.num); else if (avar.type = LEXP) then call ioa_ ("^a = ^[true^;false^]", avar.name, (avar.num^=0)); else if (avar.type = CAT) then do; cat_p = pointer (lval_ptr, avar.txt_r); call ioa_ ("^a = ""^va""", avar.name, length (catv.text), catv.text); end; end; end; else do; msg = "Vds) Invalid dump specifier "; goto err_text; end; end; end; /* ::= ! */ /* ::= a[ ] := ! */; rule(0018): call make(AEXP,lst-3); call make(AEXP,lst); av(cka(ls.num(lst-3))) = ls.num(lst); ls(lst-4) = ls(lst); return; /* ::= k[ ] := ! */; rule(0019): call make(AEXP,lst-3); call make(CAT,lst); k(ckk(ls.num(lst-3))) = substr(ls.pt(lst)->is,ls.loc(lst),ls.num(lst)); ls(lst-4) = ls(lst); return; /* ::= K[ ] := ! */; rule(0020): call make(AEXP,lst-3); call make(CAT,lst); K(ckK(ls.num(lst-3))) = substr(ls.pt(lst)->is,ls.loc(lst),ls.num(lst)); ls(lst-4) = ls(lst); return; /* ::= ! */ rule(0021): call make(CAT,lst); ls.type(lst) = ABREV; /* ::= ! */ rule(0022): avar_ptr = ls.pt (lst-1); avar.type = ls.type (lst); if (ls.type (lst) = AEXP) | (ls.type (lst) = LEXP) then do; if (avar.txt_r ^= "0"b) /* old left-over string? */ then do; cat_p = pointer (lval_ptr, avar.txt_r); free catv in (cata); avar.txt_r = "0"b; end; avar.num = ls.num (lst); ls(lst-1) = ls(lst); return; end; avar_len, cat_l = ls.num (lst); if (avar.txt_r = "0"b) then do; allocate catv in (cata); avar.txt_r = rel (cat_p); end; else cat_p = pointer (lval_ptr, avar.txt_r); if (catv.len ^= avar_len) then do; free catv in (cata); allocate catv in (cata); avar.txt_r = rel (cat_p); end; catv.text = substr(ls.pt(lst)->is,ls.loc(lst),avar_len); ls(lst-1) = ls(lst); return; dcl azAZ09 char(62) int static init("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); /* ::= := ! */ rule(0023): if (ls.pt (lst-1) ^= null()) then return; /* var already allocated */ ns_string = substr (ls.symptr(lst-1) ->is, 1, ls.symlen(lst-1)); ls.type (lst-1) = AEXP; goto setup_avar; /* ::= := ! */ rule(0024): if (length(ns_string)>16) | (length(ns_string)=0) then do; msg = "Vnl) Abbrev-name length not 1-16 "; goto err_text; end; if (verify(ns_string,azAZ09) ^= 0) | (substr(ns_string,1,1) < "A") then do; msg = "Vin) Illegal abbrev name "; goto err_text; end; ls.type (lst-1) = ABREV; dcl next_avar bit (18); next_avar = val.avar; do avar_ptr = pointer (lval_ptr, next_avar) repeat (pointer (lval_ptr, next_avar)) while (next_avar ^= "0"b); next_avar = avar.next; if (avar.name = ns_string) then do; ls.pt (lst-1) = avar_ptr; return; end; end; setup_avar: allocate avar in (cata); /* get a new descriptor */ avar.name = ns_string; avar.txt_r = "0"b; /* show no text */ avar.type = ls.type (lst-1); /* set the type trying for */ ls.pt (lst-1) = avar_ptr; /* fill in the stack reference */ avar.next = val.avar; /* link into symbol list */ val.avar = rel (avar_ptr); return; /* ::= k[ ] ! */; rule(0025): sr_ptr = addr(ls(lst-2)); i = ls.num(lst-1); sr.pt = addrel(addr(k(ckk(i))),1); sr.loc = 1; sr.num = length(k(i)); goto kexp_return; /* ::= K[ ] ! */; rule(0026): sr_ptr = addr(ls(lst-2)); i = ls.num(lst-1); sr.pt = addrel(addr(K(ckK(i))),1); sr.loc = 1; sr.num = length(K(i)); goto kexp_return; /* ::= p[ ] ! */ rule(0027): i = ls.num(lst-1); sr_ptr = addr(ls(lst-2)); sv_p = dbase.stk_info.top; if (sv_p = null()) then do; maybe_null_str: if (i = 0) then do; sr.pt = addr(dbase.err_go); /* point to something */ sr.loc = 1; sr.num = 0; goto kexp_return; end; end; else if (sv.pn = 0) then goto maybe_null_str; if (i < 0) | (i > sv.pn) then do; msg = "Vsp) Subscript not in range p[0:pn] "; goto err_text; end; sr.pt = sv.pp(i); sr.loc = 1; sr.num = sv.pl(i); goto kexp_return; /* ::= Ks ! */; rule(0028): lsbe = "Ks"; sr_ptr = addr(ls(lst)); if (ams_p ^= null()) /* If this is a \g{...} usage, it */ then do; /* is special. */ sr.pt = ams_p; sr.loc = 1; sr.num = ams_l; goto kexp_return; end; sr.pt = b.cur.sp; sr.loc = valid(b.a_.l.re(1),"Ks "); sr.num = b.a_.r.le(2); goto check_split; /* ::= Kl ! */; rule(0029): lsbe = "Kl"; sr_ptr = addr(ls(lst)); sr.pt = b.cur.sp; sr.loc = valid(b.a_.l.le(1),"Kl "); sr.num = b.a_.r.re(2); goto check_split; /* ::= Kb ! */; rule(0030): lsbe = "Kb"; sr_ptr = addr(ls(lst)); sr.pt = b.cur.sp; sr.loc = b.b_.l.le; if (b.b_.l.re < b.b_.l.le) /* lower part empty? */ then sr.loc = b.b_.r.le; /* ..yes, use upper */ sr.num = b.b_.r.re; if (b.b_.r.le > b.b_.r.re) /* upper part empty? */ then sr.num = b.b_.l.re; /* ..yes, use lower */ check_split: /* sr.loc is LHE, sr.num is RHE */ tsb = sr.loc; tse = sr.num; dcl (tsb, tse) fixed bin (21); if (sr.loc <= b.b_.l.re) & (sr.num >= b.b_.r.le) then do; /* String is split, must create a */ /* "pure" string. */ ti = sr.loc; /* alloc will clobber sr.loc */ j = b.b_.l.re - sr.loc + 1;/* size of left part */ i = sr.num - b.b_.r.le + 1;/* size of right part */ cat_l = j + i; /* size of whole thing */ call alloc; substr (catv.text, 1, j) = substr (b_s, ti, j); substr (catv.text, j+1, i) = substr (b_s, b.b_.r.le, i); end; if db_eval | db_sw then call ioa_$ioa_switch (db_output, "^a^4(,^i^) ^5i:^5i->^5i:^5i", lsbe, b.b_.l.le, b.b_.l.re, b.b_.r.le, b.b_.r.re, tsb, tse, sr.loc, sr.num); sr.num = sr.num - sr.loc + 1; goto kexp_return; /* ::= cs ! */; rule(0031): ascii = collate9(); sr_ptr = addr(ls(lst)); sr.pt = addr(ascii); sr.loc = 1; sr.num = 512; goto kexp_return; dcl ascii char(512); /* ::= ! */; rule(0032): sr_ptr = addr(ls(lst)); cat_l = length(ns_string); call alloc; catv.text = ns_string; goto kexp_return; /* ::= fak ( , ) ! */; rule(0033): call make(CAT,lst-1); call make(CAT,lst-3); sr_ptr = addr(ls(lst-5)); ns_string = substr(ls.pt(lst-1)->is,ls.loc(lst-1),ls.num(lst-1)); cv = substr(ls.pt(lst-3)->is,ls.loc(lst-3),ls.num(lst-3)); if (length(ns_string) = 0) then sr = ls (lst-3); else do; dcl (sign,fill) char(1); dcl (units,z_sup) bit(1); dcl (hexd,ti,nibble) fixed bin(21); dcl hexdigits char(16)int static init("0123456789ABCDEF"); j = length(cv); if (substr(cv,1,1) = "-") then do; sign = "-"; cv = substr(cv,2,j-1); j = j - 1; end; else sign = " "; units = "1"b; z_sup = "0"b; fill = " "; do i = length(ns_string) to 1 by -1; mc = substr(ns_string,i,1); if (mc = " ") then do; z_sup = "1"b; if units then do; if (cv = "0") then j = 0; end; end; if units then if (mc = "*") | (mc = "$") then do; fill = mc; mc = " "; end; else if (mc = "-") then do; fill = sign; mc = " "; end; else do; hexd = index("XxOo",mc); if (hexd ^= 0) then do; if (hexd > 2) then nibble = 3; else nibble = 4; j = fixed(cv,35); dcl jb bit(36)based(addr(j)); cv = ""; do ti = 1 to 36 by nibble; hexd = fixed(substr(jb,ti,nibble),17); if (cv ^= "") | (hexd ^= 0) then cv = cv || substr(hexdigits,hexd+1,1); end; if (cv = "") then cv = "0"; j = length(cv); mc = " "; end; end; if (mc = " ") | (mc = "0") then do; if (j > 0) then do; substr(ns_string,i,1) = substr(cv,j,1); j = j - 1; end; else if (mc = " ") then if ^units then do; mc = "."; end; units = "0"b; end; if (mc = ",") | (mc = ".") then do; if z_sup & (j < 1) then do; substr(ns_string,i,1) = fill; if (fill ^= "*") then fill = " "; end; end; if (mc = "~") then substr(ns_string,i,1) = " "; end; if (substr(ns_string,1,1) = "-") then substr(ns_string,1,1) = sign; cat_l = length(ns_string); call alloc; catv.text = ns_string; end; goto kexp_return; /* ::= fs ( , ) | fs ( , , ) | fs ( , : ) ! */; rule(0034): begin; dcl (i, ifr, ito) fixed bin (21); call make(AEXP,lst-1); if (alternative_number = 1) then do; call make(CAT,lst-3); s1_ptr = addr(ls(lst-3)); sr_ptr = addr(ls(lst-5)); ito, ifr = ls.num(lst-1); if (ifr > 0) then ito = s1.num - ito + 1; end; else do; call make(AEXP, lst-3); call make(CAT,lst-5); s1_ptr = addr(ls(lst-5)); sr_ptr = addr(ls(lst-7)); ifr = ls.num(lst-3); ito = ls.num(lst -1); if (alternative_number = 3) then do; if (ito < 0) then ito = s1.num + ito + 1; if (ifr > ito) then ifr = 0; /* force error condition */ ito = ito - ifr + 1; end; end; if (ifr < 0) then ifr = max (1, s1.num + ifr + 1); if (ifr > s1.num) | (ifr = 0) then do; msg = "Vfs) substr from outside string "; goto err_text; end; cat_l = abs(ito); call alloc; sr.num = 0; if (ifr < 0) then do; ifr = -ifr; if (ito > 0) then do; ifr = min(ifr + 1,ito); ito = max(0,ito - ifr); end; else do; ifr = min(ifr,-ito); ito = min(ito + ifr,0); end; substr(catv.text,1,ifr) = " "; sr.num = ifr; ifr = 1; end; if (ito < 0) then do; ito = -ito; i = s1.num - ifr + 1; if (i < ito) then do; i = ito - i; substr (catv.text, sr.num+1, i) = " "; sr.num = sr.num + i; ito = ito - i; end; end; substr (catv.text, sr.num+1, ito) = substr (s1.pt->is, ifr + s1.loc - 1, min ((s1.num-ifr+1), ito)); sr.num = sr.num + ito; end; goto kexp_return; /* ::= frs ( , , ) ! */; dcl XXloc(4) ptr; dcl XXnum(4) fixed bin(21); rule(0035): call make(CAT,lst-1); call make(CAT,lst-3); call make(CAT,lst-5); s1_ptr = addr(ls(lst-5)); s2_ptr = addr(ls(lst-3)); XXloc(4) = addr(s2.pt->ic(s2.loc)); XXnum(4) = s2.num; i = index(substr(s1.pt->is,s1.loc,s1.num),substr(s2.pt->is,s2.loc,s2.num)); if (i = 0) then do; XXloc(1), XXloc(2), XXloc(3) = addr(s1.pt->ic(s1.loc)); XXnum(1) = s1.num; XXnum(2), XXnum(3) = 0; end; else do; XXloc(1) = addr(s1.pt->ic(s1.loc)); XXnum(1) = i-1; XXloc(2) = addr(XXloc(1)->ic(i)); XXnum(2) = s2.num; XXloc(3) = addr(XXloc(2)->ic(s2.num+1)); XXnum(3) = s1.num - XXnum(1) - XXnum(2); end; s2_ptr = addr(ls(lst-1)); cat_l = 0; do i = 1 to s2.num; ii = index("bmas",substr(s2.pt->is,i,1)); if (ii = 0) then do; msg = "Vrs) Improper control string. "; goto err_text; end; cat_l = cat_l + XXnum(ii); end; sr_ptr = addr(ls(lst-7)); call alloc; sr.num = 0; do i = 1 to s2.num; ii = index("bmas",substr(s2.pt->is,i,1)); substr(catv.text,sr.num+1,XXnum(ii)) = substr(XXloc(ii)->is,1,XXnum(ii)); sr.num = sr.num + XXnum(ii); end; goto kexp_return; /* ::= if ( , ) ! */; rule(0036): sr_ptr = addr( ls(lst-5)); call make(LEXP,lst-3); sr.pt = ls.pt(lst-1); /* plug in the given value */ sr.type = ls.type(lst-1); sr.loc = ls.loc(lst-1); sr.num = ls.num(lst-1); if (ls.num(lst-3) = 0) then do; /* if false */ sr.type = CAT; /* ..convert to a null string */ sr.num = 0; end; goto kexp_return; /* ::= if ( , , ) ! */; rule(0037): sr_ptr = addr( ls(lst-7)); call make(LEXP,lst-5); if (ls.num(lst-5) ^= 0) then do; sr.pt = ls.pt(lst-3); sr.type = ls.type(lst-3); sr.loc = ls.loc(lst-3); sr.num = ls.num(lst-3); end; else do; sr.pt = ls.pt(lst-1); sr.type = ls.type(lst-1); sr.loc = ls.loc(lst-1); sr.num = ls.num(lst-1); end; return; /* ::= ! */; rule(0038): avar_ptr = ls.pt (lst); if (avar_ptr = null()) then do; msg = "Vnd) Variable not defined"; goto err_text; end; ls.type (lst) = avar.type; if (avar.type ^= CAT) then ls.num(lst) = avar.num; else do; cat_p = pointer (lval_ptr, avar.txt_r); ls.pt (lst) =addr (catv.text); ls.loc (lst) = 1; ls.num (lst) = catv.len; end; return; /* ::= bn ! */; rule(0039): sr_ptr = addr(ls(lst)); i = index(b.name," ")-1; if (i = -1) then i = 16; sr.pt = addr(b.name); sr.loc = 1; sr.num = i; goto kexp_return; /* ::= dn ! */; rule(0040): sr_ptr = addr(ls(lst)); i = index(b.dname," ")-1; if (i = -1) then i = 168; sr.pt = addr(b.dname); goto kexp_path; /* ::= en ! */; rule(0041): sr_ptr = addr(ls(lst)); i = index(b.ename," ")-1; if (i = -1) then i = 32; sr.pt = addr(b.ename); goto kexp_path; /* ::= sn ! */; rule(0042): sr_ptr = addr(ls(lst)); i = index(b.cname," ")-1; if (i = -1) then i = 32; sr.pt = addr(b.cname); goto kexp_path; /* ::= sk ! */; rule(0043): sr_ptr = addr(ls(lst)); i = 1; sr.pt = addr(b.kind); kexp_path: sr.loc = 1; if b.file_sw then sr.num = i; else sr.num = 0; goto kexp_return; /* ::= em ! */ rule(0044): sr_ptr = addr(ls(lst)); sr.pt = addrel(addr(err_msg),1); sr.loc = 1; sr.num = length(err_msg); goto kexp_return; /* ::= emt ( ) ! */ rule(0045): sr_ptr = addr(ls(lst-2)); sr.pt = addrel(addr(err_msg),1); sr.loc = 6; sr.num = max (0, length(err_msg)-5); goto kexp_return; /* ::= emc ( ) ! */ rule(0046): sr_ptr = addr(ls(lst-2)); sr.pt = addrel(addr(err_msg),1); sr.loc = 1; sr.num = 3; goto kexp_return; /* ::= ! */; /* ::= '|'| ! */ rule(0048): call make (CAT, lst); call make (CAT, lst-2); sr_ptr, s1_ptr = addr(ls(lst-2)); s2_ptr = addr(ls(lst)); goto concatenate; /* ::= ! */ rule(0049): call make (CAT, lst); call make (CAT, lst-1); sr_ptr, s1_ptr = addr(ls(lst-1)); s2_ptr = addr(ls(lst)); if ^conc_sw then do; conc_sw = "1"b; call ioa_$nnl("Warning: || operator missing. "); call tedwhere_ (dbase_p); end; concatenate: sx_ptr = addr( ls(lst+1)); /* borrow a stack element */ sx = s1; /* because alloc clobbers sr which */ cat_l = sx.num + s2.num; /* is the same as s1 */ dcl 1 sx like ls based(sx_ptr); dcl sx_ptr ptr; call alloc; substr(catv.text,1,s1.num) = substr(sx.pt->is,sx.loc,sx.num); substr(catv.text,sx.num+1,s2.num) = substr(s2.pt->is,s2.loc,s2.num); kexp_return: sr.type = CAT; return; /* ::= ex ( ) ! */ rule(0050): /* this is the execute MACRO */ call make(CAT,lst-1); if (ls.num(lst-1) > 0) then call ns_alt(ls.pt(lst-1),ls.loc(lst-1),ls.num(lst-1)); return; /* ::= ! */; rule(0051): i = max (ls.type (lst), ls.type (lst-2)); call make (i, lst); call make (i, lst-2); ls.type(lst-2) = LEXP; s1_ptr = addr(ls(lst-2)); s2_ptr = addr(ls(lst)); if (i = CAT) then do; if (substr(s1.pt->is,s1.loc,s1.num) < substr(s2.pt->is,s2.loc,s2.num)) then comp = "100"b; else if (substr(s1.pt->is,s1.loc,s1.num) > substr(s2.pt->is,s2.loc,s2.num)) then comp = "001"b; else comp = "010"b; end; else do; if (s1.num < s2.num) then comp = "100"b; else if (s1.num > s2.num) then comp = "001"b; else comp = "010"b; end; if ls.mask(lst-1)&comp then ls.num(lst-2) = 1; else ls.num(lst-2) = 0; ls.type (lst-2) = LEXP; return; /* ::= J ! */ rule(0052): dcl R(1:4) fixed bin(21); call make (CAT,lst); call make (CAT,lst-3); ls.type(lst-3) = LEXP; s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst)); cat_l = s1.num + s2.num; allocate catv in (cata); R(1) = 1; substr(catv.text,R(1),s1.num) = substr(s1.pt->is,s1.loc,s1.num); R(2), R(3) = R(1) + s1.num; substr(catv.text,R(3),s2.num) = substr(s2.pt->is,s2.loc,s2.num); R(4) = R(3) + s2.num; dcl tedsort_$compare entry(ptr,ptr,bit(3)); call tedsort_$compare (addr(catv.text),addr(R),comp); free catv; if ls.mask(lst-1)&comp then ls.num(lst-3) = 1; else ls.num(lst-3) = 0; ls.type (lst-3) = LEXP; return; /* ::= = | ^= | '>= | '<= | '< | '> ! */ rule(0053): dcl relmask(1:6) bit(36)int static init("010"b, "101"b, "011"b, "110"b, "100"b, "001"b ); ls.mask(lst) = relmask(alternative_number); return; /* ::= + ! */; rule(0054): call make (AEXP,lst); call make (AEXP,lst-2); ls.type(lst-2) = AEXP; ls.num(lst-2) = ls.num(lst-2) + ls.num(lst); return; /* ::= - ! */; rule(0055): call make (AEXP,lst); call make (AEXP,lst-2); ls.type(lst-2) = AEXP; ls.num(lst-2) = ls.num(lst-2) - ls.num(lst); return; /* ::= ! */ /* ::= * ! */; rule(0057): call make (AEXP,lst); call make (AEXP,lst-2); ls.type(lst-2) = AEXP; ls.num(lst-2) = ls.num(lst-2) * ls.num(lst); return; /* ::= / ! */; rule(0058): call make (AEXP,lst); call make (AEXP,lst-2); ls.type(lst-2) = AEXP; ls.num(lst-2) = divide(ls.num(lst-2),ls.num(lst),17,0); return; /* ::= '| ! */; rule(0059): call make (AEXP,lst); call make (AEXP,lst-2); ls.type(lst-2) = AEXP; ls.num(lst-2) = mod(ls.num(lst-2),ls.num(lst)); return; /* ::= ! */ /* ::= ! */; /* ::= ! */; rule(0062): call make(AEXP, lst); ls(lst-1) = ls(lst); return; /* ::= ! */ rule(0063): call make(AEXP, lst); ls(lst-1) = ls(lst); ls.num(lst-1) = - ls.num(lst-1); return; /* ::= ! */; /* ::= ( ) | ( ) | ( ) ! */ rule(0065): ls(lst-2) = ls(lst-1); return; /* ::= a[ ] ! */; rule(0066): ls.num(lst-2) = av((cka(ls.num(lst-1)))); ls.type(lst-2) = AEXP; return; /* ::= fka ( ) ! */; rule(0067): call make(AEXP,lst-1); ls(lst-3) = ls(lst-1); return; /* ::= ! */; rule(0068): ls.type(lst) = AEXP; return; /* ::= pn ! */ rule(0069): sv_p = dbase.stk_info.top; if (sv_p = null()) then ls.num (lst) = 0; else ls.num(lst) = sv.pn; ls.type(lst) = AEXP; return; /* ::= ag ! */ rule(0070): ls.num(lst) = argct; ls.type(lst) = AEXP; return; /* ::= mct ( ) ! */ rule(0071): ls.num(lst-2) = S_count; ls.type(lst-2) = AEXP; return; dcl lsbe char (4); /* ::= lb ! */; rule(0072): lsbe = "lb"; if (b.cur.sn > 0) /* if buffer not empty */ then ls.num(lst) = valid(b.a_.l.le(1),"lb "); else ls.num(lst) = 0; goto check_offset; /* ::= sb ! */; rule(0073): lsbe = "sb"; if (ams_p ^= null()) /* if a \g{...} usage */ then ls.num(lst) = 1; else if (b.cur.sn > 0) then ls.num(lst) = valid(b.a_.l.re(1),"sb "); else ls.num(lst) = 0; goto check_offset; /* ::= se ! */; rule(0074): lsbe = "se"; if (ams_p ^= null()) /* if a \g{...} usage */ then ls.num(lst) = ams_l; else if (b.cur.sn > 0) /* if buffer not empty */ then ls.num(lst) = valid(b.a_.r.le(2),"se "); else ls.num(lst) = 0; goto check_offset; /* ::= le ! */; rule(0075): lsbe = "le"; if (b.cur.sn > 0) then ls.num(lst) = valid(b.a_.r.re(2),"le "); else ls.num(lst) = 0; goto check_offset; /* ::= be ! */; rule(0076): lsbe = "be"; /* if (b.b_.r.re < b.b_.r.le) then ls.num(lst) = b.b_.l.re; else */ ls.num(lst) = b.b_.r.re; check_offset: ls.type(lst) = AEXP; if (ams_p ^= null()) then do; if db_eval | db_sw then call ioa_$ioa_switch (db_output, "^a \g{ ^i", lsbe, i); return; end; tsb = ls.num (lst); if (ls.num(lst) > b.b_.l.re) /* if number is in right part, */ then do; /* must deduct hole size */ ls.num(lst) = ls.num(lst) - (b.b_.r.le - b.b_.l.re - 1); end; if db_eval | db_sw then call ioa_$ioa_switch (db_output, "^a^4(,^i^) ^5i->^5i", lsbe, b.b_.l.le, b.b_.l.re, b.b_.r.le, b.b_.r.re, tsb, ls.num(lst)); return; /* ::= fmx ! */; rule(0077): ls.num(lst) = 2; return; /* ::= fmn ! */; rule(0078): ls.num(lst) = 1; return; /* ::= ( ) ! */ rule(0079): /* ::= ( ) ! */ rule(0080): ls(lst-3) = ls(lst-1); return; /* ::= ! */; /* ::= , ! */ /* this rule is used in the above environment, it therefore looks back */ /* to the min/max preceeding to find out which kind to do */ rule(0082): call make(AEXP,lst); call make(AEXP,lst-2); if (ls.num(lst-4) = 1) then ls.num(lst-2) = min(ls.num(lst-2),ls.num(lst)); else ls.num(lst-2) = max(ls.num(lst-2),ls.num(lst)); ls.type (lst-2) = AEXP; return; /* ::= fl ( ) ! */; rule(0083): call make (CAT,lst-1); ls.num(lst-3) = ls.num(lst-1); ls.type (lst-3) = AEXP; return; /* ::= ff ( , ) ! */; rule(0084): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ls.num(lst -5) = search ( substr(s1.pt->is,s1.loc,s1.num), substr(s2.pt->is,s2.loc,s2.num)); ls.type (lst-5) = AEXP; return; /* ::= ffr ( , ) ! */; rule(0085): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ls.num(lst -5) = search(reverse(substr(s1.pt->is,s1.loc,s1.num)), substr(s2.pt->is,s2.loc,s2.num)); ls.type (lst-5) = AEXP; return; /* ::= fi ( , ) ! */; rule(0086): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ls.num(lst -5) = index ( substr(s1.pt->is,s1.loc,s1.num), substr(s2.pt->is,s2.loc,s2.num)); ls.type (lst-5) = AEXP; return; /* ::= fir ( , ) ! */; rule(0087): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); if (s2.num = 1) /* pl1_operators blows it sometimes */ /* when length of 2nd is 1 */ then ls.num(lst -5) = index (reverse( substr(s1.pt->is,s1.loc,s1.num)), substr(s2.pt->is,s2.loc,s2.num)); else ls.num(lst -5) = index (reverse( substr(s1.pt->is,s1.loc,s1.num)), reverse (substr(s2.pt->is,s2.loc,s2.num))); ls.type (lst-5) = AEXP; return; /* ::= fv ( , ) ! */; rule(0088): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ls.num(lst -5) = verify(substr(s1.pt->is,s1.loc,s1.num),substr(s2.pt->is,s2.loc,s2.num)); ls.type (lst-5) = AEXP; return; /* ::= fvr ( , ) ! */; rule(0089): call make (CAT,lst-1); call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ls.num(lst -5) = verify(reverse(substr(s1.pt->is,s1.loc,s1.num)), substr(s2.pt->is,s2.loc,s2.num)); ls.type (lst-5) = AEXP; return; /* ::= ff ( , ) ! */; rule(0090): call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ii = 0; do i = s1.loc to s1.loc+s1.num-1; ii = ii + 1; j = fixed(unspec(substr(s1.pt->is,i,1))); if set(j) & s2.mask then do; ls.num(lst-5) = ii; ls.type (lst-5) = AEXP; return; end; end; ls.num(lst-5) = 0; ls.type (lst-5) = AEXP; return; /* ::= ffr ( , ) ! */; rule(0091): call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ii = 0; do i = s1.loc+s1.num-1 to s1.loc by -1; ii = ii + 1; j = fixed(unspec(substr(s1.pt->is,i,1))); if set(j) & s2.mask then do; ls.num(lst-5) = ii; ls.type (lst-5) = AEXP; return; end; end; ls.num(lst-5) = 0; ls.type (lst-5) = AEXP; return; /* ::= fv ( , ) ! */; rule(0092): call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ii = 0; do i = s1.loc to s1.loc+s1.num-1; ii = ii + 1; j = fixed(unspec(substr(s1.pt->is,i,1))); if set(j) & s2.mask then; else do; ls.num(lst-5) = ii; ls.type (lst-5) = AEXP; return; end; end; ls.num(lst-5) = 0; ls.type (lst-5) = AEXP; return; /* ::= fvr ( , ) ! */; rule(0093): call make (CAT,lst-3); s1_ptr = addr(ls(lst-3)); s2_ptr = addr(ls(lst-1)); ii = 0; do i = s1.loc+s1.num-1 to s1.loc by -1; ii = ii + 1; j = fixed(unspec(substr(s1.pt->is,i,1))); if set(j) & s2.mask then; else do; ls.num(lst-5) = ii; ls.type (lst-5) = AEXP; return; end; end; ls.num(lst-5) = 0; ls.type (lst-5) = AEXP; return; /* ::= fln ( lb ) | fln ( le ) | fln ( be ) ! */ rule(0094): begin; dcl leng fixed bin(21); dcl lc fixed bin(21); dcl i fixed bin(21); dcl ii fixed bin(21); dcl NL char(1)int static init(" "); leng = b.b_.r.re; if (alternative_number = 1) then leng = valid(b.a_.l.le(1),"lb "); if (alternative_number = 2) then leng = valid(b.a_.r.re(2),"le "); call tedcount_lines_ (bp, b.b_.l.le, leng, ls.num (lst-3)); /* %include dcl_tedcount_lines_; */ ls.type (lst-3) = AEXP; end; return; make: proc(typ,at); dcl typ fixed bin (21); /* type needed */ dcl at fixed bin (21); /* where in stack? */ (subscriptrange): goto fn(ls.type(at)*3+typ); /* from->to */ fn(0): /* AEXP->AEXP */ fn(8): /* LEXP->LEXP */ fn(4): /* CAT ->CAT */ return; dcl fb35 fixed bin (35); fn(1): /* AEXP->CAT */ fb35 = ls.num(at); cv = ltrim(char(fb35)); set_string: sr_ptr = addr(ls(at)); cat_l = length (cv); call alloc; catv.text = cv; ls.type (at) = CAT; return; fn(2): /* AEXP->LEXP */ if (ls.num(at) ^= 0) then ls.num(at) = 1; ls.type (at) = LEXP; return; fn(3): /* CAT ->AEXP */ ns_string = substr(ls.pt(at)->is,ls.loc(at),ls.num(at)); if (verify(ns_string," 0123456789") ^= 0) then do; if (index ("+-", substr (ns_string,1,1)) = 0) | (verify( substr (ns_string, 2)," 0123456789") ^= 0) then do; msg = "Vbd) Bad decimal digit. """; msg = msg || ns_string; msg = msg || """"; goto err_ret; end; end; ls.num(at) = fixed(ns_string,35); ls.type(at) = AEXP; return; fn(5): /* CAT ->LEXP */ ns_string = "-"; ns_string = ns_string || substr(ls.pt(at)->is,ls.loc(at),ls.num(at)); ns_string = ns_string || "-"; if (index ("-false-no-f-n-",ns_string) ^= 0) then ls.num(at) = 0; else ls.num(at) = 1; ls.type(at) = LEXP; return; fn(6): /* LEXP->AEXP */ ls.type(at) = AEXP; return; fn(7): /* LEXP->CAT */ if (ls.num(at) = 0) then cv = "false"; else cv = "true"; goto set_string; end; valid$match: proc (val,str)returns(fixed bin (21)); valid: entry(val,str)returns(fixed bin(21)); dcl val fixed bin(21); dcl str char(3); if (ams_p ^= null()) /* if a \g{...} usage */ then msg = "Vng) Value undefined in \g{} usage- "; else if ^b.present(1) then do; if (ams_l < 0) /* if a \{...} usage */ then msg = "Vni) Value undefined in input function- "; else msg = "Vna) Value undefined when no addr- "; msg = msg || str; goto err_text; end; return(val); end; dcl ( rule_number, alternative_number ) fixed bin(21) parm; dcl ii fixed bin(21); dcl bits(2000) bit(9)based(s1.pt); dcl set(0:511) bit(9)int static init( "00000000"b /* \000 */ /*..*/ /*ANULMOXGx*/ /**/ ,"00000000"b /* \001 */ /*..*/ ,"00000000"b /* \002 */ /*..*/ ,"00000000"b /* \003 */ /*..*/ ,"00000000"b /* \004 */ /*..*/ ,"00000000"b /* \005 */ /*..*/ ,"00000000"b /* \006 */ /*..*/ ,"00001000"b /* \007 */ /*..*/ ,"00001000"b /* \010 */ /*..*/ /*ANULMOXGx*/ /**/ ,"00001000"b /* \011 */ /*..*/ ,"00001000"b /* \012 */ /*..*/ ,"00001000"b /* \013 */ /*..*/ ,"00001000"b /* \014 */ /*..*/ ,"00000000"b /* \015 */ /*..*/ ,"00000000"b /* \016 */ /*..*/ ,"00000000"b /* \017 */ /*..*/ ,"00000000"b /* \020 */ /*..*/ /*ANULMOXGx*/ /**/ ,"00000000"b /* \021 */ /*..*/ ,"00000000"b /* \022 */ /*..*/ ,"00000000"b /* \023 */ /*..*/ ,"00000000"b /* \024 */ /*..*/ ,"00000000"b /* \025 */ /*..*/ ,"00000000"b /* \026 */ /*..*/ ,"00000000"b /* \027 */ /*..*/ ,"00000000"b /* \030 */ /*..*/ /*ANULMOXGx*/ /**/ ,"00000000"b /* \031 */ /*..*/ ,"00000000"b /* \032 */ /*..*/ ,"00000000"b /* \033 */ /*..*/ ,"00000000"b /* \034 */ /*..*/ ,"00000000"b /* \035 */ /*..*/ ,"00000000"b /* \036 */ /*..*/ ,"000000010"b /* \037 */ /*..*/ ,"00001000"b /* \040 */ /*..*/ /*ANULMOXGx*/ /**/ ,"00000001"b /* \041 ! */ /*..*/ ,"00000001"b /* \042 " */ /*..*/ ,"00000001"b /* \043 # */ /*..*/ ,"00000001"b /* \044 $ */ /*..*/ ,"00000001"b /* \045 % */ /*..*/ ,"00000001"b /* \046 & */ /*..*/ ,"00000001"b /* \047 ' */ /*..*/ ,"00000001"b /* \050 ( */ /*..*/ /*ANULMOXGx*/ /**/ ,"00000001"b /* \051 ) */ /*..*/ ,"00000001"b /* \052 * */ /*..*/ ,"00000001"b /* \053 + */ /*..*/ ,"00000001"b /* \054 , */ /*..*/ ,"00000001"b /* \055 - */ /*..*/ ,"00000001"b /* \056 . */ /*..*/ ,"00000001"b /* \057 / */ /*..*/ ,"01000111"b /* \060 0 */ /*..*/ /*ANULMOXGx*/ /**/ ,"01000111"b /* \061 1 */ /*..*/ ,"01000111"b /* \062 2 */ /*..*/ ,"01000111"b /* \063 3 */ /*..*/ ,"01000111"b /* \064 4 */ /*..*/ ,"01000111"b /* \065 5 */ /*..*/ ,"01000111"b /* \066 6 */ /*..*/ ,"01000111"b /* \067 7 */ /*..*/ ,"01000011"b /* \070 8 */ /*..*/ /*ANULMOXGx*/ /**/ ,"01000011"b /* \071 9 */ /*..*/ ,"00000001"b /* \072 : */ /*..*/ ,"00000001"b /* \073 ; */ /*..*/ ,"00000001"b /* \074 < */ /*..*/ ,"00000001"b /* \075 = */ /*..*/ ,"00000001"b /* \076 > */ /*..*/ ,"00000001"b /* \077 ? */ /*..*/ ,"00000001"b /* \100 @ */ /*..*/ /*ANULMOXGx*/ /**/ ,"10100011"b /* \101 A */ /*..*/ ,"10100011"b /* \102 B */ /*..*/ ,"10100011"b /* \103 C */ /*..*/ ,"10100011"b /* \104 D */ /*..*/ ,"10100011"b /* \105 E */ /*..*/ ,"10100011"b /* \106 F */ /*..*/ ,"10100001"b /* \107 G */ /*..*/ ,"10100001"b /* \110 H */ /*..*/ /*ANULMOXGx*/ /**/ ,"10100001"b /* \111 I */ /*..*/ ,"10100001"b /* \112 J */ /*..*/ ,"10100001"b /* \113 K */ /*..*/ ,"10100001"b /* \114 L */ /*..*/ ,"10100001"b /* \115 M */ /*..*/ ,"10100001"b /* \116 N */ /*..*/ ,"10100001"b /* \117 O */ /*..*/ ,"10100001"b /* \120 P */ /*..*/ /*ANULMOXGx*/ /**/ ,"10100001"b /* \121 Q */ /*..*/ ,"10100001"b /* \122 R */ /*..*/ ,"10100001"b /* \123 S */ /*..*/ ,"10100001"b /* \124 T */ /*..*/ ,"10100001"b /* \125 U */ /*..*/ ,"10100001"b /* \126 V */ /*..*/ ,"10100001"b /* \127 W */ /*..*/ ,"10100001"b /* \130 X */ /*..*/ /*ANULMOXGx*/ /**/ ,"10100001"b /* \131 Y */ /*..*/ ,"10100001"b /* \132 Z */ /*..*/ ,"00000001"b /* \133 [ */ /*..*/ ,"00000001"b /* \134 \ */ /*..*/ ,"00000001"b /* \135 ] */ /*..*/ ,"00000001"b /* \136 ^ */ /*..*/ ,"10000001"b /* \137 _ */ /*..*/ ,"00000001"b /* \140 ` */ /*..*/ /*ANULMOXGx*/ /**/ ,"10010011"b /* \141 a */ /*..*/ ,"10010011"b /* \142 b */ /*..*/ ,"10010011"b /* \143 c */ /*..*/ ,"10010011"b /* \144 d */ /*..*/ ,"10010011"b /* \145 e */ /*..*/ ,"10010011"b /* \146 f */ /*..*/ ,"10010001"b /* \147 g */ /*..*/ ,"10010001"b /* \150 h */ /*..*/ /*ANULMOXGx*/ /**/ ,"10010001"b /* \151 i */ /*..*/ ,"10010001"b /* \152 j */ /*..*/ ,"10010001"b /* \153 k */ /*..*/ ,"10010001"b /* \154 l */ /*..*/ ,"10010001"b /* \155 m */ /*..*/ ,"10010001"b /* \156 n */ /*..*/ ,"10010001"b /* \157 o */ /*..*/ ,"10010001"b /* \160 p */ /*..*/ /*ANULMOXGx*/ /**/ ,"10010001"b /* \161 q */ /*..*/ ,"10010001"b /* \162 r */ /*..*/ ,"10010001"b /* \163 s */ /*..*/ ,"10010001"b /* \164 t */ /*..*/ ,"10010001"b /* \165 u */ /*..*/ ,"10010001"b /* \166 v */ /*..*/ ,"10010001"b /* \167 w */ /*..*/ ,"10010001"b /* \170 x */ /*..*/ /*ANULMOXGx*/ /**/ ,"10010001"b /* \171 y */ /*..*/ ,"10010001"b /* \172 z */ /*..*/ ,"00000001"b /* \173 { */ /*..*/ ,"00000001"b /* \174 | */ /*..*/ ,"00000001"b /* \175 } */ /*..*/ ,"00000001"b /* \176 ~ */ /*..*/ ,"00000000"b /* \177 */ /*..*/ ,(384)(9)"0"b ); end ted_vtab_; */ ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull and Bull HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by Bull HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved */