1: #include <stdio.h>
   2: 
   3: #ifdef unix
   4: #	include <ctype.h>
   5: #endif
   6: 
   7: #include "ftypes"
   8: #include "defines"
   9: #include "locdefs"
  10: 
  11: #define VL 6
  12: 
  13: #ifndef OVERLAID
  14:     /*
  15: 	 * Normal Table definitions
  16: 	 */
  17: 
  18: #define MAXINCLUDES 10
  19: #define MAXLITERALS 20
  20: #define MAXCTL 20
  21: #define MAXHASH 401
  22: #define MAXSTNO 301    /*  Increased from 201 PLW 10/80 */
  23: #define MAXEXT 200
  24: #define MAXEQUIV 150
  25: #define MAXLABLIST 125
  26: 
  27: #else
  28: 
  29:     /*
  30: 	 * Smaller table sizes for overlaid compiler
  31: 	 */
  32: 
  33: #define MAXINCLUDES 10
  34: #define MAXLITERALS 10
  35: #define MAXCTL 10
  36: #define MAXHASH 401
  37: #define MAXSTNO 81
  38: #define MAXEXT 80
  39: #define MAXEQUIV 25 /* from 40 */
  40: #define MAXLABLIST 75   /* from 125 */
  41: 
  42: #endif
  43: 
  44: typedef union expression *expptr;
  45: typedef union taggedblock *tagptr;
  46: typedef union chainedblock *chainp;
  47: 
  48: extern FILEP infile;
  49: extern FILEP diagfile;
  50: extern FILEP textfile;
  51: extern FILEP asmfile;
  52: extern FILEP initfile;
  53: extern long int headoffset;
  54: 
  55: extern char token [ ];
  56: extern int toklen;
  57: extern int yylval;
  58: extern int lineno;
  59: extern char *infname;
  60: extern int needkwd;
  61: extern struct labelblock *thislabel;
  62: 
  63: extern flag profileflag;
  64: extern flag optimflag;
  65: extern flag nowarnflag;
  66: extern flag ftn66flag;
  67: extern flag shiftcase;
  68: extern flag undeftype;
  69: extern flag shortsubs;
  70: extern flag onetripflag;
  71: extern flag checksubs;
  72: extern flag debugflag;
  73: extern int nerr;
  74: extern int nwarn;
  75: extern int ndata;
  76: 
  77: extern int parstate;
  78: extern flag headerdone;
  79: extern int blklevel;
  80: extern flag saveall;
  81: extern flag substars;
  82: extern int impltype[ ];
  83: extern int implleng[ ];
  84: extern int implstg[ ];
  85: 
  86: extern int tyint;
  87: extern int tylogical;
  88: extern ftnint typesize[];
  89: extern int typealign[];
  90: extern int procno;
  91: extern int proctype;
  92: extern char * procname;
  93: extern int rtvlabel[ ];
  94: extern int fudgelabel;  /* to confuse the pdp11 optimizer */
  95: extern struct addrblock *typeaddr;
  96: extern struct addrblock *retslot;
  97: extern int cxslot;
  98: extern int chslot;
  99: extern int chlgslot;
 100: extern int procclass;
 101: extern ftnint procleng;
 102: extern int nentry;
 103: extern flag multitype;
 104: extern int blklevel;
 105: extern int lastlabno;
 106: extern int lastvarno;
 107: extern int lastargslot;
 108: extern int argloc;
 109: extern ftnint autoleng;
 110: extern ftnint bssleng;
 111: extern int retlabel;
 112: extern int ret0label;
 113: extern int dorange;
 114: extern int regnum[ ];
 115: extern struct nameblock *regnamep[ ];
 116: extern int maxregvar;
 117: extern int highregvar;
 118: extern int nregvar;
 119: 
 120: extern chainp templist;
 121: extern chainp holdtemps;
 122: extern struct entrypoint *entries;
 123: extern struct rplblock *rpllist;
 124: extern chainp curdtp;
 125: extern ftnint curdtelt;
 126: extern flag toomanyinit;
 127: 
 128: extern flag inioctl;
 129: extern int iostmt;
 130: extern struct addrblock *ioblkp;
 131: extern int nioctl;
 132: extern int nequiv;
 133: extern int nintnames;
 134: extern int nextnames;
 135: 
 136: struct chain
 137:     {
 138:     chainp nextp;
 139:     tagptr datap;
 140:     };
 141: 
 142: extern chainp chains;
 143: 
 144: struct ctlframe
 145:     {
 146:     unsigned ctltype:8;
 147:     unsigned dostepsign:8;
 148:     int ctlabels[4];
 149:     int dolabel;
 150:     struct nameblock *donamep;
 151:     expptr domax;
 152:     expptr dostep;
 153:     };
 154: #define endlabel ctlabels[0]
 155: #define elselabel ctlabels[1]
 156: #define dobodylabel ctlabels[1]
 157: #define doposlabel ctlabels[2]
 158: #define doneglabel ctlabels[3]
 159: extern struct ctlframe ctls[ ];
 160: extern struct ctlframe *ctlstack;
 161: extern struct ctlframe *lastctl;
 162: 
 163: struct extsym
 164:     {
 165:     char extname[XL];
 166:     unsigned extstg:4;
 167:     unsigned extsave:1;
 168:     unsigned extinit:1;
 169:     ptr extp;
 170:     ftnint extleng;
 171:     ftnint maxleng;
 172:     };
 173: 
 174: extern struct extsym extsymtab[ ];
 175: extern struct extsym *nextext;
 176: extern struct extsym *lastext;
 177: 
 178: struct labelblock
 179:     {
 180:     int labelno;
 181:     unsigned blklevel:8;
 182:     unsigned labused:1;
 183:     unsigned labinacc:1;
 184:     unsigned labdefined:1;
 185:     unsigned labtype:2;
 186:     ftnint stateno;
 187:     };
 188: 
 189: extern struct labelblock labeltab[ ];
 190: extern struct labelblock *labtabend;
 191: extern struct labelblock *highlabtab;
 192: 
 193: struct entrypoint
 194:     {
 195:     chainp nextp;
 196:     struct extsym *entryname;
 197:     chainp arglist;
 198:     int entrylabel;
 199:     int typelabel;
 200:     ptr enamep;
 201:     };
 202: 
 203: struct primblock
 204:     {
 205:     unsigned tag:4;
 206:     unsigned vtype:4;
 207:     struct nameblock *namep;
 208:     struct listblock *argsp;
 209:     expptr fcharp;
 210:     expptr lcharp;
 211:     };
 212: 
 213: 
 214: struct hashentry
 215:     {
 216:     int hashval;
 217:     struct nameblock *varp;
 218:     };
 219: extern struct hashentry hashtab[ ];
 220: extern struct hashentry *lasthash;
 221: 
 222: struct intrpacked   /* bits for intrinsic function description */
 223:     {
 224:     unsigned f1:3;
 225:     unsigned f2:4;
 226:     unsigned f3:7;
 227:     };
 228: 
 229: struct nameblock
 230:     {
 231:     unsigned tag:4;
 232:     unsigned vtype:4;
 233:     unsigned vclass:4;
 234:     unsigned vstg:4;
 235:     expptr vleng;
 236:     char varname[VL];
 237:     unsigned vdovar:1;
 238:     unsigned vdcldone:1;
 239:     unsigned vadjdim:1;
 240:     unsigned vsave:1;
 241:     unsigned vprocclass:3;
 242:     unsigned vregno:4;
 243:     union   {
 244:         int varno;
 245:         chainp vstfdesc;    /* points to (formals, expr) pair */
 246:         struct intrpacked intrdesc; /* bits for intrinsic function */
 247:         } vardesc;
 248:     struct dimblock *vdim;
 249:     int voffset;
 250:     };
 251: 
 252: 
 253: struct paramblock
 254:     {
 255:     unsigned tag:4;
 256:     unsigned vtype:4;
 257:     unsigned vclass:4;
 258:     expptr vleng;
 259:     char varname[VL];
 260:     ptr paramval;
 261:     } ;
 262: 
 263: 
 264: struct exprblock
 265:     {
 266:     unsigned tag:4;
 267:     unsigned vtype:4;
 268:     unsigned vclass:4;
 269:     expptr vleng;
 270:     unsigned opcode:6;
 271:     expptr leftp;
 272:     expptr rightp;
 273:     };
 274: 
 275: 
 276: union constant
 277:     {
 278:     char *ccp;
 279:     ftnint ci;
 280:     double cd[2];
 281:     };
 282: 
 283: struct constblock
 284:     {
 285:     unsigned tag:4;
 286:     unsigned vtype:4;
 287:     expptr vleng;
 288:     union constant const;
 289:     };
 290: 
 291: 
 292: struct listblock
 293:     {
 294:     unsigned tag:4;
 295:     unsigned vtype:4;
 296:     chainp listp;
 297:     };
 298: 
 299: 
 300: 
 301: struct addrblock
 302:     {
 303:     unsigned tag:4;
 304:     unsigned vtype:4;
 305:     unsigned vclass:4;
 306:     unsigned vstg:4;
 307:     expptr vleng;
 308:     int memno;
 309:     expptr memoffset;
 310:     unsigned istemp:1;
 311:     unsigned ntempelt:10;
 312:     };
 313: 
 314: 
 315: 
 316: struct errorblock
 317:     {
 318:     unsigned tag:4;
 319:     unsigned vtype:4;
 320:     };
 321: 
 322: 
 323: union expression
 324:     {
 325:     struct exprblock;
 326:     struct addrblock;
 327:     struct constblock;
 328:     struct errorblock;
 329:     struct listblock;
 330:     struct primblock;
 331:     } ;
 332: 
 333: 
 334: 
 335: struct dimblock
 336:     {
 337:     int ndim;
 338:     expptr nelt;
 339:     expptr baseoffset;
 340:     expptr basexpr;
 341:     struct
 342:         {
 343:         expptr dimsize;
 344:         expptr dimexpr;
 345:         } dims[1];
 346:     };
 347: 
 348: 
 349: struct impldoblock
 350:     {
 351:     unsigned tag:4;
 352:     unsigned isactive:1;
 353:     unsigned isbusy:1;
 354:     struct nameblock *varnp;
 355:     struct constblock *varvp;
 356:     expptr implb;
 357:     expptr impub;
 358:     expptr impstep;
 359:     ftnint impdiff;
 360:     ftnint implim;
 361:     chainp datalist;
 362:     };
 363: 
 364: 
 365: struct rplblock /* name replacement block */
 366:     {
 367:     chainp nextp;
 368:     struct nameblock *rplnp;
 369:     ptr rplvp;
 370:     struct exprblock *rplxp;
 371:     int rpltag;
 372:     };
 373: 
 374: 
 375: 
 376: struct equivblock
 377:     {
 378:     ptr equivs;
 379:     unsigned eqvinit:1;
 380:     long int eqvtop;
 381:     long int eqvbottom;
 382:     } ;
 383: #define eqvleng eqvtop
 384: 
 385: extern struct equivblock eqvclass[ ];
 386: 
 387: 
 388: struct eqvchain
 389:     {
 390:     chainp nextp;
 391:     ptr eqvitem;
 392:     long int eqvoffset;
 393:     } ;
 394: 
 395: union chainedblock
 396:     {
 397:     struct chain;
 398:     struct entrypoint;
 399:     struct rplblock;
 400:     struct eqvchain;
 401:     };
 402: 
 403: 
 404: 
 405: union taggedblock
 406:     {
 407:     struct nameblock;
 408:     struct paramblock;
 409:     struct exprblock;
 410:     struct constblock;
 411:     struct listblock;
 412:     struct addrblock;
 413:     struct errorblock;
 414:     struct primblock;
 415:     struct impldoblock;
 416:     } ;
 417: 
 418: 
 419: 
 420: 
 421: struct literal
 422:     {
 423:     short littype;
 424:     short litnum;
 425:     union   {
 426:         ftnint litival;
 427:         double litdval;
 428:         struct  {
 429:             char litclen;   /* small integer */
 430:             char litcstr[XL];
 431:             } litcval;
 432:         } litval;
 433:     };
 434: 
 435: extern struct literal litpool[ ];
 436: extern int nliterals;
 437: 
 438: 
 439: 
 440: 
 441: 
 442: /* popular functions with non integer return values */
 443: 
 444: 
 445: int *ckalloc();
 446: char *varstr(), *nounder(), *varunder();
 447: char *copyn(), *copys();
 448: chainp hookup(), mkchain();
 449: ftnint convci();
 450: char *convic();
 451: char *setdoto();
 452: double convcd();
 453: struct nameblock *mkname();
 454: struct labelblock *mklabel();
 455: struct extsym *mkext(), *newentry();
 456: struct exprblock *addrof(), *call1(), *call2(), *call3(), *call4();
 457: struct addrblock *builtin(), *mktemp(), *mktmpn();
 458: struct addrblock *autovar(), *mklhs(), *mkaddr(), *putconst(), *memversion();
 459: struct constblock *mkintcon();
 460: expptr mkexpr(), mkconv(), mkfunct(), fixexpr(), fixtype();
 461: tagptr cpexpr(), mkprim();
 462: struct errorblock *errnode();

