| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#include <stdio.h> |
| 36 |
|
| 37 |
#ifdef FCOM |
| 38 |
#include "pass2.h" |
| 39 |
#endif |
| 40 |
#include "ftypes.h" |
| 41 |
|
| 42 |
#define INTERDATA 2 |
| 43 |
#define GCOS 3 |
| 44 |
#define PDP11 4 |
| 45 |
#define IBM 5 |
| 46 |
#define CMACH 6 |
| 47 |
#define VAX 7 |
| 48 |
|
| 49 |
#define DMR 2 |
| 50 |
#define SCJ 3 |
| 51 |
|
| 52 |
#define BINARY 2 |
| 53 |
#define ASCII 3 |
| 54 |
|
| 55 |
#define PREFIX 2 |
| 56 |
#define POSTFIX 3 |
| 57 |
|
| 58 |
#define M(x) (1<<x) |
| 59 |
#define ALLOC(x) ckalloc(sizeof(struct x)) |
| 60 |
#define BALLO() (bigptr)ckalloc(sizeof(struct bigblock)) |
| 61 |
typedef void *ptr; |
| 62 |
typedef FILE *FILEP; |
| 63 |
typedef short flag; |
| 64 |
typedef long int ftnint; |
| 65 |
#define LOCAL static |
| 66 |
|
| 67 |
#define NO 0 |
| 68 |
#define YES 1 |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
#define TNAME 1 |
| 75 |
#define TCONST 2 |
| 76 |
#define TEXPR 3 |
| 77 |
#define TADDR 4 |
| 78 |
#define TPRIM 5 |
| 79 |
#define TLIST 6 |
| 80 |
#define TIMPLDO 7 |
| 81 |
#define TERROR 8 |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
#define OUTSIDE 0 |
| 87 |
#define INSIDE 1 |
| 88 |
#define INDCL 2 |
| 89 |
#define INDATA 3 |
| 90 |
#define INEXEC 4 |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
#define PROCMAIN 1 |
| 95 |
#define PROCBLOCK 2 |
| 96 |
#define PROCSUBR 3 |
| 97 |
#define PROCFUNCT 4 |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
#define STGUNKNOWN 0 |
| 103 |
#define STGARG 1 |
| 104 |
#define STGAUTO 2 |
| 105 |
#define STGBSS 3 |
| 106 |
#define STGINIT 4 |
| 107 |
#define STGCONST 5 |
| 108 |
#define STGEXT 6 |
| 109 |
#define STGINTR 7 |
| 110 |
#define STGSTFUNCT 8 |
| 111 |
#define STGCOMMON 9 |
| 112 |
#define STGEQUIV 10 |
| 113 |
#define STGREG 11 |
| 114 |
#define STGLENG 12 |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
#define CLUNKNOWN 0 |
| 119 |
#define CLPARAM 1 |
| 120 |
#define CLVAR 2 |
| 121 |
#define CLENTRY 3 |
| 122 |
#define CLMAIN 4 |
| 123 |
#define CLBLOCK 5 |
| 124 |
#define CLPROC 6 |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
#define PUNKNOWN 0 |
| 130 |
#define PEXTERNAL 1 |
| 131 |
#define PINTRINSIC 2 |
| 132 |
#define PSTFUNCT 3 |
| 133 |
#define PTHISPROC 4 |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
#define CTLDO 1 |
| 138 |
#define CTLIF 2 |
| 139 |
#define CTLELSE 3 |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
#define OPPLUS 1 |
| 145 |
#define OPMINUS 2 |
| 146 |
#define OPSTAR 3 |
| 147 |
#define OPSLASH 4 |
| 148 |
#define OPPOWER 5 |
| 149 |
#define OPNEG 6 |
| 150 |
#define OPOR 7 |
| 151 |
#define OPAND 8 |
| 152 |
#define OPEQV 9 |
| 153 |
#define OPNEQV 10 |
| 154 |
#define OPNOT 11 |
| 155 |
#define OPCONCAT 12 |
| 156 |
#define OPLT 13 |
| 157 |
#define OPEQ 14 |
| 158 |
#define OPGT 15 |
| 159 |
#define OPLE 16 |
| 160 |
#define OPNE 17 |
| 161 |
#define OPGE 18 |
| 162 |
#define OPCALL 19 |
| 163 |
#define OPCCALL 20 |
| 164 |
#define OPASSIGN 21 |
| 165 |
|
| 166 |
|
| 167 |
#define OPCONV 24 |
| 168 |
#define OPLSHIFT 25 |
| 169 |
#define OPMOD 26 |
| 170 |
#define OPCOMMA 27 |
| 171 |
|
| 172 |
|
| 173 |
#define OPABS 30 |
| 174 |
#define OPMIN 31 |
| 175 |
#define OPMAX 32 |
| 176 |
#define OPADDR 33 |
| 177 |
#define OPINDIRECT 34 |
| 178 |
#define OPBITOR 35 |
| 179 |
#define OPBITAND 36 |
| 180 |
#define OPBITXOR 37 |
| 181 |
#define OPBITNOT 38 |
| 182 |
#define OPRSHIFT 39 |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
#define REGARG 1 |
| 188 |
#define REGAUTO 2 |
| 189 |
#define REGBSS 3 |
| 190 |
#define REGINIT 4 |
| 191 |
#define REGCONST 5 |
| 192 |
#define REGEXT 6 |
| 193 |
#define REGPROG 7 |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
#define LABUNKNOWN 0 |
| 198 |
#define LABEXEC 1 |
| 199 |
#define LABFORMAT 2 |
| 200 |
#define LABOTHER 3 |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
#define INTREND 0 |
| 206 |
#define INTRCONV 1 |
| 207 |
#define INTRMIN 2 |
| 208 |
#define INTRMAX 3 |
| 209 |
#define INTRGEN 4 |
| 210 |
#define INTRSPEC 5 |
| 211 |
#define INTRBOOL 6 |
| 212 |
#define INTRCNST 7 |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
#define IOSTDIN MKICON(5) |
| 218 |
#define IOSTDOUT MKICON(6) |
| 219 |
|
| 220 |
#define IOSBAD (-1) |
| 221 |
#define IOSPOSITIONAL 0 |
| 222 |
#define IOSUNIT 1 |
| 223 |
#define IOSFMT 2 |
| 224 |
|
| 225 |
#define IOINQUIRE 1 |
| 226 |
#define IOOPEN 2 |
| 227 |
#define IOCLOSE 3 |
| 228 |
#define IOREWIND 4 |
| 229 |
#define IOBACKSPACE 5 |
| 230 |
#define IOENDFILE 6 |
| 231 |
#define IOREAD 7 |
| 232 |
#define IOWRITE 8 |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
#define MSKLOGICAL M(TYLOGICAL) |
| 238 |
#define MSKADDR M(TYADDR) |
| 239 |
#define MSKCHAR M(TYCHAR) |
| 240 |
#define MSKINT M(TYSHORT)|M(TYLONG) |
| 241 |
#define MSKREAL M(TYREAL)|M(TYDREAL) |
| 242 |
#define MSKCOMPLEX M(TYCOMPLEX)|M(TYDCOMPLEX) |
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
#define ONEOF(x,y) (M(x) & (y)) |
| 247 |
#define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX) |
| 248 |
#define ISREAL(z) ONEOF(z, MSKREAL) |
| 249 |
#define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX) |
| 250 |
#define ISICON(z) (z->tag==TCONST && ISINT(z->vtype)) |
| 251 |
#define ISCHAR(z) (z->vtype==TYCHAR) |
| 252 |
#define ISINT(z) ONEOF(z, MSKINT) |
| 253 |
#define ISCONST(z) (z->tag==TCONST) |
| 254 |
#define ISERROR(z) (z->tag==TERROR) |
| 255 |
#define ISPLUSOP(z) (z->tag==TEXPR && z->b_expr.opcode==OPPLUS) |
| 256 |
#define ISSTAROP(z) (z->tag==TEXPR && z->b_expr.opcode==OPSTAR) |
| 257 |
#define ISONE(z) (ISICON(z) && z->b_const.fconst.ci==1) |
| 258 |
|
| 259 |
#define MKICON(z) mkintcon( (ftnint)(z) ) |
| 260 |
#define CHCON(z) mkstrcon(strlen(z), z) |
| 261 |
|
| 262 |
|
| 263 |
#define roundup(a,b) ( b * ( (a+b-1)/b) ) |
| 264 |
|
| 265 |
|
| 266 |
void prchars(int *); |
| 267 |
|