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

Defined struct's

addrblock defined in line 284; used 157 times
chain defined in line 119; used 2 times
  • in line 380(2)
constblock defined in line 266; used 72 times
ctlframe defined in line 127; used 14 times
dimblock defined in line 318; used 19 times
entrypoint defined in line 176; used 19 times
equivblock defined in line 359; used 12 times
eqvchain defined in line 371; used 10 times
errorblock defined in line 299; used 12 times
exprblock defined in line 247; used 78 times
extsym defined in line 146; used 52 times
hashentry defined in line 197; used 20 times
impldoblock defined in line 332; used 10 times
intrpacked defined in line 205; used 4 times
labelblock defined in line 161; used 45 times
listblock defined in line 275; used 33 times
literal defined in line 404; used 6 times
nameblock defined in line 212; used 108 times
paramblock defined in line 236; used 4 times
primblock defined in line 186; used 24 times
rplblock defined in line 348; used 15 times

Defined union's

chainedblock defined in line 378; used 1 times
  • in line 29
constant defined in line 259; used 14 times
expression defined in line 306; used 1 times
  • in line 27
taggedblock defined in line 388; used 1 times
  • in line 28

Defined typedef's

tagptr defined in line 28; used 12 times

Defined macros

MAXCTL defined in line 19; used 2 times
MAXEQUIV defined in line 23; used 1 times
MAXEXT defined in line 22; used 2 times
MAXHASH defined in line 20; used 4 times
MAXINCLUDES defined in line 17; used 1 times
MAXLABLIST defined in line 24; used 1 times
MAXLITERALS defined in line 18; used 2 times
MAXSTNO defined in line 21; used 2 times
dobodylabel defined in line 139; used 5 times
doneglabel defined in line 141; used 3 times
doposlabel defined in line 140; used 3 times
elselabel defined in line 138; used 7 times
endlabel defined in line 137; used 14 times
eqvleng defined in line 366; used 2 times

Usage of this include

Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1565
Valid CSS Valid XHTML 1.0 Strict