Defined struct's

addrblock defined in line 301; used 157 times
chain defined in line 136; used 2 times
  • in line 397(2)
constblock defined in line 283; used 72 times
ctlframe defined in line 144; used 14 times
dimblock defined in line 335; used 19 times
entrypoint defined in line 193; used 19 times
equivblock defined in line 376; used 14 times
eqvchain defined in line 388; used 10 times
errorblock defined in line 316; used 12 times
exprblock defined in line 264; used 78 times
extsym defined in line 163; used 52 times
hashentry defined in line 214; used 20 times
impldoblock defined in line 349; used 12 times
intrpacked defined in line 222; used 4 times
labelblock defined in line 178; used 45 times
listblock defined in line 292; used 33 times
literal defined in line 421; used 6 times
nameblock defined in line 229; used 108 times
paramblock defined in line 253; used 4 times
primblock defined in line 203; used 24 times
rplblock defined in line 365; used 15 times

Defined union's

chainedblock defined in line 395; used 1 times
  • in line 46
constant defined in line 276; used 14 times
expression defined in line 323; used 1 times
  • in line 44
taggedblock defined in line 405; used 1 times
  • in line 45

Defined typedef's

tagptr defined in line 45; used 12 times

Defined macros

MAXCTL defined in line 35; used 2 times
MAXEQUIV defined in line 39; used 2 times
MAXEXT defined in line 38; used 2 times
MAXHASH defined in line 36; used 4 times
MAXINCLUDES defined in line 33; used 1 times
MAXLABLIST defined in line 40; used 5 times
MAXLITERALS defined in line 34; used 2 times
MAXSTNO defined in line 37; used 2 times
dobodylabel defined in line 156; used 5 times
doneglabel defined in line 158; used 3 times
doposlabel defined in line 157; used 3 times
elselabel defined in line 155; used 7 times
endlabel defined in line 154; used 14 times
eqvleng defined in line 383; used 2 times

Usage of this include

Last modified: 1983-12-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1421
Valid CSS Valid XHTML 1.0 Strict