1: #include "defs"
   2: #include "string_defs"
   3: 
   4: 
   5: FILEP infile    = { stdin };
   6: FILEP diagfile  = { stderr };
   7: 
   8: FILEP textfile;
   9: FILEP asmfile;
  10: FILEP initfile;
  11: long int headoffset;
  12: 
  13: char token[200];
  14: int toklen;
  15: int lineno;
  16: char *infname;
  17: int needkwd;
  18: struct labelblock *thislabel    = NULL;
  19: flag nowarnflag = NO;
  20: flag ftn66flag  = NO;
  21: flag profileflag    = NO;
  22: flag optimflag  = NO;
  23: flag shiftcase  = YES;
  24: flag undeftype  = NO;
  25: flag shortsubs  = YES;
  26: flag onetripflag    = NO;
  27: flag checksubs  = NO;
  28: flag debugflag  = NO;
  29: int nerr;
  30: int nwarn;
  31: int ndata;
  32: 
  33: flag saveall;
  34: flag substars;
  35: int parstate    = OUTSIDE;
  36: flag headerdone = NO;
  37: int blklevel;
  38: int impltype[26];
  39: int implleng[26];
  40: int implstg[26];
  41: 
  42: int tyint   = TYLONG ;       /* Changed from TYSHORT CFS 7/83  */
  43: int tylogical   = TYLONG;
  44: ftnint typesize[NTYPES]
  45:     = { 1, SZADDR, SZSHORT, SZLONG, SZLONG, 2*SZLONG,
  46:         2*SZLONG, 4*SZLONG, SZLONG, 1, 1, 1};
  47: int typealign[NTYPES]
  48:     = { 1, ALIADDR, ALISHORT, ALILONG, ALILONG, ALIDOUBLE,
  49:         ALILONG, ALIDOUBLE, ALILONG, 1, 1, 1};
  50: int procno;
  51: int proctype    = TYUNKNOWN;
  52: char *procname;
  53: int rtvlabel[NTYPES];
  54: int fudgelabel;
  55: struct addrblock *typeaddr;
  56: struct addrblock *retslot;
  57: int cxslot  = -1;
  58: int chslot  = -1;
  59: int chlgslot    = -1;
  60: int procclass   = CLUNKNOWN;
  61: int nentry;
  62: flag multitype;
  63: ftnint procleng;
  64: int lastlabno   = 10;
  65: int lastvarno;
  66: int lastargslot;
  67: int argloc;
  68: ftnint autoleng;
  69: ftnint bssleng  = 0;
  70: int retlabel;
  71: int ret0label;
  72: struct ctlframe ctls[MAXCTL];
  73: struct ctlframe *ctlstack   = ctls-1;
  74: struct ctlframe *lastctl    = ctls+MAXCTL ;
  75: 
  76: struct nameblock *regnamep[MAXREGVAR];
  77: int highregvar;
  78: int nregvar;
  79: 
  80: struct extsym extsymtab[MAXEXT];
  81: struct extsym *nextext  = extsymtab;
  82: struct extsym *lastext  = extsymtab+MAXEXT;
  83: 
  84: struct equivblock eqvclass[MAXEQUIV];
  85: struct hashentry hashtab[MAXHASH];
  86: struct hashentry *lasthash  = hashtab+MAXHASH;
  87: 
  88: struct labelblock labeltab[MAXSTNO];
  89: struct labelblock *labtabend    = labeltab+MAXSTNO;
  90: struct labelblock *highlabtab = labeltab;
  91: struct rplblock *rpllist    = NULL;
  92: chainp curdtp   = NULL;
  93: flag toomanyinit;
  94: ftnint curdtelt;
  95: chainp templist = NULL;
  96: chainp holdtemps    = NULL;
  97: int dorange = 0;
  98: struct entrypoint *entries  = NULL;
  99: 
 100: chainp chains   = NULL;
 101: 
 102: flag inioctl;
 103: struct addrblock *ioblkp;
 104: int iostmt;
 105: int nioctl;
 106: int nequiv  = 0;
 107: int nintnames   = 0;
 108: int nextnames   = 0;
 109: 
 110: struct literal litpool[MAXLITERALS];
 111: int nliterals;
 112: 
 113: 
 114: 
 115: fileinit()
 116: {
 117: procno = 0;
 118: lastlabno = 10;
 119: lastvarno = 0;
 120: nextext = extsymtab;
 121: nliterals = 0;
 122: nerr = 0;
 123: ndata = 0;
 124: }
 125: 
 126: 
 127: 
 128: 
 129: 
 130: procinit()
 131: {
 132: register struct nameblock *p;
 133: register struct dimblock *q;
 134: register struct hashentry *hp;
 135: register struct labelblock *lp;
 136: chainp cp;
 137: int i;
 138: 
 139: pruse(asmfile, USECONST);
 140: #if FAMILY == SCJ
 141:     p2pass(USETEXT);
 142: #endif
 143: parstate = OUTSIDE;
 144: headerdone = NO;
 145: blklevel = 1;
 146: saveall = NO;
 147: substars = NO;
 148: nwarn = 0;
 149: thislabel = NULL;
 150: needkwd = 0;
 151: 
 152: ++procno;
 153: proctype = TYUNKNOWN;
 154: procname = "MAIN     ";
 155: procclass = CLUNKNOWN;
 156: nentry = 0;
 157: multitype = NO;
 158: typeaddr = NULL;
 159: retslot = NULL;
 160: cxslot = -1;
 161: chslot = -1;
 162: chlgslot = -1;
 163: procleng = 0;
 164: blklevel = 1;
 165: lastargslot = 0;
 166: #if TARGET==PDP11
 167:     autoleng = 6;
 168: #else
 169:     autoleng = 0;
 170: #endif
 171: 
 172: for(lp = labeltab ; lp < labtabend ; ++lp)
 173:     lp->stateno = 0;
 174: 
 175: for(hp = hashtab ; hp < lasthash ; ++hp)
 176:     if(p = hp->varp)
 177:         {
 178:         frexpr(p->vleng);
 179:         if(q = p->vdim)
 180:             {
 181:             for(i = 0 ; i < q->ndim ; ++i)
 182:                 {
 183:                 frexpr(q->dims[i].dimsize);
 184:                 frexpr(q->dims[i].dimexpr);
 185:                 }
 186:             frexpr(q->nelt);
 187:             frexpr(q->baseoffset);
 188:             frexpr(q->basexpr);
 189:             free(q);
 190:             }
 191:         free(p);
 192:         hp->varp = NULL;
 193:         }
 194: nintnames = 0;
 195: highlabtab = labeltab;
 196: 
 197: ctlstack = ctls - 1;
 198: for(cp = templist ; cp ; cp = cp->nextp)
 199:     free(cp->datap);
 200: frchain(&templist);
 201: holdtemps = NULL;
 202: dorange = 0;
 203: nregvar = 0;
 204: highregvar = 0;
 205: entries = NULL;
 206: rpllist = NULL;
 207: inioctl = NO;
 208: ioblkp = NULL;
 209: nequiv = 0;
 210: 
 211: for(i = 0 ; i<NTYPES ; ++i)
 212:     rtvlabel[i] = 0;
 213: fudgelabel = 0;
 214: 
 215: if(undeftype)
 216:     setimpl(TYUNKNOWN, (ftnint) 0, 'a', 'z');
 217: else
 218:     {
 219:     setimpl(TYREAL, (ftnint) 0, 'a', 'z');
 220:     setimpl(tyint,  (ftnint) 0, 'i', 'n');
 221:     }
 222: setimpl(-STGBSS, (ftnint) 0, 'a', 'z'); /* set class */
 223: setlog();
 224: }
 225: 
 226: 
 227: 
 228: 
 229: setimpl(type, length, c1, c2)
 230: int type;
 231: ftnint length;
 232: int c1, c2;
 233: {
 234: int i;
 235: char buff[100];
 236: 
 237: if(c1==0 || c2==0)
 238:     return;
 239: 
 240: if(c1 > c2)
 241:     error("characters out of order in implicit:%c-%c", c1, c2,ERR2 );
 242: else
 243:     if(type < 0)
 244:         for(i = c1 ; i<=c2 ; ++i)
 245:             implstg[i-'a'] = - type;
 246:     else
 247:         {
 248:         type = lengtype(type, (int) length);
 249:         if(type != TYCHAR)
 250:             length = 0;
 251:         for(i = c1 ; i<=c2 ; ++i)
 252:             {
 253:             impltype[i-'a'] = type;
 254:             implleng[i-'a'] = length;
 255:             }
 256:         }
 257: }

