home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v92.tgz / v92.tar / v92 / src / icont / tsym.h < prev    next >
C/C++ Source or Header  |  1996-03-22  |  3KB  |  70 lines

  1. /*
  2.  * Structures for symbol table entries.
  3.  */
  4.  
  5. struct tlentry {            /* local table entry */
  6.    struct tlentry *l_blink;    /*   link for bucket chain */
  7.    char *l_name;        /*   name of variable */
  8.    int l_flag;            /*   variable flags */
  9.    int l_index;            /*   "index" of local in table */
  10.    struct tlentry *l_next;      /*   next local in table */
  11.    };
  12.  
  13. struct tgentry {            /* global table entry */
  14.    struct tgentry *g_blink;    /*   link for bucket chain */
  15.    char *g_name;        /*   name of variable */
  16.    int g_flag;            /*   variable flags */
  17.    int g_nargs;            /*   number of args (procedure) or */
  18.    int g_index;            /*   "index" of global in table */
  19.    struct tgentry *g_next;      /*   next global in table */
  20.    };                /*     number of fields (record) */
  21.  
  22. struct tcentry {            /* constant table entry */
  23.    struct tcentry *c_blink;    /*   link for bucket chain */
  24.    char *c_name;        /*   pointer to string */
  25.    int c_length;        /*   length of string */
  26.    int c_flag;            /*   type of literal flag */
  27.    int c_index;            /*   "index" of constant in table */
  28.    struct tcentry *c_next;      /*   next constant in table */
  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 tlentry **lhash;    /* hash area for local table */
  53. extern struct tgentry **ghash;    /* hash area for global table */
  54. extern struct tcentry **chash;    /* hash area for constant table */
  55.  
  56. extern struct tlentry *lfirst;    /* first local table entry */
  57. extern struct tlentry *llast;    /* last local table entry */
  58. extern struct tcentry *cfirst;    /* first constant table entry */
  59. extern struct tcentry *clast;    /* last constant table entry */
  60. extern struct tgentry *gfirst;    /* first global table entry */
  61. extern struct tgentry *glast;    /* last global table entry */
  62.  
  63. /*
  64.  * Hash functions for symbol tables.
  65.  */
  66.  
  67. #define ghasher(x)    (((word)x)&gmask)     /* global symbol table */
  68. #define lhasher(x)    (((word)x)&lmask)     /* local symbol table */
  69. #define chasher(x)    (((word)x)&cmask)     /* constant symbol table */
  70.