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
- in line 95-96(2),
130,
326(2),
412(2),
457-458(4)
- in /usr/src/cmd/f77/data.c line
14-15(4),
54(2),
192(2)
- in /usr/src/cmd/f77/exec.c line
274(2),
427(2),
473(2),
551(2)
- in /usr/src/cmd/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/cmd/f77/gram.c line
122(2)
- in /usr/src/cmd/f77/init.c line
55-56(4),
103(2)
- in /usr/src/cmd/f77/intr.c line
375(2),
546-549(4)
- in /usr/src/cmd/f77/io.c line
442(2),
567(2),
778(2)
- in /usr/src/cmd/f77/misc.c line
366-371(4)
- in /usr/src/cmd/f77/pdp11.c line
278(2)
- in /usr/src/cmd/f77/proc.c line
215(2),
253(2),
539(2),
549-554(4),
586(2),
593(2),
624(2)
- in /usr/src/cmd/f77/put.c line
101-104(6),
115-118(6),
132-135(4)
- in /usr/src/cmd/f77/putdmr.c line
95(2),
177(2),
477(2),
528-532(6),
547(2),
570(2),
580-585(6),
736(2),
755-760(6),
873-877(4),
908-912(4),
935(2),
1019-1024(4),
1141(2)
constblock
defined in line
283; used 72 times
- in line 327(2),
355(2),
410(2),
459(2)
- in /usr/src/cmd/f77/data.c line
10(2),
66(2),
194(2)
- in /usr/src/cmd/f77/exec.c line
218(2),
474(2)
- in /usr/src/cmd/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/cmd/f77/gram.c line
123-124(4)
- in /usr/src/cmd/f77/intr.c line
379(2)
- in /usr/src/cmd/f77/io.c line
568(2)
- in /usr/src/cmd/f77/pdp11.c line
284(2)
- in /usr/src/cmd/f77/put.c line
119(2),
133(2)
exprblock
defined in line
264; used 78 times
- in line 325(2),
370(2),
409(2),
456(2)
- in /usr/src/cmd/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/cmd/f77/intr.c line
369(2),
377(2),
587-592(4)
- in /usr/src/cmd/f77/io.c line
425(2),
500-501(4),
548(2)
- in /usr/src/cmd/f77/misc.c line
506-511(4),
520(2),
533(2),
547(2),
561(2),
570(2)
- in /usr/src/cmd/f77/putdmr.c line
545(2),
732-737(4),
820(2),
847(2),
1020-1026(6),
1135-1139(4)
extsym
defined in line
163; used 52 times
- in line 174-176(6),
196(2),
455(2)
- in /usr/src/cmd/f77/expr.c line
681(2),
1121(2)
- in /usr/src/cmd/f77/gram.c line
128(2)
- in /usr/src/cmd/f77/init.c line
80-82(6)
- in /usr/src/cmd/f77/misc.c line
327(2),
333(2),
370(2)
- in /usr/src/cmd/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
178; used 45 times
- in line 61,
189-191(6),
454(2)
- in /usr/src/cmd/f77/exec.c line
99(2),
121(2),
198(2),
471(2),
487(2)
- in /usr/src/cmd/f77/gram.c line
114(2)
- in /usr/src/cmd/f77/init.c line
18(2),
88-90(6),
135(2)
- in /usr/src/cmd/f77/io.c line
179(2),
202(2),
242(2)
- in /usr/src/cmd/f77/misc.c line
293-296(4)
- in /usr/src/cmd/f77/proc.c line
24(2)
- in /usr/src/cmd/f77/putdmr.c line
150(2)
nameblock
defined in line
229; used 108 times
- in line 115,
150,
207,
217,
354(2),
368(2),
407(2),
453(2)
- in /usr/src/cmd/f77/data.c line
59(2)
- in /usr/src/cmd/f77/equiv.c line
17(2),
146(2),
208(2)
- in /usr/src/cmd/f77/error.c line
58(2),
110(2)
- in /usr/src/cmd/f77/exec.c line
164(2),
270(2),
426(2),
470(2)
- in /usr/src/cmd/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/cmd/f77/init.c line
76(2),
132(2)
- in /usr/src/cmd/f77/intr.c line
370(2),
547(2)
- in /usr/src/cmd/f77/io.c line
441(2),
566(2)
- in /usr/src/cmd/f77/misc.c line
255(2),
261(2)
- in /usr/src/cmd/f77/pdp11.c line
282(2),
350(2),
423(2)
- in /usr/src/cmd/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
46; used 56 times
- in line 120-124(3),
142,
448-138(2),
195-197(2),
245,
296,
361,
367,
390
- in /usr/src/cmd/f77/data.c line
296-298(2)
- in /usr/src/cmd/f77/equiv.c line
20,
257
- in /usr/src/cmd/f77/exec.c line
165,
266-271(2)
- in /usr/src/cmd/f77/expr.c line
213,
282,
612,
775-777(2),
1008
- in /usr/src/cmd/f77/gram.c line
1021
- in /usr/src/cmd/f77/init.c line
92-100(4),
136
- in /usr/src/cmd/f77/intr.c line
378,
590
- in /usr/src/cmd/f77/io.c line
423,
436-438(2)
- in /usr/src/cmd/f77/misc.c line
76-79(3),
93,
104-107(2),
394-396(2),
493-495(2),
509,
580
- in /usr/src/cmd/f77/pdp11.c line
281
- in /usr/src/cmd/f77/proc.c line
121,
291,
474,
592
- in /usr/src/cmd/f77/putdmr.c line
1022,
1140
expptr
defined in line
44; used 135 times
- in line 460-152(3),
209-210(2),
235,
258,
269-272(3),
287,
307-309(2),
338-344(5),
356-358(3)
- in /usr/src/cmd/f77/data.c line
62-63(2)
- in /usr/src/cmd/f77/equiv.c line
18
- in /usr/src/cmd/f77/exec.c line
9,
19,
134,
161,
200,
214,
268-269(2),
275,
425,
486,
518,
527
- in /usr/src/cmd/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/cmd/f77/intr.c line
380,
426
- in /usr/src/cmd/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/cmd/f77/misc.c line
523,
536,
550,
564,
612,
634
- in /usr/src/cmd/f77/pdp11.c line
147,
171
- in /usr/src/cmd/f77/proc.c line
476,
551,
589,
626,
809-811(2),
823
- in /usr/src/cmd/f77/put.c line
60,
72,
81,
92
- in /usr/src/cmd/f77/putdmr.c line
62,
123,
134,
148,
175,
334-339(2),
463,
474-476(2),
568,
581,
756,
807,
874,
896,
907,
939,
1261-1263(2)
tagptr
defined in line
45; used 12 times
Defined macros
VL
defined in line
11; used 34 times
- in line 236,
259
- in /usr/src/cmd/f77/error.c line
58,
110
- in /usr/src/cmd/f77/exec.c line
283
- in /usr/src/cmd/f77/expr.c line
704,
910,
1033,
1100,
1111,
1130,
1198
- in /usr/src/cmd/f77/intr.c line
54,
504-508(2),
519-530(4),
553,
576
- in /usr/src/cmd/f77/lex.c line
723-726(3)
- in /usr/src/cmd/f77/misc.c line
263,
272-277(2),
287
- in /usr/src/cmd/f77/pdp11.c line
469
- in /usr/src/cmd/f77/proc.c line
99,
131,
303,
404,
417
Usage of this include