#include <perms.h>
int _imp_mainep(int _imp_argc, char **_imp_argv) {
const _imp_string Version = _imp_str_literal("8.4");
const int Minusone = -1;
const int Maxint = ((Minusone) >> 1) / 10;
const int Maxdig = ((Minusone) >> 1) - Maxint * 10;
const int Bytesize = 8;
const int Maxtag = 800;
const int Maxdict = 6000;
const int Namebits = 11;
const int Maxnames = (1 << Namebits) - 1;
static int Sparenames = Maxnames;
const int Litmax = 50;
const int Recsize = 520;
const int Dimlimit = 6;
const int Ff = 12;
const int Marker = '^';
const int Squote = '"';
const int Cquote = '\'';
const int Report = 0;
const int Source = 1;
const int Object = 1;
const int Listing = 2;
const int Integer = 1;
const int Real = 2;
const int Stringv = 3;
const int Record = 4;
const int Iform = (Integer << 4) + 1;
const int Var = 91;
const int Const = 93;
const int Swit = 105;
const int Comment = 22;
const int Termin = 20;
const int Lab = 3;
const int Jump = 54;
const int Recfm = 4;
const int Proc = 7;
const int Escdec = 252;
const int Escproc = 253;
const int Escarray = 254;
const int Escrec = 255;
typedef struct Arfm {
int Class;
int Sub;
int Link;
int Ptype;
int Papp;
int Pformat;
int X;
int Pos;
} Arfm;
typedef struct Tagfm {
int App;
int Format;
int Flags;
int Index;
int Text;
int Link;
} Tagfm;
const int Usedbit = 0b1000000000000000;
const int Closed = 0b0100000000000000;
const int Constbit = 0b0010000000000000;
const int Parameters = 0b0001000000000000;
const int Subname = 0b0000100000000000;
const int Aname = 0b0000010000000000;
const int Ownbit = 0b0000001000000000;
const int Prot = 0b0000000100000000;
const int Spec = 0b0000000010000000;
const int Transbit = 0x4000;
const int Error = 0x8000;
Arfm Ar[520 /*1:520*/];
static int Class = 0;
static int X = 0;
static int Atom1 = 0;
static int Atom2 = 0;
static int Subatom = 0;
static int Type = 0;
static int App = 0;
static int Format = 0;
int Hashvalue;
static int Faulty = 0;
static int Faultrate = 0;
static int Lines = 0;
static int Textline = 0;
static int Margin = 0;
static int Errormargin = 0;
static int Errorsym = 0;
static int Column = 0;
static int Stats = 0;
static int Monpos = 0;
static int Sym = Nl;
static int Symtype = 0;
static int Quote = 0;
static int Endmark = 0;
static int Cont = ' ';
static int Csym = ' ';
static int Decl = 0;
static int Dim = 0;
static int Specgiven = 0;
static int Escapeclass = 0;
static int Protection = 0;
static int Atomflags = 0;
static int Otype = 0;
static int Realsln = 1;
static int Last1 = 0;
static int Gentype = 0;
static int Ptype = 0;
static int Papp = 0;
static int Pformat = 0;
static int Force = 0;
static int G = 0;
static int Gg = 0;
static int Mapgg = 0;
static int Fdef = 0;
static int This = -1;
static int Nmin = 0;
static int Nmax = 0;
static int Rbase = 0;
static int Dmax = 1;
static int Tmin = Maxtag;
static int Ss = 0;
_imp_string Includefile;
static int Includelist = 0;
static int Includelevel = 0;
static int Include = 0;
static int Perm = 1;
static int Progmode = 0;
static int Sstype = 0;
static int Specmode = 0;
static int Ocount = -1;
static int Limit = 0;
static int Copy = 0;
static int Order = 0;
static int Forwarn = 0;
static int Dubious = 0;
static int Dp = 1;
static int Pos1 = 0;
static int Pos2 = 0;
static int Pos = 0;
static int Dimension = 0;
static int Local = 0;
static int Fmbase = 0;
static int Searchbase = 0;
static int Formatlist = 0;
int Recid;
static unsigned char Char[134 /*0:133*/] = {
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
int Litpool[51 /*0:50*/];
static int Lit = 0;
static int Lp = 0;
static int Blockx = 0;
static int List = 1;
static int Control = 0;
static int Diag = 0;
int Hash[2048 /*0:2047*/];
Tagfm Tag[801 /*0:800*/];
int Dict[6000 /*1:6000*/];
unsigned char Buff[512 /*1:512*/];
static int Bp = 0;
const int Maxgrammar = 1720;
static int Gmin = Maxgrammar;
const int Manifest = 120;
const int Figurative = 130;
const int Actions = 180;
const int Phrasal = 200;
const unsigned char Amap[16 /*0:15*/] = {
89, 91, 92, 104, 94, 93, 105, 100, 101, 102, 103, 106, 107, 108, 109, 89};
const unsigned char Atoms[16 /*0:15*/] = {89, 1, 1, 10, 9, 1, 10, 7,
7, 7, 7, 4, 1, 4, 1, 89};
const _imp_string Text[256 /*0:255*/] = {
_imp_str_literal("Z"), _imp_str_literal("VDEC"),
_imp_str_literal("OWNVDEC"), _imp_str_literal("EXTVSPEC"),
_imp_str_literal("ADEC"), _imp_str_literal("OWNADEC"),
_imp_str_literal("EXTASPEC"), _imp_str_literal("PROC"),
_imp_str_literal("PROCSPEC"), _imp_str_literal("FORMDEC"),
_imp_str_literal("SWDEC"), _imp_str_literal("LDEC"),
_imp_str_literal("FORMSPEC"), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal("OPTION"), _imp_str_literal("COMMA"),
_imp_str_literal("T"), _imp_str_literal("COLON"),
_imp_str_literal("COMMENT"), _imp_str_literal("LB"),
_imp_str_literal("ALIAS"), _imp_str_literal("RB"),
_imp_str_literal("SUB"), _imp_str_literal("ARRAYD"),
_imp_str_literal("STYPE"), _imp_str_literal("ARRAY"),
_imp_str_literal("NAME"), _imp_str_literal("PROCD"),
_imp_str_literal("FNMAP"), _imp_str_literal("SWITCH"),
_imp_str_literal("OWN"), _imp_str_literal("EXTERNAL"),
_imp_str_literal("STRING"), _imp_str_literal("RECORD"),
_imp_str_literal("FORMAT"), _imp_str_literal("SPEC"),
_imp_str_literal("MCODE"), _imp_str_literal("LABEL"),
_imp_str_literal("OP1"), _imp_str_literal("OP2"),
_imp_str_literal("OP3"), _imp_str_literal("SIGN"),
_imp_str_literal("UOP"), _imp_str_literal("MOD"),
_imp_str_literal("DOT"), _imp_str_literal("COMP"),
_imp_str_literal("ACOMP"), _imp_str_literal("EQ"),
_imp_str_literal("EQEQ"), _imp_str_literal("JAM"),
_imp_str_literal("JUMP"), _imp_str_literal("RESOP"),
_imp_str_literal("AND"), _imp_str_literal("OR"),
_imp_str_literal("NOT"), _imp_str_literal("WHILE"),
_imp_str_literal("UNTIL"), _imp_str_literal("FOR"),
_imp_str_literal("CWORD"), _imp_str_literal("EXIT"),
_imp_str_literal("ON"), _imp_str_literal("SIGNAL"),
_imp_str_literal("THEN"), _imp_str_literal("START"),
_imp_str_literal("ELSE"), _imp_str_literal("FINISH"),
_imp_str_literal("FELSE"), _imp_str_literal("CYCLE"),
_imp_str_literal("REPEAT"), _imp_str_literal("PROGRAM"),
_imp_str_literal("BEGIN"), _imp_str_literal("END"),
_imp_str_literal("ENDPROG"), _imp_str_literal("ENDPERM"),
_imp_str_literal("FRESULT"), _imp_str_literal("MRESULT"),
_imp_str_literal("BACK"), _imp_str_literal("MONITOR"),
_imp_str_literal("STOP"), _imp_str_literal("LIST"),
_imp_str_literal("REALSLN"), _imp_str_literal("CONTROL"),
_imp_str_literal("INCLUDE"), _imp_str_literal("MASS"),
_imp_str_literal("RTYPE"), _imp_str_literal("ADDOP"),
_imp_str_literal("IDENT"), _imp_str_literal("V"),
_imp_str_literal("N"), _imp_str_literal("CONST"),
_imp_str_literal("FM"), _imp_str_literal(""),
_imp_str_literal("R"), _imp_str_literal("F"),
_imp_str_literal("M"), _imp_str_literal("P"),
_imp_str_literal("RP"), _imp_str_literal("FP"),
_imp_str_literal("MP"), _imp_str_literal("PP"),
_imp_str_literal("L"), _imp_str_literal("S"),
_imp_str_literal("A"), _imp_str_literal("AN"),
_imp_str_literal("NA"), _imp_str_literal("NAN"),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal("%MSTART"), _imp_str_literal("%CLEAR"),
_imp_str_literal("%PRED"), _imp_str_literal(""),
_imp_str_literal("%DUBIOUS"), _imp_str_literal("%DUP"),
_imp_str_literal("%PIN"), _imp_str_literal("%POUT"),
_imp_str_literal("%EDUP"), _imp_str_literal(""),
_imp_str_literal("PIDENT"), _imp_str_literal("CIDENT"),
_imp_str_literal("OIDENT"), _imp_str_literal("FNAME"),
_imp_str_literal("SWID"), _imp_str_literal("DOTL"),
_imp_str_literal("DOTR"), _imp_str_literal("ASEP"),
_imp_str_literal("CSEP"), _imp_str_literal("OSEP"),
_imp_str_literal("PSEP"), _imp_str_literal("ARB"),
_imp_str_literal("BPLRB"), _imp_str_literal("ORB"),
_imp_str_literal("PRB"), _imp_str_literal("CRB"),
_imp_str_literal("RCRB"), _imp_str_literal("RECRB"),
_imp_str_literal("RECLB"), _imp_str_literal("LAB"),
_imp_str_literal("MLAB"), _imp_str_literal("SLAB"),
_imp_str_literal("XNAME"), _imp_str_literal("OWNT"),
_imp_str_literal("DBSEP"), _imp_str_literal("PCONST"),
_imp_str_literal("CMOD"), _imp_str_literal("CSIGN"),
_imp_str_literal("CUOP"), _imp_str_literal("COP1"),
_imp_str_literal("COP2"), _imp_str_literal("COP3"),
_imp_str_literal("INDEF"), _imp_str_literal("XELSE"),
_imp_str_literal("CRESOP"), _imp_str_literal("NLAB"),
_imp_str_literal("RUNTIL"), _imp_str_literal("ACONST"),
_imp_str_literal("ORRB"), _imp_str_literal("FMANY"),
_imp_str_literal("OSTRING"), _imp_str_literal("FMLB"),
_imp_str_literal("FMRB"), _imp_str_literal("FMOR"),
_imp_str_literal("RANGERB"), _imp_str_literal("FSID"),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal("%DUMMY"),
_imp_str_literal("%DECL"), _imp_str_literal("%TYPE"),
_imp_str_literal("%ZERO"), _imp_str_literal("%APPLY"),
_imp_str_literal("%PROT"), _imp_str_literal("%SETPROT"),
_imp_str_literal("%PTYPE"), _imp_str_literal("%GAPP"),
_imp_str_literal("%LOCAL"), _imp_str_literal("%GUARD"),
_imp_str_literal("%MCODE"), _imp_str_literal("%CDUMMY"),
_imp_str_literal("%SETTYPE"), _imp_str_literal("%OPER"),
_imp_str_literal("%PARAM"), _imp_str_literal("%BLOCK"),
_imp_str_literal("%OTHER"), _imp_str_literal("%COMPILE"),
_imp_str_literal("APP"), _imp_str_literal("BASEAPP"),
_imp_str_literal("APP2"), _imp_str_literal("APP3"),
_imp_str_literal("APP4"), _imp_str_literal("APP5"),
_imp_str_literal("APP6"), _imp_str_literal("ADEFN"),
_imp_str_literal("NPARM"), _imp_str_literal("SWDEF"),
_imp_str_literal("SWIDS"), _imp_str_literal("CIEXP"),
_imp_str_literal("RCONST"), _imp_str_literal("SCONST"),
_imp_str_literal("ARRAYP"), _imp_str_literal("XIMP"),
_imp_str_literal("IMP"), _imp_str_literal("COND"),
_imp_str_literal("SCOND"), _imp_str_literal("EXP1"),
_imp_str_literal("EXP2"), _imp_str_literal("SEXP"),
_imp_str_literal("IEXP"), _imp_str_literal("IEXP1"),
_imp_str_literal("IEXP2"), _imp_str_literal("ISEXP"),
_imp_str_literal("SEQ"), _imp_str_literal("FDEF"),
_imp_str_literal("EXP"), _imp_str_literal("NARRAYP"),
_imp_str_literal("STRUCT"), _imp_str_literal("RESEXP"),
_imp_str_literal("BPL"), _imp_str_literal("CONSTB"),
_imp_str_literal("FITEM"), _imp_str_literal("MOREA"),
_imp_str_literal("CLIST"), _imp_str_literal("FPP"),
_imp_str_literal("FPP0"), _imp_str_literal("FPP1"),
_imp_str_literal("FPP2"), _imp_str_literal("INITVAR"),
_imp_str_literal("RECEXP"), _imp_str_literal("EIMP"),
_imp_str_literal("IDENTS"), _imp_str_literal("RANGE"),
_imp_str_literal("RCONSTB"), _imp_str_literal("VARP"),
_imp_str_literal("INITDEC"), _imp_str_literal(""),
_imp_str_literal(""), _imp_str_literal(""),
_imp_str_literal("ESCDEC"), _imp_str_literal("ESCPROC"),
_imp_str_literal("ESCARRAY"), _imp_str_literal("ESCREC")};
const int Gmax1 = 719;
static int Gmax = 719;
const int Impphrase = 25;
const short Initial[120 /*0:119*/] = {
24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32551,
0, 0, 0, 0, 13, 0, 14, 4, -32557, 16, -32550,
0, 0, 5, 6, 3, 12, 15, 8, 7, 9, 10,
11, -32558, -32554, -32559, -32552, -32553, 18, 22, 17, 21, 19,
0, 0, 0, -32562, -32560, 0, 0, 0, -32561, 0, 0,
0, 0, 0, 0, 0, 1, 2, 0, -32556, 0, -32555,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const unsigned char Atomic[50 /*130:179*/] = {
90, 90, 90, 90, 90, 48, 48, 19, 19, 19, 19, 25, 25, 25, 25, 25, 25,
25, 23, 104, 104, 105, 30, 20, 21, 93, 47, 45, 46, 42, 43, 44, 40, 68,
55, 104, 60, 93, 25, 40, 93, 23, 25, 57, 25, 90, 176, 177, 178, 179};
static short Phrase[56 /*200:255*/] = {
0, 564, 565, 567, 569, 571, 573, 562, 614, 203, 200, 602, 478, 480,
624, 298, 206, 308, 318, 433, 426, 437, 444, 458, 453, 461, 467, 482,
402, 627, 629, 603, 521, 511, 486, 502, 575, 527, 528, 543, 550, 578,
397, 287, 197, 636, 516, 621, 167, 0, 0, 0, 640, 693, 701, 709};
static short Gram[1721 /*0:1720*/] = {
0, -28523, -28521, -28602, -32706, -28509, -28603,
-24502, -24503, -20405, -20404, -28595, -32697, -32709,
-16323, -28600, -32704, -28587, -28589, -32681, -16344,
-28586, -28588, -12270, -32586, 216, -12287, -16380,
-8185, -8184, -12285, -12286, -12283, -12282, -12279,
-12276, -16373, 20490, -32706, -32701, 216, -16364,
-28610, -28613, -28612, 16445, 217, -16364, 62,
-32701, 16450, -16364, 5346, -16364, 166, -16344,
4332, 130, -16360, -16361, 126, 217, -32701,
216, -16364, 16450, -32700, 16404, -32701, -32706,
216, 16405, 16407, -16222, 8414, 130, 217,
-32697, 16450, 1250, 4307, 4318, 192, 93,
170, 90, 207, -16365, 16404, 90, -16360,
-16365, 16404, 241, -16365, 16404, 132, 132,
-16360, 4329, -16365, 16404, 133, 175, 90,
-16365, 16404, 209, -16365, 16404, 4313, 217,
16451, 4263, 16384, 16384, 120, 216, -32700,
16404, -32706, 16404, 243, 16409, 454, -32685,
16404, 454, 248, -16365, 16404, 4263, 194,
-16360, 4329, -32717, 16404, 4263, 16407, 454,
237, 127, 215, 454, 4263, 16384, -16364,
1502, -32629, -16361, 153, -32606, 222, 143,
-32629, 153, 454, 126, 16409, 454, 16384,
234, -16365, -32595, 147, -32678, 234, 193,
-32677, -32676, -32661, 109, -32717, 53, 52,
52, 52, 194, 194, 194, -28581, 4188,
194, -28566, 4203, 194, -28564, 4205, 4580,
16429, 183, 183, 186, 186, -28583, 0,
9437, 90, -16365, 0, 134, -16365, 0,
210, 4329, 199, -32677, -32672, -32676, -32688,
-32690, -32705, -32661, -32659, -32689, -32686, -32687,
-16330, 65, -32716, 186, -28583, -32717, -32715,
-32713, 52, -32664, 4201, 186, -32717, -32715,
55, -16328, 0, 197, 197, 52, 52,
197, -28581, -28580, 186, -28581, 4188, 4318,
194, -28581, 4188, 9437, 194, 194, 454,
16407, 216, 194, -28566, -28565, 186, -28566,
4203, 194, -28564, -28563, 186, -28564, 4205,
183, 183, 186, 183, -16365, 0, 183,
4580, 16429, 5095, 9444, 5348, 186, -28583,
-16328, 0, 16409, -16365, 0, 9437, 5348,
217, -32701, 16450, -32701, 216, -32700, 0,
-32701, -32706, 216, 243, 217, -16318, 0,
-32552, 0, -32700, 0, -32706, 0, 215,
-32550, 228, -28616, -28615, 0, 4096, 218,
218, -28616, 0, -32677, -32676, -16361, -32710,
-32669, -32662, -32661, -32660, -32659, 740, -32039,
740, -32719, 4096, 194, -32719, -32718, -32604,
-32726, -32725, -32724, -32720, 4096, 710, 6116,
-32719, 0, 710, 6116, -28581, 4188, 218,
122, 50, 16409, -32726, -32725, -32724, -32719,
4096, 710, 454, 195, 195, 195, 454,
-28581, 4188, 194, -28566, -28565, -28564, 4205,
195, 195, 195, 710, 4836, 5095, 4829,
-32726, -32725, -32724, -32719, 4096, 4827, 4828,
454, -32720, -32719, 4096, 4829, 4827, 4828,
194, -32719, 0, 710, 4836, -16291, -32677,
92, 184, 121, -28581, -28580, -32722, -32723,
4317, -32726, -32725, -32724, 0, 183, -32726,
-32725, -32724, -32720, 0, 4316, 195, 195,
195, 454, -28581, 4188, 4315, 183, 4317,
-32726, -32725, 0, 195, 195, 4315, 4317,
-32726, 0, 195, -32677, -32676, -16361, 16431,
228, 228, 47, -32610, -32611, 5345, -32609,
-32608, -32607, 0, 4320, 4319, 5345, -32609,
-32608, 0, 4319, 5345, -32609, 0, -32613,
-16361, 16431, 222, 222, 156, -32677, 92,
183, 186, 1222, 16435, 228, 16403, 4324,
138, 8420, -32723, 4189, 93, 454, 148,
-32674, 16546, 16409, -32597, 182, -16383, 16388,
234, -16365, -32595, 172, -32678, 234, 90,
244, 246, -16365, 0, 235, -32678, 234,
-16365, 246, -16365, 0, -32678, 234, 90,
16407, 222, 16405, 222, 145, 16407, 222,
16405, 222, 146, 16407, 1252, 154, 5348,
-16365, 142, 126, 182, -16383, 16391, 90,
-16365, 127, -32678, 238, 90, 125, 239,
-16365, 8319, 8430, 128, 126, -16361, 127,
190, 240, 189, 16409, 182, -16383, 16391,
90, -16365, 0, -32678, 240, 90, 16623,
-16365, 0, 244, 232, 1252, 1252, 137,
1252, 137, 1252, 137, 1252, 137, 1252,
137, 222, -16365, 0, 131, 194, -16360,
-16333, -16332, 124, 181, -16292, -16277, 16493,
-31802, 5342, -28581, 4188, 4263, 181, 186,
454, 16475, 183, -28583, 199, 5598, 9438,
222, -32677, -32676, 16407, 186, 228, 135,
16409, -32632, 0, -32677, 92, -32677, -32676,
-32662, -32661, -32660, -32659, 165, -32677, 92,
188, -32662, 107, 188, -32660, 109, -32732,
37, -16344, 4318, 148, -32674, 16424, 222,
16405, 222, 174, -28644, -32734, -32680, -28641,
-32733, -32730, -32735, -32727, -32738, 4326, -32738,
-32739, -32741, -32736, 199, -28644, -32680, -28641,
4326, -32739, -32741, 199, -32738, -32739, -32741,
-32736, -32729, 199, -32616, 199, -32739, -32741,
-32729, 199, -32616, -32729, 199, -28644, -32680,
4326, -32738, -32739, -32741, 199, 245, 4318,
245, 16409, 152, 4318, 16409, 152, 245,
-32672, -32671, -32670, 99, 16407, 200, 144,
185, -32677, 92, 16407, -32582, 200, 200,
187, 141, -32677, 92, 16410, 191, -32677,
-32676, -32662, -32661, -32660, 109, 198, [720 ... 1720] = 0};
static short Glink[1721 /*0:1720*/] = {
-1, 71, 72, 38, 46, 47, 67,
67, 75, 67, 0, 67, 51, 76,
79, 53, 55, 80, 67, 81, 82,
83, 67, 84, 26, 41, 85, 86,
57, 57, 89, 93, 96, 97, 102,
103, 104, 107, 46, 67, 67, 0,
110, 110, 111, 52, 49, 0, 61,
67, 62, 0, 67, 0, 111, 112,
112, 58, 113, 114, 115, 64, 67,
66, 116, 117, 68, 0, 67, 122,
67, 0, 73, 123, 123, 67, 77,
67, 40, 77, 67, 67, 0, 124,
127, 128, 87, 86, 0, 90, 131,
89, 0, 94, 93, 0, 132, 98,
137, 100, 97, 0, 138, 67, 105,
104, 0, 108, 107, 0, 67, 67,
67, 139, 140, 141, 0, 118, 120,
116, 142, 116, 67, 71, 125, 67,
0, 67, 129, 85, 0, 143, 133,
144, 135, 145, 0, 156, 157, 59,
158, 67, 119, 91, 159, 146, 145,
148, 146, 151, 0, 153, 153, 154,
146, 0, 99, 160, 67, 134, 161,
162, 165, 161, 141, 162, 162, 168,
172, 174, 175, 176, 177, 178, 179,
182, 185, 188, 189, 180, 190, 190,
183, 191, 191, 186, 191, 191, 0,
188, 192, 193, 194, 0, 196, 0,
0, 198, 197, 0, 201, 200, 0,
204, 205, 0, 228, 232, 219, 234,
235, 0, 236, 237, 238, 0, 232,
226, 244, 245, 221, 248, 249, 250,
251, 245, 0, 252, 229, 249, 250,
251, 253, 0, 0, 188, 254, 260,
239, 269, 269, 242, 191, 191, 270,
246, 272, 272, 229, 273, 274, 275,
276, 0, 255, 266, 266, 258, 267,
267, 261, 266, 266, 264, 267, 267,
232, 268, 232, 0, 277, 0, 278,
232, 273, 232, 282, 283, 279, 285,
253, 0, 0, 286, 0, 232, 0,
288, 0, 290, 0, 292, 294, 0,
0, 297, 0, 0, 299, 301, 0,
303, 0, 305, 0, 307, 0, 0,
310, 313, 314, 315, 0, 0, 316,
311, 314, 0, 332, 332, 328, 349,
350, 351, 351, 351, 351, 330, 282,
352, 358, 0, 333, 341, 347, 359,
360, 361, 362, 363, 0, 342, 343,
345, 0, 346, 0, 269, 269, 0,
0, 366, 353, 371, 372, 373, 374,
0, 375, 376, 377, 383, 384, 364,
385, 385, 367, 269, 269, 269, 269,
389, 390, 391, 392, 393, 0, 378,
360, 361, 362, 341, 0, 379, 380,
386, 363, 341, 0, 353, 354, 355,
375, 395, 0, 396, 0, 400, 269,
269, 401, 0, 411, 411, 406, 417,
407, 418, 419, 420, 0, 412, 418,
419, 420, 421, 0, 409, 406, 424,
417, 422, 425, 425, 408, 415, 427,
430, 431, 0, 426, 432, 428, 434,
436, 0, 433, 269, 269, 441, 442,
282, 443, 0, 446, 451, 447, 446,
452, 451, 0, 449, 448, 454, 453,
457, 0, 455, 459, 458, 0, 269,
464, 465, 282, 466, 0, 469, 469,
470, 471, 472, 473, 474, 475, 476,
477, 0, 479, 269, 481, 0, 483,
485, 485, 205, 490, 488, 496, 497,
491, 494, 490, 0, 491, 491, 0,
498, 499, 501, 0, 0, 504, 506,
510, 499, 508, 0, 506, 506, 504,
512, 513, 514, 515, 0, 517, 518,
519, 520, 0, 522, 523, 524, 525,
522, 0, 528, 529, 531, 536, 532,
534, 0, 532, 0, 537, 538, 539,
541, 542, 542, 0, 544, 546, 0,
547, 548, 549, 533, 551, 553, 558,
554, 556, 0, 554, 0, 559, 560,
557, 0, 563, 205, 0, 566, 564,
568, 565, 570, 567, 572, 569, 574,
571, 576, 575, 0, 579, 580, 592,
593, 584, 205, 585, 588, 588, 588,
590, 205, 594, 594, 595, 596, 597,
581, 600, 598, 601, 0, 205, 205,
205, 606, 606, 607, 608, 609, 605,
610, 612, 0, 193, 193, 193, 193,
193, 193, 193, 193, 0, 623, 623,
192, 626, 626, 0, 626, 626, 631,
633, 282, 282, 634, 282, 282, 637,
638, 639, 0, 650, 677, 684, 666,
655, 205, 205, 205, 205, 650, 659,
668, 685, 666, 0, 662, 686, 666,
662, 668, 685, 0, 670, 674, 689,
666, 205, 0, 205, 0, 674, 689,
205, 0, 666, 205, 0, 680, 692,
680, 659, 668, 685, 0, 650, 687,
662, 688, 205, 690, 691, 666, 680,
697, 697, 697, 697, 698, 699, 700,
0, 703, 703, 704, 706, 707, 708,
708, 700, 711, 711, 712, 713, 719,
719, 719, 719, 719, 719, 0, [720 ... 1720] = 0};
const short Maxkdict = 618;
const short Kdict[587 /*32:618*/] = {
0, 511, 131, 531, 131, 551, 559, 131, 567,
575, 583, 603, 623, 631, 663, 671, 129, 129,
129, 129, 129, 129, 129, 129, 129, 129, 691,
698, 707, 751, 795, 131, 131, 824, 900, 960,
1076, 1120, 1280, 128, 128, 1392, 128, 128, 1460,
1600, 1636, 1704, 1792, 128, 1872, 2088, 2284, 2316,
128, 2356, 128, 128, 128, 2375, 2383, 2415, 2423,
2443, 131, 131, 131, 131, 131, 131, 131, 131,
131, 131, 131, 131, 131, 131, 131, 131, 131,
131, 131, 131, 131, 131, 131, 131, 131, 131,
131, 131, 2451, 131, 2459, -32351, 16428, 25, 16428,
29, -32349, 16433, 1, 16434, 1, -16127, 0, 16427,
21, 16407, 0, 16409, 0, -32323, -10840, 40, 16471,
0, -32341, -10580, 32, 16473, 117, 16384, 19, -31955,
-32322, -10580, 36, -9290, 0, 16473, 113, 16432, 13,
-32337, 16427, 46, 16427, 17, 16405, 0, 16404, 0,
-31556, -31939, -32322, -9551, 2, 16433, 1, 16433, 5,
16426, 5, -31606, -32323, -9807, 0, -32374, -9678, 0,
16436, 0, 16435, 0, -31939, -32322, 16433, 4, 16426,
9, 16433, 3, -30772, -31666, 10578, 11457, -32344, 16413,
2, 16411, 2, 68, -32374, 16440, 0, 16440, 0,
8393, 83, 16408, 0, -31291, 10841, 69, -32311, 16412,
18, 10830, 9157, 10565, 16412, 18, 9415, 78, 16458,
0, -32049, 8665, 8908, 16455, 0, -30131, 78, -31277,
84, -32055, 10194, 76, 16469, 0, 10958, 69, 16447,
32, 84, -32319, 16418, 2, 10830, 16418, 2, 8909,
10830, 16406, 0, -31927, 10073, 9921, 8649, 16419, 5,
9153, 10190, 8915, 16469, 1, -27956, -31282, 88, -31927,
8916, 10066, 9793, 16419, 3, 84, 16447, 4, 68,
-32305, 16459, 2, 70, -30650, -31284, 80, -31931, 10194,
10567, 9921, 16460, 1, 9938, 16461, 0, 10697, 84,
16467, 3, 9801, 69, 16460, 0, 8915, 16452, 0,
-29631, -30903, -31282, -31793, 10069, 10819, 10185, 78, 16416,
9, 82, 16445, 0, 16416, 9, 9422, 9299, -32315,
16453, 0, 10700, 69, 16454, 0, 10700, 69, 16464,
1210, -30778, 78, -31549, 8916, 8903, 82, -32344, 16412,
17, 16472, 17, 10956, 8900, 16470, 0, 16446, 44,
-28735, -29239, 10063, 71, -30263, -31668, -32302, 16412, 20,
8389, 76, 16412, 36, 10063, 71, -32311, 16412, 21,
10830, 9157, 10565, 16412, 21, 10830, 9157, 10565, 16412,
20, 10835, 16467, 1, 8898, 76, 16425, 6, -31935,
10063, 10825, 10575, 16465, 109, 80, 16416, 10, -32191,
10831, 16442, 0, 8909, -32314, 16414, 1, -31794, 10069,
10819, 10185, 78, 16416, 10, 16416, 10, -30770, -31408,
-32174, 10071, 16418, 1, -32374, 16441, 2, 16441, 2,
9428, 10063, 16402, 0, -32315, 16448, 0, 8918, 10830,
16448, 0, -30523, 82, -31419, -31927, 9167, 8402, 77,
16457, 0, 77, 16419, 6, 9412, 8387, 8916, 16415,
123, 9938, 16419, 7, -31931, 10959, 9428, 8910, 16415,
104, -28351, -30397, -31024, -32045, 10964, 10066, 16464, 1319,
9813, 7892, -32323, 16462, 1384, 16463, 1241, 8389, 84,
16456, 0, 10575, 68, -32314, 16421, 64, 10575, 8397,
84, -32301, 16422, 9, 8912, 67, 16422, 12, 76,
-32301, 16412, 33, -31924, 10190, 9938, 9793, 16468, 1,
10063, 71, 16468, 4, -27704, -28983, -29488, -31276, -31913,
10713, 8916, 77, 16419, 4, 10825, 9283, 16417, 12,
-31423, -31921, 9426, 9166, 40, 16420, 48, 80, 16466,
115, 10834, 16451, 0, 8645, 16423, 0, 10055, 9793,
-32315, 16449, 0, 8918, 10830, 16449, 0, 10575, 84,
-32311, 16412, 19, 10830, 9157, 10565, 16412, 19, -32056,
10962, 69, 16464, 1354, 10053, 16450, 0, 78, -32052,
9428, 76, 16444, 182, 10693, 83, 16446, 46, 9416,
8908, 16443, 180, 16407, 0, -31939, -32292, -10454, 51,
16426, 13, 16433, 1, 16409, 0, -32290, -10454, 51,
16426, 13, 16410, 0, 16431, 14, -32323, 16430, 51,
16433, 1};
void Flushbuffer(int Limit) {
int J;
if (Bp >= Limit) {
if (!Faulty) {
Selectoutput(Object);
for (J = 1; J <= Bp; J++) Printsymbol(Buff[J]);
Selectoutput(Listing);
}
Bp = 0;
}
}
void Addchar(unsigned char Ch) {
Bp++;
Buff[Bp] = Ch;
}
void Op(int Code, int Param) {
Buff[Bp + 1] = Code;
Buff[Bp + 2] = Param >> 8;
Buff[Bp + 3] = Param;
Bp += 3;
}
void Setconst(int M) {
Buff[Bp + 1] = 'N';
Buff[Bp + 5] = M;
M = M >> 8;
Buff[Bp + 4] = M;
M = M >> 8;
Buff[Bp + 3] = M;
M = M >> 8;
Buff[Bp + 2] = M;
Bp += 5;
}
void Octal(int N) {
int M;
M = N >> 3;
if (M) Octal(M);
Addchar((N & 7) + '0');
}
void Hexadecimal(int N) {
int M;
M = N >> 4;
if (M) Hexadecimal(M);
if ((N & 15) > 9)
Addchar((N & 15) + 'A');
else
Addchar((N & 15) + '0');
}
void Printident(int P, int Mode) {
void Putit(int Ch) {
if (!Mode)
Printsymbol(Ch);
else
Addchar(Ch);
}
int K;
int L;
P = Tag[P];
if (!P) {
Putit('?');
return;
}
P++;
K = Dict[P];
L = K & 255;
while (L > 0) {
Putit(K >> 8);
L--;
P++;
K = Dict[P];
if (!L) break;
Putit(K & 255);
L--;
}
}
void Abandon(int N) {
static int Reason_sw;
static void *Reason[10 /*0:9*/] = {
&&Reason_0, &&Reason_1, &&Reason_2, &&Reason_3, &&Reason_4,
&&Reason_5, &&Reason_6, &&Reason_7, &&Reason_8, &&Reason_9,
};
int Stream;
Stream = Listing;
for (;;) {
if (Sym != Nl) Newline();
Printsymbol('*');
Write(Lines, 4);
Space();
goto *Reason[Reason_sw = N];
Reason_0:
Printstring(_imp_str_literal("compiler error!"));
goto More;
Reason_1:
Printstring(_imp_str_literal("switch vector too large"));
goto More;
Reason_2:
Printstring(_imp_str_literal("too many names"));
goto More;
Reason_3:
Printstring(_imp_str_literal("program too complex"));
goto More;
Reason_4:
Printstring(_imp_str_literal("feature not implemented"));
goto More;
Reason_5:
Printstring(_imp_str_literal("input ended: "));
if (Quote)
if (Quote < 0)
Printsymbol(Cquote);
else
Printsymbol(Squote);
else {
Printstring(_imp_str_literal("%endof"));
if (Progmode >= 0)
Printstring(_imp_str_literal("program"));
else
Printstring(_imp_str_literal("file"));
}
Printstring(_imp_str_literal(" missing?"));
goto More;
Reason_6:
Printstring(_imp_str_literal("too many faults!"));
goto More;
Reason_7:
Printstring(_imp_str_literal("string constant too long"));
goto More;
Reason_8:
Printstring(_imp_str_literal("dictionary full"));
goto More;
Reason_9:
Printstring(_imp_join(
_imp_str_literal("Included file "),
_imp_join(Includefile, _imp_str_literal(" does not exist"))));
More:
Newline();
Printstring(_imp_str_literal("*** compilation abandoned ***"));
Newline();
if (!Stream) break;
Closeoutput();
Stream = Report;
Selectoutput(Report);
}
exit(0);
}
void Compileblock(int Level, int Blocktag, int Dmin, int Tmax, int Id) {
auto int Gapp(void);
auto void Deletenames(int Quiet);
auto void Analyse(void);
auto void Compile(void);
int Open;
Open = Closed;
int Dbase;
Dbase = Dmax;
int Tbase;
Tbase = Tmax;
int Tstart;
Tstart = Tmax;
int Label;
Label = 4;
int Access;
Access = 1;
int Inhibit;
Inhibit = 0;
int *Bflags;
Bflags = &Tag[Blocktag];
int Blocktype;
Blocktype = *Bflags >> 4 & 7;
int Blockform;
Blockform = *Bflags & 15;
int Blockfm;
Blockfm = Tag[Blocktag];
int Blockotype;
Blockotype = Otype;
int *Blockapp;
Blockapp = &Tag[Blocktag];
int L;
int Newapp;
void Fault(int N) {
static int Fm_sw;
static void *Fm[28 /*-5:22*/] = {
&&Fm_M5, &&Fm_M4, &&Fm_M3, &&Fm_M2, &&Fm_M1, &&Fm_0, &&Fm_1,
&&Fm_2, &&Fm_3, &&Fm_4, &&Fm_5, &&Fm_6, &&Fm_7, &&Fm_8,
&&Fm_9, &&Fm_10, &&Fm_11, &&Fm_12, &&Fm_13, &&Fm_14, &&Fm_15,
&&Fm_16, &&Fm_17, &&Fm_18, &&Fm_19, &&Fm_20, &&Fm_21, &&Fm_22,
};
int St;
void Printss(void) {
int S;
int P;
if (!Pos) return;
Space();
P = 1;
for (;;) {
if (P == Pos1) Printsymbol(Marker);
if (P == Pos) break;
S = Char[P];
P++;
if (S == Nl || (S == '%' && P == Pos)) break;
if (S < ' ')
if (S == Ff)
S = Nl;
else
S = ' ';
Printsymbol(S);
}
if (List <= 0) Pos = 0;
}
if (Pos2 > Pos1) Pos1 = Pos2;
if (Sym != Nl) Newline();
St = Report;
if (N == -3) St = Listing;
for (;;) {
Selectoutput(St);
if (N < 0) {
Printsymbol('?');
Pos1 = 0;
} else
Printsymbol('*');
if (St)
if (List <= 0 && Pos1 != 0) {
Spaces(Pos1 + Margin);
Printstring(_imp_str_literal(" ! "));
} else {
if (Include) Printstring(Includefile);
Write(Lines, 4);
Printsymbol(Csym);
Space();
}
if (-5 <= N && N <= 22) goto *Fm[Fm_sw = (N) - -5];
Printstring(_imp_str_literal("fault"));
Write(N, 2);
goto Ps;
Fm_M5:
Printstring(_imp_str_literal("Dubious statement"));
Dubious = 0;
goto Psd;
Fm_M4:
Printstring(_imp_str_literal("Non-local"));
Pos1 = Forwarn;
Forwarn = 0;
goto Ps;
Fm_M3:
Printident(X, 0);
Printstring(_imp_str_literal(" unused"));
goto Nps;
Fm_M2:
Printstring(_imp_str_literal("\"}\""));
goto Miss;
Fm_M1:
Printstring(_imp_str_literal("access"));
goto Psd;
Fm_0:
Printstring(_imp_str_literal("form"));
goto Ps;
Fm_1:
Printstring(_imp_str_literal("atom"));
goto Ps;
Fm_2:
Printstring(_imp_str_literal("not declared"));
goto Ps;
Fm_3:
Printstring(_imp_str_literal("too complex"));
goto Ps;
Fm_4:
Printstring(_imp_str_literal("duplicate "));
Printident(X, 0);
goto Ps;
Fm_5:
Printstring(_imp_str_literal("type"));
goto Ps;
Fm_6:
Printstring(_imp_str_literal("match"));
goto Psd;
Fm_7:
Printstring(_imp_str_literal("context"));
goto Psd;
Fm_8:
Printstring(_imp_str_literal("%cycle"));
goto Miss;
Fm_9:
Printstring(_imp_str_literal("%start"));
goto Miss;
Fm_10:
Printstring(_imp_str_literal("size"));
if (!Pos1) Write(Lit, 1);
goto Ps;
Fm_11:
Printstring(_imp_str_literal("bounds"));
if (Ocount >= 0) Write(Ocount, 1);
goto Ps;
Fm_12:
Printstring(_imp_str_literal("index"));
goto Ps;
Fm_13:
Printstring(_imp_str_literal("order"));
goto Psd;
Fm_14:
Printstring(_imp_str_literal("not a location"));
goto Ps;
Fm_15:
Printstring(_imp_str_literal("%begin"));
goto Miss;
Fm_16:
Printstring(_imp_str_literal("%end"));
goto Miss;
Fm_17:
Printstring(_imp_str_literal("%repeat"));
goto Miss;
Fm_18:
Printstring(_imp_str_literal("%finish"));
goto Miss;
Fm_19:
Printstring(_imp_str_literal("result"));
goto Miss;
Fm_20:
Printsymbol('"');
Printident(X, 0);
Printsymbol('"');
goto Miss;
Fm_21:
Printstring(_imp_str_literal("context "));
Printident(This, 0);
goto Ps;
Fm_22:
Printstring(_imp_str_literal("format"));
goto Ps;
Miss:
Printstring(_imp_str_literal(" missing"));
goto Nps;
Psd:
Pos1 = 0;
Ps:
Printss();
Nps:
Newline();
if (St == Listing) break;
St = Listing;
}
if (N >= 0) {
if (N != 13) {
Ocount = -1;
Gg = 0;
Copy = 0;
Quote = 0;
Searchbase = 0;
Escapeclass = 0;
Gg = 0;
}
Faulty++;
Faultrate += 3;
if (Faultrate > 30) Abandon(6);
if (Faultrate <= 0) Faultrate = 3;
}
Tbase = Tstart;
if (List <= 0 && Sym != Nl) {
Errormargin = Column;
Errorsym = Sym;
Sym = Nl;
}
}
Dmin--;
Dict[Dmin] = -1;
if (Dmax == Dmin) Abandon(2);
if (List > 0 && Level > 0) {
Write(Lines, 5);
Spaces(Level * 3 - 1);
if (!Blocktag)
Printstring(_imp_str_literal("Begin"));
else {
Printstring(_imp_str_literal("Procedure "));
Printident(Blocktag, 0);
}
Newline();
}
if (Blocktag) {
Analyse();
if (Ss) Compile();
if (Blockotype)
if (!(*Bflags & Spec))
if (Progmode <= 0 && Level == 1)
Progmode = -1;
else
Fault(7);
Newapp = Gapp();
if (Specgiven) {
if (Newapp != *Blockapp) Fault(6);
}
*Blockapp = Newapp;
if (Level < 0) {
Deletenames(0);
return;
}
} else {
Open = 0;
}
for (;;) {
Analyse();
if (Ss) {
Compile();
if (Dubious) Fault(-5);
Flushbuffer(128);
if (Sstype > 0) {
if (Sstype == 2) break;
Compileblock(Specmode, Blockx, Dmin, Tmax, Id);
if (Ss < 0) break;
}
}
}
if (List > 0 && Level > 0) {
Write(Lines, 5);
Spaces(Level * 3 - 1);
Printstring(_imp_str_literal("End"));
Newline();
}
Deletenames(0);
return;
int Gapp(void) {
const int Comma = 140;
auto void Setcell(int G, int Tt);
auto void Class(Tagfm * V);
Tagfm *V;
int P;
int Link;
int Tp;
int C;
int Ap;
int T;
if (Tmax == Local) return (0);
P = Gmax1;
Link = 0;
T = Tmax;
for (;;) {
V = &Tag[T];
T--;
Class(*V);
if (C < 0) {
C = -C;
Setcell(196, Tp);
Tp = -1;
}
Setcell(C, Tp);
if (T == Local) break;
Setcell(Comma, -1);
}
if (Gmax > Gmin) Abandon(3);
return (Link);
void Setcell(int G, int Tt) {
while (P != Gmax) {
P++;
if (Glink[P] == Link && Gram[P] == G)
if (Tt < 0 || (Gram[P + 1] == Tt && Glink[P + 1] == Ap)) {
Link = P;
return;
}
}
Gmax++;
Gram[Gmax] = G;
Glink[Gmax] = Link;
Link = Gmax;
if (Tt >= 0) {
Gmax++;
Gram[Gmax] = Tt;
Glink[Gmax] = Ap;
}
P = Gmax;
}
void Class(Tagfm * V) {
const int Err = 89;
const int Rtp = 100;
const int Fnp = 101;
const int Mapp = 102;
const int Predp = 103;
const int Classmap[16 /*0:15*/] = {
89, 1764, 247, [3 ... 6] = 89, -100, -101, -102, -103, 89, 214,
89, 229, 89};
int Tags;
int Type;
int Form;
Ap = 0;
Tags = V;
Type = Tags >> 4 & 7;
Form = Tags & 15;
Tp = V << 3 | Type;
C = Classmap[Form];
if (Type == 0 && Form == 2) {
C = 208;
Tp = 0;
}
if (Tags & Parameters) Ap = V;
}
}
void Deletenames(int Quiet) {
int Flags;
Tagfm *Tx;
while (Tmax > Tbase) {
X = Tmax;
Tmax--;
Tx = &Tag[X];
Flags = Tx;
if ((Flags & Spec) != 0 && (Flags & Ownbit) == 0) Fault(20);
if ((Flags & Usedbit) == 0 && Level >= 0 && List <= 0) {
if (!Quiet) Fault(-3);
}
Dict[Tx] = Tx;
}
}
void Analyse(void) {
const int Orderbits = 0x3000;
const int Orderbit = 0x1000;
const int Escape = 0x1000;
int Strp;
int Mark;
int Flags;
int Proterr;
int K;
int S;
int C;
static int Key = 0;
int Node;
int *Z;
Arfm *Arp;
static int Act_sw;
static void *Act[21 /*180:200*/] = {
&&Act_default, &&Act_181, &&Act_182, &&Act_183, &&Act_184,
&&Act_185, &&Act_186, &&Act_187, &&Act_188, &&Act_189,
&&Act_190, &&Act_191, &&Act_192, &&Act_193, &&Act_194,
&&Act_195, &&Act_196, &&Act_197, &&Act_198, &&Act_199,
&&Act_default,
};
static int Paction_sw;
static void *Paction[16 /*0:15*/] = {
&&Paction_0, &&Paction_1, &&Paction_2,
&&Paction_3, &&Paction_4, &&Paction_5,
&&Paction_6, &&Paction_7, &&Paction_default,
&&Paction_default, &&Paction_default, &&Paction_default,
&&Paction_default, &&Paction_default, &&Paction_default,
&&Paction_default,
};
void Traceanalysis(void) {
int A;
void Show(int A) {
if (0 < A && A < 130) {
Space();
Printstring(Text[A]);
} else
Write(A, 3);
}
static int La1 = 0;
static int La2 = 0;
static int Lsa = 0;
static int Lt = 0;
if (Monpos != Pos && Sym != Nl) Newline();
Monpos = Pos;
Write(G, 3);
Space();
Printstring(Text[Class]);
if (Gg & Transbit) Printsymbol('"');
A = Gg >> 8 & 15;
if (A) {
Printsymbol('{');
Write(A, 0);
Printsymbol('}');
}
if (Atom1 != La1 || Atom2 != La2 || Lsa != Subatom || Lt != Type) {
Printstring(_imp_str_literal(" ["));
La1 = Atom1;
Show(La1);
La2 = Atom2;
Show(La2);
Lsa = Subatom;
Write(Lsa, 3);
Lt = Type;
Write(Lt, 5);
Printsymbol(']');
}
Newline();
}
void Getsym(void) {
Readsymbol(Sym);
if (Sym < 0) Abandon(5);
if (Pos != 133) Pos++;
Char[Pos] = Sym;
if (List <= 0) Printsymbol(Sym);
Column++;
}
void Readsym(void) {
static int Last = 0;
const unsigned char Mapped[128 /*0:127*/] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, '!', '"', '#', '$', 1, '&',
39, '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'[', '\\', ']', '^', '_', '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 2, '|', '}', '~', 0};
if (Sym == Nl) {
S1:
Lines++;
if (Endmark) Printsymbol(Endmark);
S11:
Pos = 0;
Pos1 = 0;
Pos2 = 0;
Margin = 0;
Column = 0;
Last = 0;
Endmark = 0;
if (List <= 0) {
if (Include) {
Printstring(_imp_str_literal(" &"));
Write(Lines, -4);
} else
Write(Lines, 5);
Csym = Cont;
Printsymbol(Csym);
Space();
if (Errormargin) {
Lines--;
Spaces(Errormargin);
Errormargin = 0;
if (Errorsym) {
Printsymbol(Errorsym);
Pos = 1;
Char[1] = Errorsym;
Sym = Errorsym;
Errorsym = 0;
goto S5;
}
}
}
S2:
Symtype = 1;
}
S3:
Readsymbol(Sym);
if (Sym < 0) Abandon(5);
if (Pos != 133) Pos++;
Char[Pos] = Sym;
if (List <= 0) Printsymbol(Sym);
Column++;
S5:
if (Sym != Nl) {
Last = Sym;
if (Quote) return;
Sym = Mapped[Sym & 127];
if (Sym <= 3) {
if (!Sym) goto S2;
if (Sym == 1) {
Symtype = 2;
goto S3;
}
if (Sym == 3) {
Cont = '+';
goto S11;
}
for (;;) {
Getsym();
if (Sym == '}') goto S3;
if (Sym == Nl) goto S4;
}
}
Key = Kdict[Sym];
if ((Key & 3) == 0 && Symtype == 2)
if (Sym == 'C' && Nextsymbol() == Nl) {
Getsym();
Cont = '+';
goto S1;
} else
Symtype = (Key & 3) - 2;
return;
}
S4:
Symtype = Quote;
if (Last == 0 && Quote == 0) goto S1;
Cont = '+';
}
int Formatselected(void) {
Formatlist = Tag[Format];
if (Formatlist < 0) {
Atom1 = Error + 22;
return (0);
}
if (Sym == '_') {
Escapeclass = Escrec;
Searchbase = Tag[Format];
}
return (1);
}
void Codeatom(int Target) {
int Dbase;
int Da;
int Base;
int N;
int Mul;
int Pendquote;
int J;
int K;
int L;
int Pt;
void Lookup(int D) {
int Newname;
int Vid;
int K1;
int K2;
int Form;
Tagfm *T;
int New;
int Dictmatch(int Ptr1, int Ptr2) {
int Len;
if (Dict[Ptr1] != Dict[Ptr2]) return (0);
Len = Dict[Ptr1] & 255;
Ptr1++;
Ptr2++;
Len--;
while (Len >= 2) {
if (Dict[Ptr1] != Dict[Ptr2]) return (0);
Ptr1++;
Ptr2++;
Len -= 2;
}
if (Len == 1)
if ((Dict[Ptr1] & 255) != (Dict[Ptr2] & 255)) return (0);
return (1);
}
New = Dmax + 1;
K1 = Hashvalue & Maxnames;
for (;;) {
Newname = Hash[K1];
if (!Newname) break;
if (Dictmatch(Newname + 1, New) == 1) goto In;
K1 = (K1 + 1) & Maxnames;
}
Sparenames--;
if (Sparenames <= 0) Abandon(2);
Hash[K1] = Dmax;
Dict[Dmax] = -1;
Newname = Dmax;
Dmax = Dp;
goto Notin;
In:
if (This >= 0 && D != 0) Searchbase = Rbase;
if (Searchbase) {
New = -1;
X = Searchbase;
for (;;) {
if (X < Formatlist) goto Notin;
if (Tag[X] == Newname) break;
X--;
}
} else {
X = Dict[Newname];
if (X <= Limit) goto Notin;
}
Subatom = X;
T = &Tag[X];
Atomflags = T;
Format = T;
App = T;
Protection = Atomflags & Prot;
Type = Atomflags >> 4 & 7;
Atom1 = Amap[Atomflags & 15];
if (Diag & 8) {
Printstring(_imp_str_literal("lookup:"));
Write(Atom1, 3);
Write(Type, 1);
Write(App, 3);
Write(Format, 5);
Write(Atomflags, 3);
Newline();
}
if (!D) {
T = T | Usedbit;
Searchbase = 0;
if ((Atomflags & Subname) != 0 && Format != 0)
if (!Formatselected()) return;
if (Atomflags & Parameters) {
if (!App) {
Atom2 = Atom1;
Atom1 -= 4;
if (97 <= Atom1 && Atom1 <= 98) {
Mapgg = Atom1;
Atom1 = Var;
}
} else if (Sym == '(') {
Searchbase = 0;
if (Atom1 >= 106) {
App = Phrase[App + 200];
Escapeclass = Escarray;
Atom1 = ((Atom1 - 106) >> 1) + 91;
} else {
Escapeclass = Escproc;
Atom1 -= 4;
}
Phrase[200] = App;
}
Pos2 = Pos;
return;
}
if ((Atomflags & Constbit) != 0 && Atom1 == Var) {
Mapgg = Const;
Atom2 = Const;
if (Type == Integer) Subatom = -Subatom;
}
return;
}
if (Tbase != Tstart) goto Notin;
if (D == Lab + Spec + Usedbit) {
T = T | Usedbit;
return;
}
if (Atomflags & Spec) {
if (D == Lab) {
T -= Spec;
return;
}
if (7 <= (Decl & 15) && (Decl & 15) <= 10 && (Decl & Spec) == 0) {
if (!((Decl ^ Atomflags) & 0b1111111)) {
T -= Spec;
Specgiven = 1;
return;
}
}
if ((Decl & 15) == Recfm) {
T = (Record << 4) + Recfm;
T = Fdef;
return;
}
}
if (Last1 == Jump && Atom1 == Swit) return;
if (!Copy) Copy = X;
Notin:
App = 0;
Vid = 0;
Atom1 = Error + 2;
if (!D) return;
Type = D >> 4 & 7;
Form = D & 15;
Atom1 = Amap[Form];
if (This < 0) {
New = Newname;
Tmax++;
X = Tmax;
} else {
New = -1;
Recid--;
Vid = Recid;
Tmin--;
X = Tmin;
Formatlist = Tmin;
}
if (11 <= Form && Form <= 14) {
if (!Dim) Dim = 1;
App = Dim;
}
if ((Otype > 2 && (D & Spec) == 0) || Perm != 0 ||
Level == Includelevel)
D = D | Usedbit;
T = &Tag[X];
if (Form == Lab) {
Id++;
Vid = Id;
}
T = Vid;
T = Newname;
T = D;
T = App;
T = Fdef;
Format = Fdef;
Subatom = X;
if (New >= 0) {
T = Dict[New];
Dict[New] = X;
if (Gmin == Maxgrammar) {
Tmin--;
Subatom = Tmin;
Tag[Tmin] = *T;
}
}
if (Tmax >= Tmin) Abandon(3);
}
Top:
Pos1 = Pos;
Subatom = 0;
Pendquote = 0;
Atomflags = 0;
if (Symtype == -2) goto Name;
if (Symtype < 0) goto Number;
if (!Symtype) {
Atom1 = Termin;
Atom2 = 0;
return;
}
if (Symtype != 2) {
if (Quote) goto Text;
if (Sym == Squote) goto Strings;
if (Sym == Cquote) goto Symbols;
if (Sym == '.' && '0' <= Nextsymbol() && Nextsymbol() <= '9')
goto Number;
}
K = Key >> 2;
Readsym();
for (;;) {
J = Kdict[K];
if (J & 0x4000) break;
if ((J & 127) != Sym || Symtype < 0) {
if (J >= 0) goto Err;
K++;
} else {
L = J >> 7 & 127;
Readsym();
if (J > 0) {
if (L) {
if (L != Sym || Symtype < 0) goto Err;
Readsym();
}
L = 1;
}
K += L;
}
}
Atom1 = J & 127;
if (!Atom1) {
Atom1 = 19;
Subatom = 19;
Atom2 = 0;
if (Sym == Nl) {
if (Ocount >= 0) return;
Readsym();
}
return;
}
Atom2 = J >> 7 & 127;
Subatom = Kdict[K + 1] & 0x3FFF;
return;
Err:
Atom1 = Error + 1;
Atom2 = 0;
if (Pos - Pos1 > 2) Pos1 = Pos;
return;
Symbols:
Atom1 = Var;
Atom2 = Const;
Type = Integer;
Mapgg = Const;
Protection = Prot;
Subatom = Lp;
if (Lp >= Litmax) Abandon(3);
Quote = ~Pendquote;
return;
Chars:
N = 0;
Cont = Cquote;
for (;;) {
Readsym();
if (Sym == Cquote) {
if (Nextsymbol() != Cquote) break;
Readsym();
}
if (N & (~((-1) >> Bytesize))) {
Pos1 = Pos;
Atom1 = Error + 10;
return;
}
if (!Quote) goto Err;
N = (N << Bytesize) + Sym;
Quote++;
}
Quote = 0;
Cont = ' ';
if (Sym != Nl) Readsym();
Litpool[Lp] = N;
Lp++;
goto Top;
Strings:
Atom1 = Var;
Atom2 = Const;
Type = Stringv;
Subatom = Strp | 0x4000;
Mapgg = Const;
Protection = Prot;
Quote = Subatom;
Textline = Lines;
return;
int Flipflop;
Text:
if (Quote < 0) goto Chars;
L = Strp;
K = 0;
Flipflop = 0;
for (;;) {
Cont = Squote;
Quote = 1;
for (;;) {
Readsym();
if (Sym == Squote) {
if (Nextsymbol() != Squote) break;
Readsym();
}
if (Flipflop >= 0) {
Glink[Strp] = (Sym << 8) + Flipflop;
Strp++;
Flipflop = -1;
} else
Flipflop = Sym;
K++;
if (K > 255) {
Lines = Textline;
Abandon(7);
}
}
if (Flipflop >= 0) {
Glink[Strp] = Flipflop;
Strp++;
}
Glink[L] = Glink[L] | K;
Quote = 0;
Cont = ' ';
Readsym();
Codeatom(Target);
if (Atom1 != 48 || Sym != Squote) return;
}
void Get(int Limit) {
int S;
int Shift;
Shift = 0;
if (Base != 10)
if (Base == 16)
Shift = 4;
else if (Base == 8)
Shift = 3;
else if (Base == 2)
Shift = 1;
N = 0;
for (;;) {
if (Symtype == -1)
S = Sym - '0';
else if (Symtype < 0)
S = Sym - 'A' + 10;
else
return;
if (S >= Limit) return;
Pt++;
Glink[Pt] = Sym;
if (Base == 10)
if (N >= Maxint && (S > Maxdig || N > Maxint)) {
Base = 0;
Type = Real;
N = 0;
}
if (!Shift)
N = N * Base + S;
else
N = (N << Shift) + S;
Readsym();
}
}
Number:
Base = 10;
Bxk:
Atom1 = Var;
Atom2 = Const;
Type = Integer;
Subatom = Lp;
Mapgg = Const;
Protection = Prot;
if (Lp >= Litmax) Abandon(3);
Pt = Strp;
Mul = 0;
for (;;) {
Get(Base);
if (Sym != '_' || Base == 0 || Pendquote != 0) break;
Pt++;
Glink[Pt] = '_';
Readsym();
Base = N;
}
if (Pendquote) {
if (Sym != Cquote) goto Err;
Readsym();
}
if (Sym == '.') {
Pt++;
Glink[Pt] = '.';
Readsym();
Type = Real;
N = Base;
Base = 0;
Get(N);
}
if (Sym == '@') {
Pt++;
Glink[Pt] = '@';
K = Pt;
Readsym();
Type = Integer;
Base = 10;
if (Sym == '-') {
Readsym();
Get(10);
N = -N;
} else
Get(10);
Pt = K + 1;
Glink[Pt] = Lp;
Litpool[Lp] = N;
Lp++;
if (!Base) Atom1 = Error + 10;
Type = Real;
}
if (Type == Real) {
Glink[Strp] = Pt - Strp;
Subatom = (Strp) | 0x2000;
Strp = Pt + 1;
} else {
Litpool[Lp] = N;
Lp++;
}
return;
Name:
if (27 <= Target && Target <= 41) {
Atom1 = 0;
return;
}
Hashvalue = 0;
Dp = Dmax + 1;
Dbase = Dp;
N = 0;
Dict[Dp] = 0;
for (;;) {
Hashvalue += Hashvalue + Sym;
Dict[Dp] = Dict[Dp] | (Sym << 8);
N++;
Dp++;
Readsym();
if (Symtype >= 0) break;
Dict[Dp] = Sym;
N++;
Readsym();
if (Symtype >= 0) break;
}
if (Sym == Cquote) {
Pendquote = 100;
if (Hashvalue == 'M') goto Symbols;
Readsym();
if (Hashvalue == 'X') {
Base = 16;
goto Bxk;
}
if (Hashvalue == 'K' || Hashvalue == 'O') {
Base = 8;
goto Bxk;
}
if (Hashvalue == 'B') {
Base = 2;
goto Bxk;
}
goto Err;
}
Dict[Dbase] = Dict[Dbase] | N;
if (!(N & 1)) Dp++;
if (Dp >= Dmin) Abandon(8);
Atom2 = 90;
if (Last1 == 0 && Sym == ':') {
Limit = Local;
Lookup(Lab);
return;
}
if (Last1 == Jump) {
Limit = Local;
Lookup(Lab + Spec + Usedbit);
return;
}
if (Decl != 0 && Target == 90) {
Searchbase = Fmbase;
Limit = Local;
Lookup(Decl);
Searchbase = 0;
} else {
Limit = 0;
Lookup(0);
}
}
int Parsedmachinecode(void) {
if (Symtype != -2) {
Atom1 = Error;
return (0);
}
Flushbuffer(128);
Addchar('w');
do {
Addchar(Sym);
Readsym();
} while (Sym == '_' || Symtype == 0);
Addchar('_');
if (Symtype) {
Readsym();
while (Symtype)
if (Symtype < 0) {
Codeatom(0);
if (Atom1 & Error) return (0);
if (Atom2 == Const && Type == Integer)
if (Subatom < 0)
Setconst(Tag[-Subatom]);
else
Setconst(Litpool[Subatom]);
else if (91 <= Atom1 && Atom1 <= 109) {
if (Atom1 == 104 && (Tag[Subatom] & Closed) == 0) {
This = Subatom;
Atom1 = Error + 21;
return (0);
}
Op(' ', Tag[Subatom]);
} else {
Atom1 = Error;
return (0);
}
} else {
if (Symtype == 2) Sym = Sym | 128;
Addchar(Sym);
Readsym();
}
}
Addchar(';');
return (1);
}
if (!Gg) Cont = ' ';
Last1 = 0;
Mapgg = 0;
S = 0;
Ss = 0;
Sstype = -1;
Fdef = 0;
Fmbase = 0;
App = 0;
Margin = Column;
Pos = 0;
Strp = Gmax + 1;
Lp = 0;
Tbase = Tstart;
Local = Tbase;
if (Gg == 0 || Ocount >= 0) {
Again:
while (!Symtype) {
C = Cont;
Cont = ' ';
if (Ocount >= 0) Cont = '+';
Readsym();
Cont = C;
}
if (Sym == '!') goto Skip;
This = -1;
Codeatom(0);
if (Atom1 == Comment) {
Skip:
Quote = 1;
C = Cont;
while (Sym != Nl) {
Readsym();
Cont = C;
}
Quote = 0;
Symtype = 0;
goto Again;
}
}
Decl = 0;
Mark = 0;
Gentype = 0;
Force = 0;
Dim = 0;
Proterr = 0;
Node = 0;
Nmax = 0;
Nmin = Recsize + 1;
Order = 1;
Gmin = Maxgrammar + 1;
if (Gg) {
Sstype = 0;
goto More;
}
Ptype = 0;
Specgiven = 0;
Stats++;
if (!Perm) Op('O', Lines);
if (Atom1 & Error) goto Fail1;
if (Escapeclass) {
G = Impphrase;
Sstype = -1;
goto A3;
}
G = Initial[Atom1];
if (!G) {
G = Initial[0];
Sstype = 0;
goto A3;
}
if (G < 0) {
G = G & 255;
Nmax = 1;
Ar[1] = 0;
Ar[1] = 0;
Ar[1] = Impphrase;
}
Gg = Gram[G];
Class = Gg & 255;
Sstype = (Gg >> 12 & 3) - 1;
goto A1;
Act_194:
Ptype = Type;
Papp = App;
Pformat = Format;
goto More;
Act_196:
K = G + 1;
goto A610;
Act_188:
K = Ar[Nmax] + 1;
A610:
Papp = Glink[K];
K = Gram[K];
if (!K) goto More;
Ptype = K & 7;
Pformat = K >> 3;
Act_183:
K = Type;
if (Gentype == 0 || K == Real) Gentype = K;
if (Pformat < 0) {
App = Papp;
Format = Pformat;
if (Ptype == Real && Type == Integer) K = Real;
if (Force) {
K = Force;
Force = 0;
}
}
if (Papp != App || (Ptype != K && Ptype != 0)) goto Fail2;
if (Pformat == Format || Pformat == 0 || Format == 0) goto More;
goto Fail2;
Act_197:
Arp = &Ar[Nmin];
K = Arp;
if (Blockform != (K & 15)) goto Fail3;
Arp = K >> 4;
Type = Blocktype;
Ptype = Blocktype;
Pformat = Blockfm;
Papp = App;
if (Ptype != Record) Pformat = -1;
goto More;
Act_195:
if (Type != 0 && Type != Integer && Type != Real) goto Fail2;
Arp = &Ar[Nmin];
K = Arp;
Arp = K >> 2;
K = K & 3;
if (!K) goto More;
if (K == 1) {
Force = Integer;
if (Type == Integer || Type == 0) goto More;
goto Fail2;
}
if (Ptype != Real && Ptype != 0) goto Fail2;
if (K == 3) Force = Integer;
goto More;
Act_198:;
K = Gg >> 8 & 15;
if (!K) {
Atom1 = Last1;
goto More;
}
if (K == 1) {
if (Type != Stringv) goto Fail2;
goto More;
}
if (K == 2) {
if (Type == Record) goto Fail2;
goto More;
}
if (K == 3) {
Codeatom(0);
if (!(Atomflags & Ownbit)) goto A7;
goto More;
}
if (X <= Local) Forwarn = Pos1;
goto More;
Paction_1:
if (Type == Record)
G = Phrase[242];
else
Pformat = -1;
goto A3;
Paction_2:
Ptype = Real;
Pformat = -1;
goto A3;
Paction_3:
Ptype = Stringv;
Pformat = -1;
goto A3;
Paction_4:
Ptype = Integer;
Pformat = -1;
goto A3;
Paction_5:
if (Ptype == Integer) goto A3;
if (Ptype == Real) {
G = Phrase[212];
Pformat = -1;
}
if (Ptype == Stringv) G = Phrase[213];
goto A3;
Paction_6:
Ptype = Gram[Ar[Nmax] + 1] & 7;
Pformat = -1;
goto A3;
Paction_7:
if (Ptype == Integer) Ptype = Real;
Pformat = -1;
goto A3;
A1:
Last1 = Class;
Atom1 = 0;
S = Subatom;
A2:
if (!(Gg & Transbit)) {
Z = &Node;
for (;;) {
K = *Z;
if ((Gg & Orderbits) == 0 || K == 0) break;
Gg -= Orderbit;
Z = &Ar[K];
}
if (Mapgg != 0 && (Gg & 255) == Var) Gg = Mapgg;
Nmin--;
if (Nmin == Nmax) goto Fail0;
*Z = Nmin;
Arp = &Ar[Nmin];
Arp = S;
Arp = (Gg & 255) | Mark;
Arp = K;
}
Mark = 0;
Mapgg = 0;
More:
G = Glink[G];
Paction_0:;
A3:
Gg = Gram[G];
Class = Gg & 255;
if (Diag & 1) Traceanalysis();
if (!Class) goto A5;
if (Class < Actions) {
if (Class >= Figurative) Class = Atomic[Class];
if (Class >= Manifest) goto A2;
if (!Atom1) Codeatom(Class);
if (Escapeclass) {
Class = Escapeclass;
Escapeclass = 0;
G += Escape;
Esc:
Gg = 0;
Arp = &Ar[Nmax + 1];
Arp = Papp;
Arp = X;
goto A4;
}
if (Class == Atom1 || Class == Atom2) goto A1;
A7:
if (Gg >= 0) goto Fail1;
G++;
goto A3;
}
if (Class >= Phrasal) {
A4:
Nmax++;
if (Nmax == Nmin) goto Fail0;
Arp = &Ar[Nmax];
Arp = Ptype;
Arp = Pos1;
Arp = Pformat;
Arp = Gentype;
Arp = Node;
Arp = G;
Node = 0;
G = Phrase[Class];
if (Force) {
Ptype = Force;
Force = 0;
}
Gentype = 0;
goto *Paction[Paction_sw = Gg >> 8 & 15];
}
goto *Act[Act_sw = (Class)-180];
A5:;
S = 0;
while (Node) {
Z = &Ar[Node];
K = *Z;
*Z = S;
S = Node;
Node = K;
}
Ss = S;
A6:
if (Nmax) {
K = Gentype;
Arp = &Ar[Nmax];
Nmax--;
Node = Arp;
Gentype = Arp;
Ptype = Arp;
Pformat = Arp;
G = Arp;
if (G & Escape) {
G -= Escape;
Papp = Arp;
Mark = 255;
Subatom = S;
goto A3;
}
if (Gentype == 0 || K == Real) Gentype = K;
Type = Gentype;
K = Gg;
for (;;) {
Gg = Gram[G];
if (!K) goto A2;
if (Gg >= 0) goto Fail1;
K -= Orderbit;
G++;
}
}
if (Copy) Fault(4);
if (!Order) Fault(13);
if (Forwarn) Fault(-4);
Pos1 = 0;
Faultrate--;
return;
Act_193:
if (Sym != '=' && Sym != '<') {
Gg = 0;
goto A5;
}
Act_181:
Atom1 = Amap[Decl & 15];
goto More;
Act_182:
Class = Escdec;
G = Glink[G] | Escape;
Decl = 0;
Otype = 0;
goto Esc;
Act_199:;
S = 0;
while (Node) {
Z = &Ar[Node];
K = *Z;
*Z = S;
S = Node;
Node = K;
}
Ss = S;
if (Quote) Codeatom(28);
Compile();
if (!(Atom1 & Error)) goto More;
goto Fail1;
Act_184:
if (Type != Integer) goto Fail4;
if (Subatom < 0)
Lit = Tag[-Subatom];
else
Lit = Litpool[Subatom];
if (Lit) goto Fail4;
goto More;
Act_185:;
S = 0;
while (Node) {
Z = &Ar[Node];
K = *Z;
*Z = S;
S = Node;
Node = K;
}
Ss = S;
Atom1 = Ar[S];
Atom2 = 0;
if (Atom1 == 97 || Atom1 == 98) Atom1 = Var;
Arp = &Ar[Nmax];
X = Arp;
Pos1 = Arp;
Pos2 = 0;
App = 0;
Format = Tag[X];
Flags = Tag[X];
Type = Flags >> 4 & 7;
Protection = Flags & Prot;
if (Flags & Aname) Protection = 0;
if ((Flags & Subname) != 0 && Format != 0)
if (!Formatselected()) goto Fail1;
goto A6;
Act_187:
Protection = Prot;
goto More;
Act_186:
if (!(Protection & Prot)) goto More;
Proterr = Nmin;
goto A7;
Act_191:
K = Protection;
Codeatom(0);
if (!(Atomflags & Aname)) Protection = K;
goto More;
Act_192:
if (!Parsedmachinecode()) goto Fail1;
goto More;
Act_189:
K = Gapp();
Deletenames(1);
Tmax = Tbase;
Tbase = Gram[Gmin];
Local = Tbase;
Gmin++;
X = Ar[Ar[Nmax]];
Tag[X] = K;
goto More;
Act_190:
Gmin--;
if (Gmin <= Gmax) Abandon(2);
Gram[Gmin] = Tbase;
Tbase = Tmax;
Local = Tbase;
goto More;
Fail4:
K = Error + 10;
goto Failed;
Fail3:
K = Error + 7;
goto Failed;
Fail2:
K = Error + 5;
Pos2 = 0;
goto Failed;
Fail0:
K = Error + 3;
goto Failed;
Fail1:
K = Atom1;
Pos2 = 0;
Failed:
if (Diag & 32) {
Printstring(_imp_str_literal("Atom1 ="));
Write(Atom1, 3);
Printstring(_imp_str_literal(" Atom2 ="));
Write(Atom2, 3);
Printstring(_imp_str_literal(" subatom ="));
Write(Subatom, 3);
Newline();
Printstring(_imp_str_literal("Type ="));
Write(Type, 1);
Printstring(_imp_str_literal(" Ptype ="));
Write(Ptype, 1);
Newline();
Printstring(_imp_str_literal("App ="));
Write(App, 1);
Printstring(_imp_str_literal(" Papp ="));
Write(Papp, 1);
Newline();
Printstring(_imp_str_literal("Format ="));
Write(Format, 1);
Printstring(_imp_str_literal(" Pformat ="));
Write(Pformat, 1);
Newline();
}
while (Sym != Nl && Sym != ';') {
Quote = 0;
Readsym();
}
if (K & Error)
Fault(K & 255);
else if (Proterr == Nmin)
Fault(14);
else
Fault(0);
Gg = 0;
Ss = 0;
Symtype = 0;
goto Paction_skip;
Paction_default:
fprintf(stderr, "Switch label 'Paction(%d):' not set in %s", Paction_sw,
__PRETTY_FUNCTION__);
exit(1) /* or %signal ... */;
Paction_skip:;
goto Act_skip;
Act_default:
fprintf(stderr, "Switch label 'Act(%d):' not set in %s", Act_sw + 180,
__PRETTY_FUNCTION__);
exit(1) /* or %signal ... */;
Act_skip:;
}
void Compile(void) {
const int Then = 4;
const int Else = 8;
const int Loop = 16;
static int C_sw;
static void *C[181 /*0:180*/] = {
&&C_0, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_27, &&C_28, &&C_29,
&&C_30, &&C_31, &&C_32, &&C_33, &&C_34,
&&C_35, &&C_36, &&C_37, &&C_38, &&C_39,
&&C_default, &&C_41, &&C_42, &&C_43, &&C_44,
&&C_45, &&C_46, &&C_47, &&C_48, &&C_49,
&&C_50, &&C_51, &&C_52, &&C_53, &&C_default,
&&C_55, &&C_56, &&C_57, &&C_58, &&C_59,
&&C_60, &&C_default, &&C_62, &&C_63, &&C_64,
&&C_65, &&C_default, &&C_67, &&C_68, &&C_69,
&&C_70, &&C_71, &&C_72, &&C_default, &&C_74,
&&C_75, &&C_76, &&C_77, &&C_78, &&C_79,
&&C_80, &&C_81, &&C_82, &&C_83, &&C_84,
&&C_85, &&C_86, &&C_87, &&C_88, &&C_89,
&&C_90, &&C_91, &&C_92, &&C_93, &&C_default,
&&C_default, &&C_96, &&C_97, &&C_98, &&C_99,
&&C_100, &&C_101, &&C_102, &&C_103, &&C_104,
&&C_105, &&C_106, &&C_107, &&C_108, &&C_109,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_120, &&C_121, &&C_122, &&C_default, &&C_124,
&&C_125, &&C_126, &&C_127, &&C_128, &&C_default,
&&C_130, &&C_131, &&C_132, &&C_133, &&C_134,
&&C_135, &&C_136, &&C_137, &&C_138, &&C_139,
&&C_140, &&C_141, &&C_142, &&C_143, &&C_144,
&&C_145, &&C_146, &&C_147, &&C_148, &&C_149,
&&C_default, &&C_151, &&C_152, &&C_153, &&C_154,
&&C_155, &&C_156, &&C_157, &&C_158, &&C_159,
&&C_160, &&C_161, &&C_162, &&C_163, &&C_164,
&&C_165, &&C_166, &&C_167, &&C_168, &&C_default,
&&C_170, &&C_171, &&C_172, &&C_173, &&C_174,
&&C_175, &&C_default, &&C_default, &&C_default, &&C_default,
&&C_default,
};
static int Litop_sw;
static void *Litop[12 /*1:12*/] = {
&&Litop_1, &&Litop_2, &&Litop_3, &&Litop_4, &&Litop_5, &&Litop_6,
&&Litop_7, &&Litop_8, &&Litop_9, &&Litop_10, &&Litop_11, &&Litop_12,
};
const unsigned char Operator[14 /*1:14*/] = {
'[', ']', 'X', '/', '&', '!', '%', '+', '-', '*', 'Q', 'x', '.', 'v'};
const unsigned char Cc[8 /*0:7*/] = {'#', '=', ')', '<',
'(', '>', 'k', 't'};
const unsigned char Anyform[16 /*0:15*/] = {1, 0, 1, 1, 1, 1, 1, 1,
0, 1, 1, 0, 1, 1, 1, 1};
const int Decmap[16 /*0:15*/] = {1, 2, 0x100B, 0x100D, 0x140C, 0x140E,
3, 4, 0x1007, 0x1008, 0x1009, 0x100A,
6, 0, 0, 0};
static unsigned char Cnest[16 /*0:15*/];
int Lmode;
int Clab;
int Dupid;
int Resln;
static int Lastdef = 0;
static int Lb;
static int Ub;
int Cp;
int Ord;
int Next;
int Link;
int J;
int K;
int N;
int Done;
int Class;
int Lit2;
int Defs;
int Decs;
int Cident;
int Pending;
static int Pstack[40 /*1:40*/];
static _imp_string Name = _imp_str_literal("");
static int Count = 0;
void Deflab(int L) {
Op(':', L);
Access = 1;
}
void Getnext(void) {
Arfm *P;
Gn:
if (!Next) {
if (!Link) {
Class = 0;
return;
}
P = &Ar[Link];
Next = P;
Link = P;
}
for (;;) {
P = &Ar[Next];
X = P;
Class = P;
if (Class < Actions) break;
if (!X) {
Next = P;
goto Gn;
}
if (P) {
P = Link;
Link = Next;
}
Next = X;
}
Next = P;
if (Diag & 2) {
if (*Length(Name)) Spaces(8 - *Length(Name));
Name = Text[Class];
Write(X, 2);
Space();
Printstring(Name);
Space();
Count--;
if (Count <= 0) {
Count = 5;
Name = _imp_str_literal("");
Newline();
}
}
}
void Setsubs(int N) {
int P;
P = Tmax;
while (N > 0) {
Tag[P] = Dimension;
P--;
N--;
}
}
void Setbp(void) {
Pending -= 2;
Lb = Pstack[Pending + 1];
Ub = Pstack[Pending + 2];
if (Ub - Lb + 1 < 0) {
Pos1 = 0;
Next = Link;
Fault(11);
Ub = Lb;
}
Setconst(Lb);
Setconst(Ub);
if (Class != 146) Addchar('b');
}
void Compileend(int Type) {
if (Access) {
Open = 0;
if (Blockform > Proc) Fault(19);
}
while (Dict[Dmin] >= 0) {
Fault(17 + (Dict[Dmin] & 1));
Dmin++;
}
Addchar(';');
if (Type == 1) Addchar(';');
*Bflags = *Bflags | Open;
if (Blocktag != 0 && Level != 1) Deflab(0);
if (Type != 2) {
if (Level != Type) Fault(16);
} else if (!Level) {
Fault(15);
}
Endmark = 11;
}
void Def(int P) {
int T;
int F;
int Type;
Tagfm *V;
Flushbuffer(1);
Defs++;
V = &Tag[P];
T = 0;
if (V >= 0) {
if (!V) {
Id++;
V = Id;
}
Lastdef = V;
T = Lastdef;
}
Op('$', T);
Printident(P, 1);
T = V;
Type = T;
if ((Type & (7 << 4)) >= 6 << 4) Type = Type & (~(7 << 4));
Op(',', Type & 0b1111111);
F = V;
if ((T & 0x70) == Record << 4) F = Tag[F];
if (F < 0) F = V;
Op(',', F);
F = Otype + (T >> 4 & 0b1111000);
if (Class == 125) F = F | 8;
Dim = V;
if (0 >= Dim || Dim > Dimlimit) Dim = 0;
Op(',', F + (Dim << 8));
if (!(T & Parameters)) Defs = 0;
F = T & 15;
if (V & Spec) {
if (3 > F || F > 10) V = V & (~Spec);
Ocount = -1;
}
Dimension = 0;
if (Otype == 2 && (F == 2 || F == 12 || F == 14)) {
V--;
}
}
void Defslab(int N) {
int P;
int L;
int B;
int W;
int Bit;
P = Tag[X];
L = Dict[P];
if (L <= N && N <= Dict[P + 1]) {
B = N - L;
W = (B >> 4) + P;
Bit = 1 << (B & 15);
if (Dict[W + 2] & Bit) {
if (Pending) Fault(4);
return;
}
if (Pending) Dict[W + 2] = Dict[W + 2] | Bit;
Setconst(N);
Op('_', Tag[X]);
} else
Fault(12);
Access = 1;
}
void Call(void) {
Tagfm *T;
T = &Tag[X];
Op('@', T);
if (T & Closed) Access = 0;
if (!T) Addchar('E');
}
void Popdef(void) {
Setconst(Pstack[Pending]);
Pending--;
}
void Poplit(void) {
if (!Pending)
Lit = 0;
else {
Lit = Pstack[Pending];
Pending--;
}
}
void Push(int X) {
if ((Cnest[Cp] & 2) != X) {
Cnest[Cp] = Cnest[Cp] | 1;
X += 4;
}
if (Cnest[Cp] & 1) Clab++;
Cnest[Cp + 1] = X;
Cp++;
}
void Poplabel(int Mode) {
Lmode = Dict[Dmin];
if (Lmode < 0 || (Lmode & 1) != Mode)
Fault(Mode + 8);
else {
Dmin++;
Label -= 3;
}
}
if (Sstype < 0)
if (!Level) {
Fault(13);
} else if (!Access) {
Access = 1;
Fault(-1);
}
if (Diag & 2) {
if (Sym != Nl) Newline();
Printstring(_imp_str_literal("ss ="));
Write(Ss, 1);
Newline();
Count = 5;
Name = _imp_str_literal("");
}
Next = Ss;
Pending = 0;
Lmode = 0;
Link = 0;
Decs = 0;
Defs = 0;
Resln = 0;
Done = 0;
Ord = Level;
if (This >= 0) Ord = 1;
C_0:;
Top:
if (Next != Link) {
Getnext();
goto *C[C_sw = Class];
}
if ((Diag & 2) != 0 && Count != 5) Newline();
if (Lmode & (Loop | Then | Else)) {
if (Lmode & Loop) Op('B', Label - 1);
if (Lmode & Then) Deflab(Label);
if (Lmode & Else) Deflab(Label - 1);
}
if (!Decs) return;
if (Atom1) {
Atom1 = Error;
return;
}
Order = Ord;
Decl = (Decl & (~15)) + Decmap[Decl & 15];
Atom1 = Atoms[Decl & 15];
if (Otype) {
if (Atom1 != Proc) Atom1++;
if (Otype == 2) {
N = Decl & 15;
if (N & 1) {
Decl = Decl | Prot;
if ((Decl & 0b1111111) == Iform) Decl = Decl | Constbit;
}
} else
Decl = Decl | Ownbit;
}
if (Sstype == 0 && Atom1 == Proc) Sstype = 1;
if (Decl & Spec) Atom1++;
if (Atom1 == 5) {
Ocount = 0;
Cont = '+';
}
if (!Anyform[Decl & 15]) {
if ((Decl >> 4 & 7) == Record) {
if (Tag[Fdef] & Spec) This = Fdef;
if (Fdef == This) Atom1 = Error + 21;
}
if (!Fdef) Atom1 = Error + 10;
}
return;
Atop:
Access = 0;
goto Top;
C_88:;
C_28:
Decl = X & (~7);
Fdef = X & 7;
if ((X & 0b1110001) == (Real << 4) + 1) Fdef = Realsln;
Decs = 1;
goto Top;
C_34:;
C_35:
Otype = X;
Ord = 1;
goto Top;
C_152:
Decl += X << 1;
goto Top;
C_31:;
C_32:
Specmode = Level + 1;
if (X == 9) Decl = Decl | Prot;
C_29:
Ord = 1;
Dim = 0;
C_30:
Decl += X;
Decs = 1;
goto Top;
C_27:
Lit = 0;
if (Pending) {
Poplit();
if (0 >= Lit || Lit > Dimlimit) {
Atom1 = Error + 11;
return;
}
}
Dim = Lit;
Decl += X;
Decs = 1;
goto Top;
C_37:
X = X | Subname;
C_36:
Lit = 0;
if (Pending) {
Poplit();
if (0 >= Lit || Lit > 255) {
Atom1 = Error + 10;
return;
}
}
Fdef = Lit;
C_33:
Decl = X;
Decs = 1;
goto Top;
C_39:
Decl = Decl | Spec;
Ocount = -1;
Specmode = -1;
goto Top;
C_38:
Decl = 64 + 4;
Order = 1;
Atom1 = X;
if (Atom1 == 12) Decl = Decl | Spec;
Fdef = Tmax + 1;
return;
C_175:
Id++;
Tag[X] = Id;
return;
C_41:
Decs = 1;
Decl = X | Spec | Closed;
goto Top;
C_133:
Recid = 0;
Rbase = Tmin - 1;
This = X;
Fmbase = Fdef;
Formatlist = Tmin;
Def(This);
goto Top;
C_148:
if (!Next) {
Fdef = 0;
goto Top;
}
Getnext();
Fdef = X;
goto Top;
C_127:
Addchar('}');
goto Top;
C_126:
Addchar('{');
goto Top;
C_174:
Setbp();
C_171:;
C_172:;
C_173:
Addchar('~');
Addchar(Class - 171 + 'A');
goto Top;
C_168:
Rbase = -Rbase;
Sstype = 0;
Specmode = 0;
C_147:
Searchbase = 0;
Tag[This] = Tmin;
Tag[This] = Rbase;
goto Top;
C_45:
if (X == 36) Addchar('U');
goto Top;
C_46:
Addchar('\\');
goto Top;
C_47:;
C_48:;
C_42:;
C_43:;
C_44:
Addchar(Operator[X]);
goto Top;
C_56:;
C_57:
Push(X);
goto Top;
C_58:
Cnest[Cp] = Cnest[Cp] ^ 2;
goto Top;
C_138:
X = 128 + 32 + 16 + 4;
C_59:;
C_60:
if (Class == 138)
Op('f', Label - 1);
else
Deflab(Label - 1);
C_166:;
C_62:
Lmode = (Lmode & (Else | Loop)) | (X >> 3);
Clab = Label;
Cp = 1;
Cnest[1] = X & 7;
goto Top;
C_72:
Poplabel(0);
if (Lmode & 32) Deflab(Label + 1);
goto Atop;
C_69:
Poplabel(1);
goto Top;
C_163:;
C_70:
Poplabel(1);
if ((Lmode & 3) == 3) Fault(7);
C_68:
Lmode = (Lmode & Else) | 3;
if (Access) {
Op('F', Label - 1);
Lmode = Else | 3;
}
Deflab(Label);
if (Next) goto Top;
C_120:;
C_67:;
C_71:;
Stcy:
if (!Lmode) {
Deflab(Label - 1);
Lmode = Loop;
}
Dmin--;
if (Dmin <= Dmax) Abandon(3);
Dict[Dmin] = Lmode;
Label += 3;
return;
C_64:
if (Dict[Dmin] >= 0 || Inhibit != 0) Fault(13);
Inhibit = 1;
N = 0;
if (!Pending) N = 0xFFFF;
while (Pending > 0) {
Poplit();
if (Lit & (~15)) Fault(10);
J = 1 << Lit;
if (N & J) Dubious = 1;
N = N | J;
}
Op('o', N);
Op(',', Label);
Lmode = Then | 1;
goto Stcy;
C_104:
Op('J', Tag[X]);
Inhibit = 1;
goto Atop;
C_149:
Stats--;
Access = 1;
Inhibit = 1;
Op('L', Tag[X]);
goto Top;
C_63:
J = Dmin;
L = Label - 3;
for (;;) {
if (Dict[J] < 0) {
Fault(7);
goto Top;
}
if (!(Dict[J] & 1)) break;
J++;
L -= 3;
}
if (X == 32) L++;
Op('F', L);
Dict[J] = Dict[J] | X;
goto Atop;
C_50:
Addchar('C');
goto Cop;
C_49:;
if (Next) {
Addchar('"');
Push(0);
} else
Addchar('?');
Cop:
if (Cnest[Cp] & 2) X = X ^ 1;
J = Cp;
L = Clab;
while (!(Cnest[J] & 4)) {
J--;
L -= Cnest[J] & 1;
}
Op(Cc[X], L);
if (Cnest[Cp] & 1) Deflab(Clab + 1);
Cp--;
Clab -= Cnest[Cp] & 1;
goto Top;
C_78:;
C_79:;
C_80:
Open = 0;
C_82:
Access = 0;
C_89:;
C_81:
Addchar(X);
goto Top;
C_65:
Poplit();
Op('e', Lit);
goto Atop;
C_51:
Addchar('S');
goto Top;
C_53:
Addchar('j');
goto Top;
C_52:
Addchar('Z');
goto Top;
C_74:
if (!Level) {
if (Progmode <= 0)
Progmode = 1;
else
Fault(7);
}
Specmode = Level + 1;
Blockx = 0;
Addchar('H');
return;
C_77:
Perm = 0;
Lines = 0;
Stats = 0;
Closeinput();
Selectinput(Source);
List--;
Tbase = Tmax;
Tstart = Tmax;
return;
C_76:
if (Include != 0 && X == 0) {
Lines = Include;
Sstype = 0;
Closeinput();
List = Includelist;
Includelevel = 0;
Include = 0;
Selectinput(Source);
return;
}
Ss = -1;
C_75:
Compileend(X);
return;
C_85:
if (!X)
Control = Lit;
else if ((Lit >> 14 & 3) == 1)
Diag = Lit & 0x3FFF;
Op('z' - X, Lit);
goto Top;
C_83:
List = List + X - 2;
goto Top;
C_84:
Realsln = X;
goto Top;
C_86:
if (Include) {
Fault(7);
return;
}
Getnext();
X -= 0x4000;
J = Glink[X];
K = J & 255;
Includefile = _imp_str_literal("");
for (;;) {
K--;
if (K < 0) break;
Includefile = _imp_join(Includefile, Tostring(J >> 8));
X++;
J = Glink[X];
K--;
if (K < 0) break;
Includefile = _imp_join(Includefile, Tostring(J & 255));
}
{
if (_imp_on_event(9)) Abandon(9);
Openinput(3, Includefile);
}
Include = Lines;
Lines = 0;
Includelist = List;
Includelevel = Level;
Selectinput(3);
goto Top;
C_154:
Dimension++;
if (Dimension == Dimlimit + 1) Fault(11);
goto Top;
C_145:
Setbp();
goto Top;
C_146:
Setbp();
C_142:;
if (!Dimension) Dimension = 1;
Op('d', Dimension);
Op(',', Defs);
if (Class != 146) {
Setsubs(Defs);
if (Dict[Dmin] >= 0 || Inhibit != 0 || Level == 0) Fault(13);
}
Dimension = 0;
Defs = 0;
goto Top;
C_128:
Id = Dupid;
goto Top;
C_130:
Blockx = X;
if ((Decl & Spec) == 0 && Level != 0) Op('F', 0);
C_125:
Dupid = Id;
if (Level < 0) return;
C_90:
Def(X);
goto Top;
C_131:;
if ((Tag[X] & (0b1111111 + Constbit)) == Iform + Constbit)
Tag[X] = Lit;
else {
if (Pending) Setconst(Lit);
Def(X);
Op('A', 1);
}
Cident = X;
goto Top;
C_124:
if (Tag[Cident] & Prot) Dubious = 1;
goto Top;
C_97:;
C_98:;
C_99:;
C_96:
Call();
goto Top;
C_165:;
C_100:;
C_101:;
C_102:;
C_103:;
C_91:;
C_92:;
C_106:;
C_107:;
C_108:;
C_109:;
K = Tag[X];
if (K < 0)
Op('n', -K);
else
Op('@', K);
goto Top;
C_121:
Setconst(0);
goto Top;
C_167:
Addchar('G');
goto Pstr;
C_93:;
if (X < 0) {
Setconst(Tag[-X]);
goto Top;
}
if (X & 0x4000) {
Addchar('\'');
Pstr:
X -= 0x4000;
J = Glink[X];
K = J & 255;
Addchar(K);
for (;;) {
K--;
if (K < 0) goto Top;
Addchar(J >> 8);
X++;
J = Glink[X];
K--;
if (K < 0) goto Top;
Addchar(J & 255);
}
}
if (X & 0x2000) {
X -= 0x2000;
K = Glink[X];
Op('D', K);
Addchar(',');
for (;;) {
if (!K) goto Top;
K--;
X++;
J = Glink[X];
if (J == '@') {
Op('@', Litpool[Glink[X + 1]]);
goto Top;
}
Addchar(J);
}
}
Setconst(Litpool[X]);
goto Top;
C_137:
Addchar('i');
goto Top;
C_141:
Addchar('a');
goto Top;
C_132:
Ocount = Ub - Lb + 1;
Def(X);
Dimension = 1;
Setsubs(1);
if (!Next) {
if (Ocount > 0) Op('A', Ocount);
Ocount = -1;
} else
Getnext();
goto Top;
C_162:
Lit = Ocount;
goto Ins;
C_143:
Poplit();
Ins:
if (Lit < 0) {
Fault(10);
Lit = 0;
}
Getnext();
goto Inst;
C_139:;
C_153:
Lit = 1;
Inst:
if (Pending) Popdef();
Op('A', Lit);
Ocount -= Lit;
if (Ocount >= 0) {
if (X) goto Top;
if (!Ocount) {
Ocount = -1;
return;
}
}
Fault(11);
return;
C_105:
Op('W', Tag[X]);
Inhibit = 1;
goto Atop;
C_134:
Def(X);
N = Ub - Lb + 1;
N = (N + 15) >> 4;
J = Dmax;
Dmax = Dmax + N + 2;
if (Dmax >= Dmin) Abandon(1);
Tag[X] = J;
Dict[J] = Lb;
Dict[J + 1] = Ub;
for (;;) {
N--;
if (N < 0) goto Top;
J++;
Dict[J + 1] = 0;
}
C_151:
Stats--;
if (X < Tbase) {
Fault(7);
return;
}
if (Pending)
Defslab(Pstack[1]);
else {
if (Tag[X]) {
Fault(4);
return;
}
Tag[X] = 1;
N = Tag[X];
for (J = Dict[N]; J <= Dict[N + 1]; J++) {
Defslab(J);
Flushbuffer(128);
}
}
Inhibit = 1;
return;
C_140:
Addchar('p');
goto Top;
C_144:;
Addchar('p');
Addchar('E');
goto Top;
C_155:;
if (X < 0)
Lit = Tag[-X];
else
Lit = Litpool[X];
Pending++;
Pstack[Pending] = Lit;
goto Top;
C_156:
Lit = Pstack[Pending];
if (Lit < 0) Lit = -Lit;
Pstack[Pending] = Lit;
goto Top;
C_157:
Lit = -Pstack[Pending];
Pstack[Pending] = Lit;
goto Top;
C_158:
Lit = ~Pstack[Pending];
Pstack[Pending] = Lit;
goto Top;
C_159:;
C_160:;
C_161:
Pending--;
Lit2 = Pstack[Pending + 1];
Lit = Pstack[Pending];
goto *Litop[Litop_sw = (X >> 2) - 1];
Litop_1:
Lit = Lit << Lit2;
goto Setl;
Litop_2:
Lit = Lit >> Lit2;
goto Setl;
Litop_3:
N = 1;
if (Lit2 < 0) Fault(10);
while (Lit2 > 0) {
Lit2--;
N = N * Lit;
}
Lit = N;
goto Setl;
Litop_4:
if (!Lit2)
Fault(10);
else
Lit = Lit / Lit2;
goto Setl;
Litop_5:
Lit = Lit & Lit2;
goto Setl;
Litop_6:
Lit = Lit | Lit2;
goto Setl;
Litop_7:
Lit = Lit ^ Lit2;
goto Setl;
Litop_8:
Lit += Lit2;
goto Setl;
Litop_9:
Lit -= Lit2;
goto Setl;
Litop_10:
Lit = Lit * Lit2;
goto Setl;
Litop_11:
Lit += Lit2;
goto Setl;
Litop_12:
N = 1;
if (Lit2 < 0) Fault(10);
while (Lit2 > 0) {
Lit2--;
N = N * Lit;
}
Lit = N;
goto Setl;
Setl:
Pstack[Pending] = Lit;
goto Top;
C_170:;
goto Top;
C_135:
Resln = 2;
goto Top;
C_136:
Resln++;
goto Top;
C_55:
Op('r', Resln);
Resln = 0;
goto Top;
C_164:
Op('r', Resln + 4);
Resln = 0;
C_122:
X = 6;
goto Cop;
C_87:
Setconst(Pstack[1]);
Bp++;
Buff[Bp] = 'P';
goto Top;
goto C_skip;
C_default:
fprintf(stderr, "Switch label 'C(%d):' not set in %s", C_sw,
__PRETTY_FUNCTION__);
exit(1) /* or %signal ... */;
C_skip:;
}
}
if (_imp_on_event(9)) Abandon(5);
Selectinput(2);
Selectoutput(Listing);
Tag[Maxtag] = 0;
Tag[0] = 0;
Tag[0] = 7;
for (X = 0; X <= Maxnames; X++) Hash[X] = 0;
Printstring(_imp_str_literal(" Edinburgh IMP77 Compiler - Version "));
Printstring(Version);
Newlines(2);
Op('l', 0);
Compileblock(0, 0, Maxdict, 0, 0);
Addchar(Nl);
Flushbuffer(0);
X = Listing;
Newline();
for (;;) {
if (!Faulty) {
Write(Stats, 5);
Printstring(_imp_str_literal(" Statements compiled"));
} else {
Printstring(_imp_str_literal(" Program contains "));
Write(Faulty, 1);
Printstring(_imp_str_literal(" fault"));
if (Faulty != 1) Printsymbol('s');
}
Newline();
if (!X) break;
X = Report;
Selectoutput(Report);
}
if (Faulty) exit(0);
exit(0);
return (1);
}