-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsymbol.h
29 lines (24 loc) · 997 Bytes
/
symbol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef symbol_defined
#define symbol_defined
/* -------- Macros: ------------------------------------------------------ */
typedef struct Symbol { /* symbol table entry */
char *name ;
short type ; /* VAR, BLTIN, UNDEF */
union {
int len; /* if str */
char *str; /* if str */
char cval; /* if VAR */
int ival; /* if VAR */
long long lval; /* if VAR */
long double val; /* if VAR */
long double (*ptr)(); /* if BUILTIN */
int (*iptr)(); /* if IBUILTIN */
} u ;
struct Symbol *next ;
} Symbol ;
/* -------- Protos ------------------------------------------------------- */
void init_sym(void);
void dump_sym(void);
Symbol *lookup_sym(const char *s);
Symbol *install_sym(const char *s, int t, long double d);
#endif