home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
icon
/
dos
/
src
/
icont
/
tsym.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-10
|
3KB
|
86 lines
/*
* Structures for symbol table entries.
*/
struct tlentry { /* local table entry */
struct tlentry *l_blink; /* link for bucket chain */
char *l_name; /* name of variable */
int l_flag; /* variable flags */
};
struct tgentry { /* global table entry */
struct tgentry *g_blink; /* link for bucket chain */
char *g_name; /* name of variable */
int g_flag; /* variable flags */
int g_nargs; /* number of args (procedure) or */
}; /* number of fields (record) */
struct tcentry { /* constant table entry */
struct tcentry *c_blink; /* link for bucket chain */
char *c_name; /* pointer to string */
int c_length; /* length of string */
int c_flag; /* type of literal flag */
};
struct tientry { /* identifier table entry */
struct tientry *i_blink; /* link for bucket chain */
char *i_name; /* pointer to string */
int i_length; /* length of string */
};
/*
* Flag values.
*/
#define F_Global 01 /* variable declared global externally */
#define F_Proc 04 /* procedure */
#define F_Record 010 /* record */
#define F_Dynamic 020 /* variable declared local dynamic */
#define F_Static 040 /* variable declared local static */
#define F_Builtin 0100 /* identifier refers to built-in procedure */
#define F_ImpError 0400 /* procedure has default error */
#define F_Argument 01000 /* variable is a formal parameter */
#define F_IntLit 02000 /* literal is an integer */
#define F_RealLit 04000 /* literal is a real */
#define F_StrLit 010000 /* literal is a string */
#define F_CsetLit 020000 /* literal is a cset */
/*
* Symbol table region pointers.
*/
extern struct tlentry **lhash; /* hash area for local table */
extern struct tgentry **ghash; /* hash area for global table */
extern struct tcentry **chash; /* hash area for constant table */
extern struct tientry **ihash; /* hash area for identifier table */
extern struct tlentry *ltable; /* local table */
extern struct tgentry *gtable; /* global table */
extern struct tcentry *ctable; /* constant table */
extern struct tientry *itable; /* identifier table */
extern struct tlentry *lfree; /* free pointer for local table */
extern struct tgentry *gfree; /* free pointer for global table */
extern struct tcentry *ctfree; /* free pointer for constant table */
extern struct tientry *ifree; /* free pointer for identifier table */
/*
* Structure for keyword table.
*/
struct keyent {
char *keyname;
int keyid;
};
extern struct keyent keytab[]; /* keyword table */
/*
* Hash functions for symbol tables.
*/
#define ghasher(x) (((word)x)&gmask) /* global symbol table */
#define lhasher(x) (((word)x)&lmask) /* local symbol table */
#define chasher(x) (((word)x)&cmask) /* constant symbol table */