Commit | Line | Data |
---|---|---|
72d5e2a4 BJ |
1 | # include "mfile1" |
2 | ||
3 | /* communication between lexical routines */ | |
4 | ||
5 | char ftitle[100] = ""; /* title of the file */ | |
6 | char ititle[100] = ""; /* title of initial file */ | |
7 | int lineno; /* line number of the input file */ | |
8 | ||
9 | CONSZ lastcon; /* the last constant read by the lexical analyzer */ | |
10 | double dcon; /* the last double read by the lexical analyzer */ | |
11 | ||
12 | ||
13 | /* symbol table maintainence */ | |
14 | ||
15 | struct symtab stab[SYMTSZ+1]; /* one extra slot for scratch */ | |
16 | ||
17 | int curftn; /* "current" function */ | |
18 | int ftnno; /* "current" function number */ | |
19 | ||
20 | int curclass, /* current storage class */ | |
21 | instruct, /* "in structure" flag */ | |
22 | stwart, /* for accessing names which are structure members or names */ | |
23 | blevel, /* block level: 0 for extern, 1 for ftn args, >=2 inside function */ | |
24 | curdim; /* current offset into the dimension table */ | |
25 | ||
26 | int dimtab[ DIMTABSZ ]; | |
27 | ||
28 | int paramstk[ PARAMSZ ]; /* used in the definition of function parameters */ | |
29 | int paramno; /* the number of parameters */ | |
30 | int autooff, /* the next unused automatic offset */ | |
31 | argoff, /* the next unused argument offset */ | |
32 | strucoff; /* the next structure offset position */ | |
33 | int regvar; /* the next free register for register variables */ | |
34 | int minrvar; /* the smallest that regvar gets witing a function */ | |
35 | OFFSZ inoff; /* offset of external element being initialized */ | |
36 | int brkflag = 0; /* complain about break statements not reached */ | |
37 | ||
38 | struct sw swtab[SWITSZ]; /* table for cases within a switch */ | |
39 | struct sw *swp; /* pointer to next free entry in swtab */ | |
40 | int swx; /* index of beginning of cases for current switch */ | |
41 | ||
42 | /* debugging flag */ | |
43 | int xdebug = 0; | |
44 | ||
45 | int strflg; /* if on, strings are to be treated as lists */ | |
46 | ||
47 | int reached; /* true if statement can be reached... */ | |
48 | ||
49 | int idname; /* tunnel to buildtree for name id's */ | |
50 | ||
51 | ||
52 | NODE node[TREESZ]; | |
53 | ||
54 | int cflag = 0; /* do we check for funny casts */ | |
55 | int hflag = 0; /* do we check for various heuristics which may indicate errors */ | |
56 | int pflag = 0; /* do we check for portable constructions */ | |
57 | ||
58 | int brklab; | |
59 | int contlab; | |
60 | int flostat; | |
61 | int retlab = NOLAB; | |
62 | int retstat; | |
63 | ||
64 | /* save array for break, continue labels, and flostat */ | |
65 | ||
66 | int asavbc[BCSZ]; | |
67 | int *psavbc = asavbc ; | |
68 | ||
69 | static char * | |
70 | ccnames[] = { /* names of storage classes */ | |
71 | "SNULL", | |
72 | "AUTO", | |
73 | "EXTERN", | |
74 | "STATIC", | |
75 | "REGISTER", | |
76 | "EXTDEF", | |
77 | "LABEL", | |
78 | "ULABEL", | |
79 | "MOS", | |
80 | "PARAM", | |
81 | "STNAME", | |
82 | "MOU", | |
83 | "UNAME", | |
84 | "TYPEDEF", | |
85 | "FORTRAN", | |
86 | "ENAME", | |
87 | "MOE", | |
88 | "UFORTRAN", | |
89 | "USTATIC", | |
90 | }; | |
91 | ||
92 | char * scnames( c ) register c; { | |
93 | /* return the name for storage class c */ | |
94 | static char buf[12]; | |
95 | if( c&FIELD ){ | |
96 | sprintf( buf, "FIELD[%d]", c&FLDSIZ ); | |
97 | return( buf ); | |
98 | } | |
99 | return( ccnames[c] ); | |
100 | } |