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
- in line 78-79(2),
113,
309(2),
395(2),
440-441(4)
- in /usr/src/usr.bin/f77/data.c line
14-15(4),
54(2),
192(2)
- in /usr/src/usr.bin/f77/exec.c line
274(2),
427(2),
473(2),
551(2)
- in /usr/src/usr.bin/f77/expr.c line
221(2),
616(2),
650(2),
680(2),
853-856(4),
949-952(4),
1118-1123(6),
1173(2),
1225(2)
- in /usr/src/usr.bin/f77/gram.head line
24(2)
- in /usr/src/usr.bin/f77/init.c line
55-56(4),
103(2)
- in /usr/src/usr.bin/f77/intr.c line
377(2),
548-551(4)
- in /usr/src/usr.bin/f77/io.c line
442(2),
567(2),
778(2)
- in /usr/src/usr.bin/f77/misc.c line
366-371(4)
- in /usr/src/usr.bin/f77/pdp11.c line
303(2)
- in /usr/src/usr.bin/f77/proc.c line
215(2),
253(2),
539(2),
549-554(4),
586(2),
593(2),
624(2)
- in /usr/src/usr.bin/f77/put.c line
101-104(6),
115-118(6),
132-135(4)
- in /usr/src/usr.bin/f77/putdmr.c line
110(2),
192(2),
492(2),
543-547(6),
562(2),
585(2),
595-600(6),
751(2),
770-775(6),
888-892(4),
923-927(4),
950(2),
1034-1039(4),
1156(2)
constblock
defined in line
266; used 72 times
- in line 310(2),
338(2),
393(2),
442(2)
- in /usr/src/usr.bin/f77/data.c line
10(2),
66(2),
194(2)
- in /usr/src/usr.bin/f77/exec.c line
218(2),
474(2)
- in /usr/src/usr.bin/f77/expr.c line
6-9(4),
18-21(4),
30-33(4),
46-49(4),
58-62(4),
70-75(4),
89-93(4),
105-109(4),
219(2),
1656(2),
1845(2),
1871(2)
- in /usr/src/usr.bin/f77/gram.head line
25-26(4)
- in /usr/src/usr.bin/f77/intr.c line
381(2)
- in /usr/src/usr.bin/f77/io.c line
568(2)
- in /usr/src/usr.bin/f77/pdp11.c line
310(2)
- in /usr/src/usr.bin/f77/put.c line
119(2),
133(2)
exprblock
defined in line
247; used 78 times
- in line 308(2),
353(2),
392(2),
439(2)
- in /usr/src/usr.bin/f77/expr.c line
200(2),
220(2),
385(2),
683-684(4),
771(2),
779(2),
1314(2),
1654(2),
2106(2)
- in /usr/src/usr.bin/f77/intr.c line
371(2),
379(2),
589-594(4)
- in /usr/src/usr.bin/f77/io.c line
425(2),
500-501(4),
548(2)
- in /usr/src/usr.bin/f77/misc.c line
506-511(4),
520(2),
533(2),
547(2),
561(2),
570(2)
- in /usr/src/usr.bin/f77/putdmr.c line
560(2),
747-752(4),
835(2),
862(2),
1035-1041(6),
1150-1154(4)
extsym
defined in line
146; used 52 times
- in line 157-159(6),
179(2),
438(2)
- in /usr/src/usr.bin/f77/expr.c line
681(2),
1121(2)
- in /usr/src/usr.bin/f77/gram.head line
30(2)
- in /usr/src/usr.bin/f77/init.c line
80-82(6)
- in /usr/src/usr.bin/f77/misc.c line
327(2),
333(2),
370(2)
- in /usr/src/usr.bin/f77/proc.c line
67(2),
93-97(6),
120(2),
394(2),
443(2),
473(2),
518(2),
633-637(4),
658(2)
labelblock
defined in line
161; used 45 times
- in line 44,
172-174(6),
437(2)
- in /usr/src/usr.bin/f77/exec.c line
99(2),
121(2),
198(2),
471(2),
487(2)
- in /usr/src/usr.bin/f77/gram.head line
16(2)
- in /usr/src/usr.bin/f77/init.c line
18(2),
88-90(6),
135(2)
- in /usr/src/usr.bin/f77/io.c line
179(2),
202(2),
242(2)
- in /usr/src/usr.bin/f77/misc.c line
293-296(4)
- in /usr/src/usr.bin/f77/proc.c line
24(2)
- in /usr/src/usr.bin/f77/putdmr.c line
165(2)
nameblock
defined in line
212; used 108 times
- in line 98,
133,
190,
200,
337(2),
351(2),
390(2),
436(2)
- in /usr/src/usr.bin/f77/data.c line
59(2)
- in /usr/src/usr.bin/f77/equiv.c line
18(2),
147(2),
209(2)
- in /usr/src/usr.bin/f77/error.c line
64(2),
120(2)
- in /usr/src/usr.bin/f77/exec.c line
164(2),
270(2),
426(2),
470(2)
- in /usr/src/usr.bin/f77/expr.c line
218(2),
648(2),
682(2),
772(2),
858(2),
935(2),
950(2),
965(2),
979(2),
1013(2),
1065(2),
1119(2),
1188(2),
1221(2),
1271(2)
- in /usr/src/usr.bin/f77/init.c line
76(2),
132(2)
- in /usr/src/usr.bin/f77/intr.c line
372(2),
549(2)
- in /usr/src/usr.bin/f77/io.c line
441(2),
566(2)
- in /usr/src/usr.bin/f77/misc.c line
255(2),
261(2)
- in /usr/src/usr.bin/f77/pdp11.c line
307(2),
386(2),
462(2)
- in /usr/src/usr.bin/f77/proc.c line
94(2),
123(2),
290-292(4),
390(2),
453(2),
477(2),
659(2),
674(2),
765(2),
788(2),
807(2)
Defined union's
Defined typedef's
chainp
defined in line
29; used 55 times
- in line 103-107(3),
125,
431-121(2),
178-180(2),
228,
279,
344,
350,
373
- in /usr/src/usr.bin/f77/data.c line
296-298(2)
- in /usr/src/usr.bin/f77/equiv.c line
21,
258
- in /usr/src/usr.bin/f77/exec.c line
165,
266-271(2)
- in /usr/src/usr.bin/f77/expr.c line
213,
282,
612,
775-777(2),
1008
- in /usr/src/usr.bin/f77/init.c line
92-100(4),
136
- in /usr/src/usr.bin/f77/intr.c line
380,
592
- in /usr/src/usr.bin/f77/io.c line
423,
436-438(2)
- in /usr/src/usr.bin/f77/misc.c line
76-79(3),
93,
104-107(2),
394-396(2),
493-495(2),
509,
580
- in /usr/src/usr.bin/f77/pdp11.c line
306
- in /usr/src/usr.bin/f77/proc.c line
121,
291,
474,
592
- in /usr/src/usr.bin/f77/putdmr.c line
1037,
1155
expptr
defined in line
27; used 135 times
- in line 443-135(3),
192-193(2),
218,
241,
252-255(3),
270,
290-292(2),
321-327(5),
339-341(3)
- in /usr/src/usr.bin/f77/data.c line
62-63(2)
- in /usr/src/usr.bin/f77/equiv.c line
19
- in /usr/src/usr.bin/f77/exec.c line
9,
19,
134,
161,
200,
214,
268-269(2),
275,
425,
486,
518,
527
- in /usr/src/usr.bin/f77/expr.c line
106,
149-155(4),
187-191(3),
201,
341,
384-391(5),
545-548(3),
676,
780,
857,
1003-1012(5),
1064-1069(3),
1190,
1226,
1310-1312(2),
1318,
1653-1660(3),
2073,
2105-2108(2)
- in /usr/src/usr.bin/f77/intr.c line
382,
428
- in /usr/src/usr.bin/f77/io.c line
39,
53,
231,
241,
378,
440,
496-497(2),
565,
680,
713,
728,
761,
776,
791,
806,
823
- in /usr/src/usr.bin/f77/misc.c line
523,
536,
550,
564,
612,
634
- in /usr/src/usr.bin/f77/pdp11.c line
154,
184
- in /usr/src/usr.bin/f77/proc.c line
476,
551,
589,
626,
809-811(2),
823
- in /usr/src/usr.bin/f77/put.c line
60,
72,
81,
92
- in /usr/src/usr.bin/f77/putdmr.c line
77,
138,
149,
163,
190,
349-354(2),
478,
489-491(2),
583,
596,
771,
822,
889,
911,
922,
954,
1276-1278(2)
tagptr
defined in line
28; used 12 times
Defined macros
VL
defined in line
11; used 34 times
- in line 219,
242
- in /usr/src/usr.bin/f77/error.c line
64,
120
- in /usr/src/usr.bin/f77/exec.c line
283
- in /usr/src/usr.bin/f77/expr.c line
704,
910,
1033,
1100,
1111,
1130,
1198
- in /usr/src/usr.bin/f77/intr.c line
54,
506-510(2),
521-532(4),
555,
578
- in /usr/src/usr.bin/f77/lex.c line
723-726(3)
- in /usr/src/usr.bin/f77/misc.c line
263,
272-277(2),
287
- in /usr/src/usr.bin/f77/pdp11.c line
508
- in /usr/src/usr.bin/f77/proc.c line
99,
131,
303,
404,
417
Usage of this include