// BTRNX - Declarations for the BCPL Compiler -- Trans.
// Copyright Xerox Corporation 1980
//  Last modified on Wed 25 Oct 72 0011.19 by  jec.
//  Swinehart, 5-10-77: docase exp
//  Paxton, 9-14-78: unsigned compares

manifest   //  Declarations for AE-Tree Items and OCODE Items.
 [  //  Fri 07 Apr 72 0301.45 for tx2
    NUMBER = 8
    STRINGCONST = 10
    CHARCONST = 11
    TRUE = 12
    FALSE = 13
    NIL = 14
    LV = 15
    RV = 16
    NEG = 17
    NOT = 18
    ULS = 20
    ULE = 21
    UGE = 22
    UGR = 23
    SIZE = 25
    OFFSET = 26
    
    PLUS = 35
    MINUS = 36
    MULT = 37
    DIV = 38
    REM = 39
    LOGAND = 40
    LOGOR = 41
    EQ = 42
    NE = 43
    LS = 44
    LE = 45
    GE = 46
    GR = 47
    EQV = 48
    NEQV = 49
    LSHIFT = 52
    RSHIFT = 53
    VECAP = 54
    RIGHTLUMP = 55
    LEFTLUMP = 56
    COMMA = 58
    COND = 59
    ASS = 60
    NUMARGS = 61
    TABLE = 65
    VALOF = 67
    RESULTIS = 68
    STATIC = 72
    EXT = 73
    MANIFEST = 74
    ENDSTATIC = 75
    STRUCTURE = 77
    LET = 78
    AND = 79
    VALDEF = 80
    CONSTDEF = 81
    FNDEF = 82
    RTDEF = 83
    VEC = 85
    FNAP = 86
    RTAP = 87
    END = 89
    SEQ = 90
    GOTO = 91
    COLON = 92
    TEST = 93
    IF = 98
    UNLESS = 99
    UNTIL = 100
    WHILE = 101
    REPEAT = 102
    REPEATUNTIL = 103
    REPEATWHILE = 104
    FOR = 105
    SWITCHON = 108 
    CASE = 111
    CASETO = 112
    DEFAULT = 113
    ENDCASE = 114
    LINE = 115
    BREAK = 116
    LOOP = 117
    RETURN = 118
    FINISH = 119
    ABORT = 120
    PLINE = 121
    NEWLOCAL = 122

///*DCS* conditional compilation
    COMPILEIF = 130
    COMPILETEST = 131
    DOCASE = 132

    STIND = 135
    STORE = 136
    FNRN = 137
    RTRN = 138
    LZ = 139
    LLZ = 140
    SZ = 141
    SWITCHLOAD = 142 // Load SWITCHON index 5-11-77
    ZEXT = 143
    ZINT = 144
    LP = 147
    LN = 148
    LLP = 149
    LLVP = 150
    STVECAP = 151
    SP = 153
    STACK = 154
    RSTACK = 155
    SAVE = 156
    ITEMN = 158
    FRAME = 159
    ENDFRAME = 160
    PARAM = 162
    RTCALL = 163
    FNCALL = 164
    LENTRY = 165
    LC = 166
    DECL = 167
    LVRV = 168
    LL = 169
    LLL = 170
    ZLOC = 171
    WSUB = 172
    BSUB = 173
    SL = 177
    JUMP = 178
    JT = 179
    JF = 180
    RES = 181
    ITEML = 182
    ITEMNL = 183
    LAB = 184
    LOC = 185
    LSTR = 186
    INT = 187
    ENTRY = 188
    BLOCK = 189
    NQUAL = 190
    WQUAL = 191
    XQUAL = 192
    WBQUAL = 193
    MWQUAL = 194
    MWBQUAL = 195
    STWQUAL = 196
    STXQUAL = 197
    STWBQUAL = 198
    STNQUAL = 199
    YQUAL = 200
    STYQUAL = 201
  ]

get "bcplx"		//  Compiler library declarations.

manifest   //  Various parameters.
 [  CaseN = 3		//  Size of case table entry
    CaseMax = 150	//  Max number of cases at a time
    CaseT = CaseMax * CaseN	//  Case table.
  ]

external
 [  //  Scalars in CAE0.B
    ZERONODE; ERRORNAME; ERRORNODE

    //  Scalars in TRN0.B
    FrameLevel
    Casetable; CaseB; CaseP
    RoutineBody; ValofBlock; SwitchBlock; RepeatBlock
    Breaklabel; Resultlabel; Defaultlabel; Endcaselabel; Looplabel
    SSP; VecSSP; MaxSSP; MaxVecSSP; Docaselabel

    //  Functions and routines in TRN
    TRNreport
    CheckSSP; CheckVecSSP

    Trans

    TransLET
    ListLength

    Jumpcond

    Transswitch; Transcall; Assign

    Load; LoadLV

    GetConst; CheckConst

    Complab; Compentry; Complentry; Compjump
    Out1; Out2; Out2P; Out3P; OutN; OutL; OutC

    DoQual; OutQual

  ]
manifest
 [  NameBit = #100000
    NameMask = #7777
    TypeMask = #170000
    PtrMask = #77777
    LOCAL = #010000
    CONSTANT = #020000
    LABEL = #030000
    ZLABEL = #040000
    EXTLABEL = #050000
    ZEXTLABEL = #060000
    INTLABEL = #070000
    ZINTLABEL = #100000
  ]