1 /* $Id: symbol.hh,v 1.6 1994/06/24 11:01:19 ceriel Exp $ */
3 /* Symbol table data structure.
4 Each identifier structure refers to a list of possible meanings of this
5 identifier. Each of these meanings is represented by a "symbol" structure.
8 typedef union constant { /* depends on type */
16 long nm_value; /* address or offset */
17 struct scope *nm_scope; /* for names that define a scope */
20 typedef struct symbol {
21 struct symbol *sy_next; /* link to next meaning */
22 struct symbol *sy_prev_sc; /* link to previous decl in scope */
23 struct type *sy_type; /* type of symbol */
30 #define FUNCTION 0x0020
36 #define FILESYM 0x0800 /* a filename */
37 #define FILELINK 0x1000 /* a filename without its suffix */
38 #define LBOUND 0x2000 /* lower bound of array descriptor */
39 #define UBOUND 0x4000 /* upper bound of array descriptor */
40 struct idf *sy_idf; /* reference back to its idf structure */
41 struct scope *sy_scope; /* scope in which this symbol resides */
43 t_const syv_const; /* CONST */
45 struct file *syv_file; /* for FILESYM */
46 struct symbol *syv_fllink; /* for FILELINK */
47 struct symbol *syv_descr; /* for LBOUND and UBOUND */
48 struct fields *syv_field;
50 #define sy_const sy_v.syv_const
51 #define sy_name sy_v.syv_name
52 #define sy_file sy_v.syv_file
53 #define sy_filelink sy_v.syv_fllink
54 #define sy_field sy_v.syv_field
55 #define sy_descr sy_v.syv_descr
56 } t_symbol, *p_symbol;
58 /* ALLOCDEF "symbol" 50 */
60 extern p_symbol NewSymbol(), Lookup(), Lookfromscope(), add_file();
61 extern p_symbol identify();
63 extern p_symbol currfile, listfile;