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: #ifdef PORT
  93: #define TSIZE       x       /* default size of parse tree space */
  94: #define SSIZE       x       /* default size of string space */
  95: #endif PORT
  96: #ifdef VAX
  97: #define TSIZE   15000       /* default size of parse tree space */
  98: #define SSIZE   15000       /* default size of string space */
  99: #endif VAX
 100: #ifdef PDP11
 101: #define TSIZE    7500       /* default size of parse tree space */
 102: #define SSIZE    5000       /* default size of string space */
 103: #endif PDP11
 104: 
 105: /*
 106:  * Structure for keyword table.
 107:  */
 108: 
 109: struct keyent {
 110:       char *keyname;
 111:       int keyid;
 112:       };
 113: 
 114: extern struct keyent keytab[];  /* keyword table */
 115: 
 116: /*
 117:  * Hash functions for symbol tables.
 118:  */
 119: 
 120: #define ghasher(x)  (((int)x)&gmask)    /* global symbol table */
 121: #define lhasher(x)  (((int)x)&lmask)    /* local symbol table */
 122: #define chasher(x)  (((int)x)&cmask)    /* constant symbol table */

Defined struct's

centry defined in line 18; used 40 times
gentry defined in line 11; used 44 times
ientry defined in line 25; used 32 times
keyent defined in line 109; used 6 times
lentry defined in line 5; used 46 times

Defined macros

CHSIZE defined in line 90; used 1 times
CSIZE defined in line 86; used 1 times
F_ARGUMENT defined in line 42; used 2 times
F_BUILTIN defined in line 40; used 1 times
F_CSETLIT defined in line 46; used 1 times
F_DYNAMIC defined in line 38; used 2 times
F_GLOBAL defined in line 35; used 4 times
F_IMPERROR defined in line 41; never used
F_INTLIT defined in line 43; used 2 times
F_PROC defined in line 36; used 2 times
F_REALLIT defined in line 44; used 2 times
F_RECORD defined in line 37; used 2 times
F_STATIC defined in line 39; used 1 times
F_STRLIT defined in line 45; used 1 times
GHSIZE defined in line 89; used 1 times
GSIZE defined in line 85; used 1 times
IHSIZE defined in line 91; used 1 times
ISIZE defined in line 87; used 1 times
LHSIZE defined in line 88; used 1 times
LSIZE defined in line 84; used 1 times
SSIZE defined in line 102; used 1 times
TSIZE defined in line 101; used 1 times
chasher defined in line 122; used 4 times
ghasher defined in line 120; used 4 times
lhasher defined in line 121; used 4 times

Usage of this include

Last modified: 1984-11-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1332
Valid CSS Valid XHTML 1.0 Strict