Defined functions

fileinit defined in line 115; used 1 times
procinit defined in line 130; used 2 times
setimpl defined in line 229; used 6 times

Defined variables

argloc defined in line 67; used 3 times
autoleng defined in line 68; used 13 times
bssleng defined in line 69; used 7 times
chains defined in line 100; used 6 times
checksubs defined in line 27; used 4 times
chlgslot defined in line 59; used 5 times
chslot defined in line 58; used 6 times
ctls defined in line 72; used 9 times
ctlstack defined in line 73; used 85 times
curdtelt defined in line 94; never used
curdtp defined in line 92; never used
cxslot defined in line 57; used 6 times
debugflag defined in line 28; used 3 times
dorange defined in line 97; used 7 times
eqvclass defined in line 84; used 8 times
fudgelabel defined in line 54; used 5 times
headoffset defined in line 11; never used
highlabtab defined in line 90; used 5 times
highregvar defined in line 77; used 6 times
holdtemps defined in line 96; used 6 times
implleng defined in line 39; used 3 times
implstg defined in line 40; used 3 times
impltype defined in line 38; used 3 times
infname defined in line 16; used 12 times
ioblkp defined in line 103; used 10 times
iostmt defined in line 104; used 8 times
labeltab defined in line 88; used 11 times
labtabend defined in line 89; used 4 times
lastargslot defined in line 66; used 7 times
lastctl defined in line 74; used 1 times
lastext defined in line 82; used 1 times
lastlabno defined in line 64; used 3 times
lastvarno defined in line 65; used 3 times
litpool defined in line 110; used 2 times
multitype defined in line 62; used 4 times
ndata defined in line 31; used 2 times
needkwd defined in line 17; used 5 times
nentry defined in line 61; used 7 times
nequiv defined in line 106; used 5 times
nextext defined in line 81; used 15 times
nextnames defined in line 108; never used
nintnames defined in line 107; used 3 times
nioctl defined in line 105; used 4 times
nliterals defined in line 111; used 5 times
nowarnflag defined in line 19; used 3 times
nregvar defined in line 78; used 11 times
nwarn defined in line 30; used 4 times
onetripflag defined in line 26; used 6 times
optimflag defined in line 22; used 1 times
procleng defined in line 63; used 6 times
procname defined in line 52; used 5 times
procno defined in line 50; used 8 times
profileflag defined in line 21; used 4 times
regnamep defined in line 76; used 3 times
ret0label defined in line 71; used 3 times
retlabel defined in line 70; used 7 times
retslot defined in line 56; used 6 times
rpllist defined in line 91; used 15 times
rtvlabel defined in line 53; used 7 times
saveall defined in line 33; used 2 times
shiftcase defined in line 23; used 2 times
shortsubs defined in line 25; used 3 times
substars defined in line 34; used 4 times
templist defined in line 95; used 7 times
thislabel defined in line 18; used 21 times
token defined in line 13; used 16 times
toklen defined in line 14; used 16 times
toomanyinit defined in line 93; never used
typeaddr defined in line 55; used 6 times
undeftype defined in line 24; used 3 times
Last modified: 1988-06-13
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3909
Valid CSS Valid XHTML 1.0 Strict