1 /* $Id: symtab.h,v 1.7 1994/06/24 12:27:25 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
10 /* Symbol/Expression type: */
13 #define T_CONST 0x0002
14 #define T_VALUE 0x0003
19 #define T_TYPE 0x0007 /* Mask for type bits */
22 #define T_ARR 0x0008 /* Object is an array */
23 #define T_BYTE 0x0010 /* Object is a byte array if T_ARR */
24 #define T_PARAM 0x0020 /* Formal parameter */
25 #define T_LVALUE 0x0040 /* This object may be assigned */
26 #define T_NOTDECL 0x0080 /* If you didn't declare it */
27 #define T_USED 0x0100 /* If you've used it */
28 #define T_ASSIGNED 0x0200 /* Or assigned it */
29 #define T_REP 0x0400 /* Replicator index */
30 #define T_BUILTIN 0x0800 /* Builtin name */
31 #define T_RECURS 0x1000 /* This proc is now compiled */
32 /* Note that some types and flags are only used for symbols, and others only
38 struct par_list { /* List of parameter types for a proc object */
39 struct par_list *pr_next;
40 struct symbol *pr_var; /* The formal parameter while visible */
41 int pr_type; /* Its type */
46 union storage { /* An object is found */
47 int level; /* either at a certain local level */
48 char *builtin; /* or using a global builtin name */
54 int offset; /* from its local level or builtin name */
55 } vc; /* Variable or channel */
61 char *file; /* file it is in */
62 int label; /* A unique id*/
63 struct par_list *pars;
71 union type_info s_info;
72 struct symbol *s_left, *s_right;
77 struct symtab *global;
81 struct symbol *insert();
82 struct symbol *searchall();
86 void var_memory(), chan_memory();
90 void check_recursion();
92 #define var_constant(v) (((v)->s_type&T_TYPE)==T_CONST)
93 #define var_proc(v) (((v)->s_type&T_TYPE)==T_PROC)
94 #define var_declared(v) (! ((v)->s_type&T_NOTDECL))
96 extern union type_info none;