|
|
1.1 ! root 1: /* ! 2: * Structures for symbol table entries. ! 3: */ ! 4: ! 5: struct lentry { /* local table entry */ ! 6: struct lentry *l_blink; /* link for bucket chain */ ! 7: char *l_name; /* name of variable */ ! 8: int l_flag; /* variable flags */ ! 9: }; ! 10: ! 11: struct gentry { /* global table entry */ ! 12: struct gentry *g_blink; /* link for bucket chain */ ! 13: char *g_name; /* name of variable */ ! 14: int g_flag; /* variable flags */ ! 15: int g_nargs; /* number of args (procedure) or */ ! 16: }; /* number of fields (record) */ ! 17: ! 18: struct centry { /* constant table entry */ ! 19: struct centry *c_blink; /* link for bucket chain */ ! 20: char *c_name; /* pointer to string */ ! 21: int c_length; /* length of string */ ! 22: int c_flag; /* type of literal flag */ ! 23: }; ! 24: ! 25: struct ientry { /* identifier table entry */ ! 26: struct ientry *i_blink; /* link for bucket chain */ ! 27: char *i_name; /* pointer to string */ ! 28: int i_length; /* length of string */ ! 29: }; ! 30: ! 31: /* ! 32: * Flag values. ! 33: */ ! 34: ! 35: #define F_Global 01 /* variable declared global externally */ ! 36: #define F_Proc 04 /* procedure */ ! 37: #define F_Record 010 /* record */ ! 38: #define F_Dynamic 020 /* variable declared local dynamic */ ! 39: #define F_Static 040 /* variable declared local static */ ! 40: #define F_Builtin 0100 /* identifier refers to built-in procedure */ ! 41: #define F_ImpError 0400 /* procedure has default error */ ! 42: #define F_Argument 01000 /* variable is a formal parameter */ ! 43: #define F_IntLit 02000 /* literal is an integer */ ! 44: #define F_RealLit 04000 /* literal is a real */ ! 45: #define F_StrLit 010000 /* literal is a string */ ! 46: #define F_CsetLit 020000 /* literal is a cset */ ! 47: ! 48: /* ! 49: * Symbol table region pointers. ! 50: */ ! 51: ! 52: extern struct lentry **lhash; /* hash area for local table */ ! 53: extern struct gentry **ghash; /* hash area for global table */ ! 54: extern struct centry **chash; /* hash area for constant table */ ! 55: extern struct ientry **ihash; /* hash area for identifier table */ ! 56: ! 57: extern struct lentry *ltable; /* local table */ ! 58: extern struct gentry *gtable; /* global table */ ! 59: extern struct centry *ctable; /* constant table */ ! 60: extern struct ientry *itable; /* identifier table */ ! 61: ! 62: extern struct lentry *lfree; /* free pointer for local table */ ! 63: extern struct gentry *gfree; /* free pointer for global table */ ! 64: extern struct centry *ctfree; /* free pointer for constant table */ ! 65: extern struct ientry *ifree; /* free pointer for identifier table */ ! 66: ! 67: extern int lsize; /* initial size of local table */ ! 68: extern int gsize; /* initial size of global table */ ! 69: extern int csize; /* initial size of constant table */ ! 70: extern int isize; /* initial size of identifier table */ ! 71: extern int ihsize; /* initial size of identifier hash table */ ! 72: extern int lhsize; /* initial size of local hash tables */ ! 73: extern int ghsize; /* initial size of global hash tables */ ! 74: extern int chsize; /* initial size of constant hash tables */ ! 75: extern int lmask; /* mask for local table hash */ ! 76: extern int gmask; /* mask for global table hash */ ! 77: extern int cmask; /* mask for constant table hash */ ! 78: extern int imask; /* mask for identifier table hash */ ! 79: ! 80: /* ! 81: * Symbol table parameters. ! 82: */ ! 83: ! 84: #define LSize 100 /* default size of local table */ ! 85: #define GSize 100 /* default size of global table */ ! 86: #define CSize 100 /* default size of constant table */ ! 87: #define ISize 500 /* default size of identifier table */ ! 88: #define LhSize 128 /* default size of local hash table */ ! 89: #define GhSize 128 /* default size of global hash table */ ! 90: #define ChSize 128 /* default size of constant hash table */ ! 91: #define IhSize 128 /* default size of identifier hash table */ ! 92: ! 93: ! 94: /* ! 95: * Structure for keyword table. ! 96: */ ! 97: ! 98: struct keyent { ! 99: char *keyname; ! 100: int keyid; ! 101: }; ! 102: ! 103: extern struct keyent keytab[]; /* keyword table */ ! 104: ! 105: /* ! 106: * Hash functions for symbol tables. ! 107: */ ! 108: ! 109: #define ghasher(x) (((int)x)&gmask) /* global symbol table */ ! 110: #define lhasher(x) (((int)x)&lmask) /* local symbol table */ ! 111: #define chasher(x) (((int)x)&cmask) /* constant symbol table */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.