home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / languages / pascal / PTC / _PtC1 / ptc__c < prev    next >
Encoding:
Text File  |  1991-03-04  |  251.5 KB  |  9,464 lines

  1. /*
  2. **    Code derived from program ptc
  3. **    Translated by ptc $Revision: 1.3 $
  4. **    $Id: c.ptc 1.3 91/03/09 20:57:47 gtoal Exp Locker: gtoal $
  5. */
  6. # include <stdio.h>
  7. # include <string.h>
  8. # include <stdlib.h>
  9. # include <ctype.h>
  10. # include "<ptc$dir>.ptcmain.h"
  11. text    input = { stdin, 0, 0, 0, 0};
  12. text    output = { stdout, 0, 0, 0, 1};
  13. text    erroutput = { stderr, 0, 0, 0, 1 };
  14. static FILE    *Tmpfil;
  15. static long    Tmplng;
  16. static double    Tmpdbl;
  17. /*
  18. **    Definitions for standard types
  19. */
  20. typedef unsigned char    boolean;
  21. # define false (boolean)0
  22. # define true (boolean)1
  23. static char    *Bools[] = { "false", "true" };
  24. typedef int    integer;
  25. # define maxint    2147483647
  26. # ifndef Unionoffs
  27. # define Unionoffs(p, m) (((long)(&(p)->m))-((long)(p)))
  28. # endif
  29. # define Claimset() (void)Currset(0, (setptr)0)
  30. # define Newset() Currset(1, (setptr)0)
  31. # define Saveset(s) Currset(2, s)
  32. # define setbits 31
  33. typedef unsigned int    setword;
  34. typedef setword *    setptr;
  35. boolean    Member(unsigned int m, setptr sp),
  36.     Le(setptr p1, setptr p2),
  37.     Ge(setptr p1, setptr p2),
  38.     Eq(setptr p1, setptr p2),
  39.     Ne(setptr p1, setptr p2);
  40. setptr    Union(setptr p1, setptr p2);
  41. setptr    Diff(setptr p1, setptr p2);
  42. setptr    Insmem(unsigned int m, setptr sp);
  43. setptr    Mksubr(unsigned int lo, unsigned int hi, setptr sp);
  44. setptr    Currset(int n, setptr sp);
  45. setptr    Inter(setptr p1, setptr p2);
  46. static setptr    Tmpset;
  47. setptr    Conset[];
  48. void    Setncpy(setptr S1, setptr S2, unsigned int N);
  49. # ifndef SETALIGN
  50. # define SETALIGN(x) Alignset((unsigned int *)(x))
  51. struct Set { unsigned int    S[32+1]; } *Alignset(register unsigned int *Sp);
  52. # endif
  53. # ifndef STRALIGN
  54. # define STRALIGN(x) Alignstr((unsigned char *)(x))
  55. struct String { char    A[127+1]; } *Alignstr(register unsigned char *Cp);
  56. # endif
  57. /*
  58. **    Start of program definitions
  59. */
  60. static unsigned char    version[]    = "@(#)ptc.p    2.6  Date 87/09/12";
  61. static unsigned char    rcsid[]    = "$Id: c.ptc 1.3 91/03/09 20:57:47 gtoal Exp Locker: gtoal $";
  62. static unsigned char    rcsrevision[]    = "$Revision: 1.3 $";
  63. # define keytablen 39
  64. # define keywordlen 10
  65. static unsigned char    othersym[]    = "otherwise ";
  66. static unsigned char    anothersym[]    = "others    ";
  67. static unsigned char    externsym[]    = "external  ";
  68. static unsigned char    dummysym[]    = "          ";
  69. static unsigned char    wordtype[]    = "unsigned int";
  70. # define C37_setbits 31
  71. # define maxsetrange 32
  72. # define scalbase 0
  73. # define maxprio 7
  74. # define maxmachdefs 8
  75. # define machdeflen 16
  76. # define maxstrblk 1023
  77. # define maxblkcnt 1023
  78. # define maxstrstor 1048575
  79. # define maxtoknlen 127
  80. # define hashmax 512
  81. # define null 0
  82. # define minchar null
  83. # define maxchar 255
  84. # define space ' '
  85. # define tab '    '
  86. # define tab1 '    '
  87. static unsigned char    tab2[]    = "        ";
  88. static unsigned char    tab3[]    = "            ";
  89. static unsigned char    tab4[]    = "                ";
  90. # define bslash '\\'
  91. static unsigned char    nlchr[]    = "'\\n'";
  92. static unsigned char    ffchr[]    = "'\\f'";
  93. static unsigned char    nulchr[]    = "'\\0'";
  94. static unsigned char    spchr[]    = "' '";
  95. # define quote '\''
  96. # define cite '"'
  97. # define xpnent 'e'
  98. # define percent '%'
  99. # define uscore '_'
  100. # define badchr '?'
  101. # define okchr quote
  102. # define tabwidth 8
  103. # define diffcomm false
  104. # define lazyfor false
  105. # define unionnew true
  106. static unsigned char    inttyp[]    = "int";
  107. static unsigned char    chartyp[]    = "unsigned char";
  108. static unsigned char    plainchartyp[]    = "char";
  109. static unsigned char    setwtyp[]    = "setword";
  110. static unsigned char    setptyp[]    = "setptr";
  111. static unsigned char    floattyp[]    = "float";
  112. static unsigned char    doubletyp[]    = "double";
  113. static unsigned char    dblcast[]    = "(double)";
  114. # define realtyp floattyp
  115. static unsigned char    voidtyp[]    = "void";
  116. static unsigned char    voidcast[]    = "(void)";
  117. # define align true
  118. # define intlen 10
  119. # define fixlen 20
  120. static unsigned char    C24_include[]    = "# include ";
  121. static unsigned char    C4_define[]    = "# define ";
  122. static unsigned char    C53_undef[]    = "# undef ";
  123. static unsigned char    ifndef[]    = "# ifndef ";
  124. static unsigned char    endif[]    = "# endif";
  125. static unsigned char    C50_static[]    = "static ";
  126. static unsigned char    xtern[]    = "extern ";
  127. static unsigned char    typdef[]    = "typedef ";
  128. static unsigned char    registr[]    = "register ";
  129. # define indstep 2
  130. typedef unsigned short    hashtyp;
  131. typedef long    strindx;
  132. typedef integer    strbidx;
  133. typedef struct { unsigned char    A[maxstrblk + 1]; }    strblk;
  134. typedef strblk *    strptr;
  135. typedef unsigned short    strbcnt;
  136. typedef struct S62 *    idptr;
  137. typedef struct S62 {
  138.   idptr    inext;
  139.   integer    inref;
  140.   hashtyp    ihash;
  141.   strindx    istr;
  142. }    idnode;
  143. typedef unsigned char    toknidx;
  144. typedef struct { unsigned char    A[maxtoknlen - 1 + 1]; }    toknbuf;
  145. typedef struct { unsigned char    A[keywordlen - 1 + 1]; }    keyword;
  146. typedef enum { dabs, darctan, dargc, dargv,
  147.   dbreak, dboolean, dchar, dchr,
  148.   dclose, dcos, ddispose, deof,
  149.   deoln, derroutput, dexit, dexp,
  150.   dfalse, dflush, dget, dhalt,
  151.   dinput, dinteger, dln, dmaxint,
  152.   dnew, dodd, dord, doutput,
  153.   dpage, dpack, dpred, dput,
  154.   dprompt, dread, dreadln, dreal,
  155.   dreset, drewrite, dround, dseek,
  156.   dsin, dsqr, dsqrt, dsucc,
  157.   dtell, dtext, dtrue, dtrunc,
  158.   dtan, dwrite, dwriteln, dunpack,
  159.   dzfp, dztring }     predefs;
  160. typedef enum { sand, sarray, sbegin, scase,
  161.   sconst, sdiv, sdo, sdownto,
  162.   selse, send, sextern, sfile,
  163.   sfor, sforward, sfunc, sgoto,
  164.   sif, sinn, slabel, smod,
  165.   snil, snot, sof, sor,
  166.   sother2, sother, spacked, sproc,
  167.   spgm, srecord, srepeat, sset,
  168.   sthen, sto, stype, suntil,
  169.   svar, swhile, swith, seof,
  170.   sinteger, sreal, sstring, schar,
  171.   sid, splus, sminus, smul,
  172.   squot, sarrow, slpar, srpar,
  173.   slbrack, srbrack, seq, sne,
  174.   slt, sle, sgt, sge,
  175.   scomma, scolon, ssemic, sassign,
  176.   sdotdot, sdot }     symtyp;
  177. typedef struct { setword    S[4]; }    symset;
  178. typedef struct S185 {
  179.   symtyp    st;
  180.   union {
  181.     struct  {
  182.       idptr    vid;
  183.     } V1;
  184.     struct  {
  185.       unsigned char    vchr;
  186.     } V2;
  187.     struct  {
  188.       integer    vint;
  189.     } V3;
  190.     struct  {
  191.       strindx    vflt;
  192.     } V4;
  193.     struct  {
  194.       strindx    vstr;
  195.     } V5;
  196.   } U;
  197. }    lexsym;
  198. typedef enum { lpredef, lidentifier, lfield, lforward,
  199.   lpointer, lstring, llabel, lforwlab,
  200.   linteger, lreal, lcharacter }     ltypes;
  201. typedef struct S63 *    declptr;
  202. typedef struct S64 *    treeptr;
  203. typedef struct S65 *    symptr;
  204. typedef struct S65 {
  205.   treeptr    lsymdecl;
  206.   symptr    lnext;
  207.   declptr    ldecl;
  208.   ltypes    lt;
  209.   union {
  210.     struct  {
  211.       idptr    lid;
  212.       boolean    lused;
  213.     } V6;
  214.     struct  {
  215.       strindx    lstr;
  216.     } V7;
  217.     struct  {
  218.       strindx    lfloat;
  219.     } V8;
  220.     struct  {
  221.       integer    lno;
  222.       boolean    lgo;
  223.     } V9;
  224.     struct  {
  225.       integer    linum;
  226.     } V10;
  227.     struct  {
  228.       unsigned char    lchar;
  229.     } V11;
  230.   } U;
  231. }    symnode;
  232. typedef struct S63 {
  233.   declptr    dprev;
  234.   struct { symptr    A[hashmax + 1]; }    ddecl;
  235. }    declnode;
  236. typedef enum { npredef, npgm, nfunc, nproc,
  237.   nlabel, nconst, ntype, nvar,
  238.   nvalpar, nvarpar, nparproc, nparfunc,
  239.   nsubrange, nvariant, nfield, nrecord,
  240.   narray, nconfarr, nfileof, nsetof,
  241.   nbegin, nptr, nscalar, nif,
  242.   nwhile, nrepeat, nfor, ncase,
  243.   nchoise, ngoto, nwith, nwithvar,
  244.   nempty, nlabstmt, nassign, nformat,
  245.   nin, neq, nne, nlt,
  246.   nle, ngt, nge, nor,
  247.   nplus, nminus, nand, nmul,
  248.   ndiv, nmod, nquot, nnot,
  249.   numinus, nuplus, nset, nrange,
  250.   nindex, nselect, nderef, ncall,
  251.   nid, nchar, ninteger, nreal,
  252.   nstring, nnil, npush, npop,
  253.   nbreak }     treetyp;
  254. typedef enum { tnone, tboolean, tchar, tinteger,
  255.   treal, tstring, tnil, tset,
  256.   ttext, tpoly, terror }     pretyps;
  257. typedef enum { anone, aregister, aextern, areference }     attributes;
  258. typedef struct S64 {
  259.   treeptr    tnext, ttype, tup;
  260.   treetyp    tt;
  261.   union {
  262.     struct  {
  263.       predefs    tdef;
  264.       pretyps    tobtyp;
  265.     } V12;
  266.     struct  {
  267.       treeptr    tsubid, tsubpar, tfuntyp, tsublab,
  268.           tsubconst, tsubtype, tsubvar, tsubsub,
  269.           tsubstmt;
  270.       integer    tstat;
  271.       declptr    tscope;
  272.     } V13;
  273.     struct  {
  274.       treeptr    tidl, tbind;
  275.       attributes    tattr;
  276.     } V14;
  277.     struct  {
  278.       treeptr    tparid, tparparm, tpartyp;
  279.     } V15;
  280.     struct  {
  281.       treeptr    tptrid;
  282.       boolean    tptrflag;
  283.     } V16;
  284.     struct  {
  285.       treeptr    tscalid;
  286.     } V17;
  287.     struct  {
  288.       treeptr    tof;
  289.     } V18;
  290.     struct  {
  291.       treeptr    tlo, thi;
  292.     } V19;
  293.     struct  {
  294.       treeptr    tselct, tvrnt;
  295.     } V20;
  296.     struct  {
  297.       treeptr    tflist, tvlist;
  298.       idptr    tuid;
  299.       declptr    trscope;
  300.     } V21;
  301.     struct  {
  302.       treeptr    tcindx, tindtyp, tcelem;
  303.       idptr    tcuid;
  304.     } V22;
  305.     struct  {
  306.       treeptr    taindx, taelem;
  307.     } V23;
  308.     struct  {
  309.       treeptr    tbegin;
  310.     } V24;
  311.     struct  {
  312.       treeptr    tlabno, tstmt;
  313.     } V25;
  314.     struct  {
  315.       treeptr    tlabel;
  316.     } V26;
  317.     struct  {
  318.       treeptr    tlhs, trhs;
  319.     } V27;
  320.     struct  {
  321.       treeptr    tglob, tloc, ttmp;
  322.     } V28;
  323.     struct  {
  324.       treeptr    tbrkid, tbrkxp;
  325.     } V29;
  326.     struct  {
  327.       treeptr    tcall, taparm;
  328.     } V30;
  329.     struct  {
  330.       treeptr    tifxp, tthen, telse;
  331.     } V31;
  332.     struct  {
  333.       treeptr    twhixp, twhistmt;
  334.     } V32;
  335.     struct  {
  336.       treeptr    treptstmt, treptxp;
  337.     } V33;
  338.     struct  {
  339.       treeptr    tforid, tfrom, tto, tforstmt;
  340.       boolean    tincr;
  341.     } V34;
  342.     struct  {
  343.       treeptr    tcasxp, tcaslst, tcasother;
  344.     } V35;
  345.     struct  {
  346.       treeptr    tchocon, tchostmt;
  347.     } V36;
  348.     struct  {
  349.       treeptr    twithvar, twithstmt;
  350.     } V37;
  351.     struct  {
  352.       treeptr    texpw;
  353.       declptr    tenv;
  354.     } V38;
  355.     struct  {
  356.       treeptr    tvariable, toffset;
  357.     } V39;
  358.     struct  {
  359.       treeptr    trecord, tfield;
  360.     } V40;
  361.     struct  {
  362.       treeptr    texpl, texpr;
  363.     } V41;
  364.     struct  {
  365.       boolean    tisassigndest;
  366.       treeptr    texps;
  367.     } V42;
  368.     struct  {
  369.       symptr    tsym;
  370.     } V43;
  371.   } U;
  372. }    treenode;
  373. typedef enum { cabort, cbreak, ccontinue, cdefine,
  374.   cdefault, cdouble, cedata, cenum,
  375.   cetext, cextern, cfgetc, cfclose,
  376.   cfflush, cfloat, cfloor, cfprintf,
  377.   cfputc, cfread, cfscanf, cfwrite,
  378.   cgetc, cgetpid, cint, cinclude,
  379.   clong, clog, cmain, cmalloc,
  380.   cprintf, cpower, cputc, cread,
  381.   creturn, cregister, crewind, cscanf,
  382.   csetbits, csetword, csetptr, cshort,
  383.   csigned, csizeof, csprintf, cstdin,
  384.   cstdout, cstderr, cstrncmp, cstrncpy,
  385.   cstruct, cstatic, cswitch, ctypedef,
  386.   cundef, cungetc, cunion, cunlink,
  387.   cfseek, cgetchar, cputchar, cunsigned,
  388.   cwrite }     cnames;
  389. typedef enum { ebadsymbol, elongstring, elongtokn, erange,
  390.   emanytokn, enotdeclid, emultdeclid, enotdecllab,
  391.   emultdecllab, emuldeflab, ebadstring, enulchr,
  392.   ebadchar, eeofcmnt, eeofstr, evarpar,
  393.   enew, esetbase, esetsize, eoverflow,
  394.   etree, etag, euprconf, easgnconf,
  395.   ecmpconf, econfconf, evrntfile, evarfile,
  396.   emanymachs, ebadmach, eprconf }     errors;
  397. typedef struct { unsigned char    A[machdeflen - 1 + 1]; }    machdefstr;
  398. typedef struct { struct S207 {
  399.   keyword    wrd;
  400.   symtyp    sym;
  401. }    A[keytablen + 1]; }    T66;
  402. typedef struct { strptr    A[maxblkcnt + 1]; }    T67;
  403. typedef struct { idptr    A[hashmax + 1]; }    T68;
  404. typedef struct { treeptr    A[54]; }    T69;
  405. typedef struct { symptr    A[54]; }    T70;
  406. typedef struct { treeptr    A[11]; }    T71;
  407. typedef struct { unsigned char    A[(int)(nnil) - (int)(nassign) + 1]; }    T72;
  408. typedef struct { idptr    A[61]; }    T73;
  409. typedef struct { struct S198 {
  410.   integer    lolim, hilim;
  411.   strindx    typstr;
  412. }    A[maxmachdefs - 1 + 1]; }    T74;
  413. typedef struct { unsigned char    A[15 + 1]; }    T75;
  414. typedef struct { setword    S[2]; }    bitset;
  415. integer    *G205_indnt;
  416. boolean    *G203_dropset;
  417. boolean    *G201_setused;
  418. boolean    *G199_conflag;
  419. integer    *G196_nelems;
  420. treeptr    *G194_vp;
  421. treeptr    *G192_tv;
  422. symptr    *G190_iq;
  423. symptr    *G188_ip;
  424. unsigned char    *G186_lastchr;
  425. toknidx    *G183_i;
  426. toknbuf    *G181_t;
  427. boolean    usemax, usejmps, usecase, usesets, useunion, usediff,
  428.     usemksub, useintr, usesge, usesle, useseq, usesne,
  429.     usememb, useins, usescpy, usecomp, usealig, usesal;
  430. treeptr    top;
  431. treeptr    setlst;
  432. integer    setcnt;
  433. lexsym    currsym;
  434. T66    keytab;
  435. T67    strstor;
  436. strindx    strfree;
  437. strbidx    strleft;
  438. T68    idtab;
  439. declptr    symtab;
  440. integer    statlvl, maxlevel;
  441. T69    deftab;
  442. T70    defnams;
  443. T71    typnods;
  444. T72    pprio, cprio;
  445. T73    ctable;
  446. unsigned char    nmachdefs;
  447. T74    machdefs;
  448. integer    lineno, colno, lastcol, lastline;
  449. toknbuf    lasttok;
  450. integer    varno;
  451. unsigned char    pushchr;
  452. boolean    pushed;
  453. T75    hexdig;
  454.  
  455. #include "ptc.h"
  456.  
  457.  void
  458. prtmsg(errors     m)
  459. {
  460.   static unsigned char    user[]    = "Error: ";
  461.   static unsigned char    restr[]    = "Implementation restriction: ";
  462.   static unsigned char    inter[]    = "* Internal error * ";
  463. # define xtoklen 64
  464.   typedef struct { unsigned char    A[xtoklen - 1 + 1]; }    T76;
  465.   toknidx    i;
  466.   T76    xtok;
  467.  
  468.   switch ((int)(m)) {
  469.     case ebadsymbol:
  470.     (void)fprintf(erroutput.fp, "%sUnexpected symbol\n", user), Putl(erroutput, 1);
  471.     break ;
  472.     case ebadchar:
  473.     (void)fprintf(erroutput.fp, "%sBad character\n", user), Putl(erroutput, 1);
  474.     break ;
  475.     case elongstring:
  476.     (void)fprintf(erroutput.fp, "%sToo long string\n", restr), Putl(erroutput, 1);
  477.     break ;
  478.     case ebadstring:
  479.     (void)fprintf(erroutput.fp, "%sNewline in string or character\n", user), Putl(erroutput, 1);
  480.     break ;
  481.     case eeofstr:
  482.     (void)fprintf(erroutput.fp, "%sEnd of file in string or character\n", user), Putl(erroutput, 1);
  483.     break ;
  484.     case eeofcmnt:
  485.     (void)fprintf(erroutput.fp, "%sEnd of file in comment\n", user), Putl(erroutput, 1);
  486.     break ;
  487.     case elongtokn:
  488.     (void)fprintf(erroutput.fp, "%sToo long identfier\n", restr), Putl(erroutput, 1);
  489.     break ;
  490.     case emanytokn:
  491.     (void)fprintf(erroutput.fp, "%sToo many strings, identifiers or real numbers\n", restr), Putl(erroutput, 1);
  492.     break ;
  493.     case enotdeclid:
  494.     (void)fprintf(erroutput.fp, "%sIdentifier not declared\n", user), Putl(erroutput, 1);
  495.     break ;
  496.     case emultdeclid:
  497.     (void)fprintf(erroutput.fp, "%sIdentifier declared twice\n", user), Putl(erroutput, 1);
  498.     break ;
  499.     case enotdecllab:
  500.     (void)fprintf(erroutput.fp, "%sLabel not declared\n", user), Putl(erroutput, 1);
  501.     break ;
  502.     case emultdecllab:
  503.     (void)fprintf(erroutput.fp, "%sLabel declared twice\n", user), Putl(erroutput, 1);
  504.     break ;
  505.     case emuldeflab:
  506.     (void)fprintf(erroutput.fp, "%sLabel defined twice\n", user), Putl(erroutput, 1);
  507.     break ;
  508.     case evarpar:
  509.     (void)fprintf(erroutput.fp, "%sActual parameter not a variable\n", user), Putl(erroutput, 1);
  510.     break ;
  511.     case enulchr:
  512.     (void)fprintf(erroutput.fp, "%sCannot handle nul-character in strings\n", restr), Putl(erroutput, 1);
  513.     break ;
  514.     case enew:
  515.     (void)fprintf(erroutput.fp, "%sNew returned a nil-pointer\n", restr), Putl(erroutput, 1);
  516.     break ;
  517.     case eoverflow:
  518.     (void)fprintf(erroutput.fp, "%sToken buffer overflowed\n", restr), Putl(erroutput, 1);
  519.     break ;
  520.     case esetbase:
  521.     (void)fprintf(erroutput.fp, "%sCannot handle sets with base >> 0\n", restr), Putl(erroutput, 1);
  522.     break ;
  523.     case esetsize:
  524.     (void)fprintf(erroutput.fp, "%sCannot handle sets with very large range\n", restr), Putl(erroutput, 1);
  525.     break ;
  526.     case etree:
  527.     (void)fprintf(erroutput.fp, "%sBad tree structure\n", inter), Putl(erroutput, 1);
  528.     break ;
  529.     case etag:
  530.     (void)fprintf(erroutput.fp, "%sCannot find tag\n", inter), Putl(erroutput, 1);
  531.     break ;
  532.     case evrntfile:
  533.     (void)fprintf(erroutput.fp, "%sCannot initialize files in record variants\n", restr), Putl(erroutput, 1);
  534.     break ;
  535.     case evarfile:
  536.     (void)fprintf(erroutput.fp, "%sCannot handle files in structured variables\n", restr), Putl(erroutput, 1);
  537.     break ;
  538.     case euprconf:
  539.     (void)fprintf(erroutput.fp, "%sNo upper bound on conformant arrays\n", inter), Putl(erroutput, 1);
  540.     break ;
  541.     case easgnconf:
  542.     (void)fprintf(erroutput.fp, "%sCannot assign conformant arrays\n", inter), Putl(erroutput, 1);
  543.     break ;
  544.     case ecmpconf:
  545.     (void)fprintf(erroutput.fp, "%sCannot compare conformant arrays\n", inter), Putl(erroutput, 1);
  546.     break ;
  547.     case econfconf:
  548.     (void)fprintf(erroutput.fp, "%sCannot handle nested conformat arrays\n", restr), Putl(erroutput, 1);
  549.     break ;
  550.     case erange:
  551.     (void)fprintf(erroutput.fp, "%sCannot find C-type for integer-subrange\n", inter), Putl(erroutput, 1);
  552.     break ;
  553.     case emanymachs:
  554.     (void)fprintf(erroutput.fp, "%sToo many machine integer types\n", restr), Putl(erroutput, 1);
  555.     break ;
  556.     case ebadmach:
  557.     (void)fprintf(erroutput.fp, "%sBad name for machine integer type\n", inter), Putl(erroutput, 1);
  558.     break ;
  559.     case eprconf:
  560.     (void)fprintf(erroutput.fp, "%sCannot write conformant arrays\n", inter), Putl(erroutput, 1);
  561.     break ;
  562.     default:
  563.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  564.   }
  565.   if (lastline != 0) {
  566.     (void)fprintf(erroutput.fp, "Line %1d, col %1d:\n", lastline, lastcol), Putl(erroutput, 1);
  567.     if (Member((unsigned)(m), Conset[0])) {
  568.       i = 1;
  569.       while (((int)(i) < xtoklen) && (lasttok.A[i - 1] != null)) {
  570.     xtok.A[i - 1] = lasttok.A[i - 1];
  571.     i = (int)(i) + 1;
  572.       }
  573.       (void)fprintf(erroutput.fp, "Current symbol: %*.64s\n", (int)(i) - 1, xtok.A), Putl(erroutput, 1);
  574.     }
  575.   }
  576. # undef xtoklen
  577. }
  578.  
  579.  
  580.  
  581.  unsigned char
  582. uppercase(unsigned char     c)
  583. {
  584.   register unsigned char    R79;
  585.  
  586.   if ((c >= 'a') && (c <= 'z'))
  587.     R79 = (unsigned)(c) + (unsigned)('A') - (unsigned)('a');
  588.   else
  589.     R79 = c;
  590.   return R79;
  591. }
  592.  
  593.  unsigned char
  594. lowercase(unsigned char     c)
  595. {
  596.   register unsigned char    R80;
  597.  
  598.   if ((c >= 'A') && (c <= 'Z'))
  599.     R80 = (unsigned)(c) - (unsigned)('A') + (unsigned)('a');
  600.   else
  601.     R80 = c;
  602.   return R80;
  603. }
  604.  
  605.  void
  606. gettokn(strindx     i, toknbuf     *t)
  607. {
  608.   unsigned char    c;
  609.   toknidx    k;
  610.   strbidx    j;
  611.   strptr    p;
  612.  
  613.   k = 1;
  614.   p = strstor.A[i / (maxstrblk + 1)];
  615.   j = i % (maxstrblk + 1);
  616.   do {
  617.     c = (*p).A[j];
  618.     (*t).A[k - 1] = c;
  619.     j = j + 1;
  620.     k = (int)(k) + 1;
  621.     if ((int)(k) == maxtoknlen) {
  622.       c = null;
  623.       (*t).A[maxtoknlen - 1] = null;
  624.       prtmsg(eoverflow);
  625.     }
  626.   } while (!(c == null));
  627. }
  628.  
  629.  void
  630. puttokn(strindx     i, toknbuf     *t)
  631. {
  632.   unsigned char    c;
  633.   toknidx    k;
  634.   strbidx    j;
  635.   strptr    p;
  636.  
  637.   k = 1;
  638.   p = strstor.A[i / (maxstrblk + 1)];
  639.   j = i % (maxstrblk + 1);
  640.   do {
  641.     c = (*t).A[k - 1];
  642.     (*p).A[j] = c;
  643.     k = (int)(k) + 1;
  644.     j = j + 1;
  645.   } while (!(c == null));
  646. }
  647.  
  648.  void
  649. writetok(toknbuf     *w)
  650. {
  651.   toknidx    j;
  652.  
  653.   j = 1;
  654.   while ((*w).A[j - 1] != null) {
  655.     Putchr((*w).A[j - 1], output);
  656.     j = (int)(j) + 1;
  657.   }
  658. }
  659.  
  660.  void
  661. printtok(strindx     i)
  662. {
  663.   toknbuf    w;
  664.  
  665.   gettokn(i, &w);
  666.   writetok(&w);
  667. }
  668.  
  669.  void
  670. printid(idptr     ip)
  671. {
  672.   printtok((*ip).istr);
  673. }
  674.  
  675.  void
  676. printchr(unsigned char     c)
  677. {
  678.   if ((c == quote) || (c == bslash))
  679.     (void)fprintf(output.fp, "%c%c%c%c", quote, bslash, c, quote), Putl(output, 0);
  680.   else
  681.     (void)fprintf(output.fp, "%c%c%c", quote, c, quote), Putl(output, 0);
  682. }
  683.  
  684.  void
  685. printstr(strindx     i)
  686. {
  687.   toknidx    k;
  688.   unsigned char    c;
  689.   toknbuf    w;
  690.  
  691.   gettokn(i, &w);
  692.   Putchr(cite, output);
  693.   k = 1;
  694.   while (w.A[k - 1] != null) {
  695.     c = w.A[k - 1];
  696.     k = (int)(k) + 1;
  697.     if ((c == cite) || (c == bslash))
  698.       Putchr(bslash, output);
  699.     Putchr(c, output);
  700.   }
  701.   Putchr(cite, output);
  702. }
  703.  
  704.  treeptr
  705. idup(treeptr     ip)
  706. {
  707.   register treeptr    R81;
  708.  
  709.   R81 = (*(*(*ip).U.V43.tsym).lsymdecl).tup;
  710.   return R81;
  711. }
  712.  
  713.  hashtyp
  714. hashtokn(toknbuf     *id)
  715. {
  716.   register hashtyp    R82;
  717.   integer    h;
  718.   toknidx    i;
  719.  
  720.   i = 1;
  721.   h = 0;
  722.   while ((*id).A[i - 1] != null) {
  723.     h = h + (unsigned)((*id).A[i - 1]);
  724.     i = (int)(i) + 1;
  725.   }
  726.   R82 = h % hashmax;
  727.   return R82;
  728. }
  729.  
  730.  strindx
  731. savestr(toknbuf     *t)
  732. {
  733.   register strindx    R83;
  734.   toknidx    k;
  735.   strindx    i;
  736.   strbcnt    j;
  737.  
  738.   k = 1;
  739.   while ((*t).A[k - 1] != null)
  740.     k = (int)(k) + 1;
  741.   if ((int)(k) > strleft) {
  742.     if (strstor.A[maxblkcnt] != (strblk *)NIL)
  743.       error(emanytokn);
  744.     j = (strfree + maxstrblk) / (maxstrblk + 1);
  745.     strstor.A[j] = (strblk *)malloc((unsigned)(sizeof(*strstor.A[j])));
  746.     if (strstor.A[j] == (strblk *)NIL)
  747.       error(enew);
  748.     strfree = (int)(j) * (maxstrblk + 1);
  749.     strleft = maxstrblk;
  750.   }
  751.   i = strfree;
  752.   strfree = strfree + (int)(k);
  753.   strleft = strleft - (int)(k);
  754.   puttokn(i, &(*t));
  755.   R83 = i;
  756.   return R83;
  757. }
  758.  
  759.  idptr
  760. saveid(toknbuf     *id)
  761. {
  762.   register idptr    R84;
  763.   toknidx    k;
  764.   idptr    ip;
  765.   hashtyp    h;
  766.   toknbuf    t;
  767.  
  768.   h = hashtokn(&(*id));
  769.   ip = idtab.A[h];
  770.   while (ip != (struct S62 *)NIL) {
  771.     gettokn((*ip).istr, &t);
  772.     k = 1;
  773.     while ((*id).A[k - 1] == t.A[k - 1])
  774.       if ((*id).A[k - 1] == null)
  775.     goto L999;
  776.       else
  777.     k = (int)(k) + 1;
  778.     ip = (*ip).inext;
  779.   }
  780.   ip = (struct S62 *)malloc((unsigned)(sizeof(*ip)));
  781.   if (ip == (struct S62 *)NIL)
  782.     error(enew);
  783.   (*ip).inref = 0;
  784.   (*ip).istr = savestr(&(*id));
  785.   (*ip).ihash = h;
  786.   (*ip).inext = idtab.A[h];
  787.   idtab.A[h] = ip;
  788. L999:
  789.   R84 = ip;
  790.   return R84;
  791. }
  792.  
  793.  idptr
  794. mkconc(unsigned char     sep, idptr     p, idptr     q)
  795. {
  796.   register idptr    R85;
  797.   toknbuf    w, x;
  798.   toknidx    i, j;
  799.  
  800.   gettokn((*q).istr, &x);
  801.   j = 1;
  802.   while (x.A[j - 1] != null)
  803.     j = (int)(j) + 1;
  804.   w.A[1 - 1] = null;
  805.   if (p != (struct S62 *)NIL)
  806.     gettokn((*p).istr, &w);
  807.   i = 1;
  808.   while (w.A[i - 1] != null)
  809.     i = (int)(i) + 1;
  810.   if ((int)((int)((int)(i) + (int)(j)) + 2) >= maxtoknlen)
  811.     error(eoverflow);
  812.   if (sep == '>') {
  813.     w.A[i - 1] = '-';
  814.     i = (int)(i) + 1;
  815.   }
  816.   if (sep != space) {
  817.     w.A[i - 1] = sep;
  818.     i = (int)(i) + 1;
  819.   }
  820.   j = 1;
  821.   do {
  822.     w.A[i - 1] = x.A[j - 1];
  823.     i = (int)(i) + 1;
  824.     j = (int)(j) + 1;
  825.   } while (!(w.A[(int)(i) - 1 - 1] == null));
  826.   R85 = saveid(&w);
  827.   return R85;
  828. }
  829.  
  830.  void
  831. dig(integer     n)
  832. {
  833.   if (n > 0) {
  834.     dig(n / 10);
  835.     if ((int)((*G183_i)) == maxtoknlen)
  836.       error(eoverflow);
  837.     (*G181_t).A[(*G183_i) - 1] = n % 10 + (unsigned)('0');
  838.     (*G183_i) = (int)((*G183_i)) + 1;
  839.   }
  840. }
  841.  
  842.  idptr
  843. mkuniqname(toknbuf     *t)
  844. {
  845.   register idptr    R86;
  846.   toknidx    i;
  847.   toknbuf    *F182;
  848.   toknidx    *F184;
  849.  
  850.   F184 = G183_i;
  851.   G183_i = &i;
  852.   F182 = G181_t;
  853.   G181_t = &(*t);
  854.   (*G183_i) = 1;
  855.   while ((*G181_t).A[(*G183_i) - 1] != null)
  856.     (*G183_i) = (int)((*G183_i)) + 1;
  857.   varno = varno + 1;
  858.   dig(varno);
  859.   (*G181_t).A[(*G183_i) - 1] = null;
  860.   R86 = saveid(&(*G181_t));
  861.   G181_t = F182;
  862.   G183_i = F184;
  863.   return R86;
  864. }
  865.  
  866.  idptr
  867. mkvariable(unsigned char     c)
  868. {
  869.   register idptr    R87;
  870.   toknbuf    t;
  871.  
  872.   t.A[1 - 1] = c;
  873.   t.A[2 - 1] = null;
  874.   R87 = mkuniqname(&t);
  875.   return R87;
  876. }
  877.  
  878.  idptr
  879. mkrename(unsigned char     c, idptr     ip)
  880. {
  881.   register idptr    R88;
  882.  
  883.   R88 = mkconc(uscore, mkvariable(c), ip);
  884.   return R88;
  885. }
  886.  
  887.  idptr
  888. mkvrnt(void)
  889. {
  890.   register idptr    R89;
  891.   toknbuf    t;
  892.  
  893.   t.A[1 - 1] = 'U';
  894.   t.A[2 - 1] = '.';
  895.   t.A[3 - 1] = 'V';
  896.   t.A[4 - 1] = null;
  897.   R89 = mkuniqname(&t);
  898.   return R89;
  899. }
  900.  
  901.  void
  902. checksymbol(symset     ss)
  903. {
  904.   if (!(Member((unsigned)(currsym.st), ss.S)))
  905.     error(ebadsymbol);
  906. }
  907.  
  908.  unsigned char
  909. nextchar(void)
  910. {
  911.   register unsigned char    R90;
  912.   unsigned char    c;
  913.  
  914.   if (pushed) {
  915.     c = pushchr;
  916.     pushed = false;
  917.   } else
  918.     if (Eofx(input))
  919.       c = null;
  920.     else {
  921.       colno = colno + 1;
  922.       if (Eoln(input)) {
  923.     lineno = lineno + 1;
  924.     colno = 0;
  925.       }
  926.       {c = Getchr(input);}
  927.       if (c == tab)
  928.     colno = (((colno - 1) / tabwidth) + 1) * tabwidth;
  929.     }
  930.   if ((int)((*G186_lastchr)) > 0) {
  931.     lasttok.A[(*G186_lastchr) - 1] = c;
  932.     (*G186_lastchr) = (int)((*G186_lastchr)) + 1;
  933.   }
  934.   R90 = c;
  935.   return R90;
  936. }
  937.  
  938.  unsigned char
  939. peekchar(void)
  940. {
  941.   register unsigned char    R91;
  942.  
  943.   if (pushed)
  944.     R91 = pushchr;
  945.   else
  946.     if (Eofx(input))
  947.       R91 = null;
  948.     else
  949.       R91 = Bufx(input);
  950.   return R91;
  951. }
  952.  
  953.  boolean
  954. idchar(unsigned char     c)
  955. {
  956.   register boolean    R92;
  957.  
  958.   R92 = (boolean)((c >= 'a') && (c <= 'z') || (c >= '0') && (c <= '9') || (c >= 'A') && (c <= 'Z') || (c == uscore));
  959.   return R92;
  960. }
  961.  
  962.  boolean
  963. numchar(unsigned char     c)
  964. {
  965.   register boolean    R93;
  966.  
  967.   R93 = (boolean)((c >= '0') && (c <= '9'));
  968.   return R93;
  969. }
  970.  
  971.  integer
  972. numval(unsigned char     c)
  973. {
  974.   register integer    R94;
  975.  
  976.   R94 = (unsigned)(c) - (unsigned)('0');
  977.   return R94;
  978. }
  979.  
  980.  symtyp
  981. keywordcheck(toknbuf     *w, toknidx     l)
  982. {
  983.   register symtyp    R95;
  984.   register unsigned char    n;
  985.   unsigned char    i, j, k;
  986.   keyword    wrd;
  987.   symtyp    kwc;
  988.  
  989.   if (((int)(l) > 1) && ((int)(l) < keywordlen)) {
  990.     wrd = keytab.A[keytablen].wrd;
  991.     {
  992.       unsigned char    B44 = 1,
  993.           B45 = l;
  994.  
  995.       if (B44 <= B45)
  996.     for (n = B44; ; n++) {
  997.       wrd.A[n - 1] = (*w).A[n - 1];
  998.       if (n == B45) break;
  999.     }
  1000.     }
  1001.     i = 0;
  1002.     j = keytablen;
  1003.     while ((int)(j) > (int)(i)) {
  1004.       k = (int)(((int)(i) + (int)(j))) / 2;
  1005.       if (Cmpstr(keytab.A[k].wrd.A, wrd.A) >= 0)
  1006.     j = k;
  1007.       else
  1008.     i = (int)(k) + 1;
  1009.     }
  1010.     if (Cmpstr(keytab.A[j].wrd.A, wrd.A) == 0)
  1011.       kwc = keytab.A[j].sym;
  1012.     else
  1013.       kwc = sid;
  1014.   } else
  1015.     kwc = sid;
  1016.   R95 = kwc;
  1017.   return R95;
  1018. }
  1019.  
  1020.  void
  1021. nexttoken(boolean     realok)
  1022. {
  1023.   unsigned char    c;
  1024.   integer    n;
  1025.   boolean    ready;
  1026.   unsigned char    wl;
  1027.   toknbuf    wb;
  1028.  
  1029.   (*G186_lastchr) = 0;
  1030.   do {
  1031.     c = nextchar();
  1032.     if (c == '{') {
  1033.       do {
  1034.     c = nextchar();
  1035.     if (diffcomm)
  1036.       ready = (boolean)(c == '}');
  1037.     else
  1038.       ready = (boolean)(((c == '*') && (peekchar() == ')')) || (c == '}'));
  1039.       } while (!(ready || Eofx(input)));
  1040.       if (Eofx(input) && !ready)
  1041.     error(eeofcmnt);
  1042.       if ((c == '*') && !Eofx(input))
  1043.     c = nextchar();
  1044.       c = space;
  1045.     } else
  1046.       if ((c == '(') && (peekchar() == '*')) {
  1047.     c = nextchar();
  1048.     do {
  1049.       c = nextchar();
  1050.       if (diffcomm)
  1051.         ready = (boolean)((c == '*') && (peekchar() == ')'));
  1052.       else
  1053.         ready = (boolean)(((c == '*') && (peekchar() == ')')) || (c == '}'));
  1054.     } while (!(ready || Eofx(input)));
  1055.     if (Eofx(input) && !ready)
  1056.       error(eeofcmnt);
  1057.     if ((c == '*') && !Eofx(input))
  1058.       c = nextchar();
  1059.     c = space;
  1060.       }
  1061.   } while (!((c != space) && (c != tab)));
  1062.   lasttok.A[1 - 1] = c;
  1063.   (*G186_lastchr) = 2;
  1064.   lastcol = colno;
  1065.   lastline = lineno;
  1066.   if (c < okchr)
  1067.     c = badchr;
  1068.   {
  1069.     register struct S185 *W46 = &currsym;
  1070.  
  1071.     if (Eofx(input)) {
  1072.       lasttok.A[1 - 1] = '*';
  1073.       lasttok.A[2 - 1] = 'E';
  1074.       lasttok.A[3 - 1] = 'O';
  1075.       lasttok.A[4 - 1] = 'F';
  1076.       lasttok.A[5 - 1] = '*';
  1077.       (*G186_lastchr) = 6;
  1078.       W46->st = seof;
  1079.     } else
  1080.       switch ((int)(c)) {
  1081.         case '|':  case '`':  case '~':  case '}':
  1082.         case 92:  case 95:  case 63:
  1083.     error(ebadchar);
  1084.     break ;
  1085.         case 'a':  case 'b':  case 'c':  case 'd':
  1086.         case 'e':  case 'f':  case 'g':  case 'h':
  1087.         case 'i':  case 'j':  case 'k':  case 'l':
  1088.         case 'm':  case 'n':  case 'o':  case 'p':
  1089.         case 'q':  case 'r':  case 's':  case 't':
  1090.         case 'u':  case 'v':  case 'w':  case 'x':
  1091.         case 'y':  case 'z':  case 'A':  case 'B':
  1092.         case 'C':  case 'D':  case 'E':  case 'F':
  1093.         case 'G':  case 'H':  case 'I':  case 'J':
  1094.         case 'K':  case 'L':  case 'M':  case 'N':
  1095.         case 'O':  case 'P':  case 'Q':  case 'R':
  1096.         case 'S':  case 'T':  case 'U':  case 'V':
  1097.         case 'W':  case 'X':  case 'Y':  case 'Z':
  1098.     wb.A[1 - 1] = lowercase(c);
  1099.     wl = 2;
  1100.     while (((int)(wl) < maxtoknlen) && idchar(peekchar())) {
  1101.       wb.A[wl - 1] = lowercase(nextchar());
  1102.       wl = (int)(wl) + 1;
  1103.     }
  1104.     if ((int)(wl) >= maxtoknlen) {
  1105.       lasttok.A[(*G186_lastchr) - 1] = null;
  1106.       error(elongtokn);
  1107.     }
  1108.     wb.A[wl - 1] = null;
  1109.     W46->st = keywordcheck(&wb, (int)(wl) - 1);
  1110.     if (W46->st == sid)
  1111.       W46->U.V1.vid = saveid(&wb);
  1112.     break ;
  1113.         case '0':  case '1':  case '2':  case '3':
  1114.         case '4':  case '5':  case '6':  case '7':
  1115.         case '8':  case '9':
  1116.     wb.A[1 - 1] = c;
  1117.     wl = 2;
  1118.     n = numval(c);
  1119.     while (numchar(peekchar())) {
  1120.       c = nextchar();
  1121.       n = n * 10 + numval(c);
  1122.       wb.A[wl - 1] = c;
  1123.       wl = (int)(wl) + 1;
  1124.     }
  1125.     W46->st = sinteger;
  1126.     W46->U.V3.vint = n;
  1127.     if (realok && (peekchar() == '.')) {
  1128.       c = nextchar();
  1129.       realok = numchar(peekchar());
  1130.       pushchr = c;
  1131.       pushed = true;
  1132.     }
  1133.     if (realok) {
  1134.       if (peekchar() == '.') {
  1135.         W46->st = sreal;
  1136.         wb.A[wl - 1] = nextchar();
  1137.         wl = (int)(wl) + 1;
  1138.         while (numchar(peekchar())) {
  1139.           wb.A[wl - 1] = nextchar();
  1140.           wl = (int)(wl) + 1;
  1141.         }
  1142.       }
  1143.       c = peekchar();
  1144.       if ((c == 'e') || (c == 'E')) {
  1145.         W46->st = sreal;
  1146.         c = nextchar();
  1147.         wb.A[wl - 1] = xpnent;
  1148.         wl = (int)(wl) + 1;
  1149.         c = peekchar();
  1150.         if ((c == '-') || (c == '+')) {
  1151.           wb.A[wl - 1] = nextchar();
  1152.           wl = (int)(wl) + 1;
  1153.         }
  1154.         while (numchar(peekchar())) {
  1155.           wb.A[wl - 1] = nextchar();
  1156.           wl = (int)(wl) + 1;
  1157.         }
  1158.       }
  1159.       if (W46->st == sreal) {
  1160.         wb.A[wl - 1] = null;
  1161.         W46->U.V4.vflt = savestr(&wb);
  1162.       }
  1163.     }
  1164.     break ;
  1165.         case '(':
  1166.     if (peekchar() == '.') {
  1167.       c = nextchar();
  1168.       W46->st = slbrack;
  1169.     } else
  1170.       W46->st = slpar;
  1171.     break ;
  1172.         case ')':
  1173.     W46->st = srpar;
  1174.     break ;
  1175.         case '[':
  1176.     W46->st = slbrack;
  1177.     break ;
  1178.         case ']':
  1179.     W46->st = srbrack;
  1180.     break ;
  1181.         case '.':
  1182.     if (peekchar() == '.') {
  1183.       c = nextchar();
  1184.       W46->st = sdotdot;
  1185.     } else
  1186.       if (peekchar() == ')') {
  1187.         c = nextchar();
  1188.         W46->st = srbrack;
  1189.       } else
  1190.         W46->st = sdot;
  1191.     break ;
  1192.         case ';':
  1193.     W46->st = ssemic;
  1194.     break ;
  1195.         case ':':
  1196.     if (peekchar() == '=') {
  1197.       c = nextchar();
  1198.       W46->st = sassign;
  1199.     } else
  1200.       W46->st = scolon;
  1201.     break ;
  1202.         case ',':
  1203.     W46->st = scomma;
  1204.     break ;
  1205.         case '@':  case '^':
  1206.     W46->st = sarrow;
  1207.     break ;
  1208.         case '=':
  1209.     W46->st = seq;
  1210.     break ;
  1211.         case '<':
  1212.     if (peekchar() == '=') {
  1213.       c = nextchar();
  1214.       W46->st = sle;
  1215.     } else
  1216.       if (peekchar() == '>') {
  1217.         c = nextchar();
  1218.         W46->st = sne;
  1219.       } else
  1220.         W46->st = slt;
  1221.     break ;
  1222.         case '>':
  1223.     if (peekchar() == '=') {
  1224.       c = nextchar();
  1225.       W46->st = sge;
  1226.     } else
  1227.       W46->st = sgt;
  1228.     break ;
  1229.         case '+':
  1230.     W46->st = splus;
  1231.     break ;
  1232.         case '-':
  1233.     W46->st = sminus;
  1234.     break ;
  1235.         case '*':
  1236.     W46->st = smul;
  1237.     break ;
  1238.         case '/':
  1239.     W46->st = squot;
  1240.     break ;
  1241.         case 39:
  1242.     wl = 1;
  1243.     ready = false;
  1244.     do {
  1245.       if (Eoln(input)) {
  1246.         lasttok.A[(*G186_lastchr) - 1] = null;
  1247.         error(ebadstring);
  1248.       }
  1249.       c = nextchar();
  1250.       if (c == quote)
  1251.         if (peekchar() == quote)
  1252.           c = nextchar();
  1253.         else
  1254.           ready = true;
  1255.       if (c == null) {
  1256.         if (Eofx(input))
  1257.           error(eeofstr);
  1258.         lasttok.A[(*G186_lastchr) - 1] = null;
  1259.         error(enulchr);
  1260.       }
  1261.       if (!ready) {
  1262.         wb.A[wl - 1] = c;
  1263.         if ((int)(wl) >= maxtoknlen) {
  1264.           lasttok.A[(*G186_lastchr) - 1] = null;
  1265.           error(elongstring);
  1266.         }
  1267.         wl = (int)(wl) + 1;
  1268.       }
  1269.     } while (!(ready));
  1270.     if ((int)(wl) == 2) {
  1271.       W46->st = schar;
  1272.       W46->U.V2.vchr = wb.A[1 - 1];
  1273.     } else {
  1274.       wb.A[wl - 1] = null;
  1275.       W46->st = sstring;
  1276.       W46->U.V5.vstr = savestr(&wb);
  1277.     }
  1278.     break ;
  1279.         default:
  1280.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1281.       }
  1282.   }
  1283.   if ((int)((*G186_lastchr)) == 0)
  1284.     (*G186_lastchr) = 1;
  1285.   lasttok.A[(*G186_lastchr) - 1] = null;
  1286. }
  1287.  
  1288.  void
  1289. nextsymbol(symset     ss)
  1290. {
  1291.   unsigned char    lastchr;
  1292.   unsigned char    *F187;
  1293.  
  1294.   F187 = G186_lastchr;
  1295.   G186_lastchr = &lastchr;
  1296.   nexttoken((boolean)(Member((unsigned)(sreal), ss.S)));
  1297.   checksymbol(ss);
  1298.   G186_lastchr = F187;
  1299. }
  1300.  
  1301.  treeptr
  1302. typeof(treeptr     tp)
  1303. {
  1304.   register treeptr    R96;
  1305.   treeptr    tf, tq;
  1306.  
  1307.   tq = tp;
  1308.   tf = (*tq).ttype;
  1309.   while (tf == (struct S64 *)NIL) {
  1310.     switch ((int)((*tq).tt)) {
  1311.       case nchar:
  1312.       tf = typnods.A[(int)(tchar)];
  1313.       break ;
  1314.       case ninteger:
  1315.       tf = typnods.A[(int)(tinteger)];
  1316.       break ;
  1317.       case nreal:
  1318.       tf = typnods.A[(int)(treal)];
  1319.       break ;
  1320.       case nstring:
  1321.       tf = typnods.A[(int)(tstring)];
  1322.       break ;
  1323.       case nnil:
  1324.       tf = typnods.A[(int)(tnil)];
  1325.       break ;
  1326.       case nid:
  1327.       tq = idup(tq);
  1328.       if (tq == (struct S64 *)NIL)
  1329.     fatal(etree);
  1330.       break ;
  1331.       case ntype:  case nvar:  case nconst:  case nfield:
  1332.       case nvalpar:  case nvarpar:
  1333.       tq = (*tq).U.V14.tbind;
  1334.       break ;
  1335.       case npredef:  case nptr:  case nscalar:  case nrecord:
  1336.       case nconfarr:  case narray:  case nfileof:  case nsetof:
  1337.       tf = tq;
  1338.       break ;
  1339.       case nsubrange:
  1340.       if ((*(*tq).tup).tt == nconfarr)
  1341.     tf = (*(*tq).tup).U.V22.tindtyp;
  1342.       else
  1343.     tf = tq;
  1344.       break ;
  1345.       case ncall:
  1346.       tf = typeof((*tq).U.V30.tcall);
  1347.       if (tf == typnods.A[(int)(tpoly)])
  1348.     tf = typeof((*tq).U.V30.taparm);
  1349.       break ;
  1350.       case nfunc:
  1351.       tq = (*tq).U.V13.tfuntyp;
  1352.       break ;
  1353.       case nparfunc:
  1354.       tq = (*tq).U.V15.tpartyp;
  1355.       break ;
  1356.       case nproc:  case nparproc:
  1357.       tf = typnods.A[(int)(tnone)];
  1358.       break ;
  1359.       case nvariant:  case nlabel:  case npgm:  case nempty:
  1360.       case nbegin:  case nlabstmt:  case nassign:  case npush:
  1361.       case npop:  case nif:  case nwhile:  case nrepeat:
  1362.       case nfor:  case ncase:  case nchoise:  case ngoto:
  1363.       case nwith:  case nwithvar:
  1364.       fatal(etree);
  1365.       break ;
  1366.       case nformat:  case nrange:
  1367.       tq = (*tq).U.V41.texpl;
  1368.       break ;
  1369.       case nplus:  case nminus:  case nmul:
  1370.       tf = typeof((*tq).U.V41.texpl);
  1371.       if (tf == typnods.A[(int)(tinteger)])
  1372.     tf = typeof((*tq).U.V41.texpr);
  1373.       else
  1374.     if ((*tf).tt == nsetof)
  1375.       tf = typnods.A[(int)(tset)];
  1376.       break ;
  1377.       case numinus:  case nuplus:
  1378.       tq = (*tq).U.V42.texps;
  1379.       break ;
  1380.       case nmod:  case ndiv:
  1381.       tf = typnods.A[(int)(tinteger)];
  1382.       break ;
  1383.       case nquot:
  1384.       tf = typnods.A[(int)(treal)];
  1385.       break ;
  1386.       case neq:  case nne:  case nlt:  case nle:
  1387.       case ngt:  case nge:  case nin:  case nor:
  1388.       case nand:  case nnot:
  1389.       tf = typnods.A[(int)(tboolean)];
  1390.       break ;
  1391.       case nset:
  1392.       tf = typnods.A[(int)(tset)];
  1393.       break ;
  1394.       case nselect:
  1395.       tq = (*tq).U.V40.tfield;
  1396.       break ;
  1397.       case nderef:
  1398.       tq = typeof((*tq).U.V42.texps);
  1399.       switch ((int)((*tq).tt)) {
  1400.         case nptr:
  1401.     tq = (*tq).U.V16.tptrid;
  1402.     break ;
  1403.         case nfileof:
  1404.     tq = (*tq).U.V18.tof;
  1405.     break ;
  1406.         case npredef:
  1407.     tf = typnods.A[(int)(tchar)];
  1408.     break ;
  1409.         default:
  1410.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1411.       }
  1412.       break ;
  1413.       case nindex:
  1414.       tq = typeof((*tq).U.V39.tvariable);
  1415.       if ((*tq).tt == nconfarr)
  1416.     tq = (*tq).U.V22.tcelem;
  1417.       else
  1418.     if (tq == typnods.A[(int)(tstring)])
  1419.       tf = typnods.A[(int)(tchar)];
  1420.     else
  1421.       tq = (*tq).U.V23.taelem;
  1422.       break ;
  1423.       default:
  1424.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1425.     }
  1426.   }
  1427.   if ((*tp).ttype == (struct S64 *)NIL)
  1428.     (*tp).ttype = tf;
  1429.   R96 = tf;
  1430.   return R96;
  1431. }
  1432.  
  1433.  void
  1434. linkup(treeptr     up, treeptr     tp)
  1435. {
  1436.   while (tp != (struct S64 *)NIL) {
  1437.     if ((*tp).tup == (struct S64 *)NIL) {
  1438.       (*tp).tup = up;
  1439.       switch ((int)((*tp).tt)) {
  1440.         case npgm:  case nfunc:  case nproc:
  1441.     linkup(tp, (*tp).U.V13.tsubid);
  1442.     linkup(tp, (*tp).U.V13.tsubpar);
  1443.     linkup(tp, (*tp).U.V13.tfuntyp);
  1444.     linkup(tp, (*tp).U.V13.tsublab);
  1445.     linkup(tp, (*tp).U.V13.tsubconst);
  1446.     linkup(tp, (*tp).U.V13.tsubtype);
  1447.     linkup(tp, (*tp).U.V13.tsubvar);
  1448.     linkup(tp, (*tp).U.V13.tsubsub);
  1449.     linkup(tp, (*tp).U.V13.tsubstmt);
  1450.     break ;
  1451.         case nvalpar:  case nvarpar:  case nconst:  case ntype:
  1452.         case nfield:  case nvar:
  1453.     linkup(tp, (*tp).U.V14.tidl);
  1454.     linkup(tp, (*tp).U.V14.tbind);
  1455.     break ;
  1456.         case nparproc:  case nparfunc:
  1457.     linkup(tp, (*tp).U.V15.tparid);
  1458.     linkup(tp, (*tp).U.V15.tparparm);
  1459.     linkup(tp, (*tp).U.V15.tpartyp);
  1460.     break ;
  1461.         case nptr:
  1462.     linkup(tp, (*tp).U.V16.tptrid);
  1463.     break ;
  1464.         case nscalar:
  1465.     linkup(tp, (*tp).U.V17.tscalid);
  1466.     break ;
  1467.         case nsubrange:
  1468.     linkup(tp, (*tp).U.V19.tlo);
  1469.     linkup(tp, (*tp).U.V19.thi);
  1470.     break ;
  1471.         case nvariant:
  1472.     linkup(tp, (*tp).U.V20.tselct);
  1473.     linkup(tp, (*tp).U.V20.tvrnt);
  1474.     break ;
  1475.         case nrecord:
  1476.     linkup(tp, (*tp).U.V21.tflist);
  1477.     linkup(tp, (*tp).U.V21.tvlist);
  1478.     break ;
  1479.         case nconfarr:
  1480.     linkup(tp, (*tp).U.V22.tcindx);
  1481.     linkup(tp, (*tp).U.V22.tcelem);
  1482.     linkup(tp, (*tp).U.V22.tindtyp);
  1483.     break ;
  1484.         case narray:
  1485.     linkup(tp, (*tp).U.V23.taindx);
  1486.     linkup(tp, (*tp).U.V23.taelem);
  1487.     break ;
  1488.         case nfileof:  case nsetof:
  1489.     linkup(tp, (*tp).U.V18.tof);
  1490.     break ;
  1491.         case nbegin:
  1492.     linkup(tp, (*tp).U.V24.tbegin);
  1493.     break ;
  1494.         case nlabstmt:
  1495.     linkup(tp, (*tp).U.V25.tlabno);
  1496.     linkup(tp, (*tp).U.V25.tstmt);
  1497.     break ;
  1498.         case nassign:
  1499.     linkup(tp, (*tp).U.V27.tlhs);
  1500.     linkup(tp, (*tp).U.V27.trhs);
  1501.     break ;
  1502.         case npush:  case npop:
  1503.     linkup(tp, (*tp).U.V28.tglob);
  1504.     linkup(tp, (*tp).U.V28.tloc);
  1505.     linkup(tp, (*tp).U.V28.ttmp);
  1506.     break ;
  1507.         case ncall:
  1508.     linkup(tp, (*tp).U.V30.tcall);
  1509.     linkup(tp, (*tp).U.V30.taparm);
  1510.     break ;
  1511.         case nif:
  1512.     linkup(tp, (*tp).U.V31.tifxp);
  1513.     linkup(tp, (*tp).U.V31.tthen);
  1514.     linkup(tp, (*tp).U.V31.telse);
  1515.     break ;
  1516.         case nwhile:
  1517.     linkup(tp, (*tp).U.V32.twhixp);
  1518.     linkup(tp, (*tp).U.V32.twhistmt);
  1519.     break ;
  1520.         case nrepeat:
  1521.     linkup(tp, (*tp).U.V33.treptstmt);
  1522.     linkup(tp, (*tp).U.V33.treptxp);
  1523.     break ;
  1524.         case nfor:
  1525.     linkup(tp, (*tp).U.V34.tforid);
  1526.     linkup(tp, (*tp).U.V34.tfrom);
  1527.     linkup(tp, (*tp).U.V34.tto);
  1528.     linkup(tp, (*tp).U.V34.tforstmt);
  1529.     break ;
  1530.         case ncase:
  1531.     linkup(tp, (*tp).U.V35.tcasxp);
  1532.     linkup(tp, (*tp).U.V35.tcaslst);
  1533.     linkup(tp, (*tp).U.V35.tcasother);
  1534.     break ;
  1535.         case nchoise:
  1536.     linkup(tp, (*tp).U.V36.tchocon);
  1537.     linkup(tp, (*tp).U.V36.tchostmt);
  1538.     break ;
  1539.         case nwith:
  1540.     linkup(tp, (*tp).U.V37.twithvar);
  1541.     linkup(tp, (*tp).U.V37.twithstmt);
  1542.     break ;
  1543.         case nwithvar:
  1544.     linkup(tp, (*tp).U.V38.texpw);
  1545.     break ;
  1546.         case nindex:
  1547.     linkup(tp, (*tp).U.V39.tvariable);
  1548.     linkup(tp, (*tp).U.V39.toffset);
  1549.     break ;
  1550.         case nselect:
  1551.     linkup(tp, (*tp).U.V40.trecord);
  1552.     linkup(tp, (*tp).U.V40.tfield);
  1553.     break ;
  1554.         case ngoto:
  1555.     linkup(tp, (*tp).U.V26.tlabel);
  1556.     break ;
  1557.         case nrange:  case nformat:  case nin:  case neq:
  1558.         case nne:  case nlt:  case nle:  case ngt:
  1559.         case nge:  case nor:  case nplus:  case nminus:
  1560.         case nand:  case nmul:  case ndiv:  case nmod:
  1561.         case nquot:
  1562.     linkup(tp, (*tp).U.V41.texpl);
  1563.     linkup(tp, (*tp).U.V41.texpr);
  1564.     break ;
  1565.         case nderef:  case nnot:  case nset:  case numinus:
  1566.         case nuplus:
  1567.     linkup(tp, (*tp).U.V42.texps);
  1568.     break ;
  1569.         case nid:  case nnil:  case ninteger:  case nreal:
  1570.         case nchar:  case nstring:  case npredef:  case nlabel:
  1571.         case nempty:
  1572.     break ;
  1573.         default:
  1574.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1575.       }
  1576.     }
  1577.     tp = (*tp).tnext;
  1578.   }
  1579. }
  1580.  
  1581.  symptr
  1582. mksym(ltypes     vt)
  1583. {
  1584.   register symptr    R97;
  1585.   symptr    mp;
  1586.  
  1587.   mp = (struct S65 *)malloc((unsigned)(sizeof(*mp)));
  1588.   if (mp == (struct S65 *)NIL)
  1589.     error(enew);
  1590.   (*mp).lt = vt;
  1591.   (*mp).lnext = (struct S65 *)NIL;
  1592.   (*mp).lsymdecl = (struct S64 *)NIL;
  1593.   (*mp).ldecl = (struct S63 *)NIL;
  1594.   R97 = mp;
  1595.   return R97;
  1596. }
  1597.  
  1598.  void
  1599. declsym(symptr     sp)
  1600. {
  1601.   hashtyp    h;
  1602.  
  1603.   if (Member((unsigned)((*sp).lt), Conset[1]))
  1604.     h = (*(*sp).U.V6.lid).ihash;
  1605.   else
  1606.     h = hashmax;
  1607.   (*sp).lnext = (*symtab).ddecl.A[h];
  1608.   (*symtab).ddecl.A[h] = sp;
  1609.   (*sp).ldecl = symtab;
  1610. }
  1611.  
  1612.  treeptr
  1613. mknode(treetyp     nt)
  1614. {
  1615.   register treeptr    R98;
  1616.   treeptr    tp;
  1617.  
  1618.   tp = (struct S64 *)NIL;
  1619.   switch ((int)(nt)) {
  1620.     case npredef:
  1621.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V12.tdef) + sizeof(tp->U.V12)));
  1622.     break ;
  1623.     case npgm:
  1624.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V13.tsubid) + sizeof(tp->U.V13)));
  1625.     break ;
  1626.     case nfunc:
  1627.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V13.tsubid) + sizeof(tp->U.V13)));
  1628.     break ;
  1629.     case nproc:
  1630.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V13.tsubid) + sizeof(tp->U.V13)));
  1631.     break ;
  1632.     case nlabel:
  1633.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1634.     break ;
  1635.     case nconst:
  1636.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1637.     break ;
  1638.     case ntype:
  1639.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1640.     break ;
  1641.     case nvar:
  1642.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1643.     break ;
  1644.     case nvalpar:
  1645.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1646.     break ;
  1647.     case nvarpar:
  1648.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1649.     break ;
  1650.     case nparproc:
  1651.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V15.tparid) + sizeof(tp->U.V15)));
  1652.     break ;
  1653.     case nparfunc:
  1654.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V15.tparid) + sizeof(tp->U.V15)));
  1655.     break ;
  1656.     case nsubrange:
  1657.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V19.tlo) + sizeof(tp->U.V19)));
  1658.     break ;
  1659.     case nvariant:
  1660.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V20.tselct) + sizeof(tp->U.V20)));
  1661.     break ;
  1662.     case nfield:
  1663.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V14.tidl) + sizeof(tp->U.V14)));
  1664.     break ;
  1665.     case nrecord:
  1666.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V21.tflist) + sizeof(tp->U.V21)));
  1667.     break ;
  1668.     case nconfarr:
  1669.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V22.tcindx) + sizeof(tp->U.V22)));
  1670.     break ;
  1671.     case narray:
  1672.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V23.taindx) + sizeof(tp->U.V23)));
  1673.     break ;
  1674.     case nfileof:
  1675.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V18.tof) + sizeof(tp->U.V18)));
  1676.     break ;
  1677.     case nsetof:
  1678.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V18.tof) + sizeof(tp->U.V18)));
  1679.     break ;
  1680.     case nbegin:
  1681.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V24.tbegin) + sizeof(tp->U.V24)));
  1682.     break ;
  1683.     case nptr:
  1684.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V16.tptrid) + sizeof(tp->U.V16)));
  1685.     break ;
  1686.     case nscalar:
  1687.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V17.tscalid) + sizeof(tp->U.V17)));
  1688.     break ;
  1689.     case nif:
  1690.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V31.tifxp) + sizeof(tp->U.V31)));
  1691.     break ;
  1692.     case nwhile:
  1693.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V32.twhixp) + sizeof(tp->U.V32)));
  1694.     break ;
  1695.     case nrepeat:
  1696.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V33.treptstmt) + sizeof(tp->U.V33)));
  1697.     break ;
  1698.     case nfor:
  1699.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V34.tforid) + sizeof(tp->U.V34)));
  1700.     break ;
  1701.     case ncase:
  1702.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V35.tcasxp) + sizeof(tp->U.V35)));
  1703.     break ;
  1704.     case nchoise:
  1705.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V36.tchocon) + sizeof(tp->U.V36)));
  1706.     break ;
  1707.     case ngoto:
  1708.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V26.tlabel) + sizeof(tp->U.V26)));
  1709.     break ;
  1710.     case nwith:
  1711.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V37.twithvar) + sizeof(tp->U.V37)));
  1712.     break ;
  1713.     case nwithvar:
  1714.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V38.texpw) + sizeof(tp->U.V38)));
  1715.     break ;
  1716.     case nempty:
  1717.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V12.tdef)));
  1718.     break ;
  1719.     case nlabstmt:
  1720.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V25.tlabno) + sizeof(tp->U.V25)));
  1721.     break ;
  1722.     case nassign:
  1723.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V27.tlhs) + sizeof(tp->U.V27)));
  1724.     break ;
  1725.     case nformat:
  1726.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1727.     break ;
  1728.     case nin:
  1729.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1730.     break ;
  1731.     case neq:
  1732.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1733.     break ;
  1734.     case nne:
  1735.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1736.     break ;
  1737.     case nlt:
  1738.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1739.     break ;
  1740.     case nle:
  1741.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1742.     break ;
  1743.     case ngt:
  1744.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1745.     break ;
  1746.     case nge:
  1747.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1748.     break ;
  1749.     case nor:
  1750.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1751.     break ;
  1752.     case nplus:
  1753.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1754.     break ;
  1755.     case nminus:
  1756.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1757.     break ;
  1758.     case nand:
  1759.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1760.     break ;
  1761.     case nmul:
  1762.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1763.     break ;
  1764.     case ndiv:
  1765.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1766.     break ;
  1767.     case nmod:
  1768.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1769.     break ;
  1770.     case nquot:
  1771.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1772.     break ;
  1773.     case nnot:
  1774.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V42.tisassigndest) + sizeof(tp->U.V42)));
  1775.     break ;
  1776.     case numinus:
  1777.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V42.tisassigndest) + sizeof(tp->U.V42)));
  1778.     break ;
  1779.     case nuplus:
  1780.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V42.tisassigndest) + sizeof(tp->U.V42)));
  1781.     break ;
  1782.     case nset:
  1783.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V42.tisassigndest) + sizeof(tp->U.V42)));
  1784.     break ;
  1785.     case nrange:
  1786.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V41.texpl) + sizeof(tp->U.V41)));
  1787.     break ;
  1788.     case nindex:
  1789.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V39.tvariable) + sizeof(tp->U.V39)));
  1790.     break ;
  1791.     case nselect:
  1792.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V40.trecord) + sizeof(tp->U.V40)));
  1793.     break ;
  1794.     case nderef:
  1795.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V42.tisassigndest) + sizeof(tp->U.V42)));
  1796.     break ;
  1797.     case ncall:
  1798.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V30.tcall) + sizeof(tp->U.V30)));
  1799.     break ;
  1800.     case nid:
  1801.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1802.     break ;
  1803.     case nchar:
  1804.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1805.     break ;
  1806.     case ninteger:
  1807.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1808.     break ;
  1809.     case nreal:
  1810.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1811.     break ;
  1812.     case nstring:
  1813.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V43.tsym) + sizeof(tp->U.V43)));
  1814.     break ;
  1815.     case nnil:
  1816.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V12.tdef)));
  1817.     break ;
  1818.     case npush:
  1819.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V28.tglob) + sizeof(tp->U.V28)));
  1820.     break ;
  1821.     case npop:
  1822.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V28.tglob) + sizeof(tp->U.V28)));
  1823.     break ;
  1824.     case nbreak:
  1825.     tp = (struct S64 *)malloc((unsigned)(Unionoffs(tp, U.V29.tbrkid) + sizeof(tp->U.V29)));
  1826.     break ;
  1827.     default:
  1828.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1829.   }
  1830.   if (tp == (struct S64 *)NIL)
  1831.     error(enew);
  1832.   (*tp).tt = nt;
  1833.   (*tp).tnext = (struct S64 *)NIL;
  1834.   (*tp).tup = (struct S64 *)NIL;
  1835.   (*tp).ttype = (struct S64 *)NIL;
  1836.   R98 = tp;
  1837.   return R98;
  1838. }
  1839.  
  1840.  treeptr
  1841. mklit(void)
  1842. {
  1843.   register treeptr    R99;
  1844.   symptr    sp;
  1845.   treeptr    tp;
  1846.  
  1847.   switch ((int)(currsym.st)) {
  1848.     case sinteger:
  1849.     sp = mksym(linteger);
  1850.     (*sp).U.V10.linum = currsym.U.V3.vint;
  1851.     tp = mknode(ninteger);
  1852.     break ;
  1853.     case sreal:
  1854.     sp = mksym(lreal);
  1855.     (*sp).U.V8.lfloat = currsym.U.V4.vflt;
  1856.     tp = mknode(nreal);
  1857.     break ;
  1858.     case schar:
  1859.     sp = mksym(lcharacter);
  1860.     (*sp).U.V11.lchar = currsym.U.V2.vchr;
  1861.     tp = mknode(nchar);
  1862.     break ;
  1863.     case sstring:
  1864.     sp = mksym(lstring);
  1865.     (*sp).U.V7.lstr = currsym.U.V5.vstr;
  1866.     tp = mknode(nstring);
  1867.     break ;
  1868.     default:
  1869.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  1870.   }
  1871.   (*tp).U.V43.tsym = sp;
  1872.   (*sp).lsymdecl = tp;
  1873.   R99 = tp;
  1874.   return R99;
  1875. }
  1876.  
  1877.  symptr
  1878. lookupid(idptr     ip, boolean     fieldok)
  1879. {
  1880.   register symptr    R100;
  1881.   symptr    sp;
  1882.   declptr    dp;
  1883.   struct { setword    S[2]; }    vs;
  1884.  
  1885.   R100 = (struct S65 *)NIL;
  1886.   if (fieldok)
  1887.     Setncpy(vs.S, Conset[2], sizeof(vs.S));
  1888.   else
  1889.     Setncpy(vs.S, Conset[3], sizeof(vs.S));
  1890.   sp = (struct S65 *)NIL;
  1891.   dp = symtab;
  1892.   while (dp != (struct S63 *)NIL) {
  1893.     sp = (*dp).ddecl.A[(*ip).ihash];
  1894.     while (sp != (struct S65 *)NIL) {
  1895.       if ((Member((unsigned)((*sp).lt), vs.S)) && ((*sp).U.V6.lid == ip))
  1896.     goto L999;
  1897.       sp = (*sp).lnext;
  1898.     }
  1899.     dp = (*dp).dprev;
  1900.   }
  1901. L999:
  1902.   R100 = sp;
  1903.   return R100;
  1904. }
  1905.  
  1906.  symptr
  1907. lookuplabel(integer     i)
  1908. {
  1909.   register symptr    R101;
  1910.   symptr    sp;
  1911.   declptr    dp;
  1912.  
  1913.   sp = (struct S65 *)NIL;
  1914.   dp = symtab;
  1915.   while (dp != (struct S63 *)NIL) {
  1916.     sp = (*dp).ddecl.A[hashmax];
  1917.     while (sp != (struct S65 *)NIL) {
  1918.       if ((Member((unsigned)((*sp).lt), Conset[4])) && ((*sp).U.V9.lno == i))
  1919.     goto L999;
  1920.       sp = (*sp).lnext;
  1921.     }
  1922.     dp = (*dp).dprev;
  1923.   }
  1924. L999:
  1925.   R101 = sp;
  1926.   return R101;
  1927. }
  1928.  
  1929.  void
  1930. enterscope(declptr     dp)
  1931. {
  1932.   register hashtyp    h;
  1933.  
  1934.   if (dp == (struct S63 *)NIL) {
  1935.     dp = (struct S63 *)malloc((unsigned)(sizeof(*dp)));
  1936.     {
  1937.       hashtyp    B47 = 0,
  1938.           B48 = hashmax;
  1939.  
  1940.       if (B47 <= B48)
  1941.     for (h = B47; ; h++) {
  1942.       (*dp).ddecl.A[h] = (struct S65 *)NIL;
  1943.       if (h == B48) break;
  1944.     }
  1945.     }
  1946.   }
  1947.   (*dp).dprev = symtab;
  1948.   symtab = dp;
  1949. }
  1950.  
  1951.  declptr
  1952. currscope(void)
  1953. {
  1954.   register declptr    R102;
  1955.  
  1956.   R102 = symtab;
  1957.   return R102;
  1958. }
  1959.  
  1960.  void
  1961. leavescope(void)
  1962. {
  1963.   symtab = (*symtab).dprev;
  1964. }
  1965.  
  1966.  symptr
  1967. mkid(idptr     ip)
  1968. {
  1969.   register symptr    R103;
  1970.   symptr    sp;
  1971.  
  1972.   sp = mksym(lidentifier);
  1973.   (*sp).U.V6.lid = ip;
  1974.   (*sp).U.V6.lused = false;
  1975.   declsym(sp);
  1976.   (*ip).inref = (*ip).inref + 1;
  1977.   R103 = sp;
  1978.   return R103;
  1979. }
  1980.  
  1981.  treeptr
  1982. newid(idptr     ip)
  1983. {
  1984.   register treeptr    R104;
  1985.   symptr    sp;
  1986.   treeptr    tp;
  1987.  
  1988.   sp = lookupid(ip, false);
  1989.   if (sp != (struct S65 *)NIL)
  1990.     if ((*sp).ldecl != symtab)
  1991.       sp = (struct S65 *)NIL;
  1992.   if (sp == (struct S65 *)NIL) {
  1993.     tp = mknode(nid);
  1994.     sp = mkid(ip);
  1995.     (*sp).lsymdecl = tp;
  1996.     (*tp).U.V43.tsym = sp;
  1997.   } else
  1998.     if ((*sp).lt == lpointer) {
  1999.       tp = mknode(nid);
  2000.       (*tp).U.V43.tsym = sp;
  2001.       (*sp).lt = lidentifier;
  2002.       (*sp).lsymdecl = tp;
  2003.     } else
  2004.       if ((*sp).lt == lforward) {
  2005.     (*sp).lt = lidentifier;
  2006.     tp = (*sp).lsymdecl;
  2007.       } else
  2008.     error(emultdeclid);
  2009.   R104 = tp;
  2010.   return R104;
  2011. }
  2012.  
  2013.  treeptr
  2014. oldid(idptr     ip, ltypes     l)
  2015. {
  2016.   register treeptr    R105;
  2017.   symptr    sp;
  2018.   treeptr    tp;
  2019.  
  2020.   sp = lookupid(ip, true);
  2021.   if (sp == (struct S65 *)NIL) {
  2022.     if (Member((unsigned)(l), Conset[5])) {
  2023.       tp = newid(ip);
  2024.       (*(*tp).U.V43.tsym).lt = l;
  2025.     } else
  2026.       error(enotdeclid);
  2027.   } else {
  2028.     (*sp).U.V6.lused = true;
  2029.     tp = mknode(nid);
  2030.     (*tp).U.V43.tsym = sp;
  2031.     if (((*sp).lt == lpointer) && (l == lidentifier)) {
  2032.       (*sp).lt = lidentifier;
  2033.       (*sp).lsymdecl = tp;
  2034.     }
  2035.   }
  2036.   R105 = tp;
  2037.   return R105;
  2038. }
  2039.  
  2040.  treeptr
  2041. oldfield(treeptr     tp, idptr     ip)
  2042. {
  2043.   register treeptr    R106;
  2044.   treeptr    tq, ti, fp;
  2045.  
  2046.   fp = (struct S64 *)NIL;
  2047.   tq = (*tp).U.V21.tflist;
  2048.   while (tq != (struct S64 *)NIL) {
  2049.     ti = (*tq).U.V14.tidl;
  2050.     while (ti != (struct S64 *)NIL) {
  2051.       if ((*(*ti).U.V43.tsym).U.V6.lid == ip) {
  2052.     fp = mknode(nid);
  2053.     (*fp).U.V43.tsym = (*ti).U.V43.tsym;
  2054.     goto L999;
  2055.       }
  2056.       ti = (*ti).tnext;
  2057.     }
  2058.     tq = (*tq).tnext;
  2059.   }
  2060.   tq = (*tp).U.V21.tvlist;
  2061.   while (tq != (struct S64 *)NIL) {
  2062.     fp = oldfield((*tq).U.V20.tvrnt, ip);
  2063.     if (fp != (struct S64 *)NIL)
  2064.       tq = (struct S64 *)NIL;
  2065.     else
  2066.       tq = (*tq).tnext;
  2067.   }
  2068. L999:
  2069.   R106 = fp;
  2070.   return R106;
  2071. }
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  void
  2097. addfields(treeptr     rp)
  2098. {
  2099.   treeptr    fp, ip, vp;
  2100.   symptr    sp;
  2101.  
  2102.   fp = (*rp).U.V21.tflist;
  2103.   while (fp != (struct S64 *)NIL) {
  2104.     ip = (*fp).U.V14.tidl;
  2105.     while (ip != (struct S64 *)NIL) {
  2106.       sp = mksym(lfield);
  2107.       (*sp).U.V6.lid = (*(*ip).U.V43.tsym).U.V6.lid;
  2108.       (*sp).U.V6.lused = false;
  2109.       (*sp).lsymdecl = ip;
  2110.       declsym(sp);
  2111.       ip = (*ip).tnext;
  2112.     }
  2113.     fp = (*fp).tnext;
  2114.   }
  2115.   vp = (*rp).U.V21.tvlist;
  2116.   while (vp != (struct S64 *)NIL) {
  2117.     addfields((*vp).U.V20.tvrnt);
  2118.     vp = (*vp).tnext;
  2119.   }
  2120. }
  2121.  
  2122.  void
  2123. scopeup(treeptr     tp)
  2124. {
  2125.   addfields(typeof(tp));
  2126. }
  2127.  
  2128.  treeptr
  2129. newlbl(void)
  2130. {
  2131.   register treeptr    R130;
  2132.   symptr    sp;
  2133.   treeptr    tp;
  2134.  
  2135.   tp = mknode(nlabel);
  2136.   sp = lookuplabel(currsym.U.V3.vint);
  2137.   if (sp != (struct S65 *)NIL)
  2138.     if ((*sp).ldecl != symtab)
  2139.       sp = (struct S65 *)NIL;
  2140.   if (sp == (struct S65 *)NIL) {
  2141.     sp = mksym(lforwlab);
  2142.     (*sp).U.V9.lno = currsym.U.V3.vint;
  2143.     (*sp).U.V9.lgo = false;
  2144.     (*sp).lsymdecl = tp;
  2145.     declsym(sp);
  2146.   } else
  2147.     error(emultdecllab);
  2148.   (*tp).U.V43.tsym = sp;
  2149.   R130 = tp;
  2150.   return R130;
  2151. }
  2152.  
  2153.  treeptr
  2154. oldlbl(boolean     defpt)
  2155. {
  2156.   register treeptr    R131;
  2157.   symptr    sp;
  2158.   treeptr    tp;
  2159.  
  2160.   sp = lookuplabel(currsym.U.V3.vint);
  2161.   if (sp == (struct S65 *)NIL) {
  2162.     prtmsg(enotdecllab);
  2163.     tp = newlbl();
  2164.     sp = (*tp).U.V43.tsym;
  2165.   } else {
  2166.     tp = mknode(nlabel);
  2167.     (*tp).U.V43.tsym = sp;
  2168.   }
  2169.   if (defpt) {
  2170.     if ((*sp).lt == lforwlab)
  2171.       (*sp).lt = llabel;
  2172.     else
  2173.       error(emuldeflab);
  2174.   }
  2175.   R131 = tp;
  2176.   return R131;
  2177. }
  2178.  
  2179.  void
  2180. pbody(treeptr     tp)
  2181. {
  2182.   treeptr    tq;
  2183.  
  2184.   statlvl = statlvl + 1;
  2185.   if (currsym.st == slabel) {
  2186.     (*tp).U.V13.tsublab = plabel();
  2187.     linkup(tp, (*tp).U.V13.tsublab);
  2188.   } else
  2189.     (*tp).U.V13.tsublab = (struct S64 *)NIL;
  2190.   if (currsym.st == sconst) {
  2191.     (*tp).U.V13.tsubconst = pconst();
  2192.     linkup(tp, (*tp).U.V13.tsubconst);
  2193.   } else
  2194.     (*tp).U.V13.tsubconst = (struct S64 *)NIL;
  2195.   if (currsym.st == stype) {
  2196.     (*tp).U.V13.tsubtype = ptype();
  2197.     linkup(tp, (*tp).U.V13.tsubtype);
  2198.   } else
  2199.     (*tp).U.V13.tsubtype = (struct S64 *)NIL;
  2200.   if (currsym.st == svar) {
  2201.     (*tp).U.V13.tsubvar = pvar();
  2202.     linkup(tp, (*tp).U.V13.tsubvar);
  2203.   } else
  2204.     (*tp).U.V13.tsubvar = (struct S64 *)NIL;
  2205.   (*tp).U.V13.tsubsub = (struct S64 *)NIL;
  2206.   tq = (struct S64 *)NIL;
  2207.   while ((currsym.st == sproc) || (currsym.st == sfunc)) {
  2208.     if (tq == (struct S64 *)NIL) {
  2209.       tq = psubs();
  2210.       (*tp).U.V13.tsubsub = tq;
  2211.     } else {
  2212.       (*tq).tnext = psubs();
  2213.       tq = (*tq).tnext;
  2214.     }
  2215.   }
  2216.   linkup(tp, (*tp).U.V13.tsubsub);
  2217.   checksymbol(*((symset *)SETALIGN(Conset[6])));
  2218.   if (currsym.st == sbegin) {
  2219.     (*tp).U.V13.tsubstmt = pbegin(false);
  2220.     linkup(tp, (*tp).U.V13.tsubstmt);
  2221.   }
  2222.   statlvl = statlvl - 1;
  2223. }
  2224.  
  2225.  treeptr
  2226. pprmlist(void)
  2227. {
  2228.   register treeptr    R133;
  2229.   treeptr    tp, tq;
  2230.   idptr    din, dut, der;
  2231.  
  2232.   tp = (struct S64 *)NIL;
  2233.   din = (*(*(*deftab.A[(int)(dinput)]).U.V14.tidl).U.V43.tsym).U.V6.lid;
  2234.   dut = (*(*(*deftab.A[(int)(doutput)]).U.V14.tidl).U.V43.tsym).U.V6.lid;
  2235.   der = (*(*(*deftab.A[(int)(derroutput)]).U.V14.tidl).U.V43.tsym).U.V6.lid;
  2236.   while ((currsym.U.V1.vid == din) || (currsym.U.V1.vid == dut) || (currsym.U.V1.vid == der)) {
  2237.     if (currsym.U.V1.vid == din)
  2238.       (*defnams.A[(int)(dinput)]).U.V6.lused = true;
  2239.     else
  2240.       if (currsym.U.V1.vid == dut)
  2241.     (*defnams.A[(int)(doutput)]).U.V6.lused = true;
  2242.       else
  2243.     (*defnams.A[(int)(derroutput)]).U.V6.lused = true;
  2244.     nextsymbol(*((symset *)SETALIGN(Conset[7])));
  2245.     if (currsym.st == srpar)
  2246.       goto L999;
  2247.     nextsymbol(*((symset *)SETALIGN(Conset[8])));
  2248.   }
  2249.   tq = newid(currsym.U.V1.vid);
  2250.   (void)fprintf(output.fp, "/* "), Putl(output, 0);
  2251.   printid(currsym.U.V1.vid);
  2252.   (void)fprintf(output.fp, " */\n"), Putl(output, 1);
  2253.   (*(*tq).U.V43.tsym).lt = lpointer;
  2254.   tp = tq;
  2255.   nextsymbol(*((symset *)SETALIGN(Conset[9])));
  2256.   while (currsym.st == scomma) {
  2257.     nextsymbol(*((symset *)SETALIGN(Conset[10])));
  2258.     if (currsym.U.V1.vid == din)
  2259.       (*defnams.A[(int)(dinput)]).U.V6.lused = true;
  2260.     else
  2261.       if (currsym.U.V1.vid == dut)
  2262.     (*defnams.A[(int)(doutput)]).U.V6.lused = true;
  2263.       else
  2264.     if (currsym.U.V1.vid == der)
  2265.       (*defnams.A[(int)(derroutput)]).U.V6.lused = true;
  2266.     else {
  2267.       (void)fprintf(output.fp, "/* "), Putl(output, 0);
  2268.       printid(currsym.U.V1.vid);
  2269.       (void)fprintf(output.fp, " */\n"), Putl(output, 1);
  2270.       (*tq).tnext = newid(currsym.U.V1.vid);
  2271.       tq = (*tq).tnext;
  2272.       (*(*tq).U.V43.tsym).lt = lpointer;
  2273.     }
  2274.     nextsymbol(*((symset *)SETALIGN(Conset[11])));
  2275.   }
  2276. L999:
  2277.   R133 = tp;
  2278.   return R133;
  2279. }
  2280.  
  2281.  treeptr
  2282. pprogram(void)
  2283. {
  2284.   register treeptr    R132;
  2285.   treeptr    tp;
  2286.  
  2287.   enterscope((declptr)NIL);
  2288.   tp = mknode(npgm);
  2289.   nextsymbol(*((symset *)SETALIGN(Conset[12])));
  2290.   (*tp).U.V13.tstat = statlvl;
  2291.   (*tp).U.V13.tsubid = mknode(nid);
  2292.   (*(*tp).U.V13.tsubid).tup = tp;
  2293.   (*(*tp).U.V13.tsubid).U.V43.tsym = mksym(lidentifier);
  2294.   (*(*(*tp).U.V13.tsubid).U.V43.tsym).U.V6.lid = currsym.U.V1.vid;
  2295.   (*(*(*tp).U.V13.tsubid).U.V43.tsym).lsymdecl = (*tp).U.V13.tsubid;
  2296.   linkup(tp, (*tp).U.V13.tsubid);
  2297.   nextsymbol(*((symset *)SETALIGN(Conset[13])));
  2298.   if (currsym.st == slpar) {
  2299.     nextsymbol(*((symset *)SETALIGN(Conset[14])));
  2300.     (*tp).U.V13.tsubpar = pprmlist();
  2301.     linkup(tp, (*tp).U.V13.tsubpar);
  2302.     nextsymbol(*((symset *)SETALIGN(Conset[15])));
  2303.   } else
  2304.     (*tp).U.V13.tsubpar = (struct S64 *)NIL;
  2305.   nextsymbol(*((symset *)SETALIGN(Conset[16])));
  2306.   pbody(tp);
  2307.   checksymbol(*((symset *)SETALIGN(Conset[17])));
  2308.   nextsymbol(*((symset *)SETALIGN(Conset[18])));
  2309.   (*tp).U.V13.tscope = currscope();
  2310.   leavescope();
  2311.   R132 = tp;
  2312.   return R132;
  2313. }
  2314.  
  2315.  treeptr
  2316. pmodule(void)
  2317. {
  2318.   register treeptr    R134;
  2319.   treeptr    tp;
  2320.  
  2321.   enterscope((declptr)NIL);
  2322.   tp = mknode(npgm);
  2323.   (*tp).U.V13.tstat = statlvl;
  2324.   (*tp).U.V13.tsubid = (struct S64 *)NIL;
  2325.   (*tp).U.V13.tsubpar = (struct S64 *)NIL;
  2326.   pbody(tp);
  2327.   checksymbol(*((symset *)SETALIGN(Conset[19])));
  2328.   if (currsym.st == ssemic)
  2329.     nextsymbol(*((symset *)SETALIGN(Conset[20])));
  2330.   (*tp).U.V13.tscope = currscope();
  2331.   leavescope();
  2332.   R134 = tp;
  2333.   return R134;
  2334. }
  2335.  
  2336.  treeptr
  2337. plabel(void)
  2338. {
  2339.   register treeptr    R135;
  2340.   treeptr    tp, tq;
  2341.  
  2342.   tq = (struct S64 *)NIL;
  2343.   do {
  2344.     nextsymbol(*((symset *)SETALIGN(Conset[21])));
  2345.     if (tq == (struct S64 *)NIL) {
  2346.       tq = newlbl();
  2347.       tp = tq;
  2348.     } else {
  2349.       (*tq).tnext = newlbl();
  2350.       tq = (*tq).tnext;
  2351.     }
  2352.     nextsymbol(*((symset *)SETALIGN(Conset[22])));
  2353.   } while (!(currsym.st == ssemic));
  2354.   nextsymbol(*((symset *)SETALIGN(Conset[23])));
  2355.   R135 = tp;
  2356.   return R135;
  2357. }
  2358.  
  2359.  treeptr
  2360. pidlist(ltypes     l)
  2361. {
  2362.   register treeptr    R136;
  2363.   treeptr    tp, tq;
  2364.  
  2365.   tq = newid(currsym.U.V1.vid);
  2366.   (*(*tq).U.V43.tsym).lt = l;
  2367.   tp = tq;
  2368.   nextsymbol(*((symset *)SETALIGN(Conset[24])));
  2369.   while (currsym.st == scomma) {
  2370.     nextsymbol(*((symset *)SETALIGN(Conset[25])));
  2371.     (*tq).tnext = newid(currsym.U.V1.vid);
  2372.     tq = (*tq).tnext;
  2373.     (*(*tq).U.V43.tsym).lt = l;
  2374.     nextsymbol(*((symset *)SETALIGN(Conset[26])));
  2375.   }
  2376.   R136 = tp;
  2377.   return R136;
  2378. }
  2379.  
  2380.  treeptr
  2381. pconst(void)
  2382. {
  2383.   register treeptr    R137;
  2384.   treeptr    tp, tq;
  2385.  
  2386.   tq = (struct S64 *)NIL;
  2387.   nextsymbol(*((symset *)SETALIGN(Conset[27])));
  2388.   do {
  2389.     if (tq == (struct S64 *)NIL) {
  2390.       tq = mknode(nconst);
  2391.       (*tq).U.V14.tattr = anone;
  2392.       tp = tq;
  2393.     } else {
  2394.       (*tq).tnext = mknode(nconst);
  2395.       tq = (*tq).tnext;
  2396.       (*tq).U.V14.tattr = anone;
  2397.     }
  2398.     (*tq).U.V14.tidl = pidlist(lidentifier);
  2399.     checksymbol(*((symset *)SETALIGN(Conset[28])));
  2400.     nextsymbol(*((symset *)SETALIGN(Conset[29])));
  2401.     (*tq).U.V14.tbind = pconstant(true);
  2402.     nextsymbol(*((symset *)SETALIGN(Conset[30])));
  2403.     nextsymbol(*((symset *)SETALIGN(Conset[31])));
  2404.   } while (!(currsym.st != sid));
  2405.   R137 = tp;
  2406.   return R137;
  2407. }
  2408.  
  2409.  treeptr
  2410. pconstant(boolean     realok)
  2411. {
  2412.   register treeptr    R138;
  2413.   treeptr    tp, tq;
  2414.   boolean    neg;
  2415.  
  2416.   neg = (boolean)(currsym.st == sminus);
  2417.   if (Member((unsigned)(currsym.st), Conset[32]))
  2418.     if (realok)
  2419.       nextsymbol(*((symset *)SETALIGN(Conset[33])));
  2420.     else
  2421.       nextsymbol(*((symset *)SETALIGN(Conset[34])));
  2422.   if (currsym.st == sid)
  2423.     tp = oldid(currsym.U.V1.vid, lidentifier);
  2424.   else
  2425.     tp = mklit();
  2426.   if (neg) {
  2427.     tq = mknode(numinus);
  2428.     (*tq).U.V42.texps = tp;
  2429.     tp = tq;
  2430.   }
  2431.   R138 = tp;
  2432.   return R138;
  2433. }
  2434.  
  2435.  treeptr
  2436. precord(symtyp     cs, declptr     dp)
  2437. {
  2438.   register treeptr    R139;
  2439.   treeptr    tp, tq, tl, tv;
  2440.   lexsym    tsym;
  2441.  
  2442.   tp = mknode(nrecord);
  2443.   (*tp).U.V21.tflist = (struct S64 *)NIL;
  2444.   (*tp).U.V21.tvlist = (struct S64 *)NIL;
  2445.   (*tp).U.V21.tuid = (struct S62 *)NIL;
  2446.   (*tp).U.V21.trscope = (struct S63 *)NIL;
  2447.   if (cs == send) {
  2448.     enterscope(dp);
  2449.     dp = currscope();
  2450.   }
  2451.   nextsymbol(*((symset *)SETALIGN((Tmpset = Newset(), (void)Insmem((unsigned)(sid), Tmpset),
  2452.     (void)Insmem((unsigned)(scase), Tmpset),
  2453.     (void)Insmem((unsigned)(cs), Tmpset), Tmpset))));
  2454.   tq = (struct S64 *)NIL;
  2455.   while (currsym.st == sid) {
  2456.     if (tq == (struct S64 *)NIL) {
  2457.       tq = mknode(nfield);
  2458.       (*tq).U.V14.tattr = anone;
  2459.       (*tp).U.V21.tflist = tq;
  2460.     } else {
  2461.       (*tq).tnext = mknode(nfield);
  2462.       tq = (*tq).tnext;
  2463.       (*tq).U.V14.tattr = anone;
  2464.     }
  2465.     (*tq).U.V14.tidl = pidlist(lfield);
  2466.     checksymbol(*((symset *)SETALIGN(Conset[35])));
  2467.     leavescope();
  2468.     (*tq).U.V14.tbind = ptypedef();
  2469.     enterscope(dp);
  2470.     if (currsym.st == ssemic)
  2471.       nextsymbol(*((symset *)SETALIGN((Tmpset = Newset(), (void)Insmem((unsigned)(sid), Tmpset),
  2472.     (void)Insmem((unsigned)(scase), Tmpset),
  2473.     (void)Insmem((unsigned)(cs), Tmpset), Tmpset))));
  2474.   }
  2475.   if (currsym.st == scase) {
  2476.     nextsymbol(*((symset *)SETALIGN(Conset[36])));
  2477.     tsym = currsym;
  2478.     nextsymbol(*((symset *)SETALIGN(Conset[37])));
  2479.     if (currsym.st == scolon) {
  2480.       tv = newid(tsym.U.V1.vid);
  2481.       if (tq == (struct S64 *)NIL) {
  2482.     tq = mknode(nfield);
  2483.     (*tp).U.V21.tflist = tq;
  2484.       } else {
  2485.     (*tq).tnext = mknode(nfield);
  2486.     tq = (*tq).tnext;
  2487.       }
  2488.       (*tq).U.V14.tidl = tv;
  2489.       (*(*tv).U.V43.tsym).lt = lfield;
  2490.       nextsymbol(*((symset *)SETALIGN(Conset[38])));
  2491.       leavescope();
  2492.       (*tq).U.V14.tbind = oldid(currsym.U.V1.vid, lidentifier);
  2493.       enterscope(dp);
  2494.       nextsymbol(*((symset *)SETALIGN(Conset[39])));
  2495.     }
  2496.     tq = (struct S64 *)NIL;
  2497.     do {
  2498.       tv = (struct S64 *)NIL;
  2499.       do {
  2500.     nextsymbol(*((symset *)SETALIGN((Tmpset = Newset(), (void)Insmem((unsigned)(sid), Tmpset),
  2501.       (void)Insmem((unsigned)(sinteger), Tmpset),
  2502.       (void)Insmem((unsigned)(schar), Tmpset),
  2503.       (void)Insmem((unsigned)(splus), Tmpset),
  2504.       (void)Insmem((unsigned)(sminus), Tmpset),
  2505.       (void)Insmem((unsigned)(cs), Tmpset), Tmpset))));
  2506.     if (currsym.st == cs)
  2507.       goto L999;
  2508.     if (tv == (struct S64 *)NIL) {
  2509.       tv = pconstant(false);
  2510.       tl = tv;
  2511.     } else {
  2512.       (*tv).tnext = pconstant(false);
  2513.       tv = (*tv).tnext;
  2514.     }
  2515.     nextsymbol(*((symset *)SETALIGN(Conset[40])));
  2516.       } while (!(currsym.st == scolon));
  2517.       nextsymbol(*((symset *)SETALIGN(Conset[41])));
  2518.       if (tq == (struct S64 *)NIL) {
  2519.     tq = mknode(nvariant);
  2520.     (*tp).U.V21.tvlist = tq;
  2521.       } else {
  2522.     (*tq).tnext = mknode(nvariant);
  2523.     tq = (*tq).tnext;
  2524.       }
  2525.       (*tq).U.V20.tselct = tl;
  2526.       (*tq).U.V20.tvrnt = precord(srpar, dp);
  2527.     } while (!(currsym.st == cs));
  2528.   }
  2529. L999:
  2530.   if (cs == send) {
  2531.     (*tp).U.V21.trscope = dp;
  2532.     leavescope();
  2533.   }
  2534.   nextsymbol(*((symset *)SETALIGN(Conset[42])));
  2535.   R139 = tp;
  2536.   return R139;
  2537. }
  2538.  
  2539.  treeptr
  2540. ptypedef(void)
  2541. {
  2542.   register treeptr    R140;
  2543.   treeptr    tp, tq;
  2544.   symtyp    st;
  2545.   symset    ss;
  2546.  
  2547.   nextsymbol(*((symset *)SETALIGN(Conset[43])));
  2548.   if (currsym.st == spacked)
  2549.     nextsymbol(*((symset *)SETALIGN(Conset[44])));
  2550.   Setncpy(ss.S, Conset[45], sizeof(ss.S));
  2551.   switch ((int)(currsym.st)) {
  2552.     case splus:  case sminus:  case schar:  case sinteger:
  2553.     case sid:
  2554.     st = currsym.st;
  2555.     tp = pconstant(false);
  2556.     if (st == sid)
  2557.       nextsymbol(*((symset *)SETALIGN(Union(Conset[46], ss.S))));
  2558.     else
  2559.       nextsymbol(*((symset *)SETALIGN(Conset[47])));
  2560.     Claimset();
  2561.     if (currsym.st == sdotdot) {
  2562.       nextsymbol(*((symset *)SETALIGN(Conset[48])));
  2563.       tq = mknode(nsubrange);
  2564.       (*tq).U.V19.tlo = tp;
  2565.       (*tq).U.V19.thi = pconstant(false);
  2566.       tp = tq;
  2567.       nextsymbol(ss);
  2568.     }
  2569.     break ;
  2570.     case slpar:
  2571.     tp = mknode(nscalar);
  2572.     nextsymbol(*((symset *)SETALIGN(Conset[49])));
  2573.     (*tp).U.V17.tscalid = pidlist(lidentifier);
  2574.     checksymbol(*((symset *)SETALIGN(Conset[50])));
  2575.     nextsymbol(ss);
  2576.     break ;
  2577.     case sarrow:
  2578.     tp = mknode(nptr);
  2579.     nextsymbol(*((symset *)SETALIGN(Conset[51])));
  2580.     (*tp).U.V16.tptrid = oldid(currsym.U.V1.vid, lpointer);
  2581.     (*tp).U.V16.tptrflag = false;
  2582.     nextsymbol(*((symset *)SETALIGN(Conset[52])));
  2583.     break ;
  2584.     case sarray:
  2585.     nextsymbol(*((symset *)SETALIGN(Conset[53])));
  2586.     tp = mknode(narray);
  2587.     (*tp).U.V23.taindx = ptypedef();
  2588.     tq = tp;
  2589.     while (currsym.st == scomma) {
  2590.       (*tq).U.V23.taelem = mknode(narray);
  2591.       tq = (*tq).U.V23.taelem;
  2592.       (*tq).U.V23.taindx = ptypedef();
  2593.     }
  2594.     checksymbol(*((symset *)SETALIGN(Conset[54])));
  2595.     nextsymbol(*((symset *)SETALIGN(Conset[55])));
  2596.     (*tq).U.V23.taelem = ptypedef();
  2597.     break ;
  2598.     case srecord:
  2599.     tp = precord(send, (declptr)NIL);
  2600.     break ;
  2601.     case sfile:  case sset:
  2602.     if (currsym.st == sfile)
  2603.       tp = mknode(nfileof);
  2604.     else {
  2605.       tp = mknode(nsetof);
  2606.       usesets = true;
  2607.     }
  2608.     nextsymbol(*((symset *)SETALIGN(Conset[56])));
  2609.     (*tp).U.V18.tof = ptypedef();
  2610.     break ;
  2611.     default:
  2612.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2613.   }
  2614.   R140 = tp;
  2615.   return R140;
  2616. }
  2617.  
  2618.  treeptr
  2619. ptype(void)
  2620. {
  2621.   register treeptr    R141;
  2622.   treeptr    tp, tq;
  2623.  
  2624.   tq = (struct S64 *)NIL;
  2625.   nextsymbol(*((symset *)SETALIGN(Conset[57])));
  2626.   do {
  2627.     if (tq == (struct S64 *)NIL) {
  2628.       tq = mknode(ntype);
  2629.       (*tq).U.V14.tattr = anone;
  2630.       tp = tq;
  2631.     } else {
  2632.       (*tq).tnext = mknode(ntype);
  2633.       tq = (*tq).tnext;
  2634.       (*tq).U.V14.tattr = anone;
  2635.     }
  2636.     (*tq).U.V14.tidl = pidlist(lidentifier);
  2637.     checksymbol(*((symset *)SETALIGN(Conset[58])));
  2638.     (*tq).U.V14.tbind = ptypedef();
  2639.     nextsymbol(*((symset *)SETALIGN(Conset[59])));
  2640.   } while (!(currsym.st != sid));
  2641.   R141 = tp;
  2642.   return R141;
  2643. }
  2644.  
  2645.  treeptr
  2646. pvar(void)
  2647. {
  2648.   register treeptr    R142;
  2649.   treeptr    ti, tp, tq;
  2650.  
  2651.   tq = (struct S64 *)NIL;
  2652.   nextsymbol(*((symset *)SETALIGN(Conset[60])));
  2653.   do {
  2654.     if (tq == (struct S64 *)NIL) {
  2655.       tq = mknode(nvar);
  2656.       (*tq).U.V14.tattr = anone;
  2657.       tp = tq;
  2658.     } else {
  2659.       (*tq).tnext = mknode(nvar);
  2660.       tq = (*tq).tnext;
  2661.       (*tq).U.V14.tattr = anone;
  2662.     }
  2663.     ti = newid(currsym.U.V1.vid);
  2664.     (*tq).U.V14.tidl = ti;
  2665.     nextsymbol(*((symset *)SETALIGN(Conset[61])));
  2666.     while (currsym.st == scomma) {
  2667.       nextsymbol(*((symset *)SETALIGN(Conset[62])));
  2668.       (*ti).tnext = newid(currsym.U.V1.vid);
  2669.       ti = (*ti).tnext;
  2670.       nextsymbol(*((symset *)SETALIGN(Conset[63])));
  2671.     }
  2672.     (*tq).U.V14.tbind = ptypedef();
  2673.     nextsymbol(*((symset *)SETALIGN(Conset[64])));
  2674.   } while (!(currsym.st != sid));
  2675.   R142 = tp;
  2676.   return R142;
  2677. }
  2678.  
  2679.  treeptr
  2680. psubs(void)
  2681. {
  2682.   register treeptr    R143;
  2683.   treeptr    tp, tv, tq;
  2684.   boolean    func;
  2685.   symtyp    colsem;
  2686.  
  2687.   func = (boolean)(currsym.st == sfunc);
  2688.   if (func)
  2689.     colsem = scolon;
  2690.   else
  2691.     colsem = ssemic;
  2692.   nextsymbol(*((symset *)SETALIGN(Conset[65])));
  2693.   tq = newid(currsym.U.V1.vid);
  2694.   if ((*tq).tup == (struct S64 *)NIL) {
  2695.     enterscope((declptr)NIL);
  2696.     if (func)
  2697.       tp = mknode(nfunc);
  2698.     else
  2699.       tp = mknode(nproc);
  2700.     (*tp).U.V13.tstat = statlvl;
  2701.     (*tp).U.V13.tsubid = tq;
  2702.     linkup(tp, tq);
  2703.     nextsymbol(*((symset *)SETALIGN((Tmpset = Newset(), (void)Insmem((unsigned)(slpar), Tmpset),
  2704.       (void)Insmem((unsigned)(colsem), Tmpset), Tmpset))));
  2705.     if (currsym.st == slpar) {
  2706.       (*tp).U.V13.tsubpar = psubpar();
  2707.       linkup(tp, (*tp).U.V13.tsubpar);
  2708.       nextsymbol(*((symset *)SETALIGN((Tmpset = Newset(), (void)Insmem((unsigned)(colsem), Tmpset), Tmpset))));
  2709.     } else
  2710.       (*tp).U.V13.tsubpar = (struct S64 *)NIL;
  2711.     if (func) {
  2712.       nextsymbol(*((symset *)SETALIGN(Conset[66])));
  2713.       (*tp).U.V13.tfuntyp = oldid(currsym.U.V1.vid, lidentifier);
  2714.       nextsymbol(*((symset *)SETALIGN(Conset[67])));
  2715.     } else
  2716.       (*tp).U.V13.tfuntyp = mknode(nempty);
  2717.     linkup(tp, (*tp).U.V13.tfuntyp);
  2718.     nextsymbol(*((symset *)SETALIGN(Conset[68])));
  2719.   } else {
  2720.     enterscope((*(*tq).tup).U.V13.tscope);
  2721.     if (func)
  2722.       tp = mknode(nfunc);
  2723.     else
  2724.       tp = mknode(nproc);
  2725.     (*tp).U.V13.tfuntyp = (*(*tq).tup).U.V13.tfuntyp;
  2726.     tv = (*(*tq).tup).U.V13.tsubpar;
  2727.     (*tp).U.V13.tsubpar = tv;
  2728.     while (tv != (struct S64 *)NIL) {
  2729.       (*tv).tup = tp;
  2730.       tv = (*tv).tnext;
  2731.     }
  2732.     (*tp).U.V13.tsubid = tq;
  2733.     (*tq).tup = tp;
  2734.     nextsymbol(*((symset *)SETALIGN(Conset[69])));
  2735.     nextsymbol(*((symset *)SETALIGN(Conset[70])));
  2736.   }
  2737.   if (Member((unsigned)(currsym.st), Conset[71])) {
  2738.     (*(*(*tp).U.V13.tsubid).U.V43.tsym).lt = lforward;
  2739.     nextsymbol(*((symset *)SETALIGN(Conset[72])));
  2740.     (*tp).U.V13.tsublab = (struct S64 *)NIL;
  2741.     (*tp).U.V13.tsubconst = (struct S64 *)NIL;
  2742.     (*tp).U.V13.tsubtype = (struct S64 *)NIL;
  2743.     (*tp).U.V13.tsubvar = (struct S64 *)NIL;
  2744.     (*tp).U.V13.tsubsub = (struct S64 *)NIL;
  2745.     (*tp).U.V13.tsubstmt = (struct S64 *)NIL;
  2746.   } else
  2747.     pbody(tp);
  2748.   nextsymbol(*((symset *)SETALIGN(Conset[73])));
  2749.   (*tp).U.V13.tscope = currscope();
  2750.   leavescope();
  2751.   R143 = tp;
  2752.   return R143;
  2753. }
  2754.  
  2755.  treeptr
  2756. pconfsub(void)
  2757. {
  2758.   register treeptr    R144;
  2759.   treeptr    tp;
  2760.  
  2761.   tp = mknode(nsubrange);
  2762.   nextsymbol(*((symset *)SETALIGN(Conset[74])));
  2763.   (*tp).U.V19.tlo = newid(currsym.U.V1.vid);
  2764.   nextsymbol(*((symset *)SETALIGN(Conset[75])));
  2765.   nextsymbol(*((symset *)SETALIGN(Conset[76])));
  2766.   (*tp).U.V19.thi = newid(currsym.U.V1.vid);
  2767.   nextsymbol(*((symset *)SETALIGN(Conset[77])));
  2768.   R144 = tp;
  2769.   return R144;
  2770. }
  2771.  
  2772.  treeptr
  2773. pconform(void)
  2774. {
  2775.   register treeptr    R145;
  2776.   treeptr    tp, tq;
  2777.  
  2778.   nextsymbol(*((symset *)SETALIGN(Conset[78])));
  2779.   tp = mknode(nconfarr);
  2780.   (*tp).U.V22.tcuid = mkvariable('S');
  2781.   (*tp).U.V22.tcindx = pconfsub();
  2782.   nextsymbol(*((symset *)SETALIGN(Conset[79])));
  2783.   (*tp).U.V22.tindtyp = oldid(currsym.U.V1.vid, lidentifier);
  2784.   nextsymbol(*((symset *)SETALIGN(Conset[80])));
  2785.   tq = tp;
  2786.   while (currsym.st == ssemic) {
  2787.     error(econfconf);
  2788.     (*tq).U.V22.tcelem = mknode(nconfarr);
  2789.     tq = (*tq).U.V22.tcelem;
  2790.     (*tq).U.V22.tcindx = pconfsub();
  2791.     nextsymbol(*((symset *)SETALIGN(Conset[81])));
  2792.     (*tq).U.V22.tindtyp = oldid(currsym.U.V1.vid, lidentifier);
  2793.     nextsymbol(*((symset *)SETALIGN(Conset[82])));
  2794.   }
  2795.   nextsymbol(*((symset *)SETALIGN(Conset[83])));
  2796.   nextsymbol(*((symset *)SETALIGN(Conset[84])));
  2797.   switch ((int)(currsym.st)) {
  2798.     case sid:
  2799.     (*tq).U.V22.tcelem = oldid(currsym.U.V1.vid, lidentifier);
  2800.     break ;
  2801.     case sarray:
  2802.     error(econfconf);
  2803.     (*tq).U.V22.tcelem = pconform();
  2804.     break ;
  2805.     default:
  2806.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2807.   }
  2808.   R145 = tp;
  2809.   return R145;
  2810. }
  2811.  
  2812.  treeptr
  2813. psubpar(void)
  2814. {
  2815.   register treeptr    R146;
  2816.   treeptr    tp, tq;
  2817.   treetyp    nt;
  2818.  
  2819.   tq = (struct S64 *)NIL;
  2820.   do {
  2821.     nextsymbol(*((symset *)SETALIGN(Conset[85])));
  2822.     switch ((int)(currsym.st)) {
  2823.       case sid:
  2824.       nt = nvalpar;
  2825.       break ;
  2826.       case svar:
  2827.       nt = nvarpar;
  2828.       break ;
  2829.       case sfunc:
  2830.       nt = nparfunc;
  2831.       break ;
  2832.       case sproc:
  2833.       nt = nparproc;
  2834.       break ;
  2835.       default:
  2836.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2837.     }
  2838.     if (nt != nvalpar)
  2839.       nextsymbol(*((symset *)SETALIGN(Conset[86])));
  2840.     if (tq == (struct S64 *)NIL) {
  2841.       tq = mknode(nt);
  2842.       tp = tq;
  2843.     } else {
  2844.       (*tq).tnext = mknode(nt);
  2845.       tq = (*tq).tnext;
  2846.     }
  2847.     switch ((int)(nt)) {
  2848.       case nvarpar:  case nvalpar:
  2849.       (*tq).U.V14.tidl = pidlist(lidentifier);
  2850.       (*tq).U.V14.tattr = anone;
  2851.       checksymbol(*((symset *)SETALIGN(Conset[87])));
  2852.       if (nt == nvalpar)
  2853.     nextsymbol(*((symset *)SETALIGN(Conset[88])));
  2854.       else
  2855.     nextsymbol(*((symset *)SETALIGN(Conset[89])));
  2856.       switch ((int)(currsym.st)) {
  2857.         case sid:
  2858.     (*tq).U.V14.tbind = oldid(currsym.U.V1.vid, lidentifier);
  2859.     break ;
  2860.         case sarray:
  2861.     (*tq).U.V14.tbind = pconform();
  2862.     break ;
  2863.         default:
  2864.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2865.       }
  2866.       nextsymbol(*((symset *)SETALIGN(Conset[90])));
  2867.       break ;
  2868.       case nparproc:
  2869.       (*tq).U.V15.tparid = newid(currsym.U.V1.vid);
  2870.       nextsymbol(*((symset *)SETALIGN(Conset[91])));
  2871.       if (currsym.st == slpar) {
  2872.     enterscope((declptr)NIL);
  2873.     (*tq).U.V15.tparparm = psubpar();
  2874.     nextsymbol(*((symset *)SETALIGN(Conset[92])));
  2875.     leavescope();
  2876.       } else
  2877.     (*tq).U.V15.tparparm = (struct S64 *)NIL;
  2878.       (*tq).U.V15.tpartyp = (struct S64 *)NIL;
  2879.       break ;
  2880.       case nparfunc:
  2881.       (*tq).U.V15.tparid = newid(currsym.U.V1.vid);
  2882.       nextsymbol(*((symset *)SETALIGN(Conset[93])));
  2883.       if (currsym.st == slpar) {
  2884.     enterscope((declptr)NIL);
  2885.     (*tq).U.V15.tparparm = psubpar();
  2886.     nextsymbol(*((symset *)SETALIGN(Conset[94])));
  2887.     leavescope();
  2888.       } else
  2889.     (*tq).U.V15.tparparm = (struct S64 *)NIL;
  2890.       nextsymbol(*((symset *)SETALIGN(Conset[95])));
  2891.       (*tq).U.V15.tpartyp = oldid(currsym.U.V1.vid, lidentifier);
  2892.       nextsymbol(*((symset *)SETALIGN(Conset[96])));
  2893.       break ;
  2894.       default:
  2895.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2896.     }
  2897.   } while (!(currsym.st == srpar));
  2898.   R146 = tp;
  2899.   return R146;
  2900. }
  2901.  
  2902.  treeptr
  2903. plabstmt(void)
  2904. {
  2905.   register treeptr    R147;
  2906.   treeptr    tp;
  2907.  
  2908.   nextsymbol(*((symset *)SETALIGN(Conset[97])));
  2909.   if (currsym.st == sinteger) {
  2910.     tp = mknode(nlabstmt);
  2911.     (*tp).U.V25.tlabno = oldlbl(true);
  2912.     nextsymbol(*((symset *)SETALIGN(Conset[98])));
  2913.     nextsymbol(*((symset *)SETALIGN(Conset[99])));
  2914.     (*tp).U.V25.tstmt = pstmt();
  2915.   } else
  2916.     tp = pstmt();
  2917.   R147 = tp;
  2918.   return R147;
  2919. }
  2920.  
  2921.  treeptr
  2922. pstmt(void)
  2923. {
  2924.   register treeptr    R148;
  2925.   treeptr    tp;
  2926.  
  2927.   switch ((int)(currsym.st)) {
  2928.     case sid:
  2929.     tp = psimple();
  2930.     break ;
  2931.     case sif:
  2932.     tp = pif();
  2933.     break ;
  2934.     case swhile:
  2935.     tp = pwhile();
  2936.     break ;
  2937.     case srepeat:
  2938.     tp = prepeat();
  2939.     break ;
  2940.     case sfor:
  2941.     tp = pfor();
  2942.     break ;
  2943.     case scase:
  2944.     tp = pcase();
  2945.     break ;
  2946.     case swith:
  2947.     tp = pwith();
  2948.     break ;
  2949.     case sbegin:
  2950.     tp = pbegin(true);
  2951.     break ;
  2952.     case sgoto:
  2953.     tp = pgoto();
  2954.     break ;
  2955.     case send:  case selse:  case suntil:  case ssemic:
  2956.     tp = mknode(nempty);
  2957.     break ;
  2958.     default:
  2959.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2960.   }
  2961.   R148 = tp;
  2962.   return R148;
  2963. }
  2964.  
  2965.  void
  2966. flagassigndest(treeptr     tp)
  2967. {
  2968.   if (Member((unsigned)((*tp).tt), Conset[100]))
  2969.     switch ((int)((*tp).tt)) {
  2970.       case nindex:
  2971.       flagassigndest((*tp).U.V39.tvariable);
  2972.       break ;
  2973.       case nselect:
  2974.       flagassigndest((*tp).U.V40.trecord);
  2975.       break ;
  2976.       case nderef:
  2977.       (*tp).U.V42.tisassigndest = true;
  2978.       break ;
  2979.       default:
  2980.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  2981.     }
  2982. }
  2983.  
  2984.  treeptr
  2985. psimple(void)
  2986. {
  2987.   register treeptr    R149;
  2988.   treeptr    tq, tp;
  2989.  
  2990.   tp = pvariable(oldid(currsym.U.V1.vid, lidentifier));
  2991.   if (currsym.st == sassign) {
  2992.     tq = mknode(nassign);
  2993.     flagassigndest(tp);
  2994.     (*tq).U.V27.tlhs = tp;
  2995.     (*tq).U.V27.trhs = pexpr((treeptr)NIL);
  2996.     tp = tq;
  2997.   }
  2998.   R149 = tp;
  2999.   return R149;
  3000. }
  3001.  
  3002.  treeptr
  3003. pvariable(treeptr     varptr)
  3004. {
  3005.   register treeptr    R150;
  3006.   treeptr    tp, tq;
  3007.  
  3008.   nextsymbol(*((symset *)SETALIGN(Conset[101])));
  3009.   if (Member((unsigned)(currsym.st), Conset[102])) {
  3010.     switch ((int)(currsym.st)) {
  3011.       case slpar:
  3012.       tp = mknode(ncall);
  3013.       (*tp).U.V30.tcall = varptr;
  3014.       tq = (struct S64 *)NIL;
  3015.       do {
  3016.     if (tq == (struct S64 *)NIL) {
  3017.       tq = pexpr((treeptr)NIL);
  3018.       (*tp).U.V30.taparm = tq;
  3019.     } else {
  3020.       (*tq).tnext = pexpr((treeptr)NIL);
  3021.       tq = (*tq).tnext;
  3022.     }
  3023.       } while (!(currsym.st == srpar));
  3024.       break ;
  3025.       case slbrack:
  3026.       tq = varptr;
  3027.       do {
  3028.     tp = mknode(nindex);
  3029.     (*tp).U.V39.tvariable = tq;
  3030.     (*tp).U.V39.toffset = pexpr((treeptr)NIL);
  3031.     tq = tp;
  3032.       } while (!(currsym.st == srbrack));
  3033.       break ;
  3034.       case sdot:
  3035.       tp = mknode(nselect);
  3036.       (*tp).U.V40.trecord = varptr;
  3037.       nextsymbol(*((symset *)SETALIGN(Conset[103])));
  3038.       tq = typeof(varptr);
  3039.       enterscope((*tq).U.V21.trscope);
  3040.       (*tp).U.V40.tfield = oldid(currsym.U.V1.vid, lfield);
  3041.       leavescope();
  3042.       break ;
  3043.       case sarrow:
  3044.       tp = mknode(nderef);
  3045.       (*tp).U.V42.tisassigndest = false;
  3046.       (*tp).U.V42.texps = varptr;
  3047.       break ;
  3048.       default:
  3049.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3050.     }
  3051.     tp = pvariable(tp);
  3052.   } else {
  3053.     tp = varptr;
  3054.     if ((*tp).tt == nid) {
  3055.       tq = idup(tp);
  3056.       if (tq != (struct S64 *)NIL)
  3057.     if (Member((unsigned)((*tq).tt), Conset[104])) {
  3058.       tp = mknode(ncall);
  3059.       (*tp).U.V30.tcall = varptr;
  3060.       (*tp).U.V30.taparm = (struct S64 *)NIL;
  3061.     }
  3062.     }
  3063.   }
  3064.   R150 = tp;
  3065.   return R150;
  3066. }
  3067.  
  3068.  treeptr
  3069. padjust(treeptr     tu, treeptr     tr)
  3070. {
  3071.   register treeptr    R152;
  3072.  
  3073.   if ((int)(pprio.A[(int)((*tu).tt) - (int)(nassign)]) >= (int)(pprio.A[(int)((*tr).tt) - (int)(nassign)])) {
  3074.     if (Member((unsigned)((*tr).tt), Conset[105]))
  3075.       (*tr).U.V42.texps = padjust(tu, (*tr).U.V42.texps);
  3076.     else
  3077.       (*tr).U.V41.texpl = padjust(tu, (*tr).U.V41.texpl);
  3078.     R152 = tr;
  3079.   } else {
  3080.     if (Member((unsigned)((*tu).tt), Conset[106]))
  3081.       (*tu).U.V42.texps = tr;
  3082.     else
  3083.       (*tu).U.V41.texpr = tr;
  3084.     R152 = tu;
  3085.   }
  3086.   return R152;
  3087. }
  3088.  
  3089.  treeptr
  3090. pexpr(treeptr     tnp)
  3091. {
  3092.   register treeptr    R151;
  3093.   treeptr    tp, tq;
  3094.   treetyp    nt;
  3095.   boolean    next;
  3096.  
  3097.   nextsymbol(*((symset *)SETALIGN(Conset[107])));
  3098.   next = true;
  3099.   switch ((int)(currsym.st)) {
  3100.     case splus:
  3101.     tp = mknode(nuplus);
  3102.     (*tp).U.V42.texps = (struct S64 *)NIL;
  3103.     tp = pexpr(tp);
  3104.     next = false;
  3105.     break ;
  3106.     case sminus:
  3107.     tp = mknode(numinus);
  3108.     (*tp).U.V42.texps = (struct S64 *)NIL;
  3109.     tp = pexpr(tp);
  3110.     next = false;
  3111.     break ;
  3112.     case snot:
  3113.     tp = mknode(nnot);
  3114.     (*tp).U.V42.texps = (struct S64 *)NIL;
  3115.     tp = pexpr(tp);
  3116.     next = false;
  3117.     break ;
  3118.     case schar:  case sinteger:  case sreal:  case sstring:
  3119.     tp = mklit();
  3120.     break ;
  3121.     case snil:
  3122.     tp = mknode(nnil);
  3123.     break ;
  3124.     case sid:
  3125.     tp = pvariable(oldid(currsym.U.V1.vid, lidentifier));
  3126.     next = false;
  3127.     break ;
  3128.     case slpar:
  3129.     tp = mknode(nuplus);
  3130.     (*tp).U.V42.texps = pexpr((treeptr)NIL);
  3131.     break ;
  3132.     case slbrack:
  3133.     usesets = true;
  3134.     tp = mknode(nset);
  3135.     (*tp).U.V42.texps = (struct S64 *)NIL;
  3136.     tq = (struct S64 *)NIL;
  3137.     do {
  3138.       if (tq == (struct S64 *)NIL) {
  3139.     tq = pexpr((treeptr)NIL);
  3140.     (*tp).U.V42.texps = tq;
  3141.       } else {
  3142.     (*tq).tnext = pexpr((treeptr)NIL);
  3143.     tq = (*tq).tnext;
  3144.       }
  3145.     } while (!(currsym.st == srbrack));
  3146.     break ;
  3147.     case srbrack:
  3148.     tp = mknode(nempty);
  3149.     next = false;
  3150.     break ;
  3151.     default:
  3152.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3153.   }
  3154.   if (next)
  3155.     nextsymbol(*((symset *)SETALIGN(Conset[108])));
  3156.   switch ((int)(currsym.st)) {
  3157.     case sdotdot:
  3158.     nt = nrange;
  3159.     break ;
  3160.     case splus:
  3161.     nt = nplus;
  3162.     break ;
  3163.     case sminus:
  3164.     nt = nminus;
  3165.     break ;
  3166.     case smul:
  3167.     nt = nmul;
  3168.     break ;
  3169.     case sdiv:
  3170.     nt = ndiv;
  3171.     break ;
  3172.     case smod:
  3173.     nt = nmod;
  3174.     break ;
  3175.     case squot:
  3176.     (*defnams.A[(int)(dreal)]).U.V6.lused = true;
  3177.     nt = nquot;
  3178.     break ;
  3179.     case sand:
  3180.     nt = nand;
  3181.     break ;
  3182.     case sor:
  3183.     nt = nor;
  3184.     break ;
  3185.     case sinn:
  3186.     nt = nin;
  3187.     usesets = true;
  3188.     break ;
  3189.     case sle:
  3190.     nt = nle;
  3191.     break ;
  3192.     case slt:
  3193.     nt = nlt;
  3194.     break ;
  3195.     case seq:
  3196.     nt = neq;
  3197.     break ;
  3198.     case sge:
  3199.     nt = nge;
  3200.     break ;
  3201.     case sgt:
  3202.     nt = ngt;
  3203.     break ;
  3204.     case sne:
  3205.     nt = nne;
  3206.     break ;
  3207.     case scolon:
  3208.     nt = nformat;
  3209.     break ;
  3210.     case sid:  case schar:  case sinteger:  case sreal:
  3211.     case sstring:  case snil:  case ssemic:  case scomma:
  3212.     case slpar:  case slbrack:  case srpar:  case srbrack:
  3213.     case send:  case suntil:  case sthen:  case selse:
  3214.     case sdo:  case sdownto:  case sto:  case sof:
  3215.     nt = nnil;
  3216.     break ;
  3217.     default:
  3218.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3219.   }
  3220.   if (Member((unsigned)(nt), Conset[109]))
  3221.     (*defnams.A[(int)(dboolean)]).U.V6.lused = true;
  3222.   if (nt != nnil) {
  3223.     tq = mknode(nt);
  3224.     (*tq).U.V41.texpl = tp;
  3225.     (*tq).U.V41.texpr = (struct S64 *)NIL;
  3226.     tp = pexpr(tq);
  3227.   }
  3228.   if (tnp != (struct S64 *)NIL)
  3229.     tp = padjust(tnp, tp);
  3230.   R151 = tp;
  3231.   return R151;
  3232. }
  3233.  
  3234.  treeptr
  3235. pcase(void)
  3236. {
  3237.   register treeptr    R153;
  3238.   treeptr    tp, tq, tv;
  3239.  
  3240.   tp = mknode(ncase);
  3241.   (*tp).U.V35.tcasxp = pexpr((treeptr)NIL);
  3242.   checksymbol(*((symset *)SETALIGN(Conset[110])));
  3243.   tq = (struct S64 *)NIL;
  3244.   do {
  3245.     if (tq == (struct S64 *)NIL) {
  3246.       tq = mknode(nchoise);
  3247.       (*tp).U.V35.tcaslst = tq;
  3248.     } else {
  3249.       (*tq).tnext = mknode(nchoise);
  3250.       tq = (*tq).tnext;
  3251.     }
  3252.     (*tq).U.V36.tchocon = (struct S64 *)NIL;
  3253.     (*tq).U.V36.tchostmt = (struct S64 *)NIL;
  3254.     tv = (struct S64 *)NIL;
  3255.     do {
  3256.       nextsymbol(*((symset *)SETALIGN(Conset[111])));
  3257.       if (Member((unsigned)(currsym.st), Conset[112]))
  3258.     goto L999;
  3259.       if (tv == (struct S64 *)NIL) {
  3260.     tv = pconstant(false);
  3261.     (*tq).U.V36.tchocon = tv;
  3262.       } else {
  3263.     (*tv).tnext = pconstant(false);
  3264.     tv = (*tv).tnext;
  3265.       }
  3266.       nextsymbol(*((symset *)SETALIGN(Conset[113])));
  3267.     } while (!(currsym.st == scolon));
  3268.     (*tq).U.V36.tchostmt = plabstmt();
  3269.   } while (!(currsym.st == send));
  3270. L999:
  3271.   if ((currsym.st == sother) || (currsym.st == sother2)) {
  3272.     nextsymbol(*((symset *)SETALIGN(Conset[114])));
  3273.     if (currsym.st == scolon)
  3274.       nextsymbol(*((symset *)SETALIGN(Conset[115])));
  3275.     (*tp).U.V35.tcasother = pstmt();
  3276.     if (currsym.st == ssemic)
  3277.       nextsymbol(*((symset *)SETALIGN(Conset[116])));
  3278.   } else {
  3279.     (*tp).U.V35.tcasother = (struct S64 *)NIL;
  3280.     usecase = true;
  3281.   }
  3282.   nextsymbol(*((symset *)SETALIGN(Conset[117])));
  3283.   R153 = tp;
  3284.   return R153;
  3285. }
  3286.  
  3287.  treeptr
  3288. pif(void)
  3289. {
  3290.   register treeptr    R154;
  3291.   treeptr    tp;
  3292.  
  3293.   tp = mknode(nif);
  3294.   (*tp).U.V31.tifxp = pexpr((treeptr)NIL);
  3295.   checksymbol(*((symset *)SETALIGN(Conset[118])));
  3296.   (*tp).U.V31.tthen = plabstmt();
  3297.   if (currsym.st == selse)
  3298.     (*tp).U.V31.telse = plabstmt();
  3299.   else
  3300.     (*tp).U.V31.telse = (struct S64 *)NIL;
  3301.   R154 = tp;
  3302.   return R154;
  3303. }
  3304.  
  3305.  treeptr
  3306. pwhile(void)
  3307. {
  3308.   register treeptr    R155;
  3309.   treeptr    tp;
  3310.  
  3311.   tp = mknode(nwhile);
  3312.   (*tp).U.V32.twhixp = pexpr((treeptr)NIL);
  3313.   checksymbol(*((symset *)SETALIGN(Conset[119])));
  3314.   (*tp).U.V32.twhistmt = plabstmt();
  3315.   R155 = tp;
  3316.   return R155;
  3317. }
  3318.  
  3319.  treeptr
  3320. prepeat(void)
  3321. {
  3322.   register treeptr    R156;
  3323.   treeptr    tp, tq;
  3324.  
  3325.   tp = mknode(nrepeat);
  3326.   tq = (struct S64 *)NIL;
  3327.   do {
  3328.     if (tq == (struct S64 *)NIL) {
  3329.       tq = plabstmt();
  3330.       (*tp).U.V33.treptstmt = tq;
  3331.     } else {
  3332.       (*tq).tnext = plabstmt();
  3333.       tq = (*tq).tnext;
  3334.     }
  3335.     checksymbol(*((symset *)SETALIGN(Conset[120])));
  3336.   } while (!(currsym.st == suntil));
  3337.   (*tp).U.V33.treptxp = pexpr((treeptr)NIL);
  3338.   R156 = tp;
  3339.   return R156;
  3340. }
  3341.  
  3342.  treeptr
  3343. pfor(void)
  3344. {
  3345.   register treeptr    R157;
  3346.   treeptr    tp;
  3347.  
  3348.   tp = mknode(nfor);
  3349.   nextsymbol(*((symset *)SETALIGN(Conset[121])));
  3350.   (*tp).U.V34.tforid = oldid(currsym.U.V1.vid, lidentifier);
  3351.   nextsymbol(*((symset *)SETALIGN(Conset[122])));
  3352.   (*tp).U.V34.tfrom = pexpr((treeptr)NIL);
  3353.   checksymbol(*((symset *)SETALIGN(Conset[123])));
  3354.   (*tp).U.V34.tincr = (boolean)(currsym.st == sto);
  3355.   (*tp).U.V34.tto = pexpr((treeptr)NIL);
  3356.   checksymbol(*((symset *)SETALIGN(Conset[124])));
  3357.   (*tp).U.V34.tforstmt = plabstmt();
  3358.   R157 = tp;
  3359.   return R157;
  3360. }
  3361.  
  3362.  treeptr
  3363. pwith(void)
  3364. {
  3365.   register treeptr    R158;
  3366.   treeptr    tp, tq;
  3367.  
  3368.   tp = mknode(nwith);
  3369.   tq = (struct S64 *)NIL;
  3370.   do {
  3371.     if (tq == (struct S64 *)NIL) {
  3372.       tq = mknode(nwithvar);
  3373.       (*tp).U.V37.twithvar = tq;
  3374.     } else {
  3375.       (*tq).tnext = mknode(nwithvar);
  3376.       tq = (*tq).tnext;
  3377.     }
  3378.     enterscope((declptr)NIL);
  3379.     (*tq).U.V38.tenv = currscope();
  3380.     (*tq).U.V38.texpw = pexpr((treeptr)NIL);
  3381.     scopeup((*tq).U.V38.texpw);
  3382.     checksymbol(*((symset *)SETALIGN(Conset[125])));
  3383.   } while (!(currsym.st == sdo));
  3384.   (*tp).U.V37.twithstmt = plabstmt();
  3385.   tq = (*tp).U.V37.twithvar;
  3386.   while (tq != (struct S64 *)NIL) {
  3387.     leavescope();
  3388.     tq = (*tq).tnext;
  3389.   }
  3390.   R158 = tp;
  3391.   return R158;
  3392. }
  3393.  
  3394.  treeptr
  3395. pgoto(void)
  3396. {
  3397.   register treeptr    R159;
  3398.   treeptr    tp;
  3399.  
  3400.   nextsymbol(*((symset *)SETALIGN(Conset[126])));
  3401.   tp = mknode(ngoto);
  3402.   (*tp).U.V26.tlabel = oldlbl(false);
  3403.   nextsymbol(*((symset *)SETALIGN(Conset[127])));
  3404.   R159 = tp;
  3405.   return R159;
  3406. }
  3407.  
  3408.  treeptr
  3409. pbegin(boolean     retain)
  3410. {
  3411.   register treeptr    R160;
  3412.   treeptr    tp, tq;
  3413.  
  3414.   tq = (struct S64 *)NIL;
  3415.   do {
  3416.     if (tq == (struct S64 *)NIL) {
  3417.       tq = plabstmt();
  3418.       tp = tq;
  3419.     } else {
  3420.       (*tq).tnext = plabstmt();
  3421.       tq = (*tq).tnext;
  3422.     }
  3423.   } while (!(currsym.st == send));
  3424.   if (retain) {
  3425.     tq = mknode(nbegin);
  3426.     (*tq).U.V24.tbegin = tp;
  3427.     tp = tq;
  3428.   }
  3429.   nextsymbol(*((symset *)SETALIGN(Conset[128])));
  3430.   R160 = tp;
  3431.   return R160;
  3432. }
  3433.  
  3434.  void
  3435. parse(void)
  3436. {
  3437.   nextsymbol(*((symset *)SETALIGN(Conset[129])));
  3438.   if (currsym.st == spgm)
  3439.     top = pprogram();
  3440.   else
  3441.     top = pmodule();
  3442. }
  3443.  
  3444.  integer
  3445. cvalof(treeptr     tp)
  3446. {
  3447.   register integer    R161;
  3448.   integer    v;
  3449.   treeptr    tq;
  3450.  
  3451.   switch ((int)((*tp).tt)) {
  3452.     case nuplus:
  3453.     R161 = cvalof((*tp).U.V42.texps);
  3454.     break ;
  3455.     case numinus:
  3456.     R161 = -cvalof((*tp).U.V42.texps);
  3457.     break ;
  3458.     case nnot:
  3459.     R161 = 1 - cvalof((*tp).U.V42.texps);
  3460.     break ;
  3461.     case nid:
  3462.     tq = idup(tp);
  3463.     if (tq == (struct S64 *)NIL)
  3464.       fatal(etree);
  3465.     tp = (*(*tp).U.V43.tsym).lsymdecl;
  3466.     switch ((int)((*tq).tt)) {
  3467.       case nscalar:
  3468.       v = 0;
  3469.       tq = (*tq).U.V17.tscalid;
  3470.       while (tq != (struct S64 *)NIL)
  3471.     if (tq == tp)
  3472.       tq = (struct S64 *)NIL;
  3473.     else {
  3474.       v = v + 1;
  3475.       tq = (*tq).tnext;
  3476.     }
  3477.       R161 = v;
  3478.       break ;
  3479.       case nconst:
  3480.       R161 = cvalof((*tq).U.V14.tbind);
  3481.       break ;
  3482.       default:
  3483.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3484.     }
  3485.     break ;
  3486.     case ninteger:
  3487.     R161 = (*(*tp).U.V43.tsym).U.V10.linum;
  3488.     break ;
  3489.     case nchar:
  3490.     R161 = (unsigned)((*(*tp).U.V43.tsym).U.V11.lchar);
  3491.     break ;
  3492.     default:
  3493.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3494.   }
  3495.   return R161;
  3496. }
  3497.  
  3498.  integer
  3499. clower(treeptr     tp)
  3500. {
  3501.   register integer    R162;
  3502.   treeptr    tq;
  3503.  
  3504.   tq = typeof(tp);
  3505.   if ((*tq).tt == nscalar)
  3506.     R162 = scalbase;
  3507.   else
  3508.     if ((*tq).tt == nsubrange)
  3509.       if ((*(*tq).tup).tt == nconfarr)
  3510.     R162 = 0;
  3511.       else
  3512.     R162 = cvalof((*tq).U.V19.tlo);
  3513.     else
  3514.       if (tq == typnods.A[(int)(tchar)])
  3515.     R162 = 0;
  3516.       else
  3517.     if (tq == typnods.A[(int)(tinteger)])
  3518.       R162 = -maxint;
  3519.     else
  3520.       fatal(etree);
  3521.   return R162;
  3522. }
  3523.  
  3524.  integer
  3525. cupper(treeptr     tp)
  3526. {
  3527.   register integer    R163;
  3528.   treeptr    tq;
  3529.   integer    i;
  3530.  
  3531.   tq = typeof(tp);
  3532.   if ((*tq).tt == nscalar) {
  3533.     tq = (*tq).U.V17.tscalid;
  3534.     i = scalbase;
  3535.     while ((*tq).tnext != (struct S64 *)NIL) {
  3536.       i = i + 1;
  3537.       tq = (*tq).tnext;
  3538.     }
  3539.     R163 = i;
  3540.   } else
  3541.     if ((*tq).tt == nsubrange)
  3542.       if ((*(*tq).tup).tt == nconfarr)
  3543.     fatal(euprconf);
  3544.       else
  3545.     R163 = cvalof((*tq).U.V19.thi);
  3546.     else
  3547.       if (tq == typnods.A[(int)(tchar)])
  3548.     R163 = maxchar;
  3549.       else
  3550.     if (tq == typnods.A[(int)(tinteger)])
  3551.       R163 = maxint;
  3552.     else
  3553.       fatal(etree);
  3554.   return R163;
  3555. }
  3556.  
  3557.  integer
  3558. crange(treeptr     tp)
  3559. {
  3560.   register integer    R164;
  3561.  
  3562.   R164 = cupper(tp) - clower(tp) + 1;
  3563.   return R164;
  3564. }
  3565.  
  3566.  integer
  3567. csetwords(integer     i)
  3568. {
  3569.   register integer    R165;
  3570.  
  3571.   i = (i + (C37_setbits)) / (C37_setbits + 1);
  3572.   if (i > maxsetrange)
  3573.     error(esetsize);
  3574.   R165 = i;
  3575.   return R165;
  3576. }
  3577.  
  3578.  integer
  3579. csetsize(treeptr     tp)
  3580. {
  3581.   register integer    R166;
  3582.   treeptr    tq;
  3583.   integer    i;
  3584.  
  3585.   tq = typeof((*tp).U.V18.tof);
  3586.   i = clower(tq);
  3587.   if ((i < 0) || (i >= 6 * (C37_setbits + 1)))
  3588.     error(esetbase);
  3589.   R166 = csetwords(crange(tq)) + 1;
  3590.   return R166;
  3591. }
  3592.  
  3593.  boolean
  3594. islocal(treeptr     tp)
  3595. {
  3596.   register boolean    R167;
  3597.   treeptr    tq;
  3598.  
  3599.   tq = (*(*tp).U.V43.tsym).lsymdecl;
  3600.   while (!(Member((unsigned)((*tq).tt), Conset[130])))
  3601.     tq = (*tq).tup;
  3602.   while (!(Member((unsigned)((*tp).tt), Conset[131])))
  3603.     tp = (*tp).tup;
  3604.   R167 = (boolean)(tp == tq);
  3605.   return R167;
  3606. }
  3607.  
  3608.  void
  3609. crtnvar(treeptr     tp)
  3610. {
  3611.   while (tp != (struct S64 *)NIL) {
  3612.     switch ((int)((*tp).tt)) {
  3613.       case npgm:
  3614.       crtnvar((*tp).U.V13.tsubsub);
  3615.       break ;
  3616.       case nfunc:  case nproc:
  3617.       crtnvar((*tp).U.V13.tsubsub);
  3618.       crtnvar((*tp).U.V13.tsubstmt);
  3619.       break ;
  3620.       case nbegin:
  3621.       crtnvar((*tp).U.V24.tbegin);
  3622.       break ;
  3623.       case nif:
  3624.       crtnvar((*tp).U.V31.tthen);
  3625.       crtnvar((*tp).U.V31.telse);
  3626.       break ;
  3627.       case nwhile:
  3628.       crtnvar((*tp).U.V32.twhistmt);
  3629.       break ;
  3630.       case nrepeat:
  3631.       crtnvar((*tp).U.V33.treptstmt);
  3632.       break ;
  3633.       case nfor:
  3634.       crtnvar((*tp).U.V34.tforstmt);
  3635.       break ;
  3636.       case ncase:
  3637.       crtnvar((*tp).U.V35.tcaslst);
  3638.       crtnvar((*tp).U.V35.tcasother);
  3639.       break ;
  3640.       case nchoise:
  3641.       crtnvar((*tp).U.V36.tchostmt);
  3642.       break ;
  3643.       case nwith:
  3644.       crtnvar((*tp).U.V37.twithstmt);
  3645.       break ;
  3646.       case nlabstmt:
  3647.       crtnvar((*tp).U.V25.tstmt);
  3648.       break ;
  3649.       case nassign:
  3650.       if ((*(*tp).U.V27.tlhs).tt == ncall) {
  3651.     (*tp).U.V27.tlhs = (*(*tp).U.V27.tlhs).U.V30.tcall;
  3652.     (*(*tp).U.V27.tlhs).tup = tp;
  3653.       }
  3654.       (*G192_tv) = (*tp).U.V27.tlhs;
  3655.       if ((*(*G192_tv)).tt == nid)
  3656.     if ((*(*G192_tv)).U.V43.tsym == (*G188_ip))
  3657.       (*(*G192_tv)).U.V43.tsym = (*G190_iq);
  3658.       break ;
  3659.       case nbreak:  case npush:  case npop:  case ngoto:
  3660.       case nempty:  case ncall:
  3661.       break ;
  3662.       default:
  3663.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3664.     }
  3665.     tp = (*tp).tnext;
  3666.   }
  3667. }
  3668.  
  3669.  void
  3670. renamf(treeptr     tp)
  3671. {
  3672.   symptr    ip, iq;
  3673.   treeptr    tq, tv;
  3674.   symptr    *F189;
  3675.   symptr    *F191;
  3676.   treeptr    *F193;
  3677.  
  3678.   F193 = G192_tv;
  3679.   G192_tv = &tv;
  3680.   F191 = G190_iq;
  3681.   G190_iq = &iq;
  3682.   F189 = G188_ip;
  3683.   G188_ip = &ip;
  3684.   while (tp != (struct S64 *)NIL) {
  3685.     switch ((int)((*tp).tt)) {
  3686.       case npgm:  case nproc:
  3687.       renamf((*tp).U.V13.tsubsub);
  3688.       break ;
  3689.       case nfunc:
  3690.       tq = mknode(nvar);
  3691.       (*tq).U.V14.tattr = aregister;
  3692.       (*tq).tup = tp;
  3693.       (*tq).U.V14.tidl = newid(mkvariable('R'));
  3694.       (*(*tq).U.V14.tidl).tup = tq;
  3695.       (*tq).U.V14.tbind = (*tp).U.V13.tfuntyp;
  3696.       (*tq).tnext = (*tp).U.V13.tsubvar;
  3697.       (*tp).U.V13.tsubvar = tq;
  3698.       (*G190_iq) = (*(*tq).U.V14.tidl).U.V43.tsym;
  3699.       (*G188_ip) = (*(*tp).U.V13.tsubid).U.V43.tsym;
  3700.       crtnvar((*tp).U.V13.tsubsub);
  3701.       crtnvar((*tp).U.V13.tsubstmt);
  3702.       renamf((*tp).U.V13.tsubsub);
  3703.       break ;
  3704.       default:
  3705.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3706.     }
  3707.     tp = (*tp).tnext;
  3708.   }
  3709.   G188_ip = F189;
  3710.   G190_iq = F191;
  3711.   G192_tv = F193;
  3712. }
  3713.  
  3714.  treeptr
  3715. xtrit(treeptr     tp, treeptr     pp, boolean     last)
  3716. {
  3717.   register treeptr    R168;
  3718.   treeptr    np, rp;
  3719.   idptr    ip;
  3720.  
  3721.   np = mknode(ntype);
  3722.   ip = mkvariable('T');
  3723.   (*np).U.V14.tidl = newid(ip);
  3724.   (*(*np).U.V14.tidl).tup = np;
  3725.   rp = oldid(ip, lidentifier);
  3726.   (*rp).tup = (*tp).tup;
  3727.   (*rp).tnext = (*tp).tnext;
  3728.   (*np).U.V14.tbind = tp;
  3729.   (*tp).tup = np;
  3730.   (*tp).tnext = (struct S64 *)NIL;
  3731.   (*np).tup = pp;
  3732.   if (last && ((*pp).U.V13.tsubtype != (struct S64 *)NIL)) {
  3733.     pp = (*pp).U.V13.tsubtype;
  3734.     while ((*pp).tnext != (struct S64 *)NIL)
  3735.       pp = (*pp).tnext;
  3736.     (*pp).tnext = np;
  3737.   } else {
  3738.     (*np).tnext = (*pp).U.V13.tsubtype;
  3739.     (*pp).U.V13.tsubtype = np;
  3740.   }
  3741.   R168 = rp;
  3742.   return R168;
  3743. }
  3744.  
  3745.  void
  3746. nametype(treeptr     tp)
  3747. {
  3748.   tp = typeof(tp);
  3749.   if ((*tp).tt == nrecord)
  3750.     if ((*tp).U.V21.tuid == (struct S62 *)NIL)
  3751.       (*tp).U.V21.tuid = mkvariable('S');
  3752. }
  3753.  
  3754.  treeptr
  3755. xtrenum(treeptr     tp, treeptr     pp)
  3756. {
  3757.   register treeptr    R169;
  3758.  
  3759.   if (tp != (struct S64 *)NIL) {
  3760.     switch ((int)((*tp).tt)) {
  3761.       case nfield:  case ntype:  case nvar:
  3762.       (*tp).U.V14.tbind = xtrenum((*tp).U.V14.tbind, pp);
  3763.       break ;
  3764.       case nscalar:
  3765.       if ((*(*tp).tup).tt != ntype)
  3766.     tp = xtrit(tp, pp, false);
  3767.       break ;
  3768.       case narray:
  3769.       (*tp).U.V23.taindx = xtrenum((*tp).U.V23.taindx, pp);
  3770.       (*tp).U.V23.taelem = xtrenum((*tp).U.V23.taelem, pp);
  3771.       break ;
  3772.       case nrecord:
  3773.       (*tp).U.V21.tflist = xtrenum((*tp).U.V21.tflist, pp);
  3774.       (*tp).U.V21.tvlist = xtrenum((*tp).U.V21.tvlist, pp);
  3775.       break ;
  3776.       case nvariant:
  3777.       (*tp).U.V20.tvrnt = xtrenum((*tp).U.V20.tvrnt, pp);
  3778.       break ;
  3779.       case nfileof:
  3780.       (*tp).U.V18.tof = xtrenum((*tp).U.V18.tof, pp);
  3781.       break ;
  3782.       case nptr:
  3783.       nametype((*tp).U.V16.tptrid);
  3784.       break ;
  3785.       case nid:  case nsubrange:  case npredef:  case nempty:
  3786.       case nsetof:
  3787.       break ;
  3788.       default:
  3789.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3790.     }
  3791.     (*tp).tnext = xtrenum((*tp).tnext, pp);
  3792.   }
  3793.   R169 = tp;
  3794.   return R169;
  3795. }
  3796.  
  3797.  void
  3798. extract(treeptr     tp)
  3799. {
  3800.   treeptr    vp;
  3801.  
  3802.   while (tp != (struct S64 *)NIL) {
  3803.     (*tp).U.V13.tsubtype = xtrenum((*tp).U.V13.tsubtype, tp);
  3804.     (*tp).U.V13.tsubvar = xtrenum((*tp).U.V13.tsubvar, tp);
  3805.     vp = (*tp).U.V13.tsubvar;
  3806.     while (vp != (struct S64 *)NIL) {
  3807.       if (Member((unsigned)((*(*vp).U.V14.tbind).tt), Conset[132]))
  3808.     (*vp).U.V14.tbind = xtrit((*vp).U.V14.tbind, tp, true);
  3809.       vp = (*vp).tnext;
  3810.     }
  3811.     extract((*tp).U.V13.tsubsub);
  3812.     tp = (*tp).tnext;
  3813.   }
  3814. }
  3815.  
  3816.  void
  3817. markdecl(treeptr     xp)
  3818. {
  3819.   while (xp != (struct S64 *)NIL) {
  3820.     switch ((int)((*xp).tt)) {
  3821.       case nid:
  3822.       (*(*xp).U.V43.tsym).U.V6.lused = false;
  3823.       break ;
  3824.       case nconst:
  3825.       markdecl((*xp).U.V14.tidl);
  3826.       break ;
  3827.       case ntype:  case nvar:  case nvalpar:  case nvarpar:
  3828.       case nfield:
  3829.       markdecl((*xp).U.V14.tidl);
  3830.       if ((*(*xp).U.V14.tbind).tt != nid)
  3831.     markdecl((*xp).U.V14.tbind);
  3832.       break ;
  3833.       case nscalar:
  3834.       markdecl((*xp).U.V17.tscalid);
  3835.       break ;
  3836.       case nrecord:
  3837.       markdecl((*xp).U.V21.tflist);
  3838.       markdecl((*xp).U.V21.tvlist);
  3839.       break ;
  3840.       case nvariant:
  3841.       markdecl((*xp).U.V20.tvrnt);
  3842.       break ;
  3843.       case nconfarr:
  3844.       if ((*(*xp).U.V22.tcelem).tt != nid)
  3845.     markdecl((*xp).U.V22.tcelem);
  3846.       break ;
  3847.       case narray:
  3848.       if ((*(*xp).U.V23.taelem).tt != nid)
  3849.     markdecl((*xp).U.V23.taelem);
  3850.       break ;
  3851.       case nsetof:  case nfileof:
  3852.       if ((*(*xp).U.V18.tof).tt != nid)
  3853.     markdecl((*xp).U.V18.tof);
  3854.       break ;
  3855.       case nparproc:  case nparfunc:
  3856.       markdecl((*xp).U.V15.tparid);
  3857.       break ;
  3858.       case nptr:  case nsubrange:
  3859.       break ;
  3860.       default:
  3861.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3862.     }
  3863.     xp = (*xp).tnext;
  3864.   }
  3865. }
  3866.  
  3867.  treeptr
  3868. movedecl(treeptr     tp)
  3869. {
  3870.   register treeptr    R170;
  3871.   treeptr    ip, np;
  3872.   symptr    sp;
  3873.   boolean    move;
  3874.  
  3875.   if (tp != (struct S64 *)NIL) {
  3876.     move = false;
  3877.     switch ((int)((*tp).tt)) {
  3878.       case nconst:  case ntype:
  3879.       ip = (*tp).U.V14.tidl;
  3880.       break ;
  3881.       default:
  3882.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3883.     }
  3884.     while (ip != (struct S64 *)NIL) {
  3885.       if ((*(*ip).U.V43.tsym).U.V6.lused) {
  3886.     move = true;
  3887.     sp = (*ip).U.V43.tsym;
  3888.     if ((*(*sp).U.V6.lid).inref > 1)
  3889.       (*sp).U.V6.lid = mkrename('M', (*sp).U.V6.lid);
  3890.     ip = (struct S64 *)NIL;
  3891.       } else
  3892.     ip = (*ip).tnext;
  3893.     }
  3894.     if (move) {
  3895.       np = (*tp).tnext;
  3896.       (*tp).tnext = (struct S64 *)NIL;
  3897.       ip = tp;
  3898.       while ((*ip).tt != npgm)
  3899.     ip = (*ip).tup;
  3900.       (*tp).tup = ip;
  3901.       switch ((int)((*tp).tt)) {
  3902.         case nconst:
  3903.     if ((*ip).U.V13.tsubconst == (struct S64 *)NIL)
  3904.       (*ip).U.V13.tsubconst = tp;
  3905.     else {
  3906.       ip = (*ip).U.V13.tsubconst;
  3907.       while ((*ip).tnext != (struct S64 *)NIL)
  3908.         ip = (*ip).tnext;
  3909.       (*ip).tnext = tp;
  3910.     }
  3911.     break ;
  3912.         case ntype:
  3913.     if ((*ip).U.V13.tsubtype == (struct S64 *)NIL)
  3914.       (*ip).U.V13.tsubtype = tp;
  3915.     else {
  3916.       ip = (*ip).U.V13.tsubtype;
  3917.       while ((*ip).tnext != (struct S64 *)NIL)
  3918.         ip = (*ip).tnext;
  3919.       (*ip).tnext = tp;
  3920.     }
  3921.     break ;
  3922.         default:
  3923.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3924.       }
  3925.       tp = movedecl(np);
  3926.     } else
  3927.       (*tp).tnext = movedecl((*tp).tnext);
  3928.   }
  3929.   R170 = tp;
  3930.   return R170;
  3931. }
  3932.  
  3933.  void
  3934. moveglob(treeptr     tp, treeptr     dp)
  3935. {
  3936.   while ((*tp).tt != npgm)
  3937.     tp = (*tp).tup;
  3938.   (*dp).tup = tp;
  3939.   (*dp).tnext = (*tp).U.V13.tsubvar;
  3940.   (*tp).U.V13.tsubvar = dp;
  3941. }
  3942.  
  3943.  treeptr
  3944. stackop(treeptr     decl, treeptr     glob, treeptr     loc)
  3945. {
  3946.   register treeptr    R171;
  3947.   treeptr    op, ip, dp, tp;
  3948.  
  3949.   ip = newid(mkvariable('F'));
  3950.   switch ((int)((*(*G194_vp)).tt)) {
  3951.     case nvarpar:  case nvalpar:  case nvar:
  3952.     dp = mknode(nvarpar);
  3953.     (*dp).U.V14.tattr = areference;
  3954.     (*dp).U.V14.tidl = ip;
  3955.     (*dp).U.V14.tbind = (*decl).U.V14.tbind;
  3956.     break ;
  3957.     case nparproc:  case nparfunc:
  3958.     dp = mknode((*(*G194_vp)).tt);
  3959.     (*dp).U.V15.tparid = ip;
  3960.     (*dp).U.V15.tparparm = (struct S64 *)NIL;
  3961.     (*dp).U.V15.tpartyp = (*(*G194_vp)).U.V15.tpartyp;
  3962.     break ;
  3963.     default:
  3964.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  3965.   }
  3966.   (*ip).tup = dp;
  3967.   tp = decl;
  3968.   while (!(Member((unsigned)((*tp).tt), Conset[133])))
  3969.     tp = (*tp).tup;
  3970.   (*dp).tup = tp;
  3971.   if ((*tp).U.V13.tsubvar == (struct S64 *)NIL)
  3972.     (*tp).U.V13.tsubvar = dp;
  3973.   else {
  3974.     tp = (*tp).U.V13.tsubvar;
  3975.     while ((*tp).tnext != (struct S64 *)NIL)
  3976.       tp = (*tp).tnext;
  3977.     (*tp).tnext = dp;
  3978.   }
  3979.   (*dp).tnext = (struct S64 *)NIL;
  3980.   op = mknode(npush);
  3981.   (*op).U.V28.tglob = glob;
  3982.   (*op).U.V28.tloc = loc;
  3983.   (*op).U.V28.ttmp = ip;
  3984.   R171 = op;
  3985.   return R171;
  3986. }
  3987.  
  3988.  void
  3989. addcode(treeptr     tp, treeptr     push)
  3990. {
  3991.   treeptr    pop;
  3992.  
  3993.   pop = mknode(npop);
  3994.   (*pop).U.V28.tglob = (*push).U.V28.tglob;
  3995.   (*pop).U.V28.ttmp = (*push).U.V28.ttmp;
  3996.   (*pop).U.V28.tloc = (struct S64 *)NIL;
  3997.   (*push).tnext = (*tp).U.V13.tsubstmt;
  3998.   (*tp).U.V13.tsubstmt = push;
  3999.   (*push).tup = tp;
  4000.   while ((*push).tnext != (struct S64 *)NIL)
  4001.     push = (*push).tnext;
  4002.   (*push).tnext = pop;
  4003.   (*pop).tup = tp;
  4004. }
  4005.  
  4006.  void
  4007. movevars(treeptr     tp, treeptr     vp)
  4008. {
  4009.   treeptr    ep, dp, np;
  4010.   idptr    ip;
  4011.   symptr    sp;
  4012.   treeptr    *F195;
  4013.  
  4014.   F195 = G194_vp;
  4015.   G194_vp = &vp;
  4016.   while ((*G194_vp) != (struct S64 *)NIL) {
  4017.     switch ((int)((*(*G194_vp)).tt)) {
  4018.       case nvar:  case nvalpar:  case nvarpar:
  4019.       dp = (*(*G194_vp)).U.V14.tidl;
  4020.       break ;
  4021.       case nparproc:  case nparfunc:
  4022.       dp = (*(*G194_vp)).U.V15.tparid;
  4023.       if ((*(*dp).U.V43.tsym).U.V6.lused) {
  4024.     ep = mknode((*(*G194_vp)).tt);
  4025.     (*ep).U.V15.tparparm = (struct S64 *)NIL;
  4026.     (*ep).U.V15.tpartyp = (*(*G194_vp)).U.V15.tpartyp;
  4027.     np = newid(mkrename('G', (*(*dp).U.V43.tsym).U.V6.lid));
  4028.     (*ep).U.V15.tparid = np;
  4029.     (*np).tup = ep;
  4030.     sp = (*np).U.V43.tsym;
  4031.     ip = (*sp).U.V6.lid;
  4032.     (*(*np).U.V43.tsym).U.V6.lid = (*(*dp).U.V43.tsym).U.V6.lid;
  4033.     (*(*dp).U.V43.tsym).U.V6.lid = ip;
  4034.     (*np).U.V43.tsym = (*dp).U.V43.tsym;
  4035.     (*dp).U.V43.tsym = sp;
  4036.     (*(*np).U.V43.tsym).lsymdecl = np;
  4037.     (*(*dp).U.V43.tsym).lsymdecl = dp;
  4038.     moveglob(tp, ep);
  4039.     addcode(tp, stackop((*G194_vp), np, dp));
  4040.       }
  4041.       goto L555;
  4042.       break ;
  4043.       default:
  4044.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4045.     }
  4046.     while (dp != (struct S64 *)NIL) {
  4047.       if ((*(*dp).U.V43.tsym).U.V6.lused) {
  4048.     ep = mknode(nvarpar);
  4049.     (*ep).U.V14.tattr = areference;
  4050.     np = newid(mkrename('G', (*(*dp).U.V43.tsym).U.V6.lid));
  4051.     (*ep).U.V14.tidl = np;
  4052.     (*np).tup = ep;
  4053.     (*ep).U.V14.tbind = (*(*G194_vp)).U.V14.tbind;
  4054.     if ((*(*ep).U.V14.tbind).tt == nid)
  4055.       (*(*(*ep).U.V14.tbind).U.V43.tsym).U.V6.lused = true;
  4056.     sp = (*np).U.V43.tsym;
  4057.     ip = (*sp).U.V6.lid;
  4058.     (*(*np).U.V43.tsym).U.V6.lid = (*(*dp).U.V43.tsym).U.V6.lid;
  4059.     (*(*dp).U.V43.tsym).U.V6.lid = ip;
  4060.     (*np).U.V43.tsym = (*dp).U.V43.tsym;
  4061.     (*dp).U.V43.tsym = sp;
  4062.     (*(*np).U.V43.tsym).lsymdecl = np;
  4063.     (*(*dp).U.V43.tsym).lsymdecl = dp;
  4064.     (*(*dp).tup).U.V14.tattr = aextern;
  4065.     moveglob(tp, ep);
  4066.     addcode(tp, stackop((*G194_vp), np, dp));
  4067.       }
  4068.       dp = (*dp).tnext;
  4069.     }
  4070.   L555:
  4071.     (*G194_vp) = (*(*G194_vp)).tnext;
  4072.   }
  4073.   G194_vp = F195;
  4074. }
  4075.  
  4076.  void
  4077. registervar(treeptr     tp)
  4078. {
  4079.   treeptr    vp, xp;
  4080.  
  4081.   vp = idup(tp);
  4082.   tp = (*(*tp).U.V43.tsym).lsymdecl;
  4083.   if (((*vp).U.V14.tidl != tp) || ((*tp).tnext != (struct S64 *)NIL)) {
  4084.     xp = mknode(nvar);
  4085.     (*xp).U.V14.tattr = anone;
  4086.     (*xp).U.V14.tidl = tp;
  4087.     (*tp).tup = xp;
  4088.     (*xp).tup = (*vp).tup;
  4089.     (*xp).U.V14.tbind = (*vp).U.V14.tbind;
  4090.     (*xp).tnext = (*vp).tnext;
  4091.     (*vp).tnext = xp;
  4092.     if ((*vp).U.V14.tidl == tp)
  4093.       (*vp).U.V14.tidl = (*tp).tnext;
  4094.     else {
  4095.       vp = (*vp).U.V14.tidl;
  4096.       while ((*vp).tnext != tp)
  4097.     vp = (*vp).tnext;
  4098.       (*vp).tnext = (*tp).tnext;
  4099.     }
  4100.     (*tp).tnext = (struct S64 *)NIL;
  4101.   }
  4102.   if ((*(*tp).tup).U.V14.tattr == anone)
  4103.     (*(*tp).tup).U.V14.tattr = aregister;
  4104. }
  4105.  
  4106.  void
  4107. cklevel(treeptr     tp)
  4108. {
  4109.   tp = (*(*tp).U.V43.tsym).lsymdecl;
  4110.   while (!(Member((unsigned)((*tp).tt), Conset[134])))
  4111.     tp = (*tp).tup;
  4112.   if ((*tp).U.V13.tstat > maxlevel)
  4113.     maxlevel = (*tp).U.V13.tstat;
  4114. }
  4115.  
  4116.  void
  4117. global(treeptr     tp, treeptr     dp, boolean     depend)
  4118. {
  4119.   treeptr    ip;
  4120.   boolean    dep;
  4121.  
  4122.   while (tp != (struct S64 *)NIL) {
  4123.     switch ((int)((*tp).tt)) {
  4124.       case nproc:  case nfunc:
  4125.       markdecl((*tp).U.V13.tsubid);
  4126.       markdecl((*tp).U.V13.tsubpar);
  4127.       markdecl((*tp).U.V13.tsubconst);
  4128.       markdecl((*tp).U.V13.tsubtype);
  4129.       markdecl((*tp).U.V13.tsubvar);
  4130.       global((*tp).U.V13.tsubsub, tp, false);
  4131.       global((*tp).U.V13.tsubvar, tp, false);
  4132.       global((*tp).U.V13.tsubtype, tp, false);
  4133.       movevars(tp, (*tp).U.V13.tsubpar);
  4134.       movevars(tp, (*tp).U.V13.tsubvar);
  4135.       (*tp).U.V13.tsubtype = movedecl((*tp).U.V13.tsubtype);
  4136.       (*tp).U.V13.tsubconst = movedecl((*tp).U.V13.tsubconst);
  4137.       global((*tp).U.V13.tsubstmt, tp, true);
  4138.       global((*tp).U.V13.tsubpar, tp, false);
  4139.       global((*tp).U.V13.tsubvar, tp, false);
  4140.       global((*tp).U.V13.tsubtype, tp, false);
  4141.       global((*tp).U.V13.tfuntyp, tp, false);
  4142.       break ;
  4143.       case npgm:
  4144.       markdecl((*tp).U.V13.tsubconst);
  4145.       markdecl((*tp).U.V13.tsubtype);
  4146.       markdecl((*tp).U.V13.tsubvar);
  4147.       global((*tp).U.V13.tsubsub, tp, false);
  4148.       global((*tp).U.V13.tsubstmt, tp, true);
  4149.       break ;
  4150.       case nconst:  case ntype:  case nvar:  case nfield:
  4151.       case nvalpar:  case nvarpar:
  4152.       ip = (*tp).U.V14.tidl;
  4153.       dep = depend;
  4154.       while ((ip != (struct S64 *)NIL) && !dep) {
  4155.     if ((*(*ip).U.V43.tsym).U.V6.lused)
  4156.       dep = true;
  4157.     ip = (*ip).tnext;
  4158.       }
  4159.       global((*tp).U.V14.tbind, dp, dep);
  4160.       break ;
  4161.       case nparproc:  case nparfunc:
  4162.       global((*tp).U.V15.tparparm, dp, depend);
  4163.       global((*tp).U.V15.tpartyp, dp, depend);
  4164.       break ;
  4165.       case nsubrange:
  4166.       global((*tp).U.V19.tlo, dp, depend);
  4167.       global((*tp).U.V19.thi, dp, depend);
  4168.       break ;
  4169.       case nvariant:
  4170.       global((*tp).U.V20.tselct, dp, depend);
  4171.       global((*tp).U.V20.tvrnt, dp, depend);
  4172.       break ;
  4173.       case nrecord:
  4174.       global((*tp).U.V21.tflist, dp, depend);
  4175.       global((*tp).U.V21.tvlist, dp, depend);
  4176.       break ;
  4177.       case nconfarr:
  4178.       global((*tp).U.V22.tcindx, dp, depend);
  4179.       global((*tp).U.V22.tcelem, dp, depend);
  4180.       break ;
  4181.       case narray:
  4182.       global((*tp).U.V23.taindx, dp, depend);
  4183.       global((*tp).U.V23.taelem, dp, depend);
  4184.       break ;
  4185.       case nfileof:  case nsetof:
  4186.       global((*tp).U.V18.tof, dp, depend);
  4187.       break ;
  4188.       case nptr:
  4189.       global((*tp).U.V16.tptrid, dp, depend);
  4190.       break ;
  4191.       case nscalar:
  4192.       global((*tp).U.V17.tscalid, dp, depend);
  4193.       break ;
  4194.       case nbegin:
  4195.       global((*tp).U.V24.tbegin, dp, depend);
  4196.       break ;
  4197.       case nif:
  4198.       global((*tp).U.V31.tifxp, dp, depend);
  4199.       global((*tp).U.V31.tthen, dp, depend);
  4200.       global((*tp).U.V31.telse, dp, depend);
  4201.       break ;
  4202.       case nwhile:
  4203.       global((*tp).U.V32.twhixp, dp, depend);
  4204.       global((*tp).U.V32.twhistmt, dp, depend);
  4205.       break ;
  4206.       case nrepeat:
  4207.       global((*tp).U.V33.treptstmt, dp, depend);
  4208.       global((*tp).U.V33.treptxp, dp, depend);
  4209.       break ;
  4210.       case nfor:
  4211.       ip = idup((*tp).U.V34.tforid);
  4212.       if (Member((unsigned)((*(*ip).tup).tt), Conset[135]))
  4213.     registervar((*tp).U.V34.tforid);
  4214.       global((*tp).U.V34.tforid, dp, depend);
  4215.       global((*tp).U.V34.tfrom, dp, depend);
  4216.       global((*tp).U.V34.tto, dp, depend);
  4217.       global((*tp).U.V34.tforstmt, dp, depend);
  4218.       break ;
  4219.       case ncase:
  4220.       global((*tp).U.V35.tcasxp, dp, depend);
  4221.       global((*tp).U.V35.tcaslst, dp, depend);
  4222.       global((*tp).U.V35.tcasother, dp, depend);
  4223.       break ;
  4224.       case nchoise:
  4225.       global((*tp).U.V36.tchocon, dp, depend);
  4226.       global((*tp).U.V36.tchostmt, dp, depend);
  4227.       break ;
  4228.       case nwith:
  4229.       global((*tp).U.V37.twithvar, dp, depend);
  4230.       global((*tp).U.V37.twithstmt, dp, depend);
  4231.       break ;
  4232.       case nwithvar:
  4233.       ip = typeof((*tp).U.V38.texpw);
  4234.       if ((*ip).U.V21.tuid == (struct S62 *)NIL)
  4235.     (*ip).U.V21.tuid = mkvariable('S');
  4236.       global((*tp).U.V38.texpw, dp, depend);
  4237.       break ;
  4238.       case nlabstmt:
  4239.       global((*tp).U.V25.tstmt, dp, depend);
  4240.       break ;
  4241.       case neq:  case nne:  case nlt:  case nle:
  4242.       case ngt:  case nge:
  4243.       global((*tp).U.V41.texpl, dp, depend);
  4244.       global((*tp).U.V41.texpr, dp, depend);
  4245.       ip = typeof((*tp).U.V41.texpl);
  4246.       if ((ip == typnods.A[(int)(tstring)]) || ((*ip).tt == narray))
  4247.     usecomp = true;
  4248.       ip = typeof((*tp).U.V41.texpr);
  4249.       if ((ip == typnods.A[(int)(tstring)]) || ((*ip).tt == narray))
  4250.     usecomp = true;
  4251.       break ;
  4252.       case nin:  case nor:  case nplus:  case nminus:
  4253.       case nand:  case nmul:  case ndiv:  case nmod:
  4254.       case nquot:  case nformat:  case nrange:
  4255.       global((*tp).U.V41.texpl, dp, depend);
  4256.       global((*tp).U.V41.texpr, dp, depend);
  4257.       break ;
  4258.       case nassign:
  4259.       global((*tp).U.V27.tlhs, dp, depend);
  4260.       global((*tp).U.V27.trhs, dp, depend);
  4261.       break ;
  4262.       case nnot:  case numinus:  case nuplus:  case nderef:
  4263.       global((*tp).U.V42.texps, dp, depend);
  4264.       break ;
  4265.       case nset:
  4266.       global((*tp).U.V42.texps, dp, depend);
  4267.       break ;
  4268.       case nindex:
  4269.       global((*tp).U.V39.tvariable, dp, depend);
  4270.       global((*tp).U.V39.toffset, dp, depend);
  4271.       break ;
  4272.       case nselect:
  4273.       global((*tp).U.V40.trecord, dp, depend);
  4274.       break ;
  4275.       case ncall:
  4276.       global((*tp).U.V30.tcall, dp, depend);
  4277.       global((*tp).U.V30.taparm, dp, depend);
  4278.       break ;
  4279.       case nid:
  4280.       ip = idup(tp);
  4281.       if (ip == (struct S64 *)NIL)
  4282.     goto L555;
  4283.       do {
  4284.     ip = (*ip).tup;
  4285.     if (ip == (struct S64 *)NIL)
  4286.       goto L555;
  4287.       } while (!(Member((unsigned)((*ip).tt), Conset[136])));
  4288.       if (dp == ip) {
  4289.     if (depend)
  4290.       (*(*tp).U.V43.tsym).U.V6.lused = true;
  4291.       } else {
  4292.     (*(*tp).U.V43.tsym).U.V6.lused = true;
  4293.       }
  4294.     L555:
  4295.       ;
  4296.       break ;
  4297.       case ngoto:
  4298.       if (!islocal((*tp).U.V26.tlabel)) {
  4299.     (*(*(*tp).U.V26.tlabel).U.V43.tsym).U.V9.lgo = true;
  4300.     usejmps = true;
  4301.     cklevel((*tp).U.V26.tlabel);
  4302.       }
  4303.       break ;
  4304.       case nbreak:  case npush:  case npop:  case npredef:
  4305.       case nempty:  case nchar:  case ninteger:  case nreal:
  4306.       case nstring:  case nnil:
  4307.       break ;
  4308.       default:
  4309.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4310.     }
  4311.     tp = (*tp).tnext;
  4312.   }
  4313. }
  4314.  
  4315.  void
  4316. renamc(void)
  4317. {
  4318.   idptr    ip;
  4319.   register cnames    cn;
  4320.  
  4321.   {
  4322.     cnames    B49 = cabort,
  4323.         B50 = cwrite;
  4324.  
  4325.     if ((int)(B49) <= (int)(B50))
  4326.       for (cn = B49; ; cn = (cnames)((int)(cn)+1)) {
  4327.     ip = mkrename('C', ctable.A[(int)(cn)]);
  4328.     (*ctable.A[(int)(cn)]).istr = (*ip).istr;
  4329.     if (cn == B50) break;
  4330.       }
  4331.   }
  4332. }
  4333.  
  4334.  void
  4335. renamp(treeptr     tp, boolean     on)
  4336. {
  4337.   symptr    sp;
  4338.  
  4339.   while (tp != (struct S64 *)NIL) {
  4340.     renamp((*tp).U.V13.tsubsub, true);
  4341.     if (on && ((*tp).U.V13.tsubstmt != (struct S64 *)NIL)) {
  4342.       sp = (*(*tp).U.V13.tsubid).U.V43.tsym;
  4343.       if ((*(*sp).U.V6.lid).inref > 1)
  4344.     (*sp).U.V6.lid = mkrename('P', (*sp).U.V6.lid);
  4345.     }
  4346.     tp = (*tp).tnext;
  4347.   }
  4348. }
  4349.  
  4350.  boolean
  4351. filevar(treeptr     tp)
  4352. {
  4353.   register boolean    R172;
  4354.   boolean    fv;
  4355.   treeptr    tq;
  4356.  
  4357.   switch ((int)((*tp).tt)) {
  4358.     case npredef:
  4359.     fv = (boolean)(tp == typnods.A[(int)(ttext)]);
  4360.     break ;
  4361.     case nfileof:
  4362.     fv = true;
  4363.     break ;
  4364.     case nconfarr:
  4365.     fv = filevar(typeof((*tp).U.V22.tcelem));
  4366.     break ;
  4367.     case narray:
  4368.     fv = filevar(typeof((*tp).U.V23.taelem));
  4369.     break ;
  4370.     case nrecord:
  4371.     fv = false;
  4372.     tq = (*tp).U.V21.tvlist;
  4373.     while (tq != (struct S64 *)NIL) {
  4374.       if (filevar((*tq).U.V20.tvrnt))
  4375.     error(evrntfile);
  4376.       tq = (*tq).tnext;
  4377.     }
  4378.     tq = (*tp).U.V21.tflist;
  4379.     while (tq != (struct S64 *)NIL) {
  4380.       if (filevar(typeof((*tq).U.V14.tbind))) {
  4381.     fv = true;
  4382.     tq = (struct S64 *)NIL;
  4383.       } else
  4384.     tq = (*tq).tnext;
  4385.     }
  4386.     break ;
  4387.     case nptr:
  4388.     fv = false;
  4389.     if (!(*tp).U.V16.tptrflag) {
  4390.       (*tp).U.V16.tptrflag = true;
  4391.       if (filevar(typeof((*tp).U.V16.tptrid)))
  4392.     error(evarfile);
  4393.       (*tp).U.V16.tptrflag = false;
  4394.     }
  4395.     break ;
  4396.     case nsubrange:  case nscalar:  case nsetof:
  4397.     fv = false;
  4398.     break ;
  4399.     default:
  4400.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4401.   }
  4402.   R172 = fv;
  4403.   return R172;
  4404. }
  4405.  
  4406.  treeptr
  4407. fileinit(treeptr     ti, treeptr     tq, boolean     opn)
  4408. {
  4409.   register treeptr    R173;
  4410.   treeptr    tx, ty, tz;
  4411.  
  4412.   switch ((int)((*tq).tt)) {
  4413.     case narray:
  4414.     tz = newid(mkvariable('I'));
  4415.     ty = mknode(nvar);
  4416.     (*ty).U.V14.tattr = aregister;
  4417.     (*ty).U.V14.tidl = tz;
  4418.     (*ty).U.V14.tbind = typeof((*tq).U.V23.taindx);
  4419.     tz = tq;
  4420.     while (!(Member((unsigned)((*tz).tt), Conset[137])))
  4421.       tz = (*tz).tup;
  4422.     linkup(tz, ty);
  4423.     if ((*tz).U.V13.tsubvar == (struct S64 *)NIL)
  4424.       (*tz).U.V13.tsubvar = ty;
  4425.     else {
  4426.       tz = (*tz).U.V13.tsubvar;
  4427.       while ((*tz).tnext != (struct S64 *)NIL)
  4428.     tz = (*tz).tnext;
  4429.       (*tz).tnext = ty;
  4430.     }
  4431.     ty = (*ty).U.V14.tidl;
  4432.     tz = mknode(nindex);
  4433.     (*tz).U.V39.tvariable = ti;
  4434.     (*tz).U.V39.toffset = ty;
  4435.     tz = fileinit(tz, (*tq).U.V23.taelem, opn);
  4436.     tx = mknode(nfor);
  4437.     (*tx).U.V34.tforid = ty;
  4438.     ty = typeof((*tq).U.V23.taindx);
  4439.     if ((*ty).tt == nsubrange) {
  4440.       (*tx).U.V34.tfrom = (*ty).U.V19.tlo;
  4441.       (*tx).U.V34.tto = (*ty).U.V19.thi;
  4442.     } else
  4443.       if ((*ty).tt == nscalar) {
  4444.     ty = (*ty).U.V17.tscalid;
  4445.     (*tx).U.V34.tfrom = ty;
  4446.     while ((*ty).tnext != (struct S64 *)NIL)
  4447.       ty = (*ty).tnext;
  4448.     (*tx).U.V34.tto = ty;
  4449.       } else
  4450.     if (ty == typnods.A[(int)(tchar)]) {
  4451.       currsym.st = schar;
  4452.       currsym.U.V2.vchr = minchar;
  4453.       (*tx).U.V34.tfrom = mklit();
  4454.       currsym.st = schar;
  4455.       currsym.U.V2.vchr = maxchar;
  4456.       (*tx).U.V34.tto = mklit();
  4457.     } else
  4458.       if (ty == typnods.A[(int)(tinteger)]) {
  4459.         currsym.st = sinteger;
  4460.         currsym.U.V3.vint = -maxint;
  4461.         (*tx).U.V34.tfrom = mklit();
  4462.         currsym.st = sinteger;
  4463.         currsym.U.V3.vint = maxint;
  4464.         (*tx).U.V34.tto = mklit();
  4465.       } else
  4466.         fatal(etree);
  4467.     (*tx).U.V34.tforstmt = tz;
  4468.     (*tx).U.V34.tincr = true;
  4469.     break ;
  4470.     case npredef:  case nfileof:
  4471.     if (opn) {
  4472.       ty = mknode(nselect);
  4473.       (*ty).U.V40.trecord = ti;
  4474.       (*ty).U.V40.tfield = oldid((*defnams.A[(int)(dzfp)]).U.V6.lid, lforward);
  4475.       tx = mknode(nassign);
  4476.       (*tx).U.V27.tlhs = ty;
  4477.       currsym.st = sinteger;
  4478.       currsym.U.V3.vint = 0;
  4479.       (*tx).U.V27.trhs = mklit();
  4480.     } else {
  4481.       tx = mknode(ncall);
  4482.       (*tx).U.V30.tcall = oldid((*defnams.A[(int)(dclose)]).U.V6.lid, lidentifier);
  4483.       (*tx).U.V30.taparm = ti;
  4484.     }
  4485.     break ;
  4486.     case nrecord:
  4487.     ty = (struct S64 *)NIL;
  4488.     tq = (*tq).U.V21.tflist;
  4489.     while (tq != (struct S64 *)NIL) {
  4490.       if (filevar(typeof((*tq).U.V14.tbind))) {
  4491.     tz = (*tq).U.V14.tidl;
  4492.     while (tz != (struct S64 *)NIL) {
  4493.       tx = mknode(nselect);
  4494.       (*tx).U.V40.trecord = ti;
  4495.       (*tx).U.V40.tfield = tz;
  4496.       tx = fileinit(tx, typeof((*tq).U.V14.tbind), opn);
  4497.       (*tx).tnext = ty;
  4498.       ty = tx;
  4499.       tz = (*tz).tnext;
  4500.     }
  4501.       }
  4502.       tq = (*tq).tnext;
  4503.     }
  4504.     tx = mknode(nbegin);
  4505.     (*tx).U.V24.tbegin = ty;
  4506.     break ;
  4507.     default:
  4508.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4509.   }
  4510.   R173 = tx;
  4511.   return R173;
  4512. }
  4513.  
  4514.  void
  4515. initcode(treeptr     tp)
  4516. {
  4517.   treeptr    ti, tq, tu, tv;
  4518.  
  4519.   while (tp != (struct S64 *)NIL) {
  4520.     initcode((*tp).U.V13.tsubsub);
  4521.     tv = (*tp).U.V13.tsubvar;
  4522.     while (tv != (struct S64 *)NIL) {
  4523.       tq = typeof((*tv).U.V14.tbind);
  4524.       if (filevar(tq)) {
  4525.     ti = (*tv).U.V14.tidl;
  4526.     while (ti != (struct S64 *)NIL) {
  4527.       tu = fileinit(ti, tq, true);
  4528.       linkup(tp, tu);
  4529.       (*tu).tnext = (*tp).U.V13.tsubstmt;
  4530.       (*tp).U.V13.tsubstmt = tu;
  4531.       while ((*tu).tnext != (struct S64 *)NIL)
  4532.         tu = (*tu).tnext;
  4533.       (*tu).tnext = fileinit(ti, tq, false);
  4534.       linkup(tp, (*tu).tnext);
  4535.       ti = (*ti).tnext;
  4536.     }
  4537.       }
  4538.       tv = (*tv).tnext;
  4539.     }
  4540.     tp = (*tp).tnext;
  4541.   }
  4542. }
  4543.  
  4544.  void
  4545. transform(void)
  4546. {
  4547.   renamc();
  4548.   renamp((*top).U.V13.tsubsub, false);
  4549.   extract(top);
  4550.   renamf(top);
  4551.   initcode((*top).U.V13.tsubsub);
  4552.   global(top, top, false);
  4553. }
  4554.  
  4555.  void
  4556. increment(void)
  4557. {
  4558.   (*G205_indnt) = (*G205_indnt) + indstep;
  4559. }
  4560.  
  4561.  void
  4562. decrement(void)
  4563. {
  4564.   (*G205_indnt) = (*G205_indnt) - indstep;
  4565. }
  4566.  
  4567.  void
  4568. indent(void)
  4569. {
  4570.   integer    i;
  4571.  
  4572.   i = (*G205_indnt);
  4573.   if (i > 60)
  4574.     i = i / tabwidth * tabwidth;
  4575.   while (i >= tabwidth) {
  4576.     Putchr(tab1, output);
  4577.     i = i - tabwidth;
  4578.   }
  4579.   while (i > 0) {
  4580.     Putchr(space, output);
  4581.     i = i - 1;
  4582.   }
  4583. }
  4584.  
  4585.  boolean
  4586. arithexpr(treeptr     tp)
  4587. {
  4588.   register boolean    R174;
  4589.  
  4590.   tp = typeof(tp);
  4591.   if ((*tp).tt == nsubrange)
  4592.     if ((*(*tp).tup).tt == nconfarr)
  4593.       tp = typeof((*(*tp).tup).U.V22.tindtyp);
  4594.     else
  4595.       tp = typeof((*tp).U.V19.tlo);
  4596.   R174 = (boolean)((tp == typnods.A[(int)(tinteger)]) || (tp == typnods.A[(int)(tchar)]) || (tp == typnods.A[(int)(treal)]));
  4597.   return R174;
  4598. }
  4599.  
  4600.  boolean
  4601. needsintcast(treeptr     tp)
  4602. {
  4603.   register boolean    R175;
  4604.  
  4605.   tp = typeof(tp);
  4606.   if ((*tp).tt != nsubrange)
  4607.     R175 = false;
  4608.   else
  4609.     if (clower(tp) < 0)
  4610.       R175 = false;
  4611.     else
  4612.       R175 = (boolean)(cupper(tp) <= 65535);
  4613.   return R175;
  4614. }
  4615.  
  4616.  
  4617.  
  4618.  void
  4619. eselect(treeptr     tp)
  4620. {
  4621.   eexpr(tp);
  4622.   Putchr('.', output);
  4623. }
  4624.  
  4625.  unsigned char
  4626. typeletter(treeptr     tp)
  4627. {
  4628.   register unsigned char    R176;
  4629.   treeptr    tq;
  4630.  
  4631.   tq = tp;
  4632.   if ((*tq).tt == nformat) {
  4633.     if ((*(*tq).U.V41.texpl).tt == nformat) {
  4634.       R176 = 'f';
  4635.       goto L999;
  4636.     }
  4637.     tq = (*tp).U.V41.texpl;
  4638.   }
  4639.   tq = typeof(tq);
  4640.   if ((*tq).tt == nsubrange)
  4641.     tq = typeof((*tq).U.V19.tlo);
  4642.   if (tq == typnods.A[(int)(tstring)])
  4643.     R176 = 's';
  4644.   else
  4645.     if (tq == typnods.A[(int)(tinteger)])
  4646.       R176 = 'd';
  4647.     else
  4648.       if (tq == typnods.A[(int)(tchar)])
  4649.     R176 = 'c';
  4650.       else
  4651.     if (tq == typnods.A[(int)(treal)])
  4652.       if ((*tp).tt == nformat)
  4653.         R176 = 'e';
  4654.       else
  4655.         R176 = 'g';
  4656.     else
  4657.       if (tq == typnods.A[(int)(tboolean)]) {
  4658.         R176 = 'b';
  4659.         (*G196_nelems) = 6;
  4660.       } else
  4661.         if ((*tq).tt == narray) {
  4662.           R176 = 'a';
  4663.           (*G196_nelems) = crange((*tq).U.V23.taindx);
  4664.         } else
  4665.           if ((*tq).tt == nconfarr) {
  4666.         R176 = 'v';
  4667.         (*G196_nelems) = 0;
  4668.           } else
  4669.         fatal(etree);
  4670. L999:
  4671.   ;
  4672.   return R176;
  4673. }
  4674.  
  4675.  void
  4676. etxt(treeptr     tp)
  4677. {
  4678.   toknbuf    w;
  4679.   unsigned char    c;
  4680.   toknidx    i;
  4681.  
  4682.   switch ((int)((*tp).tt)) {
  4683.     case nid:
  4684.     tp = idup(tp);
  4685.     if ((*tp).tt == nconst)
  4686.       etxt((*tp).U.V14.tbind);
  4687.     else
  4688.       fatal(etree);
  4689.     break ;
  4690.     case nstring:
  4691.     gettokn((*(*tp).U.V43.tsym).U.V7.lstr, &w);
  4692.     i = 1;
  4693.     while (w.A[i - 1] != null) {
  4694.       c = w.A[i - 1];
  4695.       if ((c == cite) || (c == bslash))
  4696.     Putchr(bslash, output);
  4697.       else
  4698.     if (c == percent)
  4699.       Putchr(percent, output);
  4700.       Putchr(c, output);
  4701.       i = (int)(i) + 1;
  4702.     }
  4703.     break ;
  4704.     case nchar:
  4705.     c = (*(*tp).U.V43.tsym).U.V11.lchar;
  4706.     if ((c == cite) || (c == bslash))
  4707.       Putchr(bslash, output);
  4708.     else
  4709.       if (c == percent)
  4710.     Putchr(percent, output);
  4711.     Putchr(c, output);
  4712.     break ;
  4713.     default:
  4714.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4715.   }
  4716. }
  4717.  
  4718.  void
  4719. eformat(treeptr     tq)
  4720. {
  4721.   treeptr    tx;
  4722.   integer    i;
  4723.  
  4724.   switch ((int)(typeletter(tq))) {
  4725.     case 'a':
  4726.     Putchr(percent, output);
  4727.     if ((*tq).tt == nformat)
  4728.       if ((*(*tq).U.V41.texpr).tt == ninteger)
  4729.     eexpr((*tq).U.V41.texpr);
  4730.       else
  4731.     Putchr('*', output);
  4732.     (void)fprintf(output.fp, ".%1ds", (*G196_nelems)), Putl(output, 0);
  4733.     break ;
  4734.     case 'b':
  4735.     Putchr(percent, output);
  4736.     if ((*tq).tt == nformat) {
  4737.       if ((*(*tq).U.V41.texpr).tt == ninteger)
  4738.     eexpr((*tq).U.V41.texpr);
  4739.       else
  4740.     Putchr('*', output);
  4741.     }
  4742.     Putchr('s', output);
  4743.     break ;
  4744.     case 'c':
  4745.     if ((*tq).tt == nchar)
  4746.       etxt(tq);
  4747.     else {
  4748.       Putchr(percent, output);
  4749.       if ((*tq).tt == nformat)
  4750.     if ((*(*tq).U.V41.texpr).tt == ninteger)
  4751.       eexpr((*tq).U.V41.texpr);
  4752.     else
  4753.       Putchr('*', output);
  4754.       Putchr('c', output);
  4755.     }
  4756.     break ;
  4757.     case 'd':
  4758.     Putchr(percent, output);
  4759.     if ((*tq).tt == nformat) {
  4760.       if ((*(*tq).U.V41.texpr).tt == ninteger)
  4761.     eexpr((*tq).U.V41.texpr);
  4762.       else
  4763.     Putchr('*', output);
  4764.     } else
  4765.       (void)fprintf(output.fp, "%1d", intlen), Putl(output, 0);
  4766.     Putchr('d', output);
  4767.     break ;
  4768.     case 'e':
  4769.     (void)fprintf(output.fp, "%c%c", percent, space), Putl(output, 0);
  4770.     tx = (*tq).U.V41.texpr;
  4771.     if ((*tx).tt == ninteger) {
  4772.       i = cvalof(tx);
  4773.       (void)fprintf(output.fp, "%1d.", i), Putl(output, 0);
  4774.       i = i - 7;
  4775.       if (i < 1)
  4776.     Putchr('1', output);
  4777.       else
  4778.     (void)fprintf(output.fp, "%1d", i), Putl(output, 0);
  4779.     } else
  4780.       (void)fprintf(output.fp, "*.*"), Putl(output, 0);
  4781.     Putchr('e', output);
  4782.     break ;
  4783.     case 'f':
  4784.     Putchr(percent, output);
  4785.     tx = (*tq).U.V41.texpl;
  4786.     if ((*(*tx).U.V41.texpr).tt == ninteger) {
  4787.       eexpr((*tx).U.V41.texpr);
  4788.       Putchr('.', output);
  4789.       tx = (*tq).U.V41.texpr;
  4790.       if ((*tx).tt == ninteger) {
  4791.     i = cvalof(tx);
  4792.     tx = (*(*tq).U.V41.texpl).U.V41.texpr;
  4793.     if (i > cvalof(tx) - 1)
  4794.       Putchr('1', output);
  4795.     else
  4796.       (void)fprintf(output.fp, "%1d", i), Putl(output, 0);
  4797.       } else
  4798.     Putchr('*', output);
  4799.     } else
  4800.       (void)fprintf(output.fp, "*.*"), Putl(output, 0);
  4801.     Putchr('f', output);
  4802.     break ;
  4803.     case 'g':
  4804.     (void)fprintf(output.fp, "%c%1de", percent, fixlen), Putl(output, 0);
  4805.     break ;
  4806.     case 's':
  4807.     if ((*tq).tt == nstring)
  4808.       etxt(tq);
  4809.     else {
  4810.       Putchr(percent, output);
  4811.       if ((*tq).tt == nformat)
  4812.     if ((*(*tq).U.V41.texpr).tt == ninteger)
  4813.       eexpr((*tq).U.V41.texpr);
  4814.     else
  4815.       (void)fprintf(output.fp, "*.*"), Putl(output, 0);
  4816.       Putchr('s', output);
  4817.     }
  4818.     break ;
  4819.     case 'v':
  4820.     fatal(eprconf);
  4821.     break ;
  4822.     default:
  4823.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4824.   }
  4825. }
  4826.  
  4827.  void
  4828. ewrite(treeptr     tq)
  4829. {
  4830.   treeptr    tx;
  4831.  
  4832.   switch ((int)(typeletter(tq))) {
  4833.     case 'a':
  4834.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4835.     tx = tq;
  4836.     if ((*tq).tt == nformat) {
  4837.       if ((*(*tq).U.V41.texpr).tt != ninteger) {
  4838.     eexpr((*tq).U.V41.texpr);
  4839.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4840.       }
  4841.       tx = (*tq).U.V41.texpl;
  4842.     }
  4843.     eexpr(tx);
  4844.     (void)fprintf(output.fp, ".A"), Putl(output, 0);
  4845.     break ;
  4846.     case 'b':
  4847.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4848.     tx = tq;
  4849.     if ((*tq).tt == nformat) {
  4850.       if ((*(*tq).U.V41.texpr).tt != ninteger) {
  4851.     eexpr((*tq).U.V41.texpr);
  4852.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4853.       }
  4854.       tx = (*tq).U.V41.texpl;
  4855.     }
  4856.     (void)fprintf(output.fp, "Bools[(int)("), Putl(output, 0);
  4857.     eexpr(tx);
  4858.     (void)fprintf(output.fp, ")]"), Putl(output, 0);
  4859.     break ;
  4860.     case 'c':
  4861.     if ((*tq).tt == nformat) {
  4862.       if ((*(*tq).U.V41.texpr).tt != ninteger) {
  4863.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4864.     eexpr((*tq).U.V41.texpr);
  4865.       }
  4866.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  4867.       eexpr((*tq).U.V41.texpl);
  4868.     } else
  4869.       if ((*tq).tt != nchar) {
  4870.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4871.     eexpr(tq);
  4872.       }
  4873.     break ;
  4874.     case 'd':
  4875.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4876.     tx = tq;
  4877.     if ((*tq).tt == nformat) {
  4878.       if ((*(*tq).U.V41.texpr).tt != ninteger) {
  4879.     eexpr((*tq).U.V41.texpr);
  4880.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4881.       }
  4882.       tx = (*tq).U.V41.texpl;
  4883.     }
  4884.     eexpr(tx);
  4885.     break ;
  4886.     case 'e':
  4887.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4888.     tx = (*tq).U.V41.texpr;
  4889.     if ((*tx).tt != ninteger) {
  4890.       usemax = true;
  4891.       eexpr(tx);
  4892.       (void)fprintf(output.fp, ", Max("), Putl(output, 0);
  4893.       eexpr(tx);
  4894.       (void)fprintf(output.fp, " - 7, 1), "), Putl(output, 0);
  4895.     }
  4896.     eexpr((*tq).U.V41.texpl);
  4897.     break ;
  4898.     case 'f':
  4899.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4900.     tx = (*tq).U.V41.texpl;
  4901.     if ((*(*tx).U.V41.texpr).tt != ninteger) {
  4902.       eexpr((*tx).U.V41.texpr);
  4903.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  4904.     }
  4905.     if (((*(*tx).U.V41.texpr).tt != ninteger) || ((*(*tq).U.V41.texpr).tt != ninteger)) {
  4906.       usemax = true;
  4907.       (void)fprintf(output.fp, "Max(("), Putl(output, 0);
  4908.       eexpr((*tx).U.V41.texpr);
  4909.       (void)fprintf(output.fp, ") - ("), Putl(output, 0);
  4910.       eexpr((*tq).U.V41.texpr);
  4911.       (void)fprintf(output.fp, ") - 1, 1), "), Putl(output, 0);
  4912.     }
  4913.     eexpr((*(*tq).U.V41.texpl).U.V41.texpl);
  4914.     break ;
  4915.     case 'g':
  4916.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4917.     eexpr(tq);
  4918.     break ;
  4919.     case 's':
  4920.     if ((*tq).tt == nformat) {
  4921.       if ((*(*tq).U.V41.texpr).tt != ninteger) {
  4922.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4923.     eexpr((*tq).U.V41.texpr);
  4924.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4925.     eexpr((*tq).U.V41.texpr);
  4926.       }
  4927.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  4928.       eexpr((*tq).U.V41.texpl);
  4929.     } else
  4930.       if ((*tq).tt != nstring) {
  4931.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4932.     eexpr(tq);
  4933.       }
  4934.     break ;
  4935.     case 'v':
  4936.     fatal(eprconf);
  4937.     break ;
  4938.     default:
  4939.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  4940.   }
  4941. }
  4942.  
  4943.  void
  4944. esubsize(treeptr     tp, treeptr     tq)
  4945. {
  4946.   treeptr    tx, ty;
  4947.   boolean    addsize;
  4948.  
  4949.   tx = (*tq).U.V20.tvrnt;
  4950.   ty = (*tx).U.V21.tflist;
  4951.   if (ty == (struct S64 *)NIL) {
  4952.     ty = (*tx).U.V21.tvlist;
  4953.     while (ty != (struct S64 *)NIL) {
  4954.       if ((*(*ty).U.V20.tvrnt).U.V21.tflist != (struct S64 *)NIL) {
  4955.     ty = (*(*ty).U.V20.tvrnt).U.V21.tflist;
  4956.     goto L555;
  4957.       }
  4958.       ty = (*ty).tnext;
  4959.     }
  4960.   L555:
  4961.     ;
  4962.   }
  4963.   addsize = true;
  4964.   if (ty == (struct S64 *)NIL) {
  4965.     addsize = false;
  4966.     ty = (*(*(*tx).tup).tup).U.V21.tvlist;
  4967.     while (ty != (struct S64 *)NIL) {
  4968.       if ((*(*ty).U.V20.tvrnt).U.V21.tflist != (struct S64 *)NIL) {
  4969.     ty = (*(*ty).U.V20.tvrnt).U.V21.tflist;
  4970.     goto L666;
  4971.       }
  4972.       ty = (*ty).tnext;
  4973.     }
  4974.   L666:
  4975.     ;
  4976.   }
  4977.   if (ty == (struct S64 *)NIL) {
  4978.     (void)fprintf(output.fp, "sizeof(*"), Putl(output, 0);
  4979.     eexpr(tp);
  4980.     Putchr(')', output);
  4981.   } else {
  4982.     (void)fprintf(output.fp, "Unionoffs("), Putl(output, 0);
  4983.     eexpr(tp);
  4984.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  4985.     printid((*(*(*ty).U.V14.tidl).U.V43.tsym).U.V6.lid);
  4986.     if (addsize) {
  4987.       (void)fprintf(output.fp, ") + sizeof("), Putl(output, 0);
  4988.       eexpr(tp);
  4989.       (void)fprintf(output.fp, "->"), Putl(output, 0);
  4990.       printid((*tx).U.V21.tuid);
  4991.     }
  4992.     Putchr(')', output);
  4993.   }
  4994. }
  4995.  
  4996.  void
  4997. enewsize(treeptr     tp)
  4998. {
  4999.   treeptr    tq, tx, ty;
  5000.   integer    v;
  5001.  
  5002.   if (((*tp).tnext != (struct S64 *)NIL) && unionnew) {
  5003.     v = cvalof((*tp).tnext);
  5004.     tq = typeof(tp);
  5005.     tq = typeof((*tq).U.V16.tptrid);
  5006.     if ((*tq).tt != nrecord)
  5007.       fatal(etree);
  5008.     tx = (*tq).U.V21.tvlist;
  5009.     while (tx != (struct S64 *)NIL) {
  5010.       ty = (*tx).U.V20.tselct;
  5011.       while (ty != (struct S64 *)NIL) {
  5012.     if (v == cvalof(ty))
  5013.       goto L555;
  5014.     ty = (*ty).tnext;
  5015.       }
  5016.       tx = (*tx).tnext;
  5017.     }
  5018.     fatal(etag);
  5019.   L555:
  5020.     esubsize(tp, tx);
  5021.   } else {
  5022.     (void)fprintf(output.fp, "sizeof(*"), Putl(output, 0);
  5023.     eexpr(tp);
  5024.     Putchr(')', output);
  5025.   }
  5026. }
  5027.  
  5028.  void
  5029. epredef(treeptr     ts, treeptr     tp)
  5030. {
  5031.   treeptr    tq, tv, tx;
  5032.   predefs    td;
  5033.   integer    nelems;
  5034.   unsigned char    ch;
  5035.   boolean    txtfile;
  5036.   integer    *F197;
  5037.  
  5038.   F197 = G196_nelems;
  5039.   G196_nelems = &nelems;
  5040.   td = (*(*ts).U.V13.tsubstmt).U.V12.tdef;
  5041.   switch ((int)(td)) {
  5042.     case dabs:
  5043.     tq = typeof((*tp).U.V30.taparm);
  5044.     if ((tq == typnods.A[(int)(tinteger)]) || ((*tq).tt == nsubrange))
  5045.       (void)fprintf(output.fp, "abs("), Putl(output, 0);
  5046.     else
  5047.       (void)fprintf(output.fp, "fabs("), Putl(output, 0);
  5048.     eexpr((*tp).U.V30.taparm);
  5049.     Putchr(')', output);
  5050.     break ;
  5051.     case dargv:
  5052.     (void)fprintf(output.fp, "Argvgt("), Putl(output, 0);
  5053.     eexpr((*tp).U.V30.taparm);
  5054.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  5055.     eexpr((*(*tp).U.V30.taparm).tnext);
  5056.     (void)fprintf(output.fp, ".A, sizeof("), Putl(output, 0);
  5057.     eexpr((*(*tp).U.V30.taparm).tnext);
  5058.     (void)fprintf(output.fp, ".A));\n"), Putl(output, 1);
  5059.     break ;
  5060.     case dchr:
  5061.     tq = typeof((*tp).U.V30.taparm);
  5062.     if ((*tq).tt == nsubrange)
  5063.       if ((*(*tq).tup).tt == nconfarr)
  5064.     tq = typeof((*(*tq).tup).U.V22.tindtyp);
  5065.       else
  5066.     tq = typeof((*tq).U.V19.tlo);
  5067.     if ((tq == typnods.A[(int)(tinteger)]) || (tq == typnods.A[(int)(tchar)]))
  5068.       eexpr((*tp).U.V30.taparm);
  5069.     else {
  5070.       (void)fprintf(output.fp, "(unsigned char)("), Putl(output, 0);
  5071.       eexpr((*tp).U.V30.taparm);
  5072.       Putchr(')', output);
  5073.     }
  5074.     break ;
  5075.     case ddispose:
  5076.     (void)fprintf(output.fp, "free("), Putl(output, 0);
  5077.     eexpr((*tp).U.V30.taparm);
  5078.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5079.     break ;
  5080.     case deof:
  5081.     tq = (*tp).U.V30.taparm;
  5082.     if (tq != (struct S64 *)NIL) {
  5083.       tv = typeof(tq);
  5084.       if (tv == typnods.A[(int)(ttext)])
  5085.     txtfile = true;
  5086.       else
  5087.     if ((*tv).tt == nfileof)
  5088.       txtfile = (boolean)(typeof((*tv).U.V18.tof) == typnods.A[(int)(tchar)]);
  5089.     else
  5090.       txtfile = true;
  5091.     } else
  5092.       txtfile = true;
  5093.     if (txtfile)
  5094.       (void)fprintf(output.fp, "Eofx("), Putl(output, 0);
  5095.     else
  5096.       (void)fprintf(output.fp, "Eof("), Putl(output, 0);
  5097.     if ((*tp).U.V30.taparm == (struct S64 *)NIL) {
  5098.       (*defnams.A[(int)(dinput)]).U.V6.lused = true;
  5099.       printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  5100.     } else
  5101.       eexpr((*tp).U.V30.taparm);
  5102.     Putchr(')', output);
  5103.     break ;
  5104.     case deoln:
  5105.     (void)fprintf(output.fp, "Eoln("), Putl(output, 0);
  5106.     if ((*tp).U.V30.taparm == (struct S64 *)NIL) {
  5107.       (*defnams.A[(int)(dinput)]).U.V6.lused = true;
  5108.       printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  5109.     } else
  5110.       eexpr((*tp).U.V30.taparm);
  5111.     Putchr(')', output);
  5112.     break ;
  5113.     case dexit:
  5114.     (void)fprintf(output.fp, "exit("), Putl(output, 0);
  5115.     if ((*tp).U.V30.taparm == (struct S64 *)NIL)
  5116.       Putchr('0', output);
  5117.     else
  5118.       eexpr((*tp).U.V30.taparm);
  5119.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5120.     break ;
  5121.     case dbreak:  case dflush:  case dprompt:
  5122.     (void)fprintf(output.fp, "Flush("), Putl(output, 0);
  5123.     if ((*tp).U.V30.taparm == (struct S64 *)NIL) {
  5124.       (*defnams.A[(int)(doutput)]).U.V6.lused = true;
  5125.       printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5126.     } else
  5127.       eexpr((*tp).U.V30.taparm);
  5128.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5129.     break ;
  5130.     case dpage:
  5131.     (void)fprintf(output.fp, "Putchr(%s, ", ffchr), Putl(output, 0);
  5132.     if ((*tp).U.V30.taparm == (struct S64 *)NIL) {
  5133.       (*defnams.A[(int)(doutput)]).U.V6.lused = true;
  5134.       printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5135.     } else
  5136.       eexpr((*tp).U.V30.taparm);
  5137.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5138.     break ;
  5139.     case dput:  case dget:
  5140.     tv = typeof((*tp).U.V30.taparm);
  5141.     if ((tv == typnods.A[(int)(ttext)]) || (((*tv).tt == nfileof) && (typeof((*tv).U.V18.tof) == typnods.A[(int)(tchar)])))
  5142.       if (td == dget)
  5143.     (void)fprintf(output.fp, "Getx"), Putl(output, 0);
  5144.       else
  5145.     (void)fprintf(output.fp, "Putx"), Putl(output, 0);
  5146.     else {
  5147.       (void)fprintf(output.fp, "%s", voidcast), Putl(output, 0);
  5148.       if (td == dget)
  5149.     (void)fprintf(output.fp, "Get"), Putl(output, 0);
  5150.       else
  5151.     (void)fprintf(output.fp, "Put"), Putl(output, 0);
  5152.     }
  5153.     Putchr('(', output);
  5154.     eexpr((*tp).U.V30.taparm);
  5155.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5156.     break ;
  5157.     case dhalt:
  5158.     (void)fprintf(output.fp, "abort();\n"), Putl(output, 1);
  5159.     break ;
  5160.     case dnew:
  5161.     eexpr((*tp).U.V30.taparm);
  5162.     (void)fprintf(output.fp, " = ("), Putl(output, 0);
  5163.     etypedef(typeof((*tp).U.V30.taparm));
  5164.     (void)fprintf(output.fp, ")malloc((unsigned)("), Putl(output, 0);
  5165.     enewsize((*tp).U.V30.taparm);
  5166.     (void)fprintf(output.fp, "));\n"), Putl(output, 1);
  5167.     break ;
  5168.     case dord:
  5169.     (void)fprintf(output.fp, "(unsigned)("), Putl(output, 0);
  5170.     eexpr((*tp).U.V30.taparm);
  5171.     Putchr(')', output);
  5172.     break ;
  5173.     case dread:  case dreadln:
  5174.     txtfile = false;
  5175.     tq = (*tp).U.V30.taparm;
  5176.     Putchr('{', output);
  5177.     if (tq != (struct S64 *)NIL) {
  5178.       tv = typeof(tq);
  5179.       if (tv == typnods.A[(int)(ttext)]) {
  5180.     txtfile = true;
  5181.     tv = tq;
  5182.     tq = (*tq).tnext;
  5183.       } else
  5184.     if ((*tv).tt == nfileof) {
  5185.       txtfile = (boolean)(typeof((*tv).U.V18.tof) == typnods.A[(int)(tchar)]);
  5186.       tv = tq;
  5187.       tq = (*tq).tnext;
  5188.     } else {
  5189.       txtfile = true;
  5190.       tv = (struct S64 *)NIL;
  5191.     }
  5192.     } else {
  5193.       tv = (struct S64 *)NIL;
  5194.       txtfile = true;
  5195.     }
  5196.     if (txtfile) {
  5197.       if (tq == (struct S64 *)NIL)
  5198.     goto L444;
  5199.       if (((*tq).tt != nformat) && ((*tq).tnext == (struct S64 *)NIL) && (typeletter(tq) == 'c')) {
  5200.     eexpr(tq);
  5201.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  5202.     (void)fprintf(output.fp, "Getchr("), Putl(output, 0);
  5203.     if (tv == (struct S64 *)NIL)
  5204.       printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  5205.     else
  5206.       eexpr(tv);
  5207.     Putchr(')', output);
  5208.     if (td == dreadln)
  5209.       (void)fprintf(output.fp, "; "), Putl(output, 0);
  5210.     goto L444;
  5211.       }
  5212.       (void)fprintf(output.fp, "Fscan("), Putl(output, 0);
  5213.       if (tv == (struct S64 *)NIL)
  5214.     printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  5215.       else
  5216.     eexpr(tv);
  5217.       (void)fprintf(output.fp, "); "), Putl(output, 0);
  5218.       while (tq != (struct S64 *)NIL) {
  5219.     (void)fprintf(output.fp, "Scan(%c", cite), Putl(output, 0);
  5220.     ch = typeletter(tq);
  5221.     switch ((int)(ch)) {
  5222.       case 'a':
  5223.       (void)fprintf(output.fp, "%cs", percent), Putl(output, 0);
  5224.       break ;
  5225.       case 'c':
  5226.       (void)fprintf(output.fp, "%cc", percent), Putl(output, 0);
  5227.       break ;
  5228.       case 'd':
  5229.       (void)fprintf(output.fp, "%cld", percent), Putl(output, 0);
  5230.       break ;
  5231.       case 'g':
  5232.       (void)fprintf(output.fp, "%cle", percent), Putl(output, 0);
  5233.       break ;
  5234.       default:
  5235.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5236.     }
  5237.     (void)fprintf(output.fp, "%c, ", cite), Putl(output, 0);
  5238.     switch ((int)(ch)) {
  5239.       case 'a':
  5240.       eexpr(tq);
  5241.       (void)fprintf(output.fp, ".A"), Putl(output, 0);
  5242.       break ;
  5243.       case 'c':
  5244.       Putchr('&', output);
  5245.       eexpr(tq);
  5246.       break ;
  5247.       case 'd':
  5248.       (void)fprintf(output.fp, "&Tmplng"), Putl(output, 0);
  5249.       break ;
  5250.       case 'g':
  5251.       (void)fprintf(output.fp, "&Tmpdbl"), Putl(output, 0);
  5252.       break ;
  5253.       default:
  5254.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5255.     }
  5256.     Putchr(')', output);
  5257.     switch ((int)(ch)) {
  5258.       case 'd':
  5259.       (void)fprintf(output.fp, "; "), Putl(output, 0);
  5260.       eexpr(tq);
  5261.       (void)fprintf(output.fp, " = Tmplng"), Putl(output, 0);
  5262.       break ;
  5263.       case 'g':
  5264.       (void)fprintf(output.fp, "; "), Putl(output, 0);
  5265.       eexpr(tq);
  5266.       (void)fprintf(output.fp, " = Tmpdbl"), Putl(output, 0);
  5267.       break ;
  5268.       case 'a':  case 'c':
  5269.       break ;
  5270.       default:
  5271.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5272.     }
  5273.     tq = (*tq).tnext;
  5274.     if (tq != (struct S64 *)NIL) {
  5275.       Putchr(';', output),Putchr('\n', output);
  5276.       indent();
  5277.       Putchr(tab1, output);
  5278.     }
  5279.       }
  5280.       Putchr(';', output);
  5281.       if (td == dreadln)
  5282.     (void)fprintf(output.fp, "; "), Putl(output, 0);
  5283.     L444:
  5284.       if (td == dreadln) {
  5285.     (void)fprintf(output.fp, "Getl((text *)&"), Putl(output, 0);
  5286.     if (tv == (struct S64 *)NIL)
  5287.       printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  5288.     else
  5289.       eexpr(tv);
  5290.     Putchr(')', output);
  5291.       }
  5292.     } else {
  5293.       increment();
  5294.       while (tq != (struct S64 *)NIL) {
  5295.     eexpr(tq);
  5296.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  5297.     (void)fprintf(output.fp, "Buf("), Putl(output, 0);
  5298.     eexpr(tv);
  5299.     (void)fprintf(output.fp, "), Get("), Putl(output, 0);
  5300.     eexpr(tv);
  5301.     Putchr(')', output);
  5302.     tq = (*tq).tnext;
  5303.     if (tq != (struct S64 *)NIL) {
  5304.       (void)fprintf(output.fp, "; \n"), Putl(output, 1);
  5305.       indent();
  5306.     }
  5307.       }
  5308.       decrement();
  5309.     }
  5310.     (void)fprintf(output.fp, ";}\n"), Putl(output, 1);
  5311.     break ;
  5312.     case dwrite:  case dwriteln:
  5313.     txtfile = false;
  5314.     tq = (*tp).U.V30.taparm;
  5315.     if (tq != (struct S64 *)NIL) {
  5316.       tv = typeof(tq);
  5317.       if (tv == typnods.A[(int)(ttext)]) {
  5318.     txtfile = true;
  5319.     tv = tq;
  5320.     tq = (*tq).tnext;
  5321.       } else
  5322.     if ((*tv).tt == nfileof) {
  5323.       txtfile = (boolean)(typeof((*tv).U.V18.tof) == typnods.A[(int)(tchar)]);
  5324.       tv = tq;
  5325.       tq = (*tq).tnext;
  5326.     } else {
  5327.       txtfile = true;
  5328.       tv = (struct S64 *)NIL;
  5329.     }
  5330.     } else {
  5331.       tv = (struct S64 *)NIL;
  5332.       txtfile = true;
  5333.     }
  5334.     if (txtfile) {
  5335.       if (tq == (struct S64 *)NIL) {
  5336.     if (td == dwriteln) {
  5337.       (void)fprintf(output.fp, "Putchr(%s, ", nlchr), Putl(output, 0);
  5338.       if (tv == (struct S64 *)NIL)
  5339.         printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5340.       else
  5341.         eexpr(tv);
  5342.       Putchr(')', output);
  5343.     }
  5344.     Putchr(';', output),Putchr('\n', output);
  5345.     goto L555;
  5346.       } else
  5347.     if (((*tq).tt != nformat) && ((*tq).tnext == (struct S64 *)NIL))
  5348.       if (typeletter(tq) == 'c') {
  5349.         (void)fprintf(output.fp, "Putchr("), Putl(output, 0);
  5350.         eexpr(tq);
  5351.         (void)fprintf(output.fp, ", "), Putl(output, 0);
  5352.         if (tv == (struct S64 *)NIL)
  5353.           printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5354.         else
  5355.           eexpr(tv);
  5356.         Putchr(')', output);
  5357.         if (td == dwriteln) {
  5358.           (void)fprintf(output.fp, ",Putchr(%s, ", nlchr), Putl(output, 0);
  5359.           if (tv == (struct S64 *)NIL)
  5360.         printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5361.           else
  5362.         eexpr(tv);
  5363.           Putchr(')', output);
  5364.         }
  5365.         Putchr(';', output),Putchr('\n', output);
  5366.         goto L555;
  5367.       }
  5368.       tx = (struct S64 *)NIL;
  5369.       (void)fprintf(output.fp, "%sfprintf(", voidcast), Putl(output, 0);
  5370.       {
  5371.     if (tv == (struct S64 *)NIL)
  5372.       printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5373.     else
  5374.       eexpr(tv);
  5375.     (void)fprintf(output.fp, ".fp, "), Putl(output, 0);
  5376.       }
  5377.       Putchr(cite, output);
  5378.       tx = tq;
  5379.       while (tq != (struct S64 *)NIL) {
  5380.     eformat(tq);
  5381.     tq = (*tq).tnext;
  5382.       }
  5383.       if ((td == dwriteln))
  5384.     (void)fprintf(output.fp, "\\n"), Putl(output, 0);
  5385.       Putchr(cite, output);
  5386.       tq = tx;
  5387.       while (tq != (struct S64 *)NIL) {
  5388.     ewrite(tq);
  5389.     tq = (*tq).tnext;
  5390.       }
  5391.       (void)fprintf(output.fp, "), Putl("), Putl(output, 0);
  5392.       if (tv == (struct S64 *)NIL)
  5393.     printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  5394.       else
  5395.     eexpr(tv);
  5396.       if (td == dwrite)
  5397.     (void)fprintf(output.fp, ", 0)"), Putl(output, 0);
  5398.       else
  5399.     (void)fprintf(output.fp, ", 1)"), Putl(output, 0);
  5400.     } else {
  5401.       increment();
  5402.       tx = typeof(tv);
  5403.       if (tx == typnods.A[(int)(ttext)])
  5404.     tx = typnods.A[(int)(tchar)];
  5405.       else
  5406.     if ((*tx).tt == nfileof)
  5407.       tx = typeof((*tx).U.V18.tof);
  5408.     else
  5409.       fatal(etree);
  5410.       while (tq != (struct S64 *)NIL) {
  5411.     if ((Member((unsigned)((*tq).tt), Conset[138])) && (tx == typeof(tq))) {
  5412.       (void)fprintf(output.fp, "%sFwrite(", voidcast), Putl(output, 0);
  5413.       eexpr(tq);
  5414.     } else {
  5415.       if ((*tx).tt == nsetof) {
  5416.         usescpy = true;
  5417.         (void)fprintf(output.fp, "Setncpy("), Putl(output, 0);
  5418.         eselect(tv);
  5419.         (void)fprintf(output.fp, "buf.S, "), Putl(output, 0);
  5420.         eexpr(tq);
  5421.         if (typeof((*tp).U.V27.trhs) == typnods.A[(int)(tset)])
  5422.           eexpr(tq);
  5423.         else {
  5424.           eselect(tq);
  5425.           Putchr('S', output);
  5426.         }
  5427.         (void)fprintf(output.fp, ", sizeof("), Putl(output, 0);
  5428.         eexpr(tv);
  5429.         (void)fprintf(output.fp, ".buf))"), Putl(output, 0);
  5430.       } else {
  5431.         eexpr(tv);
  5432.         (void)fprintf(output.fp, ".buf = "), Putl(output, 0);
  5433.         eexpr(tq);
  5434.       }
  5435.       (void)fprintf(output.fp, ", Fwrite("), Putl(output, 0);
  5436.       eexpr(tv);
  5437.       (void)fprintf(output.fp, ".buf"), Putl(output, 0);
  5438.     }
  5439.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  5440.     eexpr(tv);
  5441.     (void)fprintf(output.fp, ".fp)"), Putl(output, 0);
  5442.     tq = (*tq).tnext;
  5443.     if (tq != (struct S64 *)NIL) {
  5444.       Putchr(',', output),Putchr('\n', output);
  5445.       indent();
  5446.     }
  5447.       }
  5448.       decrement();
  5449.     }
  5450.     Putchr(';', output),Putchr('\n', output);
  5451.   L555:
  5452.     ;
  5453.     break ;
  5454.     case dclose:
  5455.     tq = typeof((*tp).U.V30.taparm);
  5456.     txtfile = (boolean)(tq == typnods.A[(int)(ttext)]);
  5457.     if ((!txtfile) && ((*tq).tt == nfileof))
  5458.       if (typeof((*tq).U.V18.tof) == typnods.A[(int)(tchar)])
  5459.     txtfile = true;
  5460.     if (txtfile)
  5461.       (void)fprintf(output.fp, "Closex("), Putl(output, 0);
  5462.     else
  5463.       (void)fprintf(output.fp, "Close("), Putl(output, 0);
  5464.     eexpr((*tp).U.V30.taparm);
  5465.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5466.     break ;
  5467.     case dreset:  case drewrite:
  5468.     tq = typeof((*tp).U.V30.taparm);
  5469.     txtfile = (boolean)(tq == typnods.A[(int)(ttext)]);
  5470.     if ((!txtfile) && ((*tq).tt == nfileof))
  5471.       if (typeof((*tq).U.V18.tof) == typnods.A[(int)(tchar)])
  5472.     txtfile = true;
  5473.     if (txtfile)
  5474.       if (td == dreset)
  5475.     (void)fprintf(output.fp, "Resetx("), Putl(output, 0);
  5476.       else
  5477.     (void)fprintf(output.fp, "Rewritex("), Putl(output, 0);
  5478.     else
  5479.       if (td == dreset)
  5480.     (void)fprintf(output.fp, "Reset("), Putl(output, 0);
  5481.       else
  5482.     (void)fprintf(output.fp, "Rewrite("), Putl(output, 0);
  5483.     eexpr((*tp).U.V30.taparm);
  5484.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  5485.     tq = (*(*tp).U.V30.taparm).tnext;
  5486.     if (tq == (struct S64 *)NIL)
  5487.       (void)fprintf(output.fp, "NULL, 0"), Putl(output, 0);
  5488.     else {
  5489.       tq = typeof(tq);
  5490.       if (tq == typnods.A[(int)(tchar)]) {
  5491.     Putchr(cite, output);
  5492.     ch = cvalof((*(*tp).U.V30.taparm).tnext);
  5493.     if ((ch == bslash) || (ch == cite))
  5494.       Putchr(bslash, output);
  5495.     (void)fprintf(output.fp, "%c%c, -1", ch, cite), Putl(output, 0);
  5496.       } else
  5497.     if (tq == typnods.A[(int)(tstring)]) {
  5498.       eexpr((*(*tp).U.V30.taparm).tnext);
  5499.       (void)fprintf(output.fp, ", -1"), Putl(output, 0);
  5500.     } else
  5501.       if ((*tq).tt == narray) {
  5502.         eexpr((*(*tp).U.V30.taparm).tnext);
  5503.         (void)fprintf(output.fp, ".A, sizeof("), Putl(output, 0);
  5504.         eexpr((*(*tp).U.V30.taparm).tnext);
  5505.         (void)fprintf(output.fp, ".A)"), Putl(output, 0);
  5506.       } else
  5507.         fatal(etree);
  5508.     }
  5509.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5510.     break ;
  5511.     case dseek:
  5512.     (void)fprintf(output.fp, "Seek("), Putl(output, 0);
  5513.     eexpr((*tp).U.V30.taparm);
  5514.     Putchr(',', output);
  5515.     eexpr((*(*tp).U.V30.taparm).tnext);
  5516.     Putchr(',', output);
  5517.     eexpr((*(*(*tp).U.V30.taparm).tnext).tnext);
  5518.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  5519.     (*defnams.A[(int)(dseek)]).U.V6.lused = true;
  5520.     break ;
  5521.     case dtell:
  5522.     (void)fprintf(output.fp, "Tell("), Putl(output, 0);
  5523.     eexpr((*tp).U.V30.taparm);
  5524.     Putchr(')', output);
  5525.     (*defnams.A[(int)(dtell)]).U.V6.lused = true;
  5526.     break ;
  5527.     case darctan:
  5528.     (void)fprintf(output.fp, "atan("), Putl(output, 0);
  5529.     if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5530.       (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5531.     eexpr((*tp).U.V30.taparm);
  5532.     Putchr(')', output);
  5533.     break ;
  5534.     case dln:
  5535.     (void)fprintf(output.fp, "log("), Putl(output, 0);
  5536.     if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5537.       (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5538.     eexpr((*tp).U.V30.taparm);
  5539.     Putchr(')', output);
  5540.     break ;
  5541.     case dexp:
  5542.     (void)fprintf(output.fp, "exp("), Putl(output, 0);
  5543.     if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5544.       (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5545.     eexpr((*tp).U.V30.taparm);
  5546.     Putchr(')', output);
  5547.     break ;
  5548.     case dcos:  case dsin:  case dsqrt:
  5549.     eexpr((*tp).U.V30.tcall);
  5550.     Putchr('(', output);
  5551.     if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5552.       (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5553.     eexpr((*tp).U.V30.taparm);
  5554.     Putchr(')', output);
  5555.     break ;
  5556.     case dtan:
  5557.     (void)fprintf(output.fp, "atan("), Putl(output, 0);
  5558.     if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5559.       (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5560.     eexpr((*tp).U.V30.taparm);
  5561.     Putchr(')', output);
  5562.     break ;
  5563.     case dsucc:  case dpred:
  5564.     tq = typeof((*tp).U.V30.taparm);
  5565.     if ((*tq).tt == nsubrange)
  5566.       if ((*(*tq).tup).tt == nconfarr)
  5567.     tq = typeof((*(*tq).tup).U.V22.tindtyp);
  5568.       else
  5569.     tq = typeof((*tq).U.V19.tlo);
  5570.     if ((tq == typnods.A[(int)(tinteger)]) || (tq == typnods.A[(int)(tchar)])) {
  5571.       (void)fprintf(output.fp, "(("), Putl(output, 0);
  5572.       eexpr((*tp).U.V30.taparm);
  5573.       if (td == dpred)
  5574.     (void)fprintf(output.fp, ")-1)"), Putl(output, 0);
  5575.       else
  5576.     (void)fprintf(output.fp, ")+1)"), Putl(output, 0);
  5577.     } else {
  5578.       Putchr('(', output);
  5579.       tq = (*tq).tup;
  5580.       if ((*tq).tt == ntype) {
  5581.     Putchr('(', output);
  5582.     printid((*(*(*tq).U.V14.tidl).U.V43.tsym).U.V6.lid);
  5583.     Putchr(')', output);
  5584.       }
  5585.       (void)fprintf(output.fp, "((int)("), Putl(output, 0);
  5586.       eexpr((*tp).U.V30.taparm);
  5587.       if (td == dpred)
  5588.     (void)fprintf(output.fp, ")-1))"), Putl(output, 0);
  5589.       else
  5590.     (void)fprintf(output.fp, ")+1))"), Putl(output, 0);
  5591.     }
  5592.     break ;
  5593.     case dodd:
  5594.     Putchr('(', output);
  5595.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  5596.     (void)fprintf(output.fp, ")(("), Putl(output, 0);
  5597.     eexpr((*tp).U.V30.taparm);
  5598.     (void)fprintf(output.fp, ") & 1)"), Putl(output, 0);
  5599.     break ;
  5600.     case dsqr:
  5601.     tq = typeof((*tp).U.V30.taparm);
  5602.     if ((tq == typnods.A[(int)(tinteger)]) || ((*tq).tt == nsubrange)) {
  5603.       (void)fprintf(output.fp, "(("), Putl(output, 0);
  5604.       eexpr((*tp).U.V30.taparm);
  5605.       (void)fprintf(output.fp, ") * ("), Putl(output, 0);
  5606.       eexpr((*tp).U.V30.taparm);
  5607.       (void)fprintf(output.fp, "))"), Putl(output, 0);
  5608.     } else {
  5609.       (void)fprintf(output.fp, "pow("), Putl(output, 0);
  5610.       if (typeof((*tp).U.V30.taparm) != typnods.A[(int)(treal)])
  5611.     (void)fprintf(output.fp, "%s", dblcast), Putl(output, 0);
  5612.       eexpr((*tp).U.V30.taparm);
  5613.       (void)fprintf(output.fp, ", 2.0)"), Putl(output, 0);
  5614.     }
  5615.     break ;
  5616.     case dround:
  5617.     (void)fprintf(output.fp, "Round("), Putl(output, 0);
  5618.     eexpr((*tp).U.V30.taparm);
  5619.     Putchr(')', output);
  5620.     break ;
  5621.     case dtrunc:
  5622.     (void)fprintf(output.fp, "Trunc("), Putl(output, 0);
  5623.     eexpr((*tp).U.V30.taparm);
  5624.     Putchr(')', output);
  5625.     break ;
  5626.     case dpack:
  5627.     tq = typeof((*tp).U.V30.taparm);
  5628.     tx = typeof((*(*(*tp).U.V30.taparm).tnext).tnext);
  5629.     (void)fprintf(output.fp, "{    %s%s%c_j, _i = ", registr, inttyp, tab1), Putl(output, 0);
  5630.     if (!arithexpr((*(*tp).U.V30.taparm).tnext))
  5631.       (void)fprintf(output.fp, "(int)"), Putl(output, 0);
  5632.     eexpr((*(*tp).U.V30.taparm).tnext);
  5633.     if ((*tx).tt == narray)
  5634.       (void)fprintf(output.fp, " - %1d", clower((*tq).U.V23.taindx)), Putl(output, 0);
  5635.     Putchr(';', output),Putchr('\n', output);
  5636.     indent();
  5637.     (void)fprintf(output.fp, "    for (_j = 0; _j < "), Putl(output, 0);
  5638.     if ((*tq).tt == nconfarr) {
  5639.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  5640.       printid((*(*(*(*tx).U.V22.tcindx).U.V19.thi).U.V43.tsym).U.V6.lid);
  5641.       Putchr(')', output);
  5642.     } else
  5643.       (void)fprintf(output.fp, "%1d", crange((*tx).U.V23.taindx)), Putl(output, 0);
  5644.     (void)fprintf(output.fp, "; )\n"), Putl(output, 1);
  5645.     indent();
  5646.     Putchr(tab1, output);
  5647.     eexpr((*(*(*tp).U.V30.taparm).tnext).tnext);
  5648.     (void)fprintf(output.fp, ".A[_j++] = "), Putl(output, 0);
  5649.     eexpr((*tp).U.V30.taparm);
  5650.     (void)fprintf(output.fp, ".A[_i++];\n"), Putl(output, 1);
  5651.     indent();
  5652.     Putchr('}', output),Putchr('\n', output);
  5653.     break ;
  5654.     case dunpack:
  5655.     tq = typeof((*tp).U.V30.taparm);
  5656.     tx = typeof((*(*tp).U.V30.taparm).tnext);
  5657.     (void)fprintf(output.fp, "{   %s%s%c_j, _i = ", registr, inttyp, tab1), Putl(output, 0);
  5658.     if (!arithexpr((*(*(*tp).U.V30.taparm).tnext).tnext))
  5659.       (void)fprintf(output.fp, "(int)"), Putl(output, 0);
  5660.     eexpr((*(*(*tp).U.V30.taparm).tnext).tnext);
  5661.     if ((*tx).tt != nconfarr)
  5662.       (void)fprintf(output.fp, " - %1d", clower((*tx).U.V23.taindx)), Putl(output, 0);
  5663.     Putchr(';', output),Putchr('\n', output);
  5664.     indent();
  5665.     (void)fprintf(output.fp, "    for (_j = 0; _j < "), Putl(output, 0);
  5666.     if ((*tq).tt == nconfarr) {
  5667.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  5668.       printid((*(*(*(*tq).U.V22.tcindx).U.V19.thi).U.V43.tsym).U.V6.lid);
  5669.       Putchr(')', output);
  5670.     } else
  5671.       (void)fprintf(output.fp, "%1d", crange((*tq).U.V23.taindx)), Putl(output, 0);
  5672.     (void)fprintf(output.fp, "; )\n"), Putl(output, 1);
  5673.     indent();
  5674.     Putchr(tab1, output);
  5675.     eexpr((*(*tp).U.V30.taparm).tnext);
  5676.     (void)fprintf(output.fp, ".A[_i++] = "), Putl(output, 0);
  5677.     eexpr((*tp).U.V30.taparm);
  5678.     (void)fprintf(output.fp, ".A[_j++];\n"), Putl(output, 1);
  5679.     indent();
  5680.     Putchr('}', output),Putchr('\n', output);
  5681.     break ;
  5682.     default:
  5683.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5684.   }
  5685.   G196_nelems = F197;
  5686. }
  5687.  
  5688.  void
  5689. eaddr(treeptr     tp)
  5690. {
  5691.   Putchr('&', output);
  5692.   if (!(Member((unsigned)((*tp).tt), Conset[139])))
  5693.     error(evarpar);
  5694.   eexpr(tp);
  5695. }
  5696.  
  5697.  void
  5698. ecall(treeptr     tp)
  5699. {
  5700.   treeptr    tf, tq, tx;
  5701.  
  5702.   tf = idup((*tp).U.V30.tcall);
  5703.   switch ((int)((*tf).tt)) {
  5704.     case nproc:  case nfunc:
  5705.     tf = (*tf).U.V13.tsubpar;
  5706.     break ;
  5707.     case nparproc:  case nparfunc:
  5708.     tf = (*tf).U.V15.tparparm;
  5709.     break ;
  5710.     default:
  5711.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5712.   }
  5713.   if (tf != (struct S64 *)NIL) {
  5714.     switch ((int)((*tf).tt)) {
  5715.       case nvalpar:  case nvarpar:
  5716.       tf = (*tf).U.V14.tidl;
  5717.       break ;
  5718.       case nparproc:  case nparfunc:
  5719.       tf = (*tf).U.V15.tparid;
  5720.       break ;
  5721.       default:
  5722.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5723.     }
  5724.   }
  5725.   eexpr((*tp).U.V30.tcall);
  5726.   Putchr('(', output);
  5727.   tq = (*tp).U.V30.taparm;
  5728.   while (tq != (struct S64 *)NIL) {
  5729.     if (Member((unsigned)((*(*tf).tup).tt), Conset[140])) {
  5730.       if ((*tq).tt == ncall)
  5731.     printid((*(*(*tq).U.V30.tcall).U.V43.tsym).U.V6.lid);
  5732.       else
  5733.     printid((*(*tq).U.V43.tsym).U.V6.lid);
  5734.     } else {
  5735.       tx = typeof(tq);
  5736.       if (tx == typnods.A[(int)(tboolean)]) {
  5737.     tx = tq;
  5738.     while ((*tx).tt == nuplus)
  5739.       tx = (*tx).U.V42.texps;
  5740.     if (Member((unsigned)((*tx).tt), Conset[141])) {
  5741.       Putchr('(', output);
  5742.       printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  5743.       (void)fprintf(output.fp, ")("), Putl(output, 0);
  5744.       eexpr(tq);
  5745.       Putchr(')', output);
  5746.     } else
  5747.       if ((*(*tf).tup).tt == nvarpar)
  5748.         eaddr(tq);
  5749.       else
  5750.         eexpr(tq);
  5751.       } else
  5752.     if (tx == typnods.A[(int)(tset)]) {
  5753.       (void)fprintf(output.fp, "*(("), Putl(output, 0);
  5754.       etypedef((*(*tf).tup).U.V14.tbind);
  5755.       (void)fprintf(output.fp, " *)"), Putl(output, 0);
  5756.       (*G203_dropset) = true;
  5757.       if (align) {
  5758.         usesal = true;
  5759.         (void)fprintf(output.fp, "SETALIGN("), Putl(output, 0);
  5760.         eexpr(tq);
  5761.         Putchr(')', output);
  5762.       } else
  5763.         eexpr(tq);
  5764.       (*G203_dropset) = false;
  5765.       Putchr(')', output);
  5766.     } else
  5767.       if (tx == typnods.A[(int)(tstring)]) {
  5768.         (void)fprintf(output.fp, "*(("), Putl(output, 0);
  5769.         etypedef((*(*tf).tup).U.V14.tbind);
  5770.         (void)fprintf(output.fp, " *)"), Putl(output, 0);
  5771.         if (align) {
  5772.           usealig = true;
  5773.           (void)fprintf(output.fp, "STRALIGN("), Putl(output, 0);
  5774.           eexpr(tq);
  5775.           Putchr(')', output);
  5776.         } else
  5777.           eexpr(tq);
  5778.         Putchr(')', output);
  5779.       } else
  5780.         if (tx == typnods.A[(int)(tnil)]) {
  5781.           Putchr('(', output);
  5782.           etypedef((*(*tf).tup).U.V14.tbind);
  5783.           (void)fprintf(output.fp, ")NIL"), Putl(output, 0);
  5784.         } else
  5785.           if ((*(*(*tf).tup).U.V14.tbind).tt == nconfarr) {
  5786.         (void)fprintf(output.fp, "(struct "), Putl(output, 0);
  5787.         printid((*(*(*tf).tup).U.V14.tbind).U.V22.tcuid);
  5788.         (void)fprintf(output.fp, " *)&"), Putl(output, 0);
  5789.         eexpr(tq);
  5790.         if ((*tq).tnext == (struct S64 *)NIL) {
  5791.           (void)fprintf(output.fp, ", ("), Putl(output, 0);
  5792.           eexpr((*(*tx).U.V23.taindx).U.V19.thi);
  5793.           (void)fprintf(output.fp, " - "), Putl(output, 0);
  5794.           eexpr((*(*tx).U.V23.taindx).U.V19.tlo);
  5795.           (void)fprintf(output.fp, " + 1)"), Putl(output, 0);
  5796.         }
  5797.           } else {
  5798.         if ((*(*tf).tup).tt == nvarpar)
  5799.           eaddr(tq);
  5800.         else
  5801.           eexpr(tq);
  5802.           }
  5803.     }
  5804.     tq = (*tq).tnext;
  5805.     if (tq != (struct S64 *)NIL) {
  5806.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  5807.       if ((*tf).tnext == (struct S64 *)NIL) {
  5808.     tf = (*(*tf).tup).tnext;
  5809.     switch ((int)((*tf).tt)) {
  5810.       case nvalpar:  case nvarpar:
  5811.       tf = (*tf).U.V14.tidl;
  5812.       break ;
  5813.       case nparproc:  case nparfunc:
  5814.       tf = (*tf).U.V15.tparid;
  5815.       break ;
  5816.       default:
  5817.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5818.     }
  5819.       } else
  5820.     tf = (*tf).tnext;
  5821.     }
  5822.   }
  5823.   Putchr(')', output);
  5824. }
  5825.  
  5826.  boolean
  5827. constxps(treeptr     tp)
  5828. {
  5829.   register boolean    R178;
  5830.  
  5831.   switch ((int)((*tp).tt)) {
  5832.     case nrange:
  5833.     if (constxps((*tp).U.V41.texpr))
  5834.       R178 = constxps((*tp).U.V41.texpl);
  5835.     else
  5836.       R178 = false;
  5837.     break ;
  5838.     case nempty:  case ninteger:  case nchar:
  5839.     R178 = true;
  5840.     break ;
  5841.     case nid:
  5842.     tp = idup(tp);
  5843.     R178 = (boolean)(((*tp).tt == nconst) || ((*tp).tt == nscalar));
  5844.     break ;
  5845.     case nin:  case neq:  case nne:  case nlt:
  5846.     case nle:  case ngt:  case nge:  case nor:
  5847.     case nplus:  case nminus:  case nand:  case nmul:
  5848.     case ndiv:  case nmod:  case nquot:  case nnot:
  5849.     case numinus:  case nuplus:  case nset:  case nindex:
  5850.     case nselect:  case nderef:  case ncall:  case nreal:
  5851.     case nstring:  case nnil:
  5852.     R178 = false;
  5853.     break ;
  5854.     default:
  5855.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5856.   }
  5857.   return R178;
  5858. }
  5859.  
  5860.  boolean
  5861. constset(treeptr     tp)
  5862. {
  5863.   register boolean    R177;
  5864.  
  5865.   R177 = true;
  5866.   while (tp != (struct S64 *)NIL)
  5867.     if (constxps(tp))
  5868.       tp = (*tp).tnext;
  5869.     else {
  5870.       R177 = false;
  5871.       tp = (struct S64 *)NIL;
  5872.     }
  5873.   return R177;
  5874. }
  5875.  
  5876.  void
  5877. eexpr(treeptr     tp)
  5878. {
  5879.   treeptr    tq;
  5880.   boolean    flag;
  5881.  
  5882.   if (Member((unsigned)((*tp).tt), Conset[142])) {
  5883.     tq = typeof((*tp).U.V41.texpl);
  5884.     if ((Member((unsigned)((*tq).tt), Conset[143])) || (tq == typnods.A[(int)(tset)])) {
  5885.       switch ((int)((*tp).tt)) {
  5886.         case nplus:
  5887.     (*G201_setused) = true;
  5888.     useunion = true;
  5889.     (void)fprintf(output.fp, "Union"), Putl(output, 0);
  5890.     break ;
  5891.         case nminus:
  5892.     (*G201_setused) = true;
  5893.     usediff = true;
  5894.     (void)fprintf(output.fp, "Diff"), Putl(output, 0);
  5895.     break ;
  5896.         case nmul:
  5897.     (*G201_setused) = true;
  5898.     useintr = true;
  5899.     (void)fprintf(output.fp, "Inter"), Putl(output, 0);
  5900.     break ;
  5901.         case neq:
  5902.     useseq = true;
  5903.     (void)fprintf(output.fp, "Eq"), Putl(output, 0);
  5904.     break ;
  5905.         case nne:
  5906.     usesne = true;
  5907.     (void)fprintf(output.fp, "Ne"), Putl(output, 0);
  5908.     break ;
  5909.         case nge:
  5910.     usesge = true;
  5911.     (void)fprintf(output.fp, "Ge"), Putl(output, 0);
  5912.     break ;
  5913.         case nle:
  5914.     usesle = true;
  5915.     (void)fprintf(output.fp, "Le"), Putl(output, 0);
  5916.     break ;
  5917.         default:
  5918.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5919.       }
  5920.       if (Member((unsigned)((*tp).tt), Conset[144]))
  5921.     (*G203_dropset) = false;
  5922.       Putchr('(', output);
  5923.       eexpr((*tp).U.V41.texpl);
  5924.       if ((*tq).tt == nsetof)
  5925.     (void)fprintf(output.fp, ".S"), Putl(output, 0);
  5926.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  5927.       eexpr((*tp).U.V41.texpr);
  5928.       tq = typeof((*tp).U.V41.texpr);
  5929.       if ((*tq).tt == nsetof)
  5930.     (void)fprintf(output.fp, ".S"), Putl(output, 0);
  5931.       Putchr(')', output);
  5932.       goto L999;
  5933.     }
  5934.   }
  5935.   if (Member((unsigned)((*tp).tt), Conset[145])) {
  5936.     tq = typeof((*tp).U.V41.texpl);
  5937.     if ((*tq).tt == nconfarr)
  5938.       fatal(ecmpconf);
  5939.     if ((Member((unsigned)((*tq).tt), Conset[146])) || (tq == typnods.A[(int)(tstring)])) {
  5940.       (void)fprintf(output.fp, "Cmpstr("), Putl(output, 0);
  5941.       eexpr((*tp).U.V41.texpl);
  5942.       if ((*tq).tt == narray)
  5943.     (void)fprintf(output.fp, ".A"), Putl(output, 0);
  5944.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  5945.       tq = typeof((*tp).U.V41.texpr);
  5946.       if ((*tq).tt == nconfarr)
  5947.     fatal(ecmpconf);
  5948.       eexpr((*tp).U.V41.texpr);
  5949.       if ((*tq).tt == narray)
  5950.     (void)fprintf(output.fp, ".A"), Putl(output, 0);
  5951.       Putchr(')', output);
  5952.       switch ((int)((*tp).tt)) {
  5953.         case neq:
  5954.     (void)fprintf(output.fp, " == "), Putl(output, 0);
  5955.     break ;
  5956.         case nne:
  5957.     (void)fprintf(output.fp, " != "), Putl(output, 0);
  5958.     break ;
  5959.         case ngt:
  5960.     (void)fprintf(output.fp, " > "), Putl(output, 0);
  5961.     break ;
  5962.         case nlt:
  5963.     (void)fprintf(output.fp, " < "), Putl(output, 0);
  5964.     break ;
  5965.         case nge:
  5966.     (void)fprintf(output.fp, " >= "), Putl(output, 0);
  5967.     break ;
  5968.         case nle:
  5969.     (void)fprintf(output.fp, " <= "), Putl(output, 0);
  5970.     break ;
  5971.         default:
  5972.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  5973.       }
  5974.       Putchr('0', output);
  5975.       goto L999;
  5976.     }
  5977.   }
  5978.   switch ((int)((*tp).tt)) {
  5979.     case neq:  case nne:  case nlt:  case nle:
  5980.     case ngt:  case nge:  case nor:  case nand:
  5981.     case nplus:  case nminus:  case nmul:  case ndiv:
  5982.     case nmod:  case nquot:
  5983.     flag = (boolean)((int)(cprio.A[(int)((*tp).tt) - (int)(nassign)]) > (int)(cprio.A[(int)((*(*tp).U.V41.texpl).tt) - (int)(nassign)]));
  5984.     if (((Member((unsigned)((*tp).tt), Conset[147])) && !arithexpr((*tp).U.V41.texpl)) || (needsintcast((*tp).U.V41.texpl))) {
  5985.       (void)fprintf(output.fp, "(int)"), Putl(output, 0);
  5986.       flag = true;
  5987.     }
  5988.     if (flag)
  5989.       Putchr('(', output);
  5990.     eexpr((*tp).U.V41.texpl);
  5991.     if (flag)
  5992.       Putchr(')', output);
  5993.     switch ((int)((*tp).tt)) {
  5994.       case neq:
  5995.       (void)fprintf(output.fp, " == "), Putl(output, 0);
  5996.       break ;
  5997.       case nne:
  5998.       (void)fprintf(output.fp, " != "), Putl(output, 0);
  5999.       break ;
  6000.       case nlt:
  6001.       (void)fprintf(output.fp, " < "), Putl(output, 0);
  6002.       break ;
  6003.       case nle:
  6004.       (void)fprintf(output.fp, " <= "), Putl(output, 0);
  6005.       break ;
  6006.       case ngt:
  6007.       (void)fprintf(output.fp, " > "), Putl(output, 0);
  6008.       break ;
  6009.       case nge:
  6010.       (void)fprintf(output.fp, " >= "), Putl(output, 0);
  6011.       break ;
  6012.       case nor:
  6013.       (void)fprintf(output.fp, " || "), Putl(output, 0);
  6014.       break ;
  6015.       case nand:
  6016.       (void)fprintf(output.fp, " && "), Putl(output, 0);
  6017.       break ;
  6018.       case nplus:
  6019.       (void)fprintf(output.fp, " + "), Putl(output, 0);
  6020.       break ;
  6021.       case nminus:
  6022.       (void)fprintf(output.fp, " - "), Putl(output, 0);
  6023.       break ;
  6024.       case nmul:
  6025.       (void)fprintf(output.fp, " * "), Putl(output, 0);
  6026.       break ;
  6027.       case ndiv:
  6028.       (void)fprintf(output.fp, " / "), Putl(output, 0);
  6029.       break ;
  6030.       case nmod:
  6031.       (void)fprintf(output.fp, " %% "), Putl(output, 0);
  6032.       break ;
  6033.       case nquot:
  6034.       (void)fprintf(output.fp, " / (("), Putl(output, 0);
  6035.       printid((*defnams.A[(int)(dreal)]).U.V6.lid);
  6036.       Putchr(')', output);
  6037.       break ;
  6038.       default:
  6039.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6040.     }
  6041.     flag = (boolean)((int)(cprio.A[(int)((*tp).tt) - (int)(nassign)]) > (int)(cprio.A[(int)((*(*tp).U.V41.texpr).tt) - (int)(nassign)]));
  6042.     if (((Member((unsigned)((*tp).tt), Conset[148])) && !arithexpr((*tp).U.V41.texpr)) || (needsintcast((*tp).U.V41.texpr))) {
  6043.       (void)fprintf(output.fp, "(int)"), Putl(output, 0);
  6044.       flag = true;
  6045.     }
  6046.     if (flag)
  6047.       Putchr('(', output);
  6048.     eexpr((*tp).U.V41.texpr);
  6049.     if (flag)
  6050.       Putchr(')', output);
  6051.     if ((*tp).tt == nquot)
  6052.       Putchr(')', output);
  6053.     break ;
  6054.     case nuplus:  case numinus:  case nnot:
  6055.     switch ((int)((*tp).tt)) {
  6056.       case numinus:
  6057.       Putchr('-', output);
  6058.       break ;
  6059.       case nnot:
  6060.       Putchr('!', output);
  6061.       break ;
  6062.       case nuplus:
  6063.       break ;
  6064.       default:
  6065.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6066.     }
  6067.     flag = (boolean)((int)(cprio.A[(int)((*tp).tt) - (int)(nassign)]) >= (int)(cprio.A[(int)((*(*tp).U.V42.texps).tt) - (int)(nassign)]));
  6068.     if (flag)
  6069.       Putchr('(', output);
  6070.     eexpr((*tp).U.V42.texps);
  6071.     if (flag)
  6072.       Putchr(')', output);
  6073.     break ;
  6074.     case nin:
  6075.     usememb = true;
  6076.     (void)fprintf(output.fp, "Member((unsigned)("), Putl(output, 0);
  6077.     eexpr((*tp).U.V41.texpl);
  6078.     (void)fprintf(output.fp, "), "), Putl(output, 0);
  6079.     (*G203_dropset) = true;
  6080.     eexpr((*tp).U.V41.texpr);
  6081.     (*G203_dropset) = false;
  6082.     tq = typeof((*tp).U.V41.texpr);
  6083.     if ((*tq).tt == nsetof)
  6084.       (void)fprintf(output.fp, ".S"), Putl(output, 0);
  6085.     Putchr(')', output);
  6086.     break ;
  6087.     case nassign:
  6088.     tq = typeof((*tp).U.V27.trhs);
  6089.     if (tq == typnods.A[(int)(tstring)]) {
  6090.       (void)fprintf(output.fp, "%sstrncpy((char *)", voidcast), Putl(output, 0);
  6091.       eexpr((*tp).U.V27.tlhs);
  6092.       (void)fprintf(output.fp, ".A, "), Putl(output, 0);
  6093.       eexpr((*tp).U.V27.trhs);
  6094.       (void)fprintf(output.fp, ", sizeof("), Putl(output, 0);
  6095.       eexpr((*tp).U.V27.tlhs);
  6096.       (void)fprintf(output.fp, ".A))"), Putl(output, 0);
  6097.     } else
  6098.       if (tq == typnods.A[(int)(tboolean)]) {
  6099.     eexpr((*tp).U.V27.tlhs);
  6100.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  6101.     tq = (*tp).U.V27.trhs;
  6102.     while ((*tq).tt == nuplus)
  6103.       tq = (*tq).U.V42.texps;
  6104.     if (Member((unsigned)((*tq).tt), Conset[149])) {
  6105.       Putchr('(', output);
  6106.       printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  6107.       (void)fprintf(output.fp, ")("), Putl(output, 0);
  6108.       eexpr(tq);
  6109.       Putchr(')', output);
  6110.     } else
  6111.       eexpr(tq);
  6112.       } else
  6113.     if (tq == typnods.A[(int)(tnil)]) {
  6114.       eexpr((*tp).U.V27.tlhs);
  6115.       (void)fprintf(output.fp, " = ("), Putl(output, 0);
  6116.       etypedef(typeof((*tp).U.V27.tlhs));
  6117.       (void)fprintf(output.fp, ")NIL"), Putl(output, 0);
  6118.     } else {
  6119.       tq = typeof((*tp).U.V27.tlhs);
  6120.       if ((*tq).tt == nsetof) {
  6121.         usescpy = true;
  6122.         (void)fprintf(output.fp, "Setncpy("), Putl(output, 0);
  6123.         eselect((*tp).U.V27.tlhs);
  6124.         (void)fprintf(output.fp, "S, "), Putl(output, 0);
  6125.         (*G203_dropset) = true;
  6126.         tq = typeof((*tp).U.V27.trhs);
  6127.         if (tq == typnods.A[(int)(tset)])
  6128.           eexpr((*tp).U.V27.trhs);
  6129.         else {
  6130.           eselect((*tp).U.V27.trhs);
  6131.           Putchr('S', output);
  6132.         }
  6133.         (*G203_dropset) = false;
  6134.         (void)fprintf(output.fp, ", sizeof("), Putl(output, 0);
  6135.         eselect((*tp).U.V27.tlhs);
  6136.         (void)fprintf(output.fp, "S))"), Putl(output, 0);
  6137.       } else {
  6138.         eexpr((*tp).U.V27.tlhs);
  6139.         (void)fprintf(output.fp, " = "), Putl(output, 0);
  6140.         eexpr((*tp).U.V27.trhs);
  6141.       }
  6142.     }
  6143.     break ;
  6144.     case ncall:
  6145.     tq = idup((*tp).U.V30.tcall);
  6146.     if ((Member((unsigned)((*tq).tt), Conset[150])) && ((*tq).U.V13.tsubstmt != (struct S64 *)NIL))
  6147.       if ((*(*tq).U.V13.tsubstmt).tt == npredef)
  6148.     epredef(tq, tp);
  6149.       else
  6150.     ecall(tp);
  6151.     else
  6152.       ecall(tp);
  6153.     break ;
  6154.     case nselect:
  6155.     eselect((*tp).U.V40.trecord);
  6156.     eexpr((*tp).U.V40.tfield);
  6157.     break ;
  6158.     case nindex:
  6159.     eselect((*tp).U.V39.tvariable);
  6160.     (void)fprintf(output.fp, "A["), Putl(output, 0);
  6161.     tq = (*tp).U.V39.toffset;
  6162.     if (arithexpr(tq))
  6163.       eexpr(tq);
  6164.     else {
  6165.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6166.       eexpr(tq);
  6167.       Putchr(')', output);
  6168.     }
  6169.     tq = typeof((*tp).U.V39.tvariable);
  6170.     if ((*tq).tt == narray)
  6171.       if (clower((*tq).U.V23.taindx) != 0) {
  6172.     (void)fprintf(output.fp, " - "), Putl(output, 0);
  6173.     tq = typeof((*tq).U.V23.taindx);
  6174.     if ((*tq).tt == nsubrange)
  6175.       if (arithexpr((*tq).U.V19.tlo))
  6176.         eexpr((*tq).U.V19.tlo);
  6177.       else {
  6178.         (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6179.         eexpr((*tq).U.V19.tlo);
  6180.         Putchr(')', output);
  6181.       }
  6182.     else
  6183.       fatal(etree);
  6184.       }
  6185.     Putchr(']', output);
  6186.     break ;
  6187.     case nderef:
  6188.     tq = typeof((*tp).U.V42.texps);
  6189.     if (((*tq).tt == nfileof) || (((*tq).tt == npredef) && ((*tq).U.V12.tdef == dtext))) {
  6190.       if ((*tp).U.V42.tisassigndest) {
  6191.     eexpr((*tp).U.V42.texps);
  6192.     (void)fprintf(output.fp, ".buf"), Putl(output, 0);
  6193.       } else {
  6194.     if (((*tq).U.V12.tdef == dtext))
  6195.       (void)fprintf(output.fp, "Bufx("), Putl(output, 0);
  6196.     else
  6197.       (void)fprintf(output.fp, "Buf("), Putl(output, 0);
  6198.     eexpr((*tp).U.V42.texps);
  6199.     Putchr(')', output);
  6200.       }
  6201.     } else {
  6202.       (void)fprintf(output.fp, "(*"), Putl(output, 0);
  6203.       eexpr((*tp).U.V42.texps);
  6204.       Putchr(')', output);
  6205.     }
  6206.     break ;
  6207.     case nid:
  6208.     tq = idup(tp);
  6209.     if ((*tq).tt == nvarpar) {
  6210.       (void)fprintf(output.fp, "(*"), Putl(output, 0);
  6211.       printid((*(*tp).U.V43.tsym).U.V6.lid);
  6212.       Putchr(')', output);
  6213.     } else
  6214.       if (((*tq).tt == nconst) && (*G199_conflag))
  6215.     (void)fprintf(output.fp, "%1d", cvalof(tp)), Putl(output, 0);
  6216.       else
  6217.     if (Member((unsigned)((*tq).tt), Conset[151])) {
  6218.       (void)fprintf(output.fp, "(*"), Putl(output, 0);
  6219.       printid((*(*tp).U.V43.tsym).U.V6.lid);
  6220.       Putchr(')', output);
  6221.     } else
  6222.       printid((*(*tp).U.V43.tsym).U.V6.lid);
  6223.     break ;
  6224.     case nchar:
  6225.     printchr((*(*tp).U.V43.tsym).U.V11.lchar);
  6226.     break ;
  6227.     case ninteger:
  6228.     (void)fprintf(output.fp, "%1d", (*(*tp).U.V43.tsym).U.V10.linum), Putl(output, 0);
  6229.     break ;
  6230.     case nreal:
  6231.     printtok((*(*tp).U.V43.tsym).U.V8.lfloat);
  6232.     break ;
  6233.     case nstring:
  6234.     printstr((*(*tp).U.V43.tsym).U.V7.lstr);
  6235.     break ;
  6236.     case nset:
  6237.     if (constset((*tp).U.V42.texps)) {
  6238.       (void)fprintf(output.fp, "Conset[%1d]", setcnt), Putl(output, 0);
  6239.       setcnt = setcnt + 1;
  6240.       tq = mknode(nset);
  6241.       (*tq).tnext = setlst;
  6242.       setlst = tq;
  6243.       (*tq).U.V42.texps = (*tp).U.V42.texps;
  6244.     } else {
  6245.       increment();
  6246.       flag = (*G203_dropset);
  6247.       if ((*G203_dropset))
  6248.     (*G203_dropset) = false;
  6249.       else
  6250.     (void)fprintf(output.fp, "Saveset("), Putl(output, 0);
  6251.       (void)fprintf(output.fp, "(Tmpset = Newset(), "), Putl(output, 0);
  6252.       tq = (*tp).U.V42.texps;
  6253.       while (tq != (struct S64 *)NIL) {
  6254.     switch ((int)((*tq).tt)) {
  6255.       case nrange:
  6256.       usemksub = true;
  6257.       (void)fprintf(output.fp, "%sMksubr(", voidcast), Putl(output, 0);
  6258.       (void)fprintf(output.fp, "(unsigned)("), Putl(output, 0);
  6259.       eexpr((*tq).U.V41.texpl);
  6260.       (void)fprintf(output.fp, "), "), Putl(output, 0);
  6261.       (void)fprintf(output.fp, "(unsigned)("), Putl(output, 0);
  6262.       eexpr((*tq).U.V41.texpr);
  6263.       (void)fprintf(output.fp, "), Tmpset)"), Putl(output, 0);
  6264.       break ;
  6265.       case nin:  case neq:  case nne:  case nlt:
  6266.       case nle:  case ngt:  case nge:  case nor:
  6267.       case nand:  case nmul:  case ndiv:  case nmod:
  6268.       case nquot:  case nplus:  case nminus:  case nnot:
  6269.       case numinus:  case nuplus:  case nindex:  case nselect:
  6270.       case nderef:  case ncall:  case ninteger:  case nchar:
  6271.       case nid:
  6272.       useins = true;
  6273.       (void)fprintf(output.fp, "%sInsmem(", voidcast), Putl(output, 0);
  6274.       (void)fprintf(output.fp, "(unsigned)("), Putl(output, 0);
  6275.       eexpr(tq);
  6276.       (void)fprintf(output.fp, "), Tmpset)"), Putl(output, 0);
  6277.       break ;
  6278.       default:
  6279.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6280.     }
  6281.     tq = (*tq).tnext;
  6282.     if (tq != (struct S64 *)NIL) {
  6283.       Putchr(',', output),Putchr('\n', output);
  6284.       indent();
  6285.     }
  6286.       }
  6287.       (void)fprintf(output.fp, ", Tmpset)"), Putl(output, 0);
  6288.       if (!flag) {
  6289.     Putchr(')', output);
  6290.     (*G201_setused) = true;
  6291.       }
  6292.       decrement();
  6293.     }
  6294.     break ;
  6295.     case nnil:
  6296.     tq = tp;
  6297.     do {
  6298.       tq = (*tq).tup;
  6299.     } while (!(Member((unsigned)((*tq).tt), Conset[152])));
  6300.     if (Member((unsigned)((*tq).tt), Conset[153])) {
  6301.       if (typeof((*tq).U.V41.texpl) == typnods.A[(int)(tnil)])
  6302.     tq = typeof((*tq).U.V41.texpr);
  6303.       else
  6304.     tq = typeof((*tq).U.V41.texpl);
  6305.       if ((*tq).tt == nptr) {
  6306.     Putchr('(', output);
  6307.     etypedef(tq);
  6308.     Putchr(')', output);
  6309.       }
  6310.     }
  6311.     (void)fprintf(output.fp, "NIL"), Putl(output, 0);
  6312.     break ;
  6313.     default:
  6314.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6315.   }
  6316. L999:
  6317.   ;
  6318. }
  6319.  
  6320.  void
  6321. econst(treeptr     tp)
  6322. {
  6323.   symptr    sp;
  6324.  
  6325.   while (tp != (struct S64 *)NIL) {
  6326.     sp = (*(*tp).U.V14.tidl).U.V43.tsym;
  6327.     if ((*(*sp).U.V6.lid).inref > 1)
  6328.       (*sp).U.V6.lid = mkrename('X', (*sp).U.V6.lid);
  6329.     if ((*(*tp).U.V14.tbind).tt == nstring) {
  6330.       indent();
  6331.       (void)fprintf(output.fp, "%s%s%c", C50_static, chartyp, tab1), Putl(output, 0);
  6332.       printid((*sp).U.V6.lid);
  6333.       (void)fprintf(output.fp, "[]    = "), Putl(output, 0);
  6334.       eexpr((*tp).U.V14.tbind);
  6335.       Putchr(';', output),Putchr('\n', output);
  6336.     } else {
  6337.       (void)fprintf(output.fp, "%s", C4_define), Putl(output, 0);
  6338.       printid((*sp).U.V6.lid);
  6339.       Putchr(space, output);
  6340.       eexpr((*tp).U.V14.tbind);
  6341.       Putchr('\n', output);
  6342.     }
  6343.     tp = (*tp).tnext;
  6344.   }
  6345. }
  6346.  
  6347.  void
  6348. edconst(treeptr     tp)
  6349. {
  6350.   symptr    sp;
  6351.  
  6352.   while (tp != (struct S64 *)NIL) {
  6353.     sp = (*(*tp).U.V14.tidl).U.V43.tsym;
  6354.     if ((*(*tp).U.V14.tbind).tt != nstring) {
  6355.       (void)fprintf(output.fp, "%s", C53_undef), Putl(output, 0);
  6356.       printid((*sp).U.V6.lid);
  6357.       Putchr('\n', output);
  6358.     }
  6359.     tp = (*tp).tnext;
  6360.   }
  6361. }
  6362.  
  6363.  void
  6364. etrange(treeptr     tp)
  6365. {
  6366.   integer    lo, hi;
  6367.   register unsigned char    i;
  6368.  
  6369.   lo = clower(tp);
  6370.   hi = cupper(tp);
  6371.   {
  6372.     unsigned char    B51 = 1,
  6373.         B52 = nmachdefs;
  6374.  
  6375.     if (B51 <= B52)
  6376.       for (i = B51; ; i++) {
  6377.     {
  6378.       register struct S198 *W53 = &machdefs.A[i - 1];
  6379.  
  6380.       if ((lo >= W53->lolim) && (hi <= W53->hilim)) {
  6381.         printtok(W53->typstr);
  6382.         goto L999;
  6383.       }
  6384.     }
  6385.     if (i == B52) break;
  6386.       }
  6387.   }
  6388.   fatal(erange);
  6389. L999:
  6390.   ;
  6391. }
  6392.  
  6393.  void
  6394. printsuf(idptr     ip)
  6395. {
  6396.   toknbuf    w;
  6397.   toknidx    i, j;
  6398.  
  6399.   gettokn((*ip).istr, &w);
  6400.   i = 1;
  6401.   j = i;
  6402.   while (w.A[i - 1] != null) {
  6403.     if (w.A[i - 1] == '.')
  6404.       j = i;
  6405.     i = (int)(i) + 1;
  6406.   }
  6407.   if (w.A[j - 1] == '.')
  6408.     j = (int)(j) + 1;
  6409.   while (w.A[j - 1] != null) {
  6410.     Putchr(w.A[j - 1], output);
  6411.     j = (int)(j) + 1;
  6412.   }
  6413. }
  6414.  
  6415.  void
  6416. etdef(idptr     uid, treeptr     tp)
  6417. {
  6418.   integer    i;
  6419.   treeptr    tq;
  6420.  
  6421.   switch ((int)((*tp).tt)) {
  6422.     case nid:
  6423.     if ((*(*tp).U.V43.tsym).lsymdecl == (*(*typnods.A[(int)(tchar)]).tup).U.V14.tidl)
  6424.       (void)fprintf(output.fp, "%s", chartyp), Putl(output, 0);
  6425.     else
  6426.       printid((*(*tp).U.V43.tsym).U.V6.lid);
  6427.     break ;
  6428.     case nptr:
  6429.     tq = typeof((*tp).U.V16.tptrid);
  6430.     if ((*tq).tt == nrecord) {
  6431.       (void)fprintf(output.fp, "struct "), Putl(output, 0);
  6432.       printid((*tq).U.V21.tuid);
  6433.     } else
  6434.       printid((*(*(*tp).U.V16.tptrid).U.V43.tsym).U.V6.lid);
  6435.     (void)fprintf(output.fp, " *"), Putl(output, 0);
  6436.     break ;
  6437.     case nscalar:
  6438.     (void)fprintf(output.fp, "enum { "), Putl(output, 0);
  6439.     increment();
  6440.     tp = (*tp).U.V17.tscalid;
  6441.     if ((*(*(*tp).U.V43.tsym).U.V6.lid).inref > 1)
  6442.       (*(*tp).U.V43.tsym).U.V6.lid = mkrename('E', (*(*tp).U.V43.tsym).U.V6.lid);
  6443.     printid((*(*tp).U.V43.tsym).U.V6.lid);
  6444.     i = 1;
  6445.     while ((*tp).tnext != (struct S64 *)NIL) {
  6446.       if (i >= 4) {
  6447.     Putchr(',', output),Putchr('\n', output);
  6448.     indent();
  6449.     i = 1;
  6450.       } else {
  6451.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  6452.     i = i + 1;
  6453.       }
  6454.       tp = (*tp).tnext;
  6455.       if ((*(*(*tp).U.V43.tsym).U.V6.lid).inref > 1)
  6456.     (*(*tp).U.V43.tsym).U.V6.lid = mkrename('E', (*(*tp).U.V43.tsym).U.V6.lid);
  6457.       printid((*(*tp).U.V43.tsym).U.V6.lid);
  6458.     }
  6459.     decrement();
  6460.     (void)fprintf(output.fp, " } "), Putl(output, 0);
  6461.     break ;
  6462.     case nsubrange:
  6463.     tq = typeof((*tp).U.V19.tlo);
  6464.     if (tq == typnods.A[(int)(tinteger)])
  6465.       etrange(tp);
  6466.     else {
  6467.       if ((*(*tq).tup).tt == ntype)
  6468.     tq = (*(*tq).tup).U.V14.tidl;
  6469.       etdef((idptr)NIL, tq);
  6470.     }
  6471.     break ;
  6472.     case nfield:
  6473.     etdef((idptr)NIL, (*tp).U.V14.tbind);
  6474.     Putchr(tab1, output);
  6475.     tp = (*tp).U.V14.tidl;
  6476.     if (uid != (struct S62 *)NIL)
  6477.       (*(*tp).U.V43.tsym).U.V6.lid = mkconc('.', uid, (*(*tp).U.V43.tsym).U.V6.lid);
  6478.     printsuf((*(*tp).U.V43.tsym).U.V6.lid);
  6479.     i = 1;
  6480.     while ((*tp).tnext != (struct S64 *)NIL) {
  6481.       if (i >= 4) {
  6482.     Putchr(',', output),Putchr('\n', output);
  6483.     indent();
  6484.     Putchr(tab1, output);
  6485.     i = 1;
  6486.       } else {
  6487.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  6488.     i = i + 1;
  6489.       }
  6490.       tp = (*tp).tnext;
  6491.       if (uid != (struct S62 *)NIL)
  6492.     (*(*tp).U.V43.tsym).U.V6.lid = mkconc('.', uid, (*(*tp).U.V43.tsym).U.V6.lid);
  6493.       printsuf((*(*tp).U.V43.tsym).U.V6.lid);
  6494.     }
  6495.     Putchr(';', output),Putchr('\n', output);
  6496.     break ;
  6497.     case nrecord:
  6498.     (void)fprintf(output.fp, "struct "), Putl(output, 0);
  6499.     if ((*tp).U.V21.tuid == (struct S62 *)NIL)
  6500.       (*tp).U.V21.tuid = uid;
  6501.     else
  6502.       if (uid == (struct S62 *)NIL)
  6503.     printid((*tp).U.V21.tuid);
  6504.     (void)fprintf(output.fp, " {\n"), Putl(output, 1);
  6505.     increment();
  6506.     if (((*tp).U.V21.tflist == (struct S64 *)NIL) && ((*tp).U.V21.tvlist == (struct S64 *)NIL)) {
  6507.       indent();
  6508.       (void)fprintf(output.fp, "%s%cdummy;\n", inttyp, tab1), Putl(output, 1);
  6509.     }
  6510.     tq = (*tp).U.V21.tflist;
  6511.     while (tq != (struct S64 *)NIL) {
  6512.       indent();
  6513.       etdef(uid, tq);
  6514.       tq = (*tq).tnext;
  6515.     }
  6516.     if ((*tp).U.V21.tvlist != (struct S64 *)NIL) {
  6517.       indent();
  6518.       (void)fprintf(output.fp, "union {\n"), Putl(output, 1);
  6519.       increment();
  6520.       tq = (*tp).U.V21.tvlist;
  6521.       while (tq != (struct S64 *)NIL) {
  6522.     if (((*(*tq).U.V20.tvrnt).U.V21.tflist != (struct S64 *)NIL) || ((*(*tq).U.V20.tvrnt).U.V21.tvlist != (struct S64 *)NIL)) {
  6523.       indent();
  6524.       if (uid == (struct S62 *)NIL)
  6525.         etdef(mkvrnt(), (*tq).U.V20.tvrnt);
  6526.       else
  6527.         etdef(mkconc('.', uid, mkvrnt()), (*tq).U.V20.tvrnt);
  6528.       Putchr(';', output),Putchr('\n', output);
  6529.     }
  6530.     tq = (*tq).tnext;
  6531.       }
  6532.       decrement();
  6533.       indent();
  6534.       (void)fprintf(output.fp, "} U;\n"), Putl(output, 1);
  6535.     }
  6536.     decrement();
  6537.     indent();
  6538.     if ((*(*tp).tup).tt == nvariant) {
  6539.       (void)fprintf(output.fp, "} "), Putl(output, 0);
  6540.       printsuf((*tp).U.V21.tuid);
  6541.     } else
  6542.       Putchr('}', output);
  6543.     break ;
  6544.     case nconfarr:
  6545.     (void)fprintf(output.fp, "struct "), Putl(output, 0);
  6546.     printid((*tp).U.V22.tcuid);
  6547.     (void)fprintf(output.fp, " { "), Putl(output, 0);
  6548.     etdef((idptr)NIL, (*tp).U.V22.tcelem);
  6549.     (void)fprintf(output.fp, "%cA[]; }", tab1), Putl(output, 0);
  6550.     break ;
  6551.     case narray:
  6552.     (void)fprintf(output.fp, "struct { "), Putl(output, 0);
  6553.     etdef((idptr)NIL, (*tp).U.V23.taelem);
  6554.     (void)fprintf(output.fp, "%cA[", tab1), Putl(output, 0);
  6555.     tq = typeof((*tp).U.V23.taindx);
  6556.     if ((*tq).tt == nsubrange) {
  6557.       if (arithexpr((*tq).U.V19.thi)) {
  6558.     eexpr((*tq).U.V19.thi);
  6559.     if (cvalof((*tq).U.V19.tlo) != 0) {
  6560.       (void)fprintf(output.fp, " - "), Putl(output, 0);
  6561.       eexpr((*tq).U.V19.tlo);
  6562.     }
  6563.       } else {
  6564.     (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6565.     eexpr((*tq).U.V19.thi);
  6566.     if (cvalof((*tq).U.V19.tlo) != 0) {
  6567.       (void)fprintf(output.fp, ") - (int)("), Putl(output, 0);
  6568.       eexpr((*tq).U.V19.tlo);
  6569.     }
  6570.     Putchr(')', output);
  6571.       }
  6572.       (void)fprintf(output.fp, " + 1"), Putl(output, 0);
  6573.     } else
  6574.       (void)fprintf(output.fp, "%1d", crange((*tp).U.V23.taindx)), Putl(output, 0);
  6575.     (void)fprintf(output.fp, "]; }"), Putl(output, 0);
  6576.     break ;
  6577.     case nfileof:
  6578.     (void)fprintf(output.fp, "struct {\n"), Putl(output, 1);
  6579.     indent();
  6580.     (void)fprintf(output.fp, "%cFILE%c*fp;\n", tab1, tab1), Putl(output, 1);
  6581.     indent();
  6582.     (void)fprintf(output.fp, "%s%cbufvalid, eoln, eof, writable;\n", inttyp, tab1), Putl(output, 1);
  6583.     indent();
  6584.     etdef((idptr)NIL, (*tp).U.V18.tof);
  6585.     (void)fprintf(output.fp, "%cbuf;\n", tab1), Putl(output, 1);
  6586.     indent();
  6587.     (void)fprintf(output.fp, "%s%cauxbuf;\n", inttyp, tab1), Putl(output, 1);
  6588.     indent();
  6589.     (void)fprintf(output.fp, "} "), Putl(output, 0);
  6590.     break ;
  6591.     case nsetof:
  6592.     (void)fprintf(output.fp, "struct { %s%cS[%1d]; }", setwtyp, tab1, csetsize(tp)), Putl(output, 0);
  6593.     break ;
  6594.     case npredef:
  6595.     switch ((int)((*tp).U.V12.tobtyp)) {
  6596.       case tboolean:
  6597.       printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  6598.       break ;
  6599.       case tchar:
  6600.       (void)fprintf(output.fp, "%s", chartyp), Putl(output, 0);
  6601.       break ;
  6602.       case tinteger:
  6603.       printid((*defnams.A[(int)(dinteger)]).U.V6.lid);
  6604.       break ;
  6605.       case treal:
  6606.       printid((*defnams.A[(int)(dreal)]).U.V6.lid);
  6607.       break ;
  6608.       case tstring:
  6609.       (void)fprintf(output.fp, "%s *", chartyp), Putl(output, 0);
  6610.       break ;
  6611.       case ttext:
  6612.       (void)fprintf(output.fp, "text"), Putl(output, 0);
  6613.       break ;
  6614.       case tnil:  case tset:  case terror:
  6615.       fatal(etree);
  6616.       break ;
  6617.       case tnone:
  6618.       (void)fprintf(output.fp, "%s", voidtyp), Putl(output, 0);
  6619.       break ;
  6620.       default:
  6621.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6622.     }
  6623.     break ;
  6624.     case nempty:
  6625.     (void)fprintf(output.fp, "%s", voidtyp), Putl(output, 0);
  6626.     break ;
  6627.     default:
  6628.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6629.   }
  6630. }
  6631.  
  6632.  void
  6633. etypedef(treeptr     tp)
  6634. {
  6635.   etdef((idptr)NIL, tp);
  6636. }
  6637.  
  6638.  void
  6639. etype(treeptr     tp)
  6640. {
  6641.   symptr    sp;
  6642.  
  6643.   while (tp != (struct S64 *)NIL) {
  6644.     sp = (*(*tp).U.V14.tidl).U.V43.tsym;
  6645.     if ((*(*sp).U.V6.lid).inref > 1)
  6646.       (*sp).U.V6.lid = mkrename('Y', (*sp).U.V6.lid);
  6647.     indent();
  6648.     (void)fprintf(output.fp, "%s", typdef), Putl(output, 0);
  6649.     etypedef((*tp).U.V14.tbind);
  6650.     Putchr(tab1, output);
  6651.     printid((*sp).U.V6.lid);
  6652.     Putchr(';', output),Putchr('\n', output);
  6653.     tp = (*tp).tnext;
  6654.   }
  6655. }
  6656.  
  6657.  void
  6658. evar(treeptr     tp)
  6659. {
  6660.   treeptr    tq;
  6661.   integer    i;
  6662.  
  6663.   while (tp != (struct S64 *)NIL) {
  6664.     indent();
  6665.     switch ((int)((*tp).tt)) {
  6666.       case nvar:  case nvalpar:  case nvarpar:
  6667.       if ((*tp).U.V14.tattr == aregister)
  6668.     (void)fprintf(output.fp, "%s", registr), Putl(output, 0);
  6669.       etypedef((*tp).U.V14.tbind);
  6670.       break ;
  6671.       case nparproc:  case nparfunc:
  6672.       if ((*tp).tt == nparproc)
  6673.     (void)fprintf(output.fp, "%s", voidtyp), Putl(output, 0);
  6674.       else
  6675.     etypedef((*tp).U.V15.tpartyp);
  6676.       tq = (*tp).U.V15.tparid;
  6677.       (void)fprintf(output.fp, "%c(*", tab1), Putl(output, 0);
  6678.       printid((*(*tq).U.V43.tsym).U.V6.lid);
  6679.       (void)fprintf(output.fp, ")()"), Putl(output, 0);
  6680.       goto L555;
  6681.       break ;
  6682.       default:
  6683.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  6684.     }
  6685.     Putchr(tab1, output);
  6686.     tq = (*tp).U.V14.tidl;
  6687.     i = 1;
  6688.     do {
  6689.       if ((*tp).tt == nvarpar)
  6690.     Putchr('*', output);
  6691.       printid((*(*tq).U.V43.tsym).U.V6.lid);
  6692.       tq = (*tq).tnext;
  6693.       if (tq != (struct S64 *)NIL) {
  6694.     if (i >= 6) {
  6695.       i = 1;
  6696.       Putchr(',', output),Putchr('\n', output);
  6697.       indent();
  6698.       Putchr(tab1, output);
  6699.     } else {
  6700.       i = i + 1;
  6701.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  6702.     }
  6703.       }
  6704.     } while (!(tq == (struct S64 *)NIL));
  6705.   L555:
  6706.     Putchr(';', output),Putchr('\n', output);
  6707.     if ((*tp).tt == nvarpar)
  6708.       if ((*(*tp).U.V14.tbind).tt == nconfarr) {
  6709.     indent();
  6710.     etypedef((*(*tp).U.V14.tbind).U.V22.tindtyp);
  6711.     Putchr(tab1, output);
  6712.     tq = (*(*(*tp).U.V14.tbind).U.V22.tcindx).U.V19.thi;
  6713.     printid((*(*tq).U.V43.tsym).U.V6.lid);
  6714.     Putchr(';', output),Putchr('\n', output);
  6715.       }
  6716.     tp = (*tp).tnext;
  6717.   }
  6718. }
  6719.  
  6720.  void
  6721. ewithtype(treeptr     tp)
  6722. {
  6723.   treeptr    tq;
  6724.  
  6725.   tq = typeof(tp);
  6726.   (void)fprintf(output.fp, "struct "), Putl(output, 0);
  6727.   printid((*tq).U.V21.tuid);
  6728. }
  6729.  
  6730.  void
  6731. echoise(treeptr     tp)
  6732. {
  6733.   treeptr    tq;
  6734.   integer    i;
  6735.  
  6736.   while (tp != (struct S64 *)NIL) {
  6737.     tq = (*tp).U.V36.tchocon;
  6738.     i = 0;
  6739.     indent();
  6740.     while (tq != (struct S64 *)NIL) {
  6741.       (void)fprintf(output.fp, "  case "), Putl(output, 0);
  6742.       (*G199_conflag) = true;
  6743.       eexpr(tq);
  6744.       (*G199_conflag) = false;
  6745.       Putchr(':', output);
  6746.       i = i + 1;
  6747.       tq = (*tq).tnext;
  6748.       if ((tq == (struct S64 *)NIL) || (i % 4 == 0)) {
  6749.     Putchr('\n', output);
  6750.     if (tq != (struct S64 *)NIL)
  6751.       indent();
  6752.     i = 0;
  6753.       }
  6754.     }
  6755.     increment();
  6756.     if ((*(*tp).U.V36.tchostmt).tt == nbegin)
  6757.       estmt((*(*tp).U.V36.tchostmt).U.V24.tbegin);
  6758.     else
  6759.       estmt((*tp).U.V36.tchostmt);
  6760.     indent();
  6761.     (void)fprintf(output.fp, "break ;\n"), Putl(output, 1);
  6762.     decrement();
  6763.     tp = (*tp).tnext;
  6764.     if (tp != (struct S64 *)NIL)
  6765.       if ((*tp).U.V36.tchocon == (struct S64 *)NIL)
  6766.     tp = (struct S64 *)NIL;
  6767.   }
  6768. }
  6769.  
  6770.  void
  6771. cenv(idptr     ip, declptr     dp)
  6772. {
  6773.   treeptr    tp;
  6774.   symptr    sp;
  6775.   idptr    np;
  6776.   register hashtyp    h;
  6777.  
  6778.   {
  6779.     register struct S63 *W54 = &(*dp);
  6780.  
  6781.     {
  6782.       hashtyp    B55 = 0,
  6783.           B56 = hashmax - 1;
  6784.  
  6785.       if (B55 <= B56)
  6786.     for (h = B55; ; h++) {
  6787.       sp = W54->ddecl.A[h];
  6788.       while (sp != (struct S65 *)NIL) {
  6789.         if ((*sp).lt == lfield) {
  6790.           np = (*sp).U.V6.lid;
  6791.           tp = (*(*(*sp).lsymdecl).tup).tup;
  6792.           if (((*(*tp).tup).tt == nvariant) && ((*tp).U.V21.tuid != (struct S62 *)NIL))
  6793.         np = mkconc('.', (*tp).U.V21.tuid, np);
  6794.           np = mkconc('>', ip, np);
  6795.           (*sp).U.V6.lid = np;
  6796.         }
  6797.         sp = (*sp).lnext;
  6798.       }
  6799.       if (h == B56) break;
  6800.     }
  6801.     }
  6802.   }
  6803. }
  6804.  
  6805.  void
  6806. eglobid(treeptr     tp)
  6807. {
  6808.   toknidx    j;
  6809.   toknbuf    w;
  6810.  
  6811.   gettokn((*(*(*tp).U.V43.tsym).U.V6.lid).istr, &w);
  6812.   j = 1;
  6813.   if (w.A[1 - 1] == '*')
  6814.     j = 2;
  6815.   while (w.A[j - 1] != null) {
  6816.     Putchr(w.A[j - 1], output);
  6817.     j = (int)(j) + 1;
  6818.   }
  6819. }
  6820.  
  6821.  void
  6822. estmt(treeptr     tp)
  6823. {
  6824.   treeptr    tq;
  6825.   idptr    locid1, locid2;
  6826.   boolean    stusd;
  6827.   unsigned char    opc1, opc2;
  6828.  
  6829.   while (tp != (struct S64 *)NIL) {
  6830.     switch ((int)((*tp).tt)) {
  6831.       case nbegin:
  6832.       if (Member((unsigned)((*(*tp).tup).tt), Conset[154]))
  6833.     indent();
  6834.       Putchr('{', output),Putchr('\n', output);
  6835.       increment();
  6836.       estmt((*tp).U.V24.tbegin);
  6837.       decrement();
  6838.       indent();
  6839.       Putchr('}', output);
  6840.       if ((*(*tp).tup).tt != nif)
  6841.     Putchr('\n', output);
  6842.       break ;
  6843.       case nrepeat:
  6844.       indent();
  6845.       (void)fprintf(output.fp, "do {\n"), Putl(output, 1);
  6846.       increment();
  6847.       estmt((*tp).U.V33.treptstmt);
  6848.       decrement();
  6849.       indent();
  6850.       (void)fprintf(output.fp, "} while (!("), Putl(output, 0);
  6851.       eexpr((*tp).U.V33.treptxp);
  6852.       (void)fprintf(output.fp, "));\n"), Putl(output, 1);
  6853.       break ;
  6854.       case nwhile:
  6855.       indent();
  6856.       (void)fprintf(output.fp, "while ("), Putl(output, 0);
  6857.       increment();
  6858.       eexpr((*tp).U.V32.twhixp);
  6859.       stusd = (*G201_setused);
  6860.       if ((*(*tp).U.V32.twhistmt).tt == nbegin) {
  6861.     decrement();
  6862.     (void)fprintf(output.fp, ") "), Putl(output, 0);
  6863.     estmt((*tp).U.V32.twhistmt);
  6864.       } else {
  6865.     Putchr(')', output),Putchr('\n', output);
  6866.     estmt((*tp).U.V32.twhistmt);
  6867.     decrement();
  6868.       }
  6869.       (*G201_setused) = (boolean)(stusd || (*G201_setused));
  6870.       break ;
  6871.       case nfor:
  6872.       indent();
  6873.       if ((*tp).U.V34.tincr) {
  6874.     opc1 = '+';
  6875.     opc2 = '<';
  6876.       } else {
  6877.     opc1 = '-';
  6878.     opc2 = '>';
  6879.       }
  6880.       if (!lazyfor) {
  6881.     locid1 = mkvariable('B');
  6882.     locid2 = mkvariable('B');
  6883.     Putchr('{', output),Putchr('\n', output);
  6884.     increment();
  6885.     indent();
  6886.     tq = idup((*tp).U.V34.tforid);
  6887.     etypedef((*tq).U.V14.tbind);
  6888.     tq = typeof((*tq).U.V14.tbind);
  6889.     Putchr(tab1, output);
  6890.     printid(locid1);
  6891.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  6892.     eexpr((*tp).U.V34.tfrom);
  6893.     Putchr(',', output),Putchr('\n', output);
  6894.     indent();
  6895.     Putchr(tab1, output);
  6896.     printid(locid2);
  6897.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  6898.     eexpr((*tp).U.V34.tto);
  6899.     Putchr(';', output),Putchr('\n', output);
  6900.     Putchr('\n', output);
  6901.     indent();
  6902.     (void)fprintf(output.fp, "if ("), Putl(output, 0);
  6903.     if ((*tq).tt == nscalar) {
  6904.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6905.       printid(locid1);
  6906.       Putchr(')', output);
  6907.     } else
  6908.       printid(locid1);
  6909.     (void)fprintf(output.fp, " %c= ", opc2), Putl(output, 0);
  6910.     if ((*tq).tt == nscalar) {
  6911.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6912.       printid(locid2);
  6913.       Putchr(')', output);
  6914.     } else
  6915.       printid(locid2);
  6916.     Putchr(')', output),Putchr('\n', output);
  6917.     increment();
  6918.     indent();
  6919.     (*tp).U.V34.tfrom = newid(locid1);
  6920.     (*(*tp).U.V34.tfrom).tup = tp;
  6921.       }
  6922.       (void)fprintf(output.fp, "for ("), Putl(output, 0);
  6923.       increment();
  6924.       eexpr((*tp).U.V34.tforid);
  6925.       tq = typeof((*tp).U.V34.tforid);
  6926.       (void)fprintf(output.fp, " = "), Putl(output, 0);
  6927.       eexpr((*tp).U.V34.tfrom);
  6928.       (void)fprintf(output.fp, "; "), Putl(output, 0);
  6929.       if (lazyfor) {
  6930.     if ((*tq).tt == nscalar) {
  6931.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6932.       eexpr((*tp).U.V34.tforid);
  6933.       Putchr(')', output);
  6934.     } else
  6935.       eexpr((*tp).U.V34.tforid);
  6936.     (void)fprintf(output.fp, " %c= ", opc2), Putl(output, 0);
  6937.     if ((*tq).tt == nscalar) {
  6938.       (void)fprintf(output.fp, "(int)("), Putl(output, 0);
  6939.       eexpr((*tp).U.V34.tto);
  6940.       Putchr(')', output);
  6941.     } else
  6942.       eexpr((*tp).U.V34.tto);
  6943.       }
  6944.       (void)fprintf(output.fp, "; "), Putl(output, 0);
  6945.       eexpr((*tp).U.V34.tforid);
  6946.       if ((*tq).tt == nscalar) {
  6947.     (void)fprintf(output.fp, " = ("), Putl(output, 0);
  6948.     eexpr((*(*tq).tup).U.V14.tidl);
  6949.     (void)fprintf(output.fp, ")((int)("), Putl(output, 0);
  6950.     eexpr((*tp).U.V34.tforid);
  6951.     (void)fprintf(output.fp, ")%c1)", opc1), Putl(output, 0);
  6952.       } else
  6953.     (void)fprintf(output.fp, "%c%c", opc1, opc1), Putl(output, 0);
  6954.       if (!lazyfor) {
  6955.     if ((*(*tp).U.V34.tforstmt).tt != nbegin) {
  6956.       tq = mknode(nbegin);
  6957.       (*tq).U.V24.tbegin = (*tp).U.V34.tforstmt;
  6958.       (*(*tq).U.V24.tbegin).tup = tq;
  6959.       (*tp).U.V34.tforstmt = tq;
  6960.       (*tq).tup = tp;
  6961.     }
  6962.     tq = (*(*tp).U.V34.tforstmt).U.V24.tbegin;
  6963.     while ((*tq).tnext != (struct S64 *)NIL)
  6964.       tq = (*tq).tnext;
  6965.     (*tq).tnext = mknode(nbreak);
  6966.     tq = (*tq).tnext;
  6967.     (*tq).tup = (*tp).U.V34.tforstmt;
  6968.     (*tq).U.V29.tbrkid = (*tp).U.V34.tforid;
  6969.     (*tq).U.V29.tbrkxp = newid(locid2);
  6970.     (*(*tq).U.V29.tbrkxp).tup = tq;
  6971.       }
  6972.       if ((*(*tp).U.V34.tforstmt).tt == nbegin) {
  6973.     decrement();
  6974.     (void)fprintf(output.fp, ") "), Putl(output, 0);
  6975.     estmt((*tp).U.V34.tforstmt);
  6976.       } else {
  6977.     Putchr(')', output),Putchr('\n', output);
  6978.     estmt((*tp).U.V34.tforstmt);
  6979.     decrement();
  6980.       }
  6981.       if (!lazyfor) {
  6982.     decrement();
  6983.     decrement();
  6984.     indent();
  6985.     Putchr('}', output),Putchr('\n', output);
  6986.       }
  6987.       break ;
  6988.       case nif:
  6989.       indent();
  6990.       (void)fprintf(output.fp, "if ("), Putl(output, 0);
  6991.       increment();
  6992.       eexpr((*tp).U.V31.tifxp);
  6993.       stusd = (*G201_setused);
  6994.       (*G201_setused) = false;
  6995.       if ((*(*tp).U.V31.tthen).tt == nbegin) {
  6996.     decrement();
  6997.     (void)fprintf(output.fp, ") "), Putl(output, 0);
  6998.     estmt((*tp).U.V31.tthen);
  6999.     if ((*tp).U.V31.telse != (struct S64 *)NIL)
  7000.       Putchr(space, output);
  7001.     else
  7002.       Putchr('\n', output);
  7003.       } else {
  7004.     Putchr(')', output),Putchr('\n', output);
  7005.     estmt((*tp).U.V31.tthen);
  7006.     decrement();
  7007.     if ((*tp).U.V31.telse != (struct S64 *)NIL)
  7008.       indent();
  7009.       }
  7010.       if ((*tp).U.V31.telse != (struct S64 *)NIL) {
  7011.     (void)fprintf(output.fp, "else"), Putl(output, 0);
  7012.     if ((*(*tp).U.V31.telse).tt == nbegin) {
  7013.       Putchr(space, output);
  7014.       estmt((*tp).U.V31.telse);
  7015.       Putchr('\n', output);
  7016.     } else {
  7017.       increment();
  7018.       Putchr('\n', output);
  7019.       estmt((*tp).U.V31.telse);
  7020.       decrement();
  7021.     }
  7022.       }
  7023.       (*G201_setused) = (boolean)(stusd || (*G201_setused));
  7024.       break ;
  7025.       case ncase:
  7026.       indent();
  7027.       (void)fprintf(output.fp, "switch ((int)("), Putl(output, 0);
  7028.       increment();
  7029.       eexpr((*tp).U.V35.tcasxp);
  7030.       (void)fprintf(output.fp, ")) {\n"), Putl(output, 1);
  7031.       decrement();
  7032.       echoise((*tp).U.V35.tcaslst);
  7033.       indent();
  7034.       (void)fprintf(output.fp, "  default:\n"), Putl(output, 1);
  7035.       increment();
  7036.       if ((*tp).U.V35.tcasother == (struct S64 *)NIL) {
  7037.     indent();
  7038.     (void)fprintf(output.fp, "PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);\n"), Putl(output, 1);
  7039.       } else
  7040.     estmt((*tp).U.V35.tcasother);
  7041.       decrement();
  7042.       indent();
  7043.       Putchr('}', output),Putchr('\n', output);
  7044.       break ;
  7045.       case nwith:
  7046.       indent();
  7047.       Putchr('{', output),Putchr('\n', output);
  7048.       increment();
  7049.       tq = (*tp).U.V37.twithvar;
  7050.       while (tq != (struct S64 *)NIL) {
  7051.     indent();
  7052.     (void)fprintf(output.fp, "%s", registr), Putl(output, 0);
  7053.     ewithtype((*tq).U.V38.texpw);
  7054.     (void)fprintf(output.fp, " *"), Putl(output, 0);
  7055.     locid1 = mkvariable('W');
  7056.     printid(locid1);
  7057.     (void)fprintf(output.fp, " = "), Putl(output, 0);
  7058.     eaddr((*tq).U.V38.texpw);
  7059.     Putchr(';', output),Putchr('\n', output);
  7060.     cenv(locid1, (*tq).U.V38.tenv);
  7061.     tq = (*tq).tnext;
  7062.       }
  7063.       Putchr('\n', output);
  7064.       if ((*(*tp).U.V37.twithstmt).tt == nbegin)
  7065.     estmt((*(*tp).U.V37.twithstmt).U.V24.tbegin);
  7066.       else
  7067.     estmt((*tp).U.V37.twithstmt);
  7068.       decrement();
  7069.       indent();
  7070.       Putchr('}', output),Putchr('\n', output);
  7071.       break ;
  7072.       case ngoto:
  7073.       indent();
  7074.       if (islocal((*tp).U.V26.tlabel))
  7075.     (void)fprintf(output.fp, "goto L%1d;\n", (*(*(*tp).U.V26.tlabel).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7076.       else {
  7077.     tq = idup((*tp).U.V26.tlabel);
  7078.     (void)fprintf(output.fp, "longjmp(J[%1d].jb, %1d);\n", (*tq).U.V13.tstat, (*(*(*tp).U.V26.tlabel).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7079.       }
  7080.       break ;
  7081.       case nlabstmt:
  7082.       decrement();
  7083.       indent();
  7084.       (void)fprintf(output.fp, "L%1d:\n", (*(*(*tp).U.V25.tlabno).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7085.       increment();
  7086.       estmt((*tp).U.V25.tstmt);
  7087.       break ;
  7088.       case nassign:
  7089.       indent();
  7090.       eexpr(tp);
  7091.       Putchr(';', output),Putchr('\n', output);
  7092.       break ;
  7093.       case ncall:
  7094.       indent();
  7095.       tq = idup((*tp).U.V30.tcall);
  7096.       if ((Member((unsigned)((*tq).tt), Conset[155])) && ((*tq).U.V13.tsubstmt != (struct S64 *)NIL))
  7097.     if ((*(*tq).U.V13.tsubstmt).tt == npredef)
  7098.       epredef(tq, tp);
  7099.     else {
  7100.       ecall(tp);
  7101.       Putchr(';', output),Putchr('\n', output);
  7102.     }
  7103.       else {
  7104.     ecall(tp);
  7105.     Putchr(';', output),Putchr('\n', output);
  7106.       }
  7107.       break ;
  7108.       case npush:
  7109.       indent();
  7110.       eglobid((*tp).U.V28.ttmp);
  7111.       (void)fprintf(output.fp, " = "), Putl(output, 0);
  7112.       eglobid((*tp).U.V28.tglob);
  7113.       Putchr(';', output),Putchr('\n', output);
  7114.       indent();
  7115.       eglobid((*tp).U.V28.tglob);
  7116.       (void)fprintf(output.fp, " = "), Putl(output, 0);
  7117.       if ((*(*tp).U.V28.tloc).tt == nid) {
  7118.     tq = idup((*tp).U.V28.tloc);
  7119.     if (Member((unsigned)((*tq).tt), Conset[156]))
  7120.       printid((*(*(*tp).U.V28.tloc).U.V43.tsym).U.V6.lid);
  7121.     else
  7122.       eaddr((*tp).U.V28.tloc);
  7123.       } else
  7124.     eaddr((*tp).U.V28.tloc);
  7125.       Putchr(';', output),Putchr('\n', output);
  7126.       break ;
  7127.       case npop:
  7128.       indent();
  7129.       eglobid((*tp).U.V28.tglob);
  7130.       (void)fprintf(output.fp, " = "), Putl(output, 0);
  7131.       eglobid((*tp).U.V28.ttmp);
  7132.       Putchr(';', output),Putchr('\n', output);
  7133.       break ;
  7134.       case nbreak:
  7135.       indent();
  7136.       (void)fprintf(output.fp, "if ("), Putl(output, 0);
  7137.       eexpr((*tp).U.V29.tbrkid);
  7138.       (void)fprintf(output.fp, " == "), Putl(output, 0);
  7139.       eexpr((*tp).U.V29.tbrkxp);
  7140.       (void)fprintf(output.fp, ") break;\n"), Putl(output, 1);
  7141.       break ;
  7142.       case nempty:
  7143.       if (!(Member((unsigned)((*(*tp).tup).tt), Conset[157]))) {
  7144.     indent();
  7145.     Putchr(';', output),Putchr('\n', output);
  7146.       }
  7147.       break ;
  7148.       default:
  7149.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  7150.     }
  7151.     if ((*G201_setused) && (Member((unsigned)((*(*tp).tup).tt), Conset[158]))) {
  7152.       indent();
  7153.       (void)fprintf(output.fp, "Claimset();\n"), Putl(output, 1);
  7154.       (*G201_setused) = false;
  7155.     }
  7156.     tp = (*tp).tnext;
  7157.   }
  7158. }
  7159.  
  7160.  void
  7161. elabel(treeptr     tp)
  7162. {
  7163.   treeptr    tq;
  7164.   integer    i;
  7165.  
  7166.   i = 0;
  7167.   tq = (*tp).U.V13.tsublab;
  7168.   while (tq != (struct S64 *)NIL) {
  7169.     if ((*(*tq).U.V43.tsym).U.V9.lgo)
  7170.       i = i + 1;
  7171.     tq = (*tq).tnext;
  7172.   }
  7173.   if (i == 1) {
  7174.     tq = (*tp).U.V13.tsublab;
  7175.     while (!(*(*tq).U.V43.tsym).U.V9.lgo)
  7176.       tq = (*tq).tnext;
  7177.     indent();
  7178.     (void)fprintf(output.fp, "if (setjmp(J[%1d].jb))\n", (*tp).U.V13.tstat), Putl(output, 1);
  7179.     (void)fprintf(output.fp, "%cgoto L%1d;\n", tab1, (*(*tq).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7180.   } else
  7181.     if (i > 1) {
  7182.       indent();
  7183.       (void)fprintf(output.fp, "switch (setjmp(J[%1d].jb)) {\n", (*tp).U.V13.tstat), Putl(output, 1);
  7184.       indent();
  7185.       (void)fprintf(output.fp, "  case 0:\n"), Putl(output, 1);
  7186.       indent();
  7187.       (void)fprintf(output.fp, "%cbreak;\n", tab1), Putl(output, 1);
  7188.       tq = (*tp).U.V13.tsublab;
  7189.       while (tq != (struct S64 *)NIL) {
  7190.     if ((*(*tq).U.V43.tsym).U.V9.lgo) {
  7191.       indent();
  7192.       (void)fprintf(output.fp, "  case %1d:\n", (*(*tq).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7193.       indent();
  7194.       (void)fprintf(output.fp, "%cgoto L%1d;\n", tab1, (*(*tq).U.V43.tsym).U.V9.lno), Putl(output, 1);
  7195.     }
  7196.     tq = (*tq).tnext;
  7197.       }
  7198.       indent();
  7199.       (void)fprintf(output.fp, "  default:\n"), Putl(output, 1);
  7200.       indent();
  7201.       (void)fprintf(output.fp, "%cPTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);\n", tab1), Putl(output, 1);
  7202.       indent();
  7203.       Putchr('}', output),Putchr('\n', output);
  7204.     }
  7205. }
  7206.  
  7207.  void
  7208. econf(treeptr     tp)
  7209. {
  7210.   treeptr    tq;
  7211.  
  7212.   while (tp != (struct S64 *)NIL) {
  7213.     if ((*tp).tt == nvarpar)
  7214.       if ((*(*tp).U.V14.tbind).tt == nconfarr) {
  7215.     indent();
  7216.     etypedef((*(*tp).U.V14.tbind).U.V22.tindtyp);
  7217.     Putchr(tab1, output);
  7218.     tq = (*(*(*tp).U.V14.tbind).U.V22.tcindx).U.V19.tlo;
  7219.     printid((*(*tq).U.V43.tsym).U.V6.lid);
  7220.     (void)fprintf(output.fp, " = ("), Putl(output, 0);
  7221.     etypedef((*(*tp).U.V14.tbind).U.V22.tindtyp);
  7222.     (void)fprintf(output.fp, ")0;\n"), Putl(output, 1);
  7223.       }
  7224.     tp = (*tp).tnext;
  7225.   }
  7226. }
  7227.  
  7228.  void
  7229. esubr(treeptr     tp)
  7230. {
  7231.   treeptr    tq, ti;
  7232.  
  7233.   while (tp != (struct S64 *)NIL) {
  7234.     if ((*tp).U.V13.tsubsub != (struct S64 *)NIL) {
  7235.       esubr((*tp).U.V13.tsubsub);
  7236.     }
  7237.     if ((*tp).U.V13.tsubstmt == (struct S64 *)NIL) {
  7238.       goto L999;
  7239.     }
  7240.     Putchr(space, output);
  7241.     etypedef((*tp).U.V13.tfuntyp);
  7242.     Putchr('\n', output);
  7243.     printid((*(*(*tp).U.V13.tsubid).U.V43.tsym).U.V6.lid);
  7244.     Putchr('(', output);
  7245.     tq = (*tp).U.V13.tsubpar;
  7246.     while (tq != (struct S64 *)NIL) {
  7247.       switch ((int)((*tq).tt)) {
  7248.         case nvarpar:  case nvalpar:
  7249.     ti = (*tq).U.V14.tidl;
  7250.     while (ti != (struct S64 *)NIL) {
  7251.       printid((*(*ti).U.V43.tsym).U.V6.lid);
  7252.       ti = (*ti).tnext;
  7253.       if (ti != (struct S64 *)NIL)
  7254.         (void)fprintf(output.fp, ", "), Putl(output, 0);
  7255.     }
  7256.     if ((*(*tq).U.V14.tbind).tt == nconfarr) {
  7257.       ti = (*(*(*tq).U.V14.tbind).U.V22.tcindx).U.V19.thi;
  7258.       (void)fprintf(output.fp, ", "), Putl(output, 0);
  7259.       printid((*(*ti).U.V43.tsym).U.V6.lid);
  7260.     }
  7261.     break ;
  7262.         case nparproc:  case nparfunc:
  7263.     ti = (*tq).U.V15.tparid;
  7264.     printid((*(*ti).U.V43.tsym).U.V6.lid);
  7265.     break ;
  7266.         default:
  7267.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  7268.       }
  7269.       tq = (*tq).tnext;
  7270.       if (tq != (struct S64 *)NIL)
  7271.     (void)fprintf(output.fp, ", "), Putl(output, 0);
  7272.     }
  7273.     Putchr(')', output),Putchr('\n', output);
  7274.     increment();
  7275.     evar((*tp).U.V13.tsubpar);
  7276.     Putchr('{', output),Putchr('\n', output);
  7277.     econf((*tp).U.V13.tsubpar);
  7278.     econst((*tp).U.V13.tsubconst);
  7279.     etype((*tp).U.V13.tsubtype);
  7280.     evar((*tp).U.V13.tsubvar);
  7281.     if (((*tp).U.V13.tsubconst != (struct S64 *)NIL) || ((*tp).U.V13.tsubtype != (struct S64 *)NIL) || ((*tp).U.V13.tsubvar != (struct S64 *)NIL))
  7282.       Putchr('\n', output);
  7283.     elabel(tp);
  7284.     estmt((*tp).U.V13.tsubstmt);
  7285.     if ((*tp).tt == nfunc) {
  7286.       indent();
  7287.       (void)fprintf(output.fp, "return "), Putl(output, 0);
  7288.       printid((*(*(*(*tp).U.V13.tsubvar).U.V14.tidl).U.V43.tsym).U.V6.lid);
  7289.       Putchr(';', output),Putchr('\n', output);
  7290.     }
  7291.     decrement();
  7292.     edconst((*tp).U.V13.tsubconst);
  7293.     Putchr('}', output),Putchr('\n', output);
  7294.   L999:
  7295.     Putchr('\n', output);
  7296.     tp = (*tp).tnext;
  7297.   }
  7298. }
  7299.  
  7300.  boolean
  7301. use(predefs     d)
  7302. {
  7303.   register boolean    R179;
  7304.  
  7305.   R179 = (*defnams.A[(int)(d)]).U.V6.lused;
  7306.   return R179;
  7307. }
  7308.  
  7309.  void
  7310. capital(symptr     sp)
  7311. {
  7312.   toknbuf    tb;
  7313.  
  7314.   if ((*(*sp).U.V6.lid).inref > 1) {
  7315.     gettokn((*(*sp).U.V6.lid).istr, &tb);
  7316.     tb.A[1 - 1] = uppercase(tb.A[1 - 1]);
  7317.     (*sp).U.V6.lid = saveid(&tb);
  7318.   }
  7319. }
  7320.  
  7321.  void
  7322. eprogram(treeptr     tp)
  7323. {
  7324.   if ((*tp).U.V13.tsubid != (struct S64 *)NIL) {
  7325.     (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  7326.     (void)fprintf(output.fp, "**    Code derived from program "), Putl(output, 0);
  7327.     printid((*(*(*tp).U.V13.tsubid).U.V43.tsym).U.V6.lid);
  7328.     Putchr('\n', output);
  7329.     (void)fprintf(output.fp, "**    Translated by ptc %s\n", rcsrevision), Putl(output, 1);
  7330.     (void)fprintf(output.fp, "**    %s\n", rcsid), Putl(output, 1);
  7331.     (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  7332.   }
  7333.   (void)fprintf(output.fp, "%s<stdio.h>\n", C24_include), Putl(output, 1);
  7334.   (void)fprintf(output.fp, "%s<string.h>\n", C24_include), Putl(output, 1);
  7335.   (void)fprintf(output.fp, "%s<stdlib.h>\n", C24_include), Putl(output, 1);
  7336.   (void)fprintf(output.fp, "%s<ctype.h>\n", C24_include), Putl(output, 1);
  7337.   (void)fprintf(output.fp, "%s\"<ptc$dir>.ptcmain.h\"\n", C24_include), Putl(output, 1);
  7338.   if (use(dexp) || use(dln) || use(dsqr) || use(dsin) || use(dcos) || use(dtan) || use(darctan) || use(dsqrt) || use(dabs) || use(dtrunc) || use(dround))
  7339.     (void)fprintf(output.fp, "%s<math.h>\n", C24_include), Putl(output, 1);
  7340.   if (use(dinput) || use(doutput) || use(derroutput)) {
  7341.     if (use(dinput)) {
  7342.       if ((*tp).U.V13.tsubid == (struct S64 *)NIL)
  7343.     (void)fprintf(output.fp, "%s", xtern), Putl(output, 0);
  7344.       (void)fprintf(output.fp, "text%c", tab1), Putl(output, 0);
  7345.       printid((*defnams.A[(int)(dinput)]).U.V6.lid);
  7346.       if ((*tp).U.V13.tsubid != (struct S64 *)NIL)
  7347.     (void)fprintf(output.fp, " = { stdin, 0, 0, 0, 0}"), Putl(output, 0);
  7348.       Putchr(';', output),Putchr('\n', output);
  7349.     }
  7350.     if (use(doutput)) {
  7351.       if ((*tp).U.V13.tsubid == (struct S64 *)NIL)
  7352.     (void)fprintf(output.fp, "%s", xtern), Putl(output, 0);
  7353.       (void)fprintf(output.fp, "text%c", tab1), Putl(output, 0);
  7354.       printid((*defnams.A[(int)(doutput)]).U.V6.lid);
  7355.       if ((*tp).U.V13.tsubid != (struct S64 *)NIL)
  7356.     (void)fprintf(output.fp, " = { stdout, 0, 0, 0, 1}"), Putl(output, 0);
  7357.       Putchr(';', output),Putchr('\n', output);
  7358.     }
  7359.     if (use(derroutput)) {
  7360.       if ((*tp).U.V13.tsubid == (struct S64 *)NIL)
  7361.     (void)fprintf(output.fp, "%s", xtern), Putl(output, 0);
  7362.       (void)fprintf(output.fp, "text%c", tab1), Putl(output, 0);
  7363.       printid((*defnams.A[(int)(derroutput)]).U.V6.lid);
  7364.       if ((*tp).U.V13.tsubid != (struct S64 *)NIL)
  7365.     (void)fprintf(output.fp, " = { stderr, 0, 0, 0, 1 }"), Putl(output, 0);
  7366.       Putchr(';', output),Putchr('\n', output);
  7367.     }
  7368.   }
  7369.   if (use(dread) || use(dreadln)) {
  7370.     (void)fprintf(output.fp, "%sFILE%c*Tmpfil;\n", C50_static, tab1), Putl(output, 1);
  7371.     (void)fprintf(output.fp, "%slong%cTmplng;\n", C50_static, tab1), Putl(output, 1);
  7372.     (void)fprintf(output.fp, "%sdouble%cTmpdbl;\n", C50_static, tab1), Putl(output, 1);
  7373.   }
  7374.   if (usejmps) {
  7375.     (void)fprintf(output.fp, "%s<setjmp.h>\n", C24_include), Putl(output, 1);
  7376.     (void)fprintf(output.fp, "%sstruct Jb { jmp_buf%cjb; } J[%1d];\n", C50_static, tab1, (maxlevel + 1)), Putl(output, 1);
  7377.   }
  7378.   if (use(dinteger) || use(dmaxint) || use(dboolean) || use(dfalse) || use(dtrue) || use(deof) || use(deoln) || use(dexp) || use(dln) || use(dsqr) || use(dsin) || use(dcos) || use(dtan) || use(darctan) || use(dsqrt) || use(dreal)) {
  7379.     (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  7380.     (void)fprintf(output.fp, "**    Definitions for standard types\n"), Putl(output, 1);
  7381.     (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  7382.   }
  7383.   if (use(dboolean) || use(dfalse) || use(dtrue) || use(deof) || use(deoln) || usesets) {
  7384.     capital(defnams.A[(int)(dboolean)]);
  7385.     (void)fprintf(output.fp, "%s%s%c", typdef, chartyp, tab1), Putl(output, 0);
  7386.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7387.     Putchr(';', output),Putchr('\n', output);
  7388.     capital(defnams.A[(int)(dfalse)]);
  7389.     (void)fprintf(output.fp, "%s", C4_define), Putl(output, 0);
  7390.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7391.     (void)fprintf(output.fp, " ("), Putl(output, 0);
  7392.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7393.     (void)fprintf(output.fp, ")0\n"), Putl(output, 1);
  7394.     capital(defnams.A[(int)(dtrue)]);
  7395.     (void)fprintf(output.fp, "%s", C4_define), Putl(output, 0);
  7396.     printid((*defnams.A[(int)(dtrue)]).U.V6.lid);
  7397.     (void)fprintf(output.fp, " ("), Putl(output, 0);
  7398.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7399.     (void)fprintf(output.fp, ")1\n"), Putl(output, 1);
  7400.     (void)fprintf(output.fp, "%s%s%c*Bools[] = { \"false\", \"true\" };\n", C50_static, plainchartyp, tab1), Putl(output, 1);
  7401.   }
  7402.   capital(defnams.A[(int)(dinteger)]);
  7403.   if (use(dinteger)) {
  7404.     (void)fprintf(output.fp, "%s%s%c", typdef, inttyp, tab1), Putl(output, 0);
  7405.     printid((*defnams.A[(int)(dinteger)]).U.V6.lid);
  7406.     Putchr(';', output),Putchr('\n', output);
  7407.   }
  7408.   if (use(dmaxint))
  7409.     (void)fprintf(output.fp, "%smaxint%c%1d\n", C4_define, tab1, maxint), Putl(output, 1);
  7410.   capital(defnams.A[(int)(dreal)]);
  7411.   if (use(dreal)) {
  7412.     (void)fprintf(output.fp, "%s%s%c", typdef, realtyp, tab1), Putl(output, 0);
  7413.     printid((*defnams.A[(int)(dreal)]).U.V6.lid);
  7414.     Putchr(';', output),Putchr('\n', output);
  7415.   }
  7416.   if (use(dnew)) {
  7417.     (void)fprintf(output.fp, "%sUnionoffs\n", ifndef), Putl(output, 1);
  7418.     (void)fprintf(output.fp, "%sUnionoffs(p, m) (((long)(&(p)->m))-((long)(p)))\n", C4_define), Putl(output, 1);
  7419.     (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  7420.   }
  7421.   if (usesets) {
  7422.     (void)fprintf(output.fp, "%sClaimset() %sCurrset(0, (%s)0)\n", C4_define, voidcast, setptyp), Putl(output, 1);
  7423.     (void)fprintf(output.fp, "%sNewset() Currset(1, (%s)0)\n", C4_define, setptyp), Putl(output, 1);
  7424.     (void)fprintf(output.fp, "%sSaveset(s) Currset(2, s)\n", C4_define), Putl(output, 1);
  7425.     (void)fprintf(output.fp, "%ssetbits %1d\n", C4_define, C37_setbits), Putl(output, 1);
  7426.     (void)fprintf(output.fp, "%s%s%c%s;\n", typdef, wordtype, tab1, setwtyp), Putl(output, 1);
  7427.     (void)fprintf(output.fp, "%s%s *%c%s;\n", typdef, setwtyp, tab1, setptyp), Putl(output, 1);
  7428.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7429.     (void)fprintf(output.fp, "%cMember(unsigned int m, setptr sp),\n", tab1), Putl(output, 1);
  7430.     (void)fprintf(output.fp, "%cLe(setptr p1, setptr p2),\n", tab1), Putl(output, 1);
  7431.     (void)fprintf(output.fp, "%cGe(setptr p1, setptr p2),\n", tab1), Putl(output, 1);
  7432.     (void)fprintf(output.fp, "%cEq(setptr p1, setptr p2),\n", tab1), Putl(output, 1);
  7433.     (void)fprintf(output.fp, "%cNe(setptr p1, setptr p2);\n", tab1), Putl(output, 1);
  7434.     (void)fprintf(output.fp, "%s%cUnion(setptr p1, setptr p2);\n", setptyp, tab1), Putl(output, 1);
  7435.     (void)fprintf(output.fp, "%s%cDiff(setptr p1, setptr p2);\n", setptyp, tab1), Putl(output, 1);
  7436.     (void)fprintf(output.fp, "%s%cInsmem(unsigned int m, setptr sp);\n", setptyp, tab1), Putl(output, 1);
  7437.     (void)fprintf(output.fp, "%s%cMksubr(unsigned int lo, unsigned int hi, setptr sp);\n", setptyp, tab1), Putl(output, 1);
  7438.     (void)fprintf(output.fp, "%s%cCurrset(int n, setptr sp);\n", setptyp, tab1), Putl(output, 1);
  7439.     (void)fprintf(output.fp, "%s%cInter(setptr p1, setptr p2);\n", setptyp, tab1), Putl(output, 1);
  7440.     (void)fprintf(output.fp, "%s%s%cTmpset;\n", C50_static, setptyp, tab1), Putl(output, 1);
  7441.     (void)fprintf(output.fp, "%s%cConset[];\n", setptyp, tab1), Putl(output, 1);
  7442.     (void)fprintf(output.fp, "%s%cSetncpy(setptr S1, setptr S2, unsigned int N);\n", voidtyp, tab1), Putl(output, 1);
  7443.   }
  7444.   if (align) {
  7445.     (void)fprintf(output.fp, "%sSETALIGN\n", ifndef), Putl(output, 1);
  7446.     (void)fprintf(output.fp, "%sSETALIGN(x) Alignset((unsigned int *)(x))\n", C4_define), Putl(output, 1);
  7447.     (void)fprintf(output.fp, "struct Set { %s%cS[%1d+1]; } *Alignset(register unsigned int *Sp);\n", wordtype, tab1, maxsetrange), Putl(output, 1);
  7448.     (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  7449.     (void)fprintf(output.fp, "%sSTRALIGN\n", ifndef), Putl(output, 1);
  7450.     (void)fprintf(output.fp, "%sSTRALIGN(x) Alignstr((unsigned char *)(x))\n", C4_define), Putl(output, 1);
  7451.     (void)fprintf(output.fp, "struct String { char    A[%1d+1]; } *Alignstr(register unsigned char *Cp);\n", maxtoknlen), Putl(output, 1);
  7452.     (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  7453.   }
  7454.   if (((*tp).U.V13.tsubconst != (struct S64 *)NIL) || ((*tp).U.V13.tsubtype != (struct S64 *)NIL) || ((*tp).U.V13.tsubvar != (struct S64 *)NIL) || ((*tp).U.V13.tsubsub != (struct S64 *)NIL)) {
  7455.     (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  7456.     (void)fprintf(output.fp, "**    Start of program definitions\n"), Putl(output, 1);
  7457.     (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  7458.   }
  7459.   econst((*tp).U.V13.tsubconst);
  7460.   etype((*tp).U.V13.tsubtype);
  7461.   evar((*tp).U.V13.tsubvar);
  7462.   if ((*tp).U.V13.tsubsub != (struct S64 *)NIL)
  7463.     Putchr('\n', output);
  7464.   (void)fprintf(output.fp, "#ptcheader\n"), Putl(output, 1);
  7465.   esubr((*tp).U.V13.tsubsub);
  7466.   if ((*tp).U.V13.tsubid != (struct S64 *)NIL) {
  7467.     (void)fprintf(output.fp, "%s%cargc;\n", inttyp, tab1), Putl(output, 1);
  7468.     (void)fprintf(output.fp, "%s%c**argv;\n", chartyp, tab1), Putl(output, 1);
  7469.     Putchr('\n', output);
  7470.     (void)fprintf(output.fp, "int main(_ac, _av)\n"), Putl(output, 1);
  7471.     (void)fprintf(output.fp, "%s%c_ac;\n", inttyp, tab1), Putl(output, 1);
  7472.     (void)fprintf(output.fp, "%s%c*_av[];\n", chartyp, tab1), Putl(output, 1);
  7473.     Putchr('{', output),Putchr('\n', output);
  7474.     Putchr('\n', output);
  7475.     increment();
  7476.     indent();
  7477.     (void)fprintf(output.fp, "argc = _ac;\n"), Putl(output, 1);
  7478.     indent();
  7479.     (void)fprintf(output.fp, "argv = _av;\n"), Putl(output, 1);
  7480.     elabel(tp);
  7481.     estmt((*tp).U.V13.tsubstmt);
  7482.     indent();
  7483.     (void)fprintf(output.fp, "exit(0);\n"), Putl(output, 1);
  7484.     indent();
  7485.     (void)fprintf(output.fp, "/* NOTREACHED */\n"), Putl(output, 1);
  7486.     decrement();
  7487.     Putchr('}', output),Putchr('\n', output);
  7488.     edconst((*tp).U.V13.tsubconst);
  7489.   }
  7490. }
  7491.  
  7492.  integer
  7493. size(treeptr     tp)
  7494. {
  7495.   register integer    R180;
  7496.   integer    r, x;
  7497.  
  7498.   r = 0;
  7499.   while (tp != (struct S64 *)NIL) {
  7500.     if ((*tp).tt == nrange)
  7501.       x = cvalof((*tp).U.V41.texpr);
  7502.     else
  7503.       if ((*tp).tt == nempty)
  7504.     x = 0;
  7505.       else
  7506.     x = cvalof(tp);
  7507.     if (x > r)
  7508.       r = x;
  7509.     tp = (*tp).tnext;
  7510.   }
  7511.   R180 = csetwords(r + 1);
  7512.   return R180;
  7513. }
  7514.  
  7515.  void
  7516. eword(bitset     s)
  7517. {
  7518. # define bitshex 4
  7519.   integer    n;
  7520.   register integer    i;
  7521.   unsigned char    x;
  7522.  
  7523.   n = 0;
  7524.   while (n <= C37_setbits)
  7525.     n = n + bitshex;
  7526.   n = n - bitshex;
  7527.   while (n >= 0) {
  7528.     x = 0;
  7529.     {
  7530.       integer    B57 = 0,
  7531.           B58 = bitshex - 1;
  7532.  
  7533.       if (B57 <= B58)
  7534.     for (i = B57; ; i++) {
  7535.       if (Member((unsigned)((n + i)), s.S))
  7536.         switch ((int)(i)) {
  7537.           case 0:
  7538.           x = (int)(x) + 1;
  7539.           break ;
  7540.           case 1:
  7541.           x = (int)(x) + 2;
  7542.           break ;
  7543.           case 2:
  7544.           x = (int)(x) + 4;
  7545.           break ;
  7546.           case 3:
  7547.           x = (int)(x) + 8;
  7548.           break ;
  7549.           default:
  7550.           PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  7551.         }
  7552.       if (i == B58) break;
  7553.     }
  7554.     }
  7555.     Putchr(hexdig.A[x], output);
  7556.     n = n - bitshex;
  7557.   }
  7558. # undef bitshex
  7559. }
  7560.  
  7561.  void
  7562. ebits(treeptr     tp)
  7563. {
  7564.   typedef struct { bitset    A[maxsetrange + 1]; }    T77;
  7565.   T77    sets;
  7566.   integer    s;
  7567.   register integer    m;
  7568.   register integer    n;
  7569.  
  7570.   s = size(tp);
  7571.   {
  7572.     integer    B59 = 0,
  7573.         B60 = s - 1;
  7574.  
  7575.     if (B59 <= B60)
  7576.       for (n = B59; ; n++) {
  7577.     Setncpy(sets.A[n].S, Conset[159], sizeof(sets.A[n].S));
  7578.     if (n == B60) break;
  7579.       }
  7580.   }
  7581.   while (tp != (struct S64 *)NIL) {
  7582.     if ((*tp).tt == nrange)
  7583.       {
  7584.     integer    B61 = cvalof((*tp).U.V41.texpl),
  7585.         B62 = cvalof((*tp).U.V41.texpr);
  7586.  
  7587.     if (B61 <= B62)
  7588.       for (m = B61; ; m++) {
  7589.         n = m / (C37_setbits + 1);
  7590.         Setncpy(sets.A[n].S, Union(sets.A[n].S, Saveset((Tmpset = Newset(), (void)Insmem((unsigned)(m % (C37_setbits + 1)), Tmpset), Tmpset))), sizeof(sets.A[n].S));
  7591.         Claimset();
  7592.         if (m == B62) break;
  7593.       }
  7594.       }
  7595.     else
  7596.       if ((*tp).tt != nempty) {
  7597.     m = cvalof(tp);
  7598.     n = m / (C37_setbits + 1);
  7599.     Setncpy(sets.A[n].S, Union(sets.A[n].S, Saveset((Tmpset = Newset(), (void)Insmem((unsigned)(m % (C37_setbits + 1)), Tmpset), Tmpset))), sizeof(sets.A[n].S));
  7600.     Claimset();
  7601.       }
  7602.     tp = (*tp).tnext;
  7603.   }
  7604.   (void)fprintf(output.fp, "%c%1d", tab1, s), Putl(output, 0);
  7605.   {
  7606.     integer    B63 = 0,
  7607.         B64 = s - 1;
  7608.  
  7609.     if (B63 <= B64)
  7610.       for (n = B63; ; n++) {
  7611.     Putchr(',', output);
  7612.     if (n % 6 == 0)
  7613.       Putchr('\n', output);
  7614.     (void)fprintf(output.fp, "%c0x", tab1), Putl(output, 0);
  7615.     eword(sets.A[n]);
  7616.     if (n == B64) break;
  7617.       }
  7618.   }
  7619.   Putchr('\n', output);
  7620. }
  7621.  
  7622.  void
  7623. econset(treeptr     tp, integer     len)
  7624. {
  7625.   register integer    i;
  7626.  
  7627.   i = 0;
  7628.   while (tp != (struct S64 *)NIL) {
  7629.     (void)fprintf(output.fp, "%s%s%cQ%1d[] = {\n", C50_static, setwtyp, tab1, i), Putl(output, 1);
  7630.     ebits((*tp).U.V42.texps);
  7631.     (void)fprintf(output.fp, "};\n"), Putl(output, 1);
  7632.     i = i + 1;
  7633.     tp = (*tp).tnext;
  7634.   }
  7635.   (void)fprintf(output.fp, "%s%c*Conset[] = {\n", setwtyp, tab1), Putl(output, 1);
  7636.   {
  7637.     integer    B65 = len - 1,
  7638.         B66 = 1;
  7639.  
  7640.     if (B65 >= B66)
  7641.       for (i = B65; ; i--) {
  7642.     (void)fprintf(output.fp, "%cQ%1d,", tab1, i), Putl(output, 0);
  7643.     if (i % 6 == 5)
  7644.       Putchr('\n', output);
  7645.     if (i == B66) break;
  7646.       }
  7647.   }
  7648.   (void)fprintf(output.fp, "%cQ0\n", tab1), Putl(output, 1);
  7649.   (void)fprintf(output.fp, "};\n"), Putl(output, 1);
  7650. }
  7651.  
  7652.  void
  7653. emit(void)
  7654. {
  7655.   static unsigned char    ifdef[]    = "# ifdef ";
  7656.   static unsigned char    elsif[]    = "# else";
  7657.   static unsigned char    usigned[]    = "unsigned ";
  7658.   boolean    conflag, setused, dropset;
  7659.   integer    indnt;
  7660.   boolean    *F200;
  7661.   boolean    *F202;
  7662.   boolean    *F204;
  7663.   integer    *F206;
  7664.  
  7665.   F206 = G205_indnt;
  7666.   G205_indnt = &indnt;
  7667.   F204 = G203_dropset;
  7668.   G203_dropset = &dropset;
  7669.   F202 = G201_setused;
  7670.   G201_setused = &setused;
  7671.   F200 = G199_conflag;
  7672.   G199_conflag = &conflag;
  7673.   (*G205_indnt) = 0;
  7674.   varno = 0;
  7675.   (*G199_conflag) = false;
  7676.   (*G201_setused) = false;
  7677.   (*G203_dropset) = false;
  7678.   eprogram(top);
  7679.   if (setcnt > 0)
  7680.     econset(setlst, setcnt);
  7681.   if (useunion) {
  7682.     Putchr('\n', output);
  7683.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7684.     (void)fprintf(output.fp, "Union(p1, p2)\n"), Putl(output, 1);
  7685.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7686.     Putchr('{', output),Putchr('\n', output);
  7687.     (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  7688.     (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  7689.     (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  7690.     Putchr('\n', output);
  7691.     (void)fprintf(output.fp, "%cj = *p1;\n", tab1), Putl(output, 1);
  7692.     (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  7693.     (void)fprintf(output.fp, "%cif (j > *p2)\n", tab1), Putl(output, 1);
  7694.     (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  7695.     (void)fprintf(output.fp, "%celse\n", tab1), Putl(output, 1);
  7696.     (void)fprintf(output.fp, "%s*p3 = *p2;\n", tab2), Putl(output, 1);
  7697.     (void)fprintf(output.fp, "%ck = *p1 - *p2;\n", tab1), Putl(output, 1);
  7698.     (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  7699.     (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  7700.     (void)fprintf(output.fp, "%s*p3++ = (*p1++ | *p2++);\n", tab2), Putl(output, 1);
  7701.     (void)fprintf(output.fp, "%cwhile (k > 0) {\n", tab1), Putl(output, 1);
  7702.     (void)fprintf(output.fp, "%s*p3++ = *p1++;\n", tab2), Putl(output, 1);
  7703.     (void)fprintf(output.fp, "%sk--;\n", tab2), Putl(output, 1);
  7704.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7705.     (void)fprintf(output.fp, "%cwhile (k < 0) {\n", tab1), Putl(output, 1);
  7706.     (void)fprintf(output.fp, "%s*p3++ = *p2++;\n", tab2), Putl(output, 1);
  7707.     (void)fprintf(output.fp, "%sk++;\n", tab2), Putl(output, 1);
  7708.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7709.     (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  7710.     Putchr('}', output),Putchr('\n', output);
  7711.   }
  7712.   if (usediff) {
  7713.     Putchr('\n', output);
  7714.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7715.     (void)fprintf(output.fp, "Diff(p1, p2)\n"), Putl(output, 1);
  7716.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7717.     Putchr('{', output),Putchr('\n', output);
  7718.     (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  7719.     (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  7720.     (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  7721.     Putchr('\n', output);
  7722.     (void)fprintf(output.fp, "%cj = *p1;\n", tab1), Putl(output, 1);
  7723.     (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  7724.     (void)fprintf(output.fp, "%cif (j > *p2)\n", tab1), Putl(output, 1);
  7725.     (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  7726.     (void)fprintf(output.fp, "%ck = *p1 - *p2;\n", tab1), Putl(output, 1);
  7727.     (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  7728.     (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  7729.     (void)fprintf(output.fp, "%s*p3++ = (*p1++ & ~ (*p2++));\n", tab2), Putl(output, 1);
  7730.     (void)fprintf(output.fp, "%cwhile (k > 0) {\n", tab1), Putl(output, 1);
  7731.     (void)fprintf(output.fp, "%s*p3++ = *p1++;\n", tab2), Putl(output, 1);
  7732.     (void)fprintf(output.fp, "%sk--;\n", tab2), Putl(output, 1);
  7733.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7734.     (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  7735.     Putchr('}', output),Putchr('\n', output);
  7736.   }
  7737.   if (useintr) {
  7738.     Putchr('\n', output);
  7739.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7740.     (void)fprintf(output.fp, "Inter(p1, p2)\n"), Putl(output, 1);
  7741.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7742.     Putchr('{', output),Putchr('\n', output);
  7743.     (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  7744.     (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  7745.     (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  7746.     Putchr('\n', output);
  7747.     (void)fprintf(output.fp, "%cif ((j = *p1) > *p2)\n", tab1), Putl(output, 1);
  7748.     (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  7749.     (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  7750.     (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  7751.     (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  7752.     (void)fprintf(output.fp, "%s*p3++ = (*p1++ & *p2++);\n", tab2), Putl(output, 1);
  7753.     (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  7754.     Putchr('}', output),Putchr('\n', output);
  7755.   }
  7756.   if (usememb) {
  7757.     Putchr('\n', output);
  7758.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7759.     Putchr('\n', output);
  7760.     (void)fprintf(output.fp, "Member(m, sp)\n"), Putl(output, 1);
  7761.     (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7762.     (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7763.     Putchr('{', output),Putchr('\n', output);
  7764.     (void)fprintf(output.fp, "%c%s%s%s%ci = m / (setbits+1) + 1;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7765.     Putchr('\n', output);
  7766.     (void)fprintf(output.fp, "%cif ((i <= *sp) && (sp[i] & (1 << (m %% (setbits+1)))))\n", tab1), Putl(output, 1);
  7767.     (void)fprintf(output.fp, "%sreturn (", tab2), Putl(output, 0);
  7768.     printid((*defnams.A[(int)(dtrue)]).U.V6.lid);
  7769.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7770.     (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  7771.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7772.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7773.     Putchr('}', output),Putchr('\n', output);
  7774.   }
  7775.   if (useseq || usesne) {
  7776.     Putchr('\n', output);
  7777.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7778.     Putchr('\n', output);
  7779.     (void)fprintf(output.fp, "Eq(p1, p2)\n"), Putl(output, 1);
  7780.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7781.     Putchr('{', output),Putchr('\n', output);
  7782.     (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  7783.     Putchr('\n', output);
  7784.     (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  7785.     (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  7786.     (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  7787.     (void)fprintf(output.fp, "%sif (*p1++ != *p2++)\n", tab2), Putl(output, 1);
  7788.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7789.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7790.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7791.     (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  7792.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7793.     (void)fprintf(output.fp, "%cwhile (i != 0) {\n", tab1), Putl(output, 1);
  7794.     (void)fprintf(output.fp, "%sif (*p1++ != 0)\n", tab2), Putl(output, 1);
  7795.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7796.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7797.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7798.     (void)fprintf(output.fp, "%si--;\n", tab2), Putl(output, 1);
  7799.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7800.     (void)fprintf(output.fp, "%cwhile (j != 0) {\n", tab1), Putl(output, 1);
  7801.     (void)fprintf(output.fp, "%sif (*p2++ != 0)\n", tab2), Putl(output, 1);
  7802.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7803.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7804.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7805.     (void)fprintf(output.fp, "%sj--;\n", tab2), Putl(output, 1);
  7806.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7807.     (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  7808.     printid((*defnams.A[(int)(dtrue)]).U.V6.lid);
  7809.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7810.     Putchr('}', output),Putchr('\n', output);
  7811.   }
  7812.   if (usesne) {
  7813.     Putchr('\n', output);
  7814.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7815.     Putchr('\n', output);
  7816.     (void)fprintf(output.fp, "Ne(p1, p2)\n"), Putl(output, 1);
  7817.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7818.     Putchr('{', output),Putchr('\n', output);
  7819.     (void)fprintf(output.fp, "%creturn (!Eq(p1, p2));", tab1), Putl(output, 0);
  7820.     Putchr('}', output),Putchr('\n', output);
  7821.   }
  7822.   if (usesle) {
  7823.     Putchr('\n', output);
  7824.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7825.     Putchr('\n', output);
  7826.     (void)fprintf(output.fp, "Le(p1, p2)\n"), Putl(output, 1);
  7827.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7828.     Putchr('{', output),Putchr('\n', output);
  7829.     (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  7830.     Putchr('\n', output);
  7831.     (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  7832.     (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  7833.     (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  7834.     (void)fprintf(output.fp, "%sif ((*p1++ & ~ *p2++) != 0)\n", tab2), Putl(output, 1);
  7835.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7836.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7837.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7838.     (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  7839.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7840.     (void)fprintf(output.fp, "%cwhile (i != 0) {\n", tab1), Putl(output, 1);
  7841.     (void)fprintf(output.fp, "%sif (*p1++ != 0)\n", tab2), Putl(output, 1);
  7842.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7843.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7844.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7845.     (void)fprintf(output.fp, "%si--;\n", tab2), Putl(output, 1);
  7846.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7847.     (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  7848.     printid((*defnams.A[(int)(dtrue)]).U.V6.lid);
  7849.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7850.     Putchr('}', output),Putchr('\n', output);
  7851.   }
  7852.   if (usesge) {
  7853.     Putchr('\n', output);
  7854.     printid((*defnams.A[(int)(dboolean)]).U.V6.lid);
  7855.     Putchr('\n', output);
  7856.     (void)fprintf(output.fp, "Ge(p1, p2)\n"), Putl(output, 1);
  7857.     (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7858.     Putchr('{', output),Putchr('\n', output);
  7859.     (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  7860.     Putchr('\n', output);
  7861.     (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  7862.     (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  7863.     (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  7864.     (void)fprintf(output.fp, "%sif ((*p2++ & ~ *p1++) != 0)\n", tab2), Putl(output, 1);
  7865.     (void)fprintf(output.fp, "%sreturn (false);\n", tab3), Putl(output, 1);
  7866.     (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  7867.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7868.     (void)fprintf(output.fp, "%cwhile (j != 0) {\n", tab1), Putl(output, 1);
  7869.     (void)fprintf(output.fp, "%sif (*p2++ != 0)\n", tab2), Putl(output, 1);
  7870.     (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  7871.     printid((*defnams.A[(int)(dfalse)]).U.V6.lid);
  7872.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7873.     (void)fprintf(output.fp, "%sj--;\n", tab2), Putl(output, 1);
  7874.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7875.     (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  7876.     printid((*defnams.A[(int)(dtrue)]).U.V6.lid);
  7877.     (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  7878.     Putchr('}', output),Putchr('\n', output);
  7879.   }
  7880.   if (usemksub) {
  7881.     Putchr('\n', output);
  7882.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7883.     (void)fprintf(output.fp, "Mksubr(lo, hi, sp)\n"), Putl(output, 1);
  7884.     (void)fprintf(output.fp, "%c%s%s%s%clo, hi;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7885.     (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7886.     Putchr('{', output),Putchr('\n', output);
  7887.     (void)fprintf(output.fp, "%c%s%s%ci, k;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  7888.     Putchr('\n', output);
  7889.     (void)fprintf(output.fp, "%cif (hi < lo)\n", tab1), Putl(output, 1);
  7890.     (void)fprintf(output.fp, "%sreturn (sp);\n", tab2), Putl(output, 1);
  7891.     (void)fprintf(output.fp, "%ci = hi / (setbits+1) + 1;\n", tab1), Putl(output, 1);
  7892.     (void)fprintf(output.fp, "%cfor (k = *sp + 1; k <= i; k++)\n", tab1), Putl(output, 1);
  7893.     (void)fprintf(output.fp, "%ssp[k] = 0;\n", tab2), Putl(output, 1);
  7894.     (void)fprintf(output.fp, "%cif (*sp < i)\n", tab1), Putl(output, 1);
  7895.     (void)fprintf(output.fp, "%s*sp = i;\n", tab2), Putl(output, 1);
  7896.     (void)fprintf(output.fp, "%cfor (k = lo; k <= hi; k++)\n", tab1), Putl(output, 1);
  7897.     (void)fprintf(output.fp, "%ssp[k / (setbits+1) + 1] |= (1 << (k %% (setbits+1)));\n", tab2), Putl(output, 1);
  7898.     (void)fprintf(output.fp, "%creturn (sp);\n", tab1), Putl(output, 1);
  7899.     Putchr('}', output),Putchr('\n', output);
  7900.   }
  7901.   if (useins) {
  7902.     Putchr('\n', output);
  7903.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7904.     (void)fprintf(output.fp, "Insmem(m, sp)\n"), Putl(output, 1);
  7905.     (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7906.     (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7907.     Putchr('{', output),Putchr('\n', output);
  7908.     (void)fprintf(output.fp, "%c%s%s%ci,\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  7909.     (void)fprintf(output.fp, "%s%cj = m / (setbits+1) + 1;\n", tab3, tab1), Putl(output, 1);
  7910.     Putchr('\n', output);
  7911.     (void)fprintf(output.fp, "%cif (*sp < j)\n", tab1), Putl(output, 1);
  7912.     (void)fprintf(output.fp, "%sfor (i = *sp + 1, *sp = j; i <= *sp; i++)\n", tab2), Putl(output, 1);
  7913.     (void)fprintf(output.fp, "%ssp[i] = 0;\n", tab3), Putl(output, 1);
  7914.     (void)fprintf(output.fp, "%csp[j] |= (1 << (m %% (setbits+1)));\n", tab1), Putl(output, 1);
  7915.     (void)fprintf(output.fp, "%creturn (sp);\n", tab1), Putl(output, 1);
  7916.     Putchr('}', output),Putchr('\n', output);
  7917.   }
  7918.   if (usesets) {
  7919.     Putchr('\n', output);
  7920.     (void)fprintf(output.fp, "%sSETSPACE\n", ifndef), Putl(output, 1);
  7921.     (void)fprintf(output.fp, "%sSETSPACE 256\n", C4_define), Putl(output, 1);
  7922.     (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  7923.     (void)fprintf(output.fp, "%s\n", setptyp), Putl(output, 1);
  7924.     (void)fprintf(output.fp, "Currset(n,sp)\n"), Putl(output, 1);
  7925.     (void)fprintf(output.fp, "%c%s%cn;\n", tab1, inttyp, tab1), Putl(output, 1);
  7926.     (void)fprintf(output.fp, "%c%s%csp;\n", tab1, setptyp, tab1), Putl(output, 1);
  7927.     Putchr('{', output),Putchr('\n', output);
  7928.     (void)fprintf(output.fp, "%c%s%s%cSpace[SETSPACE];\n", tab1, C50_static, setwtyp, tab1), Putl(output, 1);
  7929.     (void)fprintf(output.fp, "%c%s%s%cTop = Space;\n", tab1, C50_static, setptyp, tab1), Putl(output, 1);
  7930.     Putchr('\n', output);
  7931.     (void)fprintf(output.fp, "%cswitch (n) {\n", tab1), Putl(output, 1);
  7932.     (void)fprintf(output.fp, "%c  case 0:\n", tab1), Putl(output, 1);
  7933.     (void)fprintf(output.fp, "%sTop = Space;\n", tab2), Putl(output, 1);
  7934.     (void)fprintf(output.fp, "%sreturn (0);\n", tab2), Putl(output, 1);
  7935.     (void)fprintf(output.fp, "%c  case 1:\n", tab1), Putl(output, 1);
  7936.     (void)fprintf(output.fp, "%sif (&Space[SETSPACE] - Top <= %1d) {\n", tab2, maxsetrange), Putl(output, 1);
  7937.     (void)fprintf(output.fp, "%s%sfprintf(stderr, \"Set-space exhausted\\n\");\n", tab3, voidcast), Putl(output, 1);
  7938.     (void)fprintf(output.fp, "%sexit(1);\n", tab3), Putl(output, 1);
  7939.     (void)fprintf(output.fp, "%s}\n", tab2), Putl(output, 1);
  7940.     (void)fprintf(output.fp, "%s*Top = 0;\n", tab2), Putl(output, 1);
  7941.     (void)fprintf(output.fp, "%sreturn (Top);\n", tab2), Putl(output, 1);
  7942.     (void)fprintf(output.fp, "%c  case 2:\n", tab1), Putl(output, 1);
  7943.     (void)fprintf(output.fp, "%sif (Top <= &sp[*sp])\n", tab2), Putl(output, 1);
  7944.     (void)fprintf(output.fp, "%sTop = &sp[*sp + 1];\n", tab3), Putl(output, 1);
  7945.     (void)fprintf(output.fp, "%sreturn (sp);\n", tab2), Putl(output, 1);
  7946.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7947.     (void)fprintf(output.fp, "%c/* NOTREACHED */\n", tab1), Putl(output, 1);
  7948.     Putchr('}', output),Putchr('\n', output);
  7949.   }
  7950.   if (usescpy) {
  7951.     Putchr('\n', output);
  7952.     (void)fprintf(output.fp, "%s\n", voidtyp), Putl(output, 1);
  7953.     (void)fprintf(output.fp, "Setncpy(S1, S2, N)\n"), Putl(output, 1);
  7954.     (void)fprintf(output.fp, "%c%s%s%cS1, S2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  7955.     (void)fprintf(output.fp, "%c%s%s%s%cN;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7956.     Putchr('{', output),Putchr('\n', output);
  7957.     (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  7958.     Putchr('\n', output);
  7959.     (void)fprintf(output.fp, "%cN /= sizeof(%s);\n", tab1, setwtyp), Putl(output, 1);
  7960.     (void)fprintf(output.fp, "%c*S1++ = --N;\n", tab1), Putl(output, 1);
  7961.     (void)fprintf(output.fp, "%cm = *S2++;\n", tab1), Putl(output, 1);
  7962.     (void)fprintf(output.fp, "%cwhile (m != 0 && N != 0) {\n", tab1), Putl(output, 1);
  7963.     (void)fprintf(output.fp, "%s*S1++ = *S2++;\n", tab2), Putl(output, 1);
  7964.     (void)fprintf(output.fp, "%s--N;\n", tab2), Putl(output, 1);
  7965.     (void)fprintf(output.fp, "%s--m;\n", tab2), Putl(output, 1);
  7966.     (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  7967.     (void)fprintf(output.fp, "%cwhile (N-- != 0)\n", tab1), Putl(output, 1);
  7968.     (void)fprintf(output.fp, "%s*S1++ = 0;\n", tab2), Putl(output, 1);
  7969.     Putchr('}', output),Putchr('\n', output);
  7970.   }
  7971.   if (usesal) {
  7972.     Putchr('\n', output);
  7973.     (void)fprintf(output.fp, "struct Set *\n"), Putl(output, 1);
  7974.     (void)fprintf(output.fp, "Alignset(Sp)\n"), Putl(output, 1);
  7975.     (void)fprintf(output.fp, "%c%s%s%c*Sp;\n", tab1, registr, wordtype, tab1), Putl(output, 1);
  7976.     Putchr('{', output),Putchr('\n', output);
  7977.     (void)fprintf(output.fp, "%c%sstruct Set%ctmp;\n", tab1, C50_static, tab1), Putl(output, 1);
  7978.     (void)fprintf(output.fp, "%c%s%s%c*tp = tmp.S;\n", tab1, registr, wordtype, tab1), Putl(output, 1);
  7979.     (void)fprintf(output.fp, "%c%s%s%si = *Sp;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  7980.     Putchr('\n', output);
  7981.     (void)fprintf(output.fp, "%cwhile (i-- >= 0)\n", tab1), Putl(output, 1);
  7982.     (void)fprintf(output.fp, "%s*tp++ = *Sp++;\n", tab2), Putl(output, 1);
  7983.     (void)fprintf(output.fp, "%creturn (&tmp);\n", tab1), Putl(output, 1);
  7984.     Putchr('}', output),Putchr('\n', output);
  7985.   }
  7986.   if (usealig) {
  7987.     Putchr('\n', output);
  7988.     (void)fprintf(output.fp, "struct String *\n"), Putl(output, 1);
  7989.     (void)fprintf(output.fp, "Alignstr(Cp)\n"), Putl(output, 1);
  7990.     (void)fprintf(output.fp, "%c%s%s%c*Cp;\n", tab1, registr, chartyp, tab1), Putl(output, 1);
  7991.     Putchr('{', output),Putchr('\n', output);
  7992.     (void)fprintf(output.fp, "%c%sstruct String%ctmp;\n", tab1, C50_static, tab1), Putl(output, 1);
  7993.     (void)fprintf(output.fp, "%c%s%s%c*sp = (%s*)tmp.A;\n", tab1, registr, chartyp, tab1, chartyp), Putl(output, 1);
  7994.     Putchr('\n', output);
  7995.     (void)fprintf(output.fp, "%cwhile ((*sp++ = *Cp++) != 0)\n", tab1), Putl(output, 1);
  7996.     (void)fprintf(output.fp, "%s;\n", tab2), Putl(output, 1);
  7997.     (void)fprintf(output.fp, "%creturn (&tmp);\n", tab1), Putl(output, 1);
  7998.     Putchr('}', output),Putchr('\n', output);
  7999.   }
  8000.   if (usemax) {
  8001.     Putchr('\n', output);
  8002.     (void)fprintf(output.fp, "%s\n", inttyp), Putl(output, 1);
  8003.     (void)fprintf(output.fp, "Max(m, n)\n"), Putl(output, 1);
  8004.     (void)fprintf(output.fp, "%c%s%cm, n;\n", tab1, inttyp, tab1), Putl(output, 1);
  8005.     Putchr('{', output),Putchr('\n', output);
  8006.     (void)fprintf(output.fp, "%cif (m > n)\n", tab1), Putl(output, 1);
  8007.     (void)fprintf(output.fp, "%sreturn (m);\n", tab2), Putl(output, 1);
  8008.     (void)fprintf(output.fp, "%creturn (n);\n", tab1), Putl(output, 1);
  8009.     Putchr('}', output),Putchr('\n', output);
  8010.   }
  8011.   G199_conflag = F200;
  8012.   G201_setused = F202;
  8013.   G203_dropset = F204;
  8014.   G205_indnt = F206;
  8015. }
  8016.  
  8017.  void
  8018. defname(cnames     cn, keyword     str)
  8019. {
  8020.   toknbuf    w;
  8021.   register toknidx    i;
  8022.  
  8023.   {   register int    _j, _i = 1 - 1;
  8024.       for (_j = 0; _j < 10; )
  8025.       w.A[_i++] = str.A[_j++];
  8026.   }
  8027.   {
  8028.     toknidx    B67 = 1,
  8029.         B68 = keywordlen;
  8030.  
  8031.     if (B67 <= B68)
  8032.       for (i = B67; ; i++) {
  8033.     if (w.A[i - 1] == space) {
  8034.       w.A[i - 1] = null;
  8035.       goto L999;
  8036.     }
  8037.     if (i == B68) break;
  8038.       }
  8039.   }
  8040.   w.A[keywordlen + 1 - 1] = null;
  8041. L999:
  8042.   ctable.A[(int)(cn)] = saveid(&w);
  8043. }
  8044.  
  8045.  void
  8046. defid(treetyp     nt, predefs     did, keyword     str)
  8047. {
  8048.   toknbuf    w;
  8049.   register toknidx    i;
  8050.   treeptr    tp, tq, tv;
  8051.  
  8052.   {
  8053.     toknidx    B69 = 1,
  8054.         B70 = keywordlen;
  8055.  
  8056.     if (B69 <= B70)
  8057.       for (i = B69; ; i++) {
  8058.     if (str.A[i - 1] == space) {
  8059.       w.A[i - 1] = null;
  8060.       goto L999;
  8061.     } else
  8062.       w.A[i - 1] = str.A[i - 1];
  8063.     if (i == B70) break;
  8064.       }
  8065.   }
  8066.   w.A[keywordlen + 1 - 1] = null;
  8067. L999:
  8068.   tp = newid(saveid(&w));
  8069.   defnams.A[(int)(did)] = (*tp).U.V43.tsym;
  8070.   if (Member((unsigned)(nt), Conset[160])) {
  8071.     tv = mknode(npredef);
  8072.     (*tv).U.V12.tdef = did;
  8073.     (*tv).U.V12.tobtyp = tnone;
  8074.   } else
  8075.     tv = (struct S64 *)NIL;
  8076.   switch ((int)(nt)) {
  8077.     case nscalar:
  8078.     tv = mknode(nscalar);
  8079.     (*tv).U.V17.tscalid = (struct S64 *)NIL;
  8080.     tq = mknode(ntype);
  8081.     (*tq).U.V14.tbind = tv;
  8082.     (*tq).U.V14.tidl = tp;
  8083.     tp = tq;
  8084.     break ;
  8085.     case nconst:  case ntype:  case nfield:  case nvar:
  8086.     tq = mknode(nt);
  8087.     (*tq).U.V14.tbind = tv;
  8088.     (*tq).U.V14.tidl = tp;
  8089.     (*tq).U.V14.tattr = anone;
  8090.     tp = tq;
  8091.     break ;
  8092.     case nfunc:  case nproc:
  8093.     tq = mknode(nt);
  8094.     (*tq).U.V13.tsubid = tp;
  8095.     (*tq).U.V13.tsubstmt = tv;
  8096.     (*tq).U.V13.tfuntyp = (struct S64 *)NIL;
  8097.     (*tq).U.V13.tsubpar = (struct S64 *)NIL;
  8098.     (*tq).U.V13.tsublab = (struct S64 *)NIL;
  8099.     (*tq).U.V13.tsubconst = (struct S64 *)NIL;
  8100.     (*tq).U.V13.tsubtype = (struct S64 *)NIL;
  8101.     (*tq).U.V13.tsubvar = (struct S64 *)NIL;
  8102.     (*tq).U.V13.tsubsub = (struct S64 *)NIL;
  8103.     (*tq).U.V13.tscope = (struct S63 *)NIL;
  8104.     (*tq).U.V13.tstat = 0;
  8105.     tp = tq;
  8106.     break ;
  8107.     case nid:
  8108.     break ;
  8109.     default:
  8110.     PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  8111.   }
  8112.   deftab.A[(int)(did)] = tp;
  8113. }
  8114.  
  8115.  void
  8116. defkey(symtyp     s, keyword     w)
  8117. {
  8118.   register unsigned char    i;
  8119.  
  8120.   {
  8121.     unsigned char    B71 = 1,
  8122.         B72 = keywordlen;
  8123.  
  8124.     if (B71 <= B72)
  8125.       for (i = B71; ; i++) {
  8126.     if (w.A[i - 1] == space)
  8127.       w.A[i - 1] = null;
  8128.     if (i == B72) break;
  8129.       }
  8130.   }
  8131.   {
  8132.     register struct S207 *W73 = &keytab.A[(unsigned)(s)];
  8133.  
  8134.     W73->wrd = w;
  8135.     W73->sym = s;
  8136.   }
  8137. }
  8138.  
  8139.  void
  8140. fixfp(strindx     i)
  8141. {
  8142.   toknbuf    t;
  8143.  
  8144.   gettokn(i, &t);
  8145.   t.A[1 - 1] = 'f';
  8146.   puttokn(i, &t);
  8147. }
  8148.  
  8149.  void
  8150. defmach(integer     lo, integer     hi, machdefstr     str)
  8151. {
  8152.   register toknidx    i;
  8153.   toknbuf    w;
  8154.  
  8155.   {   register int    _j, _i = 1 - 1;
  8156.       for (_j = 0; _j < 16; )
  8157.       w.A[_i++] = str.A[_j++];
  8158.   }
  8159.   if (w.A[machdeflen - 1] != space)
  8160.     error(ebadmach);
  8161.   {
  8162.     toknidx    B74 = machdeflen - 1,
  8163.         B75 = 1;
  8164.  
  8165.     if (B74 >= B75)
  8166.       for (i = B74; ; i--) {
  8167.     if (w.A[i - 1] != space) {
  8168.       w.A[(int)(i) + 1 - 1] = null;
  8169.       goto L999;
  8170.     }
  8171.     if (i == B75) break;
  8172.       }
  8173.   }
  8174.   error(ebadmach);
  8175. L999:
  8176.   if ((int)(nmachdefs) >= maxmachdefs)
  8177.     error(emanymachs);
  8178.   nmachdefs = (int)(nmachdefs) + 1;
  8179.   {
  8180.     register struct S198 *W76 = &machdefs.A[nmachdefs - 1];
  8181.  
  8182.     W76->lolim = lo;
  8183.     W76->hilim = hi;
  8184.     W76->typstr = savestr(&w);
  8185.   }
  8186. }
  8187.  
  8188.  void
  8189. initstrstore(void)
  8190. {
  8191.   register strbcnt    i;
  8192.  
  8193.   {
  8194.     strbcnt    B77 = 1,
  8195.         B78 = maxblkcnt;
  8196.  
  8197.     if (B77 <= B78)
  8198.       for (i = B77; ; i++) {
  8199.     strstor.A[i] = (strblk *)NIL;
  8200.     if (i == B78) break;
  8201.       }
  8202.   }
  8203.   strstor.A[0] = (strblk *)malloc((unsigned)(sizeof(*strstor.A[0])));
  8204.   (*strstor.A[0]).A[0] = null;
  8205.   strfree = 1;
  8206.   strleft = maxstrblk;
  8207. }
  8208.  
  8209.  void
  8210. initialize(void)
  8211. {
  8212.   typedef struct { unsigned char    A[16 - 1 + 1]; }    T78;
  8213.   register hashtyp    s;
  8214.   register pretyps    t;
  8215.   register predefs    d;
  8216.   T78    hx;
  8217.  
  8218.   lineno = 1;
  8219.   colno = 0;
  8220.   pushed = false;
  8221.   initstrstore();
  8222.   setlst = (struct S64 *)NIL;
  8223.   setcnt = 0;
  8224.   (void)strncpy((char *)hx.A, "0123456789ABCDEF", sizeof(hx.A));
  8225.   {   register int    _j, _i = 0 - 0;
  8226.       for (_j = 0; _j < 16; )
  8227.       hexdig.A[_i++] = hx.A[_j++];
  8228.   }
  8229.   symtab = (struct S63 *)NIL;
  8230.   statlvl = 0;
  8231.   maxlevel = -1;
  8232.   enterscope((declptr)NIL);
  8233.   varno = 0;
  8234.   usesets = false;
  8235.   useunion = false;
  8236.   usediff = false;
  8237.   usemksub = false;
  8238.   useintr = false;
  8239.   usesge = false;
  8240.   usesle = false;
  8241.   usesne = false;
  8242.   useseq = false;
  8243.   usememb = false;
  8244.   useins = false;
  8245.   usescpy = false;
  8246.   usecase = false;
  8247.   usejmps = false;
  8248.   usecomp = false;
  8249.   usemax = false;
  8250.   usealig = false;
  8251.   usesal = false;
  8252.   {
  8253.     hashtyp    B79 = 0,
  8254.         B80 = hashmax;
  8255.  
  8256.     if (B79 <= B80)
  8257.       for (s = B79; ; s++) {
  8258.     idtab.A[s] = (struct S62 *)NIL;
  8259.     if (s == B80) break;
  8260.       }
  8261.   }
  8262.   {
  8263.     predefs    B81 = dabs,
  8264.         B82 = dztring;
  8265.  
  8266.     if ((int)(B81) <= (int)(B82))
  8267.       for (d = B81; ; d = (predefs)((int)(d)+1)) {
  8268.     deftab.A[(int)(d)] = (struct S64 *)NIL;
  8269.     defnams.A[(int)(d)] = (struct S65 *)NIL;
  8270.     if (d == B82) break;
  8271.       }
  8272.   }
  8273.   defkey(sand, *((keyword *)STRALIGN("and       ")));
  8274.   defkey(sarray, *((keyword *)STRALIGN("array     ")));
  8275.   defkey(sbegin, *((keyword *)STRALIGN("begin     ")));
  8276.   defkey(scase, *((keyword *)STRALIGN("case      ")));
  8277.   defkey(sconst, *((keyword *)STRALIGN("const     ")));
  8278.   defkey(sdiv, *((keyword *)STRALIGN("div       ")));
  8279.   defkey(sdo, *((keyword *)STRALIGN("do        ")));
  8280.   defkey(sdownto, *((keyword *)STRALIGN("downto    ")));
  8281.   defkey(selse, *((keyword *)STRALIGN("else      ")));
  8282.   defkey(send, *((keyword *)STRALIGN("end       ")));
  8283.   defkey(sextern, *((keyword *)STRALIGN(externsym)));
  8284.   defkey(sfile, *((keyword *)STRALIGN("file      ")));
  8285.   defkey(sfor, *((keyword *)STRALIGN("for       ")));
  8286.   defkey(sforward, *((keyword *)STRALIGN("forward   ")));
  8287.   defkey(sfunc, *((keyword *)STRALIGN("function  ")));
  8288.   defkey(sgoto, *((keyword *)STRALIGN("goto      ")));
  8289.   defkey(sif, *((keyword *)STRALIGN("if        ")));
  8290.   defkey(sinn, *((keyword *)STRALIGN("in        ")));
  8291.   defkey(slabel, *((keyword *)STRALIGN("label     ")));
  8292.   defkey(smod, *((keyword *)STRALIGN("mod       ")));
  8293.   defkey(snil, *((keyword *)STRALIGN("nil       ")));
  8294.   defkey(snot, *((keyword *)STRALIGN("not       ")));
  8295.   defkey(sof, *((keyword *)STRALIGN("of        ")));
  8296.   defkey(sor, *((keyword *)STRALIGN("or        ")));
  8297.   defkey(sother2, *((keyword *)STRALIGN(anothersym)));
  8298.   defkey(sother, *((keyword *)STRALIGN(othersym)));
  8299.   defkey(spacked, *((keyword *)STRALIGN("packed    ")));
  8300.   defkey(sproc, *((keyword *)STRALIGN("procedure ")));
  8301.   defkey(spgm, *((keyword *)STRALIGN("program   ")));
  8302.   defkey(srecord, *((keyword *)STRALIGN("record    ")));
  8303.   defkey(srepeat, *((keyword *)STRALIGN("repeat    ")));
  8304.   defkey(sset, *((keyword *)STRALIGN("set       ")));
  8305.   defkey(sthen, *((keyword *)STRALIGN("then      ")));
  8306.   defkey(sto, *((keyword *)STRALIGN("to        ")));
  8307.   defkey(stype, *((keyword *)STRALIGN("type      ")));
  8308.   defkey(suntil, *((keyword *)STRALIGN("until     ")));
  8309.   defkey(svar, *((keyword *)STRALIGN("var       ")));
  8310.   defkey(swhile, *((keyword *)STRALIGN("while     ")));
  8311.   defkey(swith, *((keyword *)STRALIGN("with      ")));
  8312.   defkey(seof, *((keyword *)STRALIGN(dummysym)));
  8313.   cprio.A[(int)(nformat) - (int)(nassign)] = 0;
  8314.   cprio.A[(int)(nrange) - (int)(nassign)] = 0;
  8315.   cprio.A[(int)(nin) - (int)(nassign)] = 0;
  8316.   cprio.A[(int)(nset) - (int)(nassign)] = 0;
  8317.   cprio.A[(int)(nassign) - (int)(nassign)] = 0;
  8318.   cprio.A[(int)(nor) - (int)(nassign)] = 1;
  8319.   cprio.A[(int)(nand) - (int)(nassign)] = 2;
  8320.   cprio.A[(int)(neq) - (int)(nassign)] = 3;
  8321.   cprio.A[(int)(nne) - (int)(nassign)] = 3;
  8322.   cprio.A[(int)(nlt) - (int)(nassign)] = 3;
  8323.   cprio.A[(int)(nle) - (int)(nassign)] = 3;
  8324.   cprio.A[(int)(ngt) - (int)(nassign)] = 3;
  8325.   cprio.A[(int)(nge) - (int)(nassign)] = 3;
  8326.   cprio.A[(int)(nplus) - (int)(nassign)] = 4;
  8327.   cprio.A[(int)(nminus) - (int)(nassign)] = 4;
  8328.   cprio.A[(int)(nmul) - (int)(nassign)] = 5;
  8329.   cprio.A[(int)(ndiv) - (int)(nassign)] = 5;
  8330.   cprio.A[(int)(nmod) - (int)(nassign)] = 5;
  8331.   cprio.A[(int)(nquot) - (int)(nassign)] = 5;
  8332.   cprio.A[(int)(nnot) - (int)(nassign)] = 6;
  8333.   cprio.A[(int)(numinus) - (int)(nassign)] = 6;
  8334.   cprio.A[(int)(nuplus) - (int)(nassign)] = 7;
  8335.   cprio.A[(int)(nindex) - (int)(nassign)] = 7;
  8336.   cprio.A[(int)(nselect) - (int)(nassign)] = 7;
  8337.   cprio.A[(int)(nderef) - (int)(nassign)] = 7;
  8338.   cprio.A[(int)(ncall) - (int)(nassign)] = 7;
  8339.   cprio.A[(int)(nid) - (int)(nassign)] = 7;
  8340.   cprio.A[(int)(nchar) - (int)(nassign)] = 7;
  8341.   cprio.A[(int)(ninteger) - (int)(nassign)] = 7;
  8342.   cprio.A[(int)(nreal) - (int)(nassign)] = 7;
  8343.   cprio.A[(int)(nstring) - (int)(nassign)] = 7;
  8344.   cprio.A[(int)(nnil) - (int)(nassign)] = 7;
  8345.   pprio.A[(int)(nassign) - (int)(nassign)] = 0;
  8346.   pprio.A[(int)(nformat) - (int)(nassign)] = 0;
  8347.   pprio.A[(int)(nrange) - (int)(nassign)] = 1;
  8348.   pprio.A[(int)(nin) - (int)(nassign)] = 1;
  8349.   pprio.A[(int)(neq) - (int)(nassign)] = 1;
  8350.   pprio.A[(int)(nne) - (int)(nassign)] = 1;
  8351.   pprio.A[(int)(nlt) - (int)(nassign)] = 1;
  8352.   pprio.A[(int)(nle) - (int)(nassign)] = 1;
  8353.   pprio.A[(int)(ngt) - (int)(nassign)] = 1;
  8354.   pprio.A[(int)(nge) - (int)(nassign)] = 1;
  8355.   pprio.A[(int)(nor) - (int)(nassign)] = 2;
  8356.   pprio.A[(int)(nplus) - (int)(nassign)] = 2;
  8357.   pprio.A[(int)(nminus) - (int)(nassign)] = 2;
  8358.   pprio.A[(int)(nand) - (int)(nassign)] = 3;
  8359.   pprio.A[(int)(nmul) - (int)(nassign)] = 3;
  8360.   pprio.A[(int)(ndiv) - (int)(nassign)] = 3;
  8361.   pprio.A[(int)(nmod) - (int)(nassign)] = 3;
  8362.   pprio.A[(int)(nquot) - (int)(nassign)] = 3;
  8363.   pprio.A[(int)(nnot) - (int)(nassign)] = 4;
  8364.   pprio.A[(int)(numinus) - (int)(nassign)] = 4;
  8365.   pprio.A[(int)(nuplus) - (int)(nassign)] = 5;
  8366.   pprio.A[(int)(nset) - (int)(nassign)] = 6;
  8367.   pprio.A[(int)(nindex) - (int)(nassign)] = 6;
  8368.   pprio.A[(int)(nselect) - (int)(nassign)] = 6;
  8369.   pprio.A[(int)(nderef) - (int)(nassign)] = 6;
  8370.   pprio.A[(int)(ncall) - (int)(nassign)] = 6;
  8371.   pprio.A[(int)(nid) - (int)(nassign)] = 6;
  8372.   pprio.A[(int)(nchar) - (int)(nassign)] = 6;
  8373.   pprio.A[(int)(ninteger) - (int)(nassign)] = 6;
  8374.   pprio.A[(int)(nreal) - (int)(nassign)] = 6;
  8375.   pprio.A[(int)(nstring) - (int)(nassign)] = 6;
  8376.   pprio.A[(int)(nnil) - (int)(nassign)] = 6;
  8377.   defname(cabort, *((keyword *)STRALIGN("abort     ")));
  8378.   defname(cbreak, *((keyword *)STRALIGN("break     ")));
  8379.   defname(ccontinue, *((keyword *)STRALIGN("continue  ")));
  8380.   defname(cdefine, *((keyword *)STRALIGN("define    ")));
  8381.   defname(cdefault, *((keyword *)STRALIGN("default   ")));
  8382.   defname(cdouble, *((keyword *)STRALIGN("double    ")));
  8383.   defname(cedata, *((keyword *)STRALIGN("edata     ")));
  8384.   defname(cenum, *((keyword *)STRALIGN("enum      ")));
  8385.   defname(cetext, *((keyword *)STRALIGN("etext     ")));
  8386.   defname(cextern, *((keyword *)STRALIGN("extern    ")));
  8387.   defname(cfclose, *((keyword *)STRALIGN("fclose    ")));
  8388.   defname(cfflush, *((keyword *)STRALIGN("fflush    ")));
  8389.   defname(cfgetc, *((keyword *)STRALIGN("fgetc     ")));
  8390.   defname(cfloat, *((keyword *)STRALIGN("float     ")));
  8391.   defname(cfloor, *((keyword *)STRALIGN("floor     ")));
  8392.   defname(cfprintf, *((keyword *)STRALIGN("fprintf   ")));
  8393.   defname(cfputc, *((keyword *)STRALIGN("fputc     ")));
  8394.   defname(cfread, *((keyword *)STRALIGN("fread     ")));
  8395.   defname(cfscanf, *((keyword *)STRALIGN("fscanf    ")));
  8396.   defname(cfwrite, *((keyword *)STRALIGN("fwrite    ")));
  8397.   defname(cgetc, *((keyword *)STRALIGN("getc      ")));
  8398.   defname(cgetpid, *((keyword *)STRALIGN("getpid    ")));
  8399.   defname(cint, *((keyword *)STRALIGN("int       ")));
  8400.   defname(cinclude, *((keyword *)STRALIGN("include   ")));
  8401.   defname(clong, *((keyword *)STRALIGN("long      ")));
  8402.   defname(clog, *((keyword *)STRALIGN("log       ")));
  8403.   defname(cmain, *((keyword *)STRALIGN("main      ")));
  8404.   defname(cmalloc, *((keyword *)STRALIGN("malloc    ")));
  8405.   defname(cprintf, *((keyword *)STRALIGN("printf    ")));
  8406.   defname(cpower, *((keyword *)STRALIGN("pow       ")));
  8407.   defname(cputc, *((keyword *)STRALIGN("putc      ")));
  8408.   defname(cread, *((keyword *)STRALIGN("read      ")));
  8409.   defname(creturn, *((keyword *)STRALIGN("return    ")));
  8410.   defname(cregister, *((keyword *)STRALIGN("register  ")));
  8411.   defname(crewind, *((keyword *)STRALIGN("rewind    ")));
  8412.   defname(cscanf, *((keyword *)STRALIGN("scanf     ")));
  8413.   defname(csetbits, *((keyword *)STRALIGN("setbits   ")));
  8414.   defname(csetword, *((keyword *)STRALIGN("setword   ")));
  8415.   defname(csetptr, *((keyword *)STRALIGN("setptr    ")));
  8416.   defname(cshort, *((keyword *)STRALIGN("short     ")));
  8417.   defname(csigned, *((keyword *)STRALIGN("signed    ")));
  8418.   defname(csizeof, *((keyword *)STRALIGN("sizeof    ")));
  8419.   defname(csprintf, *((keyword *)STRALIGN("sprintf   ")));
  8420.   defname(cstatic, *((keyword *)STRALIGN("static    ")));
  8421.   defname(cstdin, *((keyword *)STRALIGN("stdin     ")));
  8422.   defname(cstdout, *((keyword *)STRALIGN("stdout    ")));
  8423.   defname(cstderr, *((keyword *)STRALIGN("stderr    ")));
  8424.   defname(cstrncmp, *((keyword *)STRALIGN("strncmp   ")));
  8425.   defname(cstrncpy, *((keyword *)STRALIGN("strncpy   ")));
  8426.   defname(cstruct, *((keyword *)STRALIGN("struct    ")));
  8427.   defname(cswitch, *((keyword *)STRALIGN("switch    ")));
  8428.   defname(ctypedef, *((keyword *)STRALIGN("typedef   ")));
  8429.   defname(cundef, *((keyword *)STRALIGN("undef     ")));
  8430.   defname(cungetc, *((keyword *)STRALIGN("ungetc    ")));
  8431.   defname(cunion, *((keyword *)STRALIGN("union     ")));
  8432.   defname(cunlink, *((keyword *)STRALIGN("unlink    ")));
  8433.   defname(cfseek, *((keyword *)STRALIGN("fseek     ")));
  8434.   defname(cgetchar, *((keyword *)STRALIGN("getchar   ")));
  8435.   defname(cputchar, *((keyword *)STRALIGN("putchar   ")));
  8436.   defname(cunsigned, *((keyword *)STRALIGN("unsigned  ")));
  8437.   defname(cwrite, *((keyword *)STRALIGN("write     ")));
  8438.   defid(nfunc, dabs, *((keyword *)STRALIGN("abs       ")));
  8439.   defid(nfunc, darctan, *((keyword *)STRALIGN("arctan    ")));
  8440.   defid(nvar, dargc, *((keyword *)STRALIGN("argc      ")));
  8441.   defid(nproc, dargv, *((keyword *)STRALIGN("argv      ")));
  8442.   defid(nfunc, dbreak, *((keyword *)STRALIGN("break     ")));
  8443.   defid(nscalar, dboolean, *((keyword *)STRALIGN("boolean   ")));
  8444.   defid(ntype, dchar, *((keyword *)STRALIGN("char      ")));
  8445.   defid(nfunc, dchr, *((keyword *)STRALIGN("chr       ")));
  8446.   defid(nproc, dclose, *((keyword *)STRALIGN("close     ")));
  8447.   defid(nfunc, dcos, *((keyword *)STRALIGN("cos       ")));
  8448.   defid(nproc, ddispose, *((keyword *)STRALIGN("dispose   ")));
  8449.   defid(nid, dfalse, *((keyword *)STRALIGN("false     ")));
  8450.   defid(nvar, derroutput, *((keyword *)STRALIGN("erroutput ")));
  8451.   defid(nfunc, deof, *((keyword *)STRALIGN("eof       ")));
  8452.   defid(nfunc, deoln, *((keyword *)STRALIGN("eoln      ")));
  8453.   defid(nproc, dexit, *((keyword *)STRALIGN("exit      ")));
  8454.   defid(nfunc, dexp, *((keyword *)STRALIGN("exp       ")));
  8455.   defid(nproc, dflush, *((keyword *)STRALIGN("flush     ")));
  8456.   defid(nproc, dget, *((keyword *)STRALIGN("get       ")));
  8457.   defid(nproc, dhalt, *((keyword *)STRALIGN("halt      ")));
  8458.   defid(nvar, dinput, *((keyword *)STRALIGN("input     ")));
  8459.   defid(ntype, dinteger, *((keyword *)STRALIGN("integer   ")));
  8460.   defid(nfunc, dln, *((keyword *)STRALIGN("ln        ")));
  8461.   defid(nconst, dmaxint, *((keyword *)STRALIGN("maxint    ")));
  8462.   defid(nproc, dnew, *((keyword *)STRALIGN("new       ")));
  8463.   defid(nfunc, dodd, *((keyword *)STRALIGN("odd       ")));
  8464.   defid(nfunc, dord, *((keyword *)STRALIGN("ord       ")));
  8465.   defid(nvar, doutput, *((keyword *)STRALIGN("output    ")));
  8466.   defid(nproc, dpack, *((keyword *)STRALIGN("pack      ")));
  8467.   defid(nproc, dpage, *((keyword *)STRALIGN("page      ")));
  8468.   defid(nfunc, dpred, *((keyword *)STRALIGN("pred      ")));
  8469.   defid(nproc, dprompt, *((keyword *)STRALIGN("prompt    ")));
  8470.   defid(nproc, dput, *((keyword *)STRALIGN("put       ")));
  8471.   defid(nproc, dread, *((keyword *)STRALIGN("read      ")));
  8472.   defid(nproc, dreadln, *((keyword *)STRALIGN("readln    ")));
  8473.   defid(ntype, dreal, *((keyword *)STRALIGN("real      ")));
  8474.   defid(nproc, dreset, *((keyword *)STRALIGN("reset     ")));
  8475.   defid(nproc, drewrite, *((keyword *)STRALIGN("rewrite   ")));
  8476.   defid(nfunc, dround, *((keyword *)STRALIGN("round     ")));
  8477.   defid(nproc, dseek, *((keyword *)STRALIGN("seek      ")));
  8478.   defid(nfunc, dsin, *((keyword *)STRALIGN("sin       ")));
  8479.   defid(nfunc, dsqr, *((keyword *)STRALIGN("sqr       ")));
  8480.   defid(nfunc, dsqrt, *((keyword *)STRALIGN("sqrt      ")));
  8481.   defid(nfunc, dsucc, *((keyword *)STRALIGN("succ      ")));
  8482.   defid(nfunc, dtell, *((keyword *)STRALIGN("tell      ")));
  8483.   defid(ntype, dtext, *((keyword *)STRALIGN("text      ")));
  8484.   defid(nid, dtrue, *((keyword *)STRALIGN("true      ")));
  8485.   defid(nfunc, dtrunc, *((keyword *)STRALIGN("trunc     ")));
  8486.   defid(nfunc, dtan, *((keyword *)STRALIGN("tan       ")));
  8487.   defid(nproc, dunpack, *((keyword *)STRALIGN("unpack    ")));
  8488.   defid(nproc, dwrite, *((keyword *)STRALIGN("write     ")));
  8489.   defid(nproc, dwriteln, *((keyword *)STRALIGN("writeln   ")));
  8490.   defid(nfield, dzfp, *((keyword *)STRALIGN("$p        ")));
  8491.   defid(ntype, dztring, *((keyword *)STRALIGN("$ztring   ")));
  8492.   (*(*deftab.A[(int)(dboolean)]).U.V14.tbind).U.V17.tscalid = deftab.A[(int)(dfalse)];
  8493.   (*deftab.A[(int)(dfalse)]).tnext = deftab.A[(int)(dtrue)];
  8494.   currsym.st = sinteger;
  8495.   currsym.U.V3.vint = maxint;
  8496.   (*deftab.A[(int)(dmaxint)]).U.V14.tbind = mklit();
  8497.   (*deftab.A[(int)(dargc)]).U.V14.tbind = (*deftab.A[(int)(dinteger)]).U.V14.tbind;
  8498.   (*deftab.A[(int)(dinput)]).U.V14.tbind = (*deftab.A[(int)(dtext)]).U.V14.tbind;
  8499.   (*deftab.A[(int)(doutput)]).U.V14.tbind = (*deftab.A[(int)(dtext)]).U.V14.tbind;
  8500.   (*deftab.A[(int)(derroutput)]).U.V14.tbind = (*deftab.A[(int)(dtext)]).U.V14.tbind;
  8501.   {
  8502.     pretyps    B83 = tnone,
  8503.         B84 = terror;
  8504.  
  8505.     if ((int)(B83) <= (int)(B84))
  8506.       for (t = B83; ; t = (pretyps)((int)(t)+1)) {
  8507.     switch ((int)(t)) {
  8508.       case tboolean:
  8509.       typnods.A[(int)(t)] = (*deftab.A[(int)(dboolean)]).U.V14.tbind;
  8510.       break ;
  8511.       case tchar:
  8512.       typnods.A[(int)(t)] = (*deftab.A[(int)(dchar)]).U.V14.tbind;
  8513.       break ;
  8514.       case tinteger:
  8515.       typnods.A[(int)(t)] = (*deftab.A[(int)(dinteger)]).U.V14.tbind;
  8516.       break ;
  8517.       case treal:
  8518.       typnods.A[(int)(t)] = (*deftab.A[(int)(dreal)]).U.V14.tbind;
  8519.       break ;
  8520.       case ttext:
  8521.       typnods.A[(int)(t)] = (*deftab.A[(int)(dtext)]).U.V14.tbind;
  8522.       break ;
  8523.       case tstring:
  8524.       typnods.A[(int)(t)] = (*deftab.A[(int)(dztring)]).U.V14.tbind;
  8525.       break ;
  8526.       case tnil:  case tset:  case tpoly:  case tnone:
  8527.       typnods.A[(int)(t)] = mknode(npredef);
  8528.       break ;
  8529.       case terror:
  8530.       break ;
  8531.       default:
  8532.       PTCerror(PTC_E_CASE, __LINE__, 0, 0, 0);
  8533.     }
  8534.     if (Member((unsigned)(t), Conset[161]))
  8535.       (*typnods.A[(int)(t)]).U.V12.tobtyp = t;
  8536.     if (t == B84) break;
  8537.       }
  8538.   }
  8539.   fixfp((*(*defnams.A[(int)(dzfp)]).U.V6.lid).istr);
  8540.   (*deftab.A[(int)(dzfp)]).U.V14.tbind = (*deftab.A[(int)(dinteger)]).U.V14.tbind;
  8541.   {
  8542.     predefs    B85 = dabs,
  8543.         B86 = dztring;
  8544.  
  8545.     if ((int)(B85) <= (int)(B86))
  8546.       for (d = B85; ; d = (predefs)((int)(d)+1)) {
  8547.     linkup((treeptr)NIL, deftab.A[(int)(d)]);
  8548.     if (d == B86) break;
  8549.       }
  8550.   }
  8551.   (*deftab.A[(int)(dchr)]).U.V13.tfuntyp = typnods.A[(int)(tchar)];
  8552.   (*deftab.A[(int)(deof)]).U.V13.tfuntyp = typnods.A[(int)(tboolean)];
  8553.   (*deftab.A[(int)(deoln)]).U.V13.tfuntyp = typnods.A[(int)(tboolean)];
  8554.   (*deftab.A[(int)(dodd)]).U.V13.tfuntyp = typnods.A[(int)(tboolean)];
  8555.   (*deftab.A[(int)(dord)]).U.V13.tfuntyp = typnods.A[(int)(tinteger)];
  8556.   (*deftab.A[(int)(dround)]).U.V13.tfuntyp = typnods.A[(int)(tinteger)];
  8557.   (*deftab.A[(int)(dtell)]).U.V13.tfuntyp = typnods.A[(int)(tinteger)];
  8558.   (*deftab.A[(int)(dtrunc)]).U.V13.tfuntyp = typnods.A[(int)(tinteger)];
  8559.   (*deftab.A[(int)(darctan)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8560.   (*deftab.A[(int)(dcos)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8561.   (*deftab.A[(int)(dsin)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8562.   (*deftab.A[(int)(dtan)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8563.   (*deftab.A[(int)(dsqrt)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8564.   (*deftab.A[(int)(dexp)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8565.   (*deftab.A[(int)(dln)]).U.V13.tfuntyp = typnods.A[(int)(treal)];
  8566.   (*deftab.A[(int)(dsqr)]).U.V13.tfuntyp = typnods.A[(int)(tpoly)];
  8567.   (*deftab.A[(int)(dabs)]).U.V13.tfuntyp = typnods.A[(int)(tpoly)];
  8568.   (*deftab.A[(int)(dpred)]).U.V13.tfuntyp = typnods.A[(int)(tpoly)];
  8569.   (*deftab.A[(int)(dsucc)]).U.V13.tfuntyp = typnods.A[(int)(tpoly)];
  8570.   (*deftab.A[(int)(dargv)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8571.   (*deftab.A[(int)(dbreak)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8572.   (*deftab.A[(int)(ddispose)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8573.   (*deftab.A[(int)(dexit)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8574.   (*deftab.A[(int)(dflush)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8575.   (*deftab.A[(int)(dget)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8576.   (*deftab.A[(int)(dhalt)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8577.   (*deftab.A[(int)(dnew)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8578.   (*deftab.A[(int)(dpack)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8579.   (*deftab.A[(int)(dput)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8580.   (*deftab.A[(int)(dprompt)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8581.   (*deftab.A[(int)(dread)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8582.   (*deftab.A[(int)(dreadln)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8583.   (*deftab.A[(int)(dreset)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8584.   (*deftab.A[(int)(drewrite)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8585.   (*deftab.A[(int)(dseek)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8586.   (*deftab.A[(int)(dwrite)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8587.   (*deftab.A[(int)(dwriteln)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8588.   (*deftab.A[(int)(dunpack)]).U.V13.tfuntyp = typnods.A[(int)(tnone)];
  8589.   nmachdefs = 0;
  8590.   defmach(0, 255, *((machdefstr *)STRALIGN("unsigned char   ")));
  8591.   defmach(-128, 127, *((machdefstr *)STRALIGN("char            ")));
  8592.   defmach(0, 65535, *((machdefstr *)STRALIGN("unsigned short  ")));
  8593.   defmach(-32768, 32767, *((machdefstr *)STRALIGN("short           ")));
  8594.   defmach(-2147483647, 2147483647, *((machdefstr *)STRALIGN("long            ")));
  8595. }
  8596.  
  8597.  void
  8598. error(errors     m)
  8599. {
  8600.   prtmsg(m);
  8601.   exit(1);
  8602. }
  8603.  
  8604.  void
  8605. fatal(errors     m)
  8606. {
  8607.   prtmsg(m);
  8608.   exit(1);
  8609. }
  8610.  
  8611. int    argc;
  8612. unsigned char    **argv;
  8613.  
  8614. int main(int     _ac, unsigned char     *_av[])
  8615. {
  8616.  
  8617.   argc = _ac;
  8618.   argv = _av;
  8619.   initialize();
  8620.   parse();
  8621.   lineno = 0;
  8622.   lastline = 0;
  8623.   transform();
  8624.   emit();
  8625. L9999:
  8626.   ;
  8627.   exit(0);
  8628.   /* NOTREACHED */
  8629. }
  8630. # undef keytablen
  8631. # undef keywordlen
  8632. # undef C37_setbits
  8633. # undef maxsetrange
  8634. # undef scalbase
  8635. # undef maxprio
  8636. # undef maxmachdefs
  8637. # undef machdeflen
  8638. # undef maxstrblk
  8639. # undef maxblkcnt
  8640. # undef maxstrstor
  8641. # undef maxtoknlen
  8642. # undef hashmax
  8643. # undef null
  8644. # undef minchar
  8645. # undef maxchar
  8646. # undef space
  8647. # undef tab
  8648. # undef tab1
  8649. # undef bslash
  8650. # undef quote
  8651. # undef cite
  8652. # undef xpnent
  8653. # undef percent
  8654. # undef uscore
  8655. # undef badchr
  8656. # undef okchr
  8657. # undef tabwidth
  8658. # undef diffcomm
  8659. # undef lazyfor
  8660. # undef unionnew
  8661. # undef realtyp
  8662. # undef align
  8663. # undef intlen
  8664. # undef fixlen
  8665. # undef indstep
  8666. static setword    Q0[] = {
  8667.     1,
  8668.     0x000003FD
  8669. };
  8670. static setword    Q1[] = {
  8671.     1,
  8672.     0x0000004C
  8673. };
  8674. static setword    Q2[] = {
  8675.     1,
  8676.     0x00000000
  8677. };
  8678. static setword    Q3[] = {
  8679.     1,
  8680.     0x5210000E
  8681. };
  8682. static setword    Q4[] = {
  8683.     1,
  8684.     0x1210000E
  8685. };
  8686. static setword    Q5[] = {
  8687.     1,
  8688.     0x00000C00
  8689. };
  8690. static setword    Q6[] = {
  8691.     1,
  8692.     0x0000000C
  8693. };
  8694. static setword    Q7[] = {
  8695.     1,
  8696.     0x0210000E
  8697. };
  8698. static setword    Q8[] = {
  8699.     2,
  8700.     0x00000000,    0x00000060
  8701. };
  8702. static setword    Q9[] = {
  8703.     2,
  8704.     0x00000002,    0x08000064
  8705. };
  8706. static setword    Q10[] = {
  8707.     1,
  8708.     0x00000C00
  8709. };
  8710. static setword    Q11[] = {
  8711.     1,
  8712.     0x0000000C
  8713. };
  8714. static setword    Q12[] = {
  8715.     2,
  8716.     0x00000000,    0x00084FF0
  8717. };
  8718. static setword    Q13[] = {
  8719.     2,
  8720.     0x00000000,    0x00000780
  8721. };
  8722. static setword    Q14[] = {
  8723.     2,
  8724.     0x00000000,    0x00000780
  8725. };
  8726. static setword    Q15[] = {
  8727.     3,
  8728.     0x00010000,    0x00000000,    0x00000001
  8729. };
  8730. static setword    Q16[] = {
  8731.     2,
  8732.     0x00000000,    0x000007E0
  8733. };
  8734. static setword    Q17[] = {
  8735.     2,
  8736.     0x00000000,    0x0000B000
  8737. };
  8738. static setword    Q18[] = {
  8739.     2,
  8740.     0x00080000,    0x00400000
  8741. };
  8742. static setword    Q19[] = {
  8743.     2,
  8744.     0x00000000,    0x0000B560
  8745. };
  8746. static setword    Q20[] = {
  8747.     2,
  8748.     0x00000000,    0x00084FF0
  8749. };
  8750. static setword    Q21[] = {
  8751.     1,
  8752.     0x00000C00
  8753. };
  8754. static setword    Q22[] = {
  8755.     2,
  8756.     0x00000000,    0x17000000
  8757. };
  8758. static setword    Q23[] = {
  8759.     2,
  8760.     0x00000000,    0x17000000
  8761. };
  8762. static setword    Q24[] = {
  8763.     1,
  8764.     0x0000000E
  8765. };
  8766. static setword    Q25[] = {
  8767.     1,
  8768.     0x0000000E
  8769. };
  8770. static setword    Q26[] = {
  8771.     1,
  8772.     0x0000000C
  8773. };
  8774. static setword    Q27[] = {
  8775.     1,
  8776.     0x0000000E
  8777. };
  8778. static setword    Q28[] = {
  8779.     1,
  8780.     0x0000000E
  8781. };
  8782. static setword    Q29[] = {
  8783.     1,
  8784.     0x00458000
  8785. };
  8786. static setword    Q30[] = {
  8787.     1,
  8788.     0x0000000E
  8789. };
  8790. static setword    Q31[] = {
  8791.     1,
  8792.     0x0000000E
  8793. };
  8794. static setword    Q32[] = {
  8795.     2,
  8796.     0x18004010,    0x00000014
  8797. };
  8798. static setword    Q33[] = {
  8799.     3,
  8800.     0x00000300,    0x40000008,    0x00000002
  8801. };
  8802. static setword    Q34[] = {
  8803.     2,
  8804.     0x00000300,    0x40000008
  8805. };
  8806. static setword    Q35[] = {
  8807.     2,
  8808.     0x00000000,    0x00000100
  8809. };
  8810. static setword    Q36[] = {
  8811.     2,
  8812.     0x00000040,    0x10000000
  8813. };
  8814. static setword    Q37[] = {
  8815.     1,
  8816.     0x00000040
  8817. };
  8818. static setword    Q38[] = {
  8819.     2,
  8820.     0x00000080,    0x00000002
  8821. };
  8822. static setword    Q39[] = {
  8823.     2,
  8824.     0x00000000,    0x80000000
  8825. };
  8826. static setword    Q40[] = {
  8827.     2,
  8828.     0x00000000,    0x00001000
  8829. };
  8830. static setword    Q41[] = {
  8831.     2,
  8832.     0x00000000,    0x40000008
  8833. };
  8834. static setword    Q42[] = {
  8835.     1,
  8836.     0x00000040
  8837. };
  8838. static setword    Q43[] = {
  8839.     2,
  8840.     0x00000000,    0x00000001
  8841. };
  8842. static setword    Q44[] = {
  8843.     2,
  8844.     0x00000300,    0x40000008
  8845. };
  8846. static setword    Q45[] = {
  8847.     1,
  8848.     0x00000200
  8849. };
  8850. static setword    Q46[] = {
  8851.     2,
  8852.     0x4001930C,    0x40001068
  8853. };
  8854. static setword    Q47[] = {
  8855.     2,
  8856.     0x4001930C,    0x60001068
  8857. };
  8858. static setword    Q48[] = {
  8859.     2,
  8860.     0x00000000,    0x30000000
  8861. };
  8862. static setword    Q49[] = {
  8863.     1,
  8864.     0x03000200
  8865. };
  8866. static setword    Q50[] = {
  8867.     2,
  8868.     0x03000200,    0x00007900
  8869. };
  8870. static setword    Q51[] = {
  8871.     1,
  8872.     0x00400000
  8873. };
  8874. static setword    Q52[] = {
  8875.     2,
  8876.     0x00000000,    0x00084FF0
  8877. };
  8878. static setword    Q53[] = {
  8879.     3,
  8880.     0x00CA03E1,    0x7FFDE00B,    0x00000001
  8881. };
  8882. static setword    Q54[] = {
  8883.     2,
  8884.     0x00300000,    0x00347F00
  8885. };
  8886. static setword    Q55[] = {
  8887.     2,
  8888.     0x00000000,    0x04780000
  8889. };
  8890. static setword    Q56[] = {
  8891.     2,
  8892.     0x00000000,    0x04780000
  8893. };
  8894. static setword    Q57[] = {
  8895.     1,
  8896.     0x00000C0C
  8897. };
  8898. static setword    Q58[] = {
  8899.     2,
  8900.     0x00000000,    0x00001000
  8901. };
  8902. static setword    Q59[] = {
  8903.     3,
  8904.     0x00000000,    0x00160000,    0x00000002
  8905. };
  8906. static setword    Q60[] = {
  8907.     3,
  8908.     0x00CA03E1,    0xFFFFE00B,    0x00000003
  8909. };
  8910. static setword    Q61[] = {
  8911.     2,
  8912.     0x00000000,    0x07000000
  8913. };
  8914. static setword    Q62[] = {
  8915.     2,
  8916.     0x4001930C,    0x40001068
  8917. };
  8918. static setword    Q63[] = {
  8919.     2,
  8920.     0x00000000,    0x20000000
  8921. };
  8922. static setword    Q64[] = {
  8923.     2,
  8924.     0x4001930C,    0x40001168
  8925. };
  8926. static setword    Q65[] = {
  8927.     2,
  8928.     0x00000000,    0x40080000
  8929. };
  8930. static setword    Q66[] = {
  8931.     2,
  8932.     0x00000000,    0x00001000
  8933. };
  8934. static setword    Q67[] = {
  8935.     2,
  8936.     0x00000000,    0x20000000
  8937. };
  8938. static setword    Q68[] = {
  8939.     2,
  8940.     0x00000000,    0x20040000
  8941. };
  8942. static setword    Q69[] = {
  8943.     2,
  8944.     0x00000000,    0x40080000
  8945. };
  8946. static setword    Q70[] = {
  8947.     2,
  8948.     0x00000000,    0x400C0000
  8949. };
  8950. static setword    Q71[] = {
  8951.     2,
  8952.     0x00000000,    0x40080000
  8953. };
  8954. static setword    Q72[] = {
  8955.     2,
  8956.     0x00000002,    0x00001000
  8957. };
  8958. static setword    Q73[] = {
  8959.     2,
  8960.     0x00000000,    0x00001000
  8961. };
  8962. static setword    Q74[] = {
  8963.     2,
  8964.     0x00000000,    0x20000000
  8965. };
  8966. static setword    Q75[] = {
  8967.     2,
  8968.     0x00000000,    0x00001000
  8969. };
  8970. static setword    Q76[] = {
  8971.     2,
  8972.     0x08004000,    0x00001010
  8973. };
  8974. static setword    Q77[] = {
  8975.     2,
  8976.     0x00000002,    0x00001000
  8977. };
  8978. static setword    Q78[] = {
  8979.     1,
  8980.     0x00400000
  8981. };
  8982. static setword    Q79[] = {
  8983.     2,
  8984.     0x00000000,    0x40200000
  8985. };
  8986. static setword    Q80[] = {
  8987.     2,
  8988.     0x00000000,    0x00001000
  8989. };
  8990. static setword    Q81[] = {
  8991.     2,
  8992.     0x00000000,    0x40200000
  8993. };
  8994. static setword    Q82[] = {
  8995.     2,
  8996.     0x00000000,    0x00001000
  8997. };
  8998. static setword    Q83[] = {
  8999.     2,
  9000.     0x00000000,    0x00100000
  9001. };
  9002. static setword    Q84[] = {
  9003.     2,
  9004.     0x00000000,    0x20000000
  9005. };
  9006. static setword    Q85[] = {
  9007.     2,
  9008.     0x00000000,    0x00001000
  9009. };
  9010. static setword    Q86[] = {
  9011.     3,
  9012.     0x00000000,    0x00000000,    0x00000001
  9013. };
  9014. static setword    Q87[] = {
  9015.     2,
  9016.     0x00000000,    0x00001000
  9017. };
  9018. static setword    Q88[] = {
  9019.     2,
  9020.     0x08004004,    0x00000080
  9021. };
  9022. static setword    Q89[] = {
  9023.     2,
  9024.     0x00000000,    0x40000000
  9025. };
  9026. static setword    Q90[] = {
  9027.     1,
  9028.     0x00002400
  9029. };
  9030. static setword    Q91[] = {
  9031.     2,
  9032.     0x08044014,    0x00000014
  9033. };
  9034. static setword    Q92[] = {
  9035.     2,
  9036.     0x00000000,    0x40000000
  9037. };
  9038. static setword    Q93[] = {
  9039.     2,
  9040.     0x08046414,    0x00000014
  9041. };
  9042. static setword    Q94[] = {
  9043.     2,
  9044.     0x00000000,    0x40000000
  9045. };
  9046. static setword    Q95[] = {
  9047.     2,
  9048.     0x00000000,    0x00001000
  9049. };
  9050. static setword    Q96[] = {
  9051.     2,
  9052.     0x00000000,    0x00001000
  9053. };
  9054. static setword    Q97[] = {
  9055.     2,
  9056.     0x08004004,    0x00001080
  9057. };
  9058. static setword    Q98[] = {
  9059.     2,
  9060.     0x00000000,    0x30000000
  9061. };
  9062. static setword    Q99[] = {
  9063.     2,
  9064.     0x00000000,    0x00001000
  9065. };
  9066. static setword    Q100[] = {
  9067.     2,
  9068.     0x00000000,    0x30000000
  9069. };
  9070. static setword    Q101[] = {
  9071.     2,
  9072.     0x00000000,    0x00001000
  9073. };
  9074. static setword    Q102[] = {
  9075.     2,
  9076.     0x08004004,    0x00001090
  9077. };
  9078. static setword    Q103[] = {
  9079.     2,
  9080.     0x00000000,    0x00400000
  9081. };
  9082. static setword    Q104[] = {
  9083.     2,
  9084.     0x00000000,    0x00001000
  9085. };
  9086. static setword    Q105[] = {
  9087.     1,
  9088.     0x00400000
  9089. };
  9090. static setword    Q106[] = {
  9091.     1,
  9092.     0x00400000
  9093. };
  9094. static setword    Q107[] = {
  9095.     2,
  9096.     0x00000000,    0x00200000
  9097. };
  9098. static setword    Q108[] = {
  9099.     2,
  9100.     0x00000000,    0x00100000
  9101. };
  9102. static setword    Q109[] = {
  9103.     2,
  9104.     0x00000200,    0x40080000
  9105. };
  9106. static setword    Q110[] = {
  9107.     2,
  9108.     0x00000000,    0x00001000
  9109. };
  9110. static setword    Q111[] = {
  9111.     2,
  9112.     0x00000000,    0x00080000
  9113. };
  9114. static setword    Q112[] = {
  9115.     2,
  9116.     0x00000000,    0x00001000
  9117. };
  9118. static setword    Q113[] = {
  9119.     2,
  9120.     0x00000000,    0x00007900
  9121. };
  9122. static setword    Q114[] = {
  9123.     3,
  9124.     0x00000000,    0x00000000,    0x00000001
  9125. };
  9126. static setword    Q115[] = {
  9127.     3,
  9128.     0x00000000,    0x00000000,    0x00000001
  9129. };
  9130. static setword    Q116[] = {
  9131.     2,
  9132.     0x00000200,    0x50280000
  9133. };
  9134. static setword    Q117[] = {
  9135.     1,
  9136.     0xA0000802
  9137. };
  9138. static setword    Q118[] = {
  9139.     2,
  9140.     0xA4000802,    0x00067900
  9141. };
  9142. static setword    Q119[] = {
  9143.     2,
  9144.     0x00000200,    0x40080000
  9145. };
  9146. static setword    Q120[] = {
  9147.     2,
  9148.     0x00000000,    0x00040000
  9149. };
  9150. static setword    Q121[] = {
  9151.     2,
  9152.     0x00000000,    0x30000000
  9153. };
  9154. static setword    Q122[] = {
  9155.     1,
  9156.     0x00400000
  9157. };
  9158. static setword    Q123[] = {
  9159.     2,
  9160.     0x00000000,    0x00001000
  9161. };
  9162. static setword    Q124[] = {
  9163.     2,
  9164.     0x00400000,    0x20000000
  9165. };
  9166. static setword    Q125[] = {
  9167.     2,
  9168.     0x00000000,    0x00001000
  9169. };
  9170. static setword    Q126[] = {
  9171.     2,
  9172.     0x00000000,    0x20000000
  9173. };
  9174. static setword    Q127[] = {
  9175.     2,
  9176.     0x00000000,    0x00001100
  9177. };
  9178. static setword    Q128[] = {
  9179.     2,
  9180.     0x00000000,    0x00001300
  9181. };
  9182. static setword    Q129[] = {
  9183.     2,
  9184.     0x00000000,    0x00006000
  9185. };
  9186. static setword    Q130[] = {
  9187.     2,
  9188.     0x08004004,    0x00001094
  9189. };
  9190. static setword    Q131[] = {
  9191.     2,
  9192.     0x00000000,    0x40000000
  9193. };
  9194. static setword    Q132[] = {
  9195.     2,
  9196.     0x00000000,    0x00007F00
  9197. };
  9198. static setword    Q133[] = {
  9199.     2,
  9200.     0x00000000,    0x00400000
  9201. };
  9202. static setword    Q134[] = {
  9203.     2,
  9204.     0x00000000,    0x00001000
  9205. };
  9206. static setword    Q135[] = {
  9207.     2,
  9208.     0x00000000,    0x30480000
  9209. };
  9210. static setword    Q136[] = {
  9211.     2,
  9212.     0x00000000,    0x00001000
  9213. };
  9214. static setword    Q137[] = {
  9215.     2,
  9216.     0x00000000,    0x30480000
  9217. };
  9218. static setword    Q138[] = {
  9219.     2,
  9220.     0x08004014,    0x00000014
  9221. };
  9222. static setword    Q139[] = {
  9223.     2,
  9224.     0x00000000,    0x50000000
  9225. };
  9226. static setword    Q140[] = {
  9227.     2,
  9228.     0x00000000,    0x00000100
  9229. };
  9230. static setword    Q141[] = {
  9231.     2,
  9232.     0x00000000,    0x00000080
  9233. };
  9234. static setword    Q142[] = {
  9235.     2,
  9236.     0x00000000,    0x40000080
  9237. };
  9238. static setword    Q143[] = {
  9239.     2,
  9240.     0x00000000,    0x00000080
  9241. };
  9242. static setword    Q144[] = {
  9243.     3,
  9244.     0x00000000,    0x00000000,    0x00000002
  9245. };
  9246. static setword    Q145[] = {
  9247.     2,
  9248.     0x08044014,    0x00000014
  9249. };
  9250. static setword    Q146[] = {
  9251.     2,
  9252.     0x00000000,    0x40000000
  9253. };
  9254. static setword    Q147[] = {
  9255.     2,
  9256.     0x00000000,    0x00001000
  9257. };
  9258. static setword    Q148[] = {
  9259.     2,
  9260.     0x00000000,    0x40040000
  9261. };
  9262. static setword    Q149[] = {
  9263.     2,
  9264.     0x00000000,    0x00001000
  9265. };
  9266. static setword    Q150[] = {
  9267.     2,
  9268.     0x00000000,    0x10080000
  9269. };
  9270. static setword    Q151[] = {
  9271.     2,
  9272.     0x00000000,    0x00001000
  9273. };
  9274. static setword    Q152[] = {
  9275.     2,
  9276.     0x00000000,    0x10080000
  9277. };
  9278. static setword    Q153[] = {
  9279.     2,
  9280.     0x00000000,    0x00001000
  9281. };
  9282. static setword    Q154[] = {
  9283.     2,
  9284.     0x00000000,    0x10080000
  9285. };
  9286. static setword    Q155[] = {
  9287.     2,
  9288.     0x00000004,    0x00000080
  9289. };
  9290. static setword    Q156[] = {
  9291.     1,
  9292.     0x00000018
  9293. };
  9294. static setword    Q157[] = {
  9295.     1,
  9296.     0x000000C0
  9297. };
  9298. static setword    Q158[] = {
  9299.     1,
  9300.     0x0000001A
  9301. };
  9302. static setword    Q159[] = {
  9303.     1,
  9304.     0x0000001E
  9305. };
  9306. static setword    Q160[] = {
  9307.     1,
  9308.     0x0000001F
  9309. };
  9310. static setword    Q161[] = {
  9311.     1,
  9312.     0x00001FE7
  9313. };
  9314. setword    *Conset[] = {
  9315.     Q161,
  9316.     Q160,    Q159,    Q158,    Q157,    Q156,    Q155,
  9317.     Q154,    Q153,    Q152,    Q151,    Q150,    Q149,
  9318.     Q148,    Q147,    Q146,    Q145,    Q144,    Q143,
  9319.     Q142,    Q141,    Q140,    Q139,    Q138,    Q137,
  9320.     Q136,    Q135,    Q134,    Q133,    Q132,    Q131,
  9321.     Q130,    Q129,    Q128,    Q127,    Q126,    Q125,
  9322.     Q124,    Q123,    Q122,    Q121,    Q120,    Q119,
  9323.     Q118,    Q117,    Q116,    Q115,    Q114,    Q113,
  9324.     Q112,    Q111,    Q110,    Q109,    Q108,    Q107,
  9325.     Q106,    Q105,    Q104,    Q103,    Q102,    Q101,
  9326.     Q100,    Q99,    Q98,    Q97,    Q96,    Q95,
  9327.     Q94,    Q93,    Q92,    Q91,    Q90,    Q89,
  9328.     Q88,    Q87,    Q86,    Q85,    Q84,    Q83,
  9329.     Q82,    Q81,    Q80,    Q79,    Q78,    Q77,
  9330.     Q76,    Q75,    Q74,    Q73,    Q72,    Q71,
  9331.     Q70,    Q69,    Q68,    Q67,    Q66,    Q65,
  9332.     Q64,    Q63,    Q62,    Q61,    Q60,    Q59,
  9333.     Q58,    Q57,    Q56,    Q55,    Q54,    Q53,
  9334.     Q52,    Q51,    Q50,    Q49,    Q48,    Q47,
  9335.     Q46,    Q45,    Q44,    Q43,    Q42,    Q41,
  9336.     Q40,    Q39,    Q38,    Q37,    Q36,    Q35,
  9337.     Q34,    Q33,    Q32,    Q31,    Q30,    Q29,
  9338.     Q28,    Q27,    Q26,    Q25,    Q24,    Q23,
  9339.     Q22,    Q21,    Q20,    Q19,    Q18,    Q17,
  9340.     Q16,    Q15,    Q14,    Q13,    Q12,    Q11,
  9341.     Q10,    Q9,    Q8,    Q7,    Q6,    Q5,
  9342.     Q4,    Q3,    Q2,    Q1,    Q0
  9343. };
  9344.  
  9345. setptr
  9346. Union(register setptr     p1, register setptr     p2)
  9347. {
  9348.     register int        i, j, k;
  9349.     register setptr        sp = Newset(),
  9350.                 p3 = sp;
  9351.  
  9352.     j = *p1;
  9353.     *p3 = j;
  9354.     if (j > *p2)
  9355.         j = *p2;
  9356.     else
  9357.         *p3 = *p2;
  9358.     k = *p1 - *p2;
  9359.     p1++, p2++, p3++;
  9360.     for (i = 0; i < j; i++)
  9361.         *p3++ = (*p1++ | *p2++);
  9362.     while (k > 0) {
  9363.         *p3++ = *p1++;
  9364.         k--;
  9365.     }
  9366.     while (k < 0) {
  9367.         *p3++ = *p2++;
  9368.         k++;
  9369.     }
  9370.     return (Saveset(sp));
  9371. }
  9372.  
  9373. boolean
  9374. Member(register unsigned int     m, register setptr     sp)
  9375. {
  9376.     register unsigned int    i = m / (setbits+1) + 1;
  9377.  
  9378.     if ((i <= *sp) && (sp[i] & (1 << (m % (setbits+1)))))
  9379.         return (true);
  9380.     return (false);
  9381. }
  9382.  
  9383. setptr
  9384. Insmem(register unsigned int     m, register setptr     sp)
  9385. {
  9386.     register int    i,
  9387.                 j = m / (setbits+1) + 1;
  9388.  
  9389.     if (*sp < j)
  9390.         for (i = *sp + 1, *sp = j; i <= *sp; i++)
  9391.             sp[i] = 0;
  9392.     sp[j] |= (1 << (m % (setbits+1)));
  9393.     return (sp);
  9394. }
  9395.  
  9396. # ifndef SETSPACE
  9397. # define SETSPACE 256
  9398. # endif
  9399. setptr
  9400. Currset(int     n, setptr     sp)
  9401. {
  9402.     static setword    Space[SETSPACE];
  9403.     static setptr    Top = Space;
  9404.  
  9405.     switch (n) {
  9406.       case 0:
  9407.         Top = Space;
  9408.         return (0);
  9409.       case 1:
  9410.         if (&Space[SETSPACE] - Top <= 32) {
  9411.             (void)fprintf(stderr, "Set-space exhausted\n");
  9412.             exit(1);
  9413.         }
  9414.         *Top = 0;
  9415.         return (Top);
  9416.       case 2:
  9417.         if (Top <= &sp[*sp])
  9418.             Top = &sp[*sp + 1];
  9419.         return (sp);
  9420.     }
  9421.     /* NOTREACHED */
  9422. }
  9423.  
  9424. void
  9425. Setncpy(register setptr     S1, register setptr     S2, 
  9426.         register unsigned int     N)
  9427. {
  9428.     register unsigned int    m;
  9429.  
  9430.     N /= sizeof(setword);
  9431.     *S1++ = --N;
  9432.     m = *S2++;
  9433.     while (m != 0 && N != 0) {
  9434.         *S1++ = *S2++;
  9435.         --N;
  9436.         --m;
  9437.     }
  9438.     while (N-- != 0)
  9439.         *S1++ = 0;
  9440. }
  9441.  
  9442. struct Set *
  9443. Alignset(register unsigned int     *Sp)
  9444. {
  9445.     static struct Set    tmp;
  9446.     register unsigned int    *tp = tmp.S;
  9447.     register int        i = *Sp;
  9448.  
  9449.     while (i-- >= 0)
  9450.         *tp++ = *Sp++;
  9451.     return (&tmp);
  9452. }
  9453.  
  9454. struct String *
  9455. Alignstr(register unsigned char     *Cp)
  9456. {
  9457.     static struct String    tmp;
  9458.     register unsigned char    *sp = (unsigned char*)tmp.A;
  9459.  
  9460.     while ((*sp++ = *Cp++) != 0)
  9461.         ;
  9462.     return (&tmp);
  9463. }
  9464.