|
|
1.1 ! root 1: /* @(#) xdefs.c: 1.2 1/12/84 */ ! 2: ! 3: # include "mfile1.h" ! 4: ! 5: /* communication between lexical routines */ ! 6: ! 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 strftn; /* 1 if current function returns struct or union */ ! 19: int ftnno; /* "current" function number */ ! 20: int curloc; /* current location counter value */ ! 21: ! 22: int curclass, /* current storage class */ ! 23: instruct, /* "in structure" flag */ ! 24: stwart, /* for accessing names which are structure members or names */ ! 25: blevel, /* block level: 0 for extern, 1 for ftn args, >=2 inside function */ ! 26: curdim; /* current offset into the dimension table */ ! 27: ! 28: int dimtab[ DIMTABSZ ]; ! 29: ! 30: int paramstk[ PARAMSZ ]; /* holds symtab indices of function parameters */ ! 31: int paramno; /* the number of parameters */ ! 32: int argsoff[ ARGSZ ]; /* the offsets for the arguments */ ! 33: int argno; /* the number of arguments */ ! 34: int argstk[ ARGSZ ]; /* the symtab indices of arguments */ ! 35: TWORD argty[ ARGSZ ]; /* the types of the arguments */ ! 36: int autooff, /* the next unused automatic offset */ ! 37: argoff, /* the next unused argument offset */ ! 38: strucoff; /* the next structure offset position */ ! 39: int regvar; /* the next free register for register variables */ ! 40: int nextrvar; /* the next allocated reg (set by cisreg) */ ! 41: OFFSZ inoff; /* offset of external element being initialized */ ! 42: int brkflag = 0; /* complain about break statements not reached */ ! 43: ! 44: struct sw swtab[SWITSZ]; /* table for cases within a switch */ ! 45: struct sw *swp; /* pointer to next free entry in swtab */ ! 46: int swx; /* index of beginning of cases for current switch */ ! 47: ! 48: /* debugging flag */ ! 49: int xdebug = 0; ! 50: int idebug = 0; ! 51: ! 52: int strflg; /* if on, strings are to be treated as lists */ ! 53: ! 54: int reached; /* true if statement can be reached... */ ! 55: ! 56: int idname; /* tunnel to buildtree for name id's */ ! 57: ! 58: ! 59: extern NODE node[]; ! 60: ! 61: int cflag = 0; /* do we check for funny casts */ ! 62: int hflag = 0; /* do we check for various heuristics which may indicate errors */ ! 63: int pflag = 0; /* do we check for portable constructions */ ! 64: int gdebug; /* for pi/sdb */ ! 65: ! 66: int brklab; ! 67: int contlab; ! 68: #ifdef M32B ! 69: int swregno; ! 70: #endif ! 71: int flostat; ! 72: int retlab = NOLAB; ! 73: int retstat; ! 74: ! 75: /* save array for break, continue labels, and flostat */ ! 76: ! 77: int asavbc[BCSZ]; ! 78: int *psavbc = asavbc ; ! 79: ! 80: /* stack of scope chains */ ! 81: ! 82: struct symtab *scopestack[MAXNEST]; ! 83: ! 84: static char *ccnames[] = ! 85: { ! 86: /* names of storage classes */ ! 87: "SNULL", ! 88: "AUTO", ! 89: "EXTERN", ! 90: "STATIC", ! 91: "REGISTER", ! 92: "EXTDEF", ! 93: "LABEL", ! 94: "ULABEL", ! 95: "MOS", ! 96: "PARAM", ! 97: "STNAME", ! 98: "MOU", ! 99: "UNAME", ! 100: "TYPEDEF", ! 101: "FORTRAN", ! 102: "ENAME", ! 103: "MOE", ! 104: "UFORTRAN", ! 105: "USTATIC", ! 106: }; ! 107: ! 108: char * ! 109: scnames( c ) ! 110: register c; ! 111: { ! 112: /* return the name for storage class c */ ! 113: static char buf[12]; ! 114: if( c&FIELD ) ! 115: { ! 116: sprintf( buf, "FIELD[%d]", c&FLDSIZ ); ! 117: return( buf ); ! 118: } ! 119: return( ccnames[c] ); ! 120: } ! 121: ! 122: #ifdef M32B ! 123: /* for register allocation optimizations */ ! 124: ! 125: int fordepth; /* nest depth of 'for' loops */ ! 126: int whdepth; /* nest depth of 'while' and 'do-while' loops */ ! 127: int brdepth; /* nest depth of 'if', 'if-else', and 'switch' */ ! 128: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.