1986-03-26 15:11:02 +00:00
|
|
|
/* S C O P E M E C H A N I S M */
|
|
|
|
|
|
|
|
/* $Header$ */
|
|
|
|
|
|
|
|
#define OPENSCOPE 0 /* Indicating an open scope */
|
|
|
|
#define CLOSEDSCOPE 1 /* Indicating a closed scope (module) */
|
|
|
|
|
1986-04-12 02:21:24 +00:00
|
|
|
#define SC_CHKFORW 1 /* Check for forward definitions when closing
|
|
|
|
a scope
|
|
|
|
*/
|
|
|
|
#define SC_CHKPROC 2 /* Check for forward procedure definitions
|
|
|
|
when closing a scope
|
|
|
|
*/
|
|
|
|
|
1986-03-26 15:11:02 +00:00
|
|
|
struct scope {
|
|
|
|
struct scope *next;
|
1986-03-27 17:37:41 +00:00
|
|
|
struct forwards *sc_forw;
|
1986-03-29 01:04:49 +00:00
|
|
|
struct def *sc_def; /* list of definitions in this scope */
|
1986-04-15 17:51:53 +00:00
|
|
|
arith sc_off; /* offsets of variables in this scope */
|
|
|
|
char sc_scopeclosed; /* flag indicating closed or open scope */
|
1986-03-26 15:11:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct scope
|
1986-04-03 00:44:39 +00:00
|
|
|
*CurrentScope,
|
1986-04-15 17:51:53 +00:00
|
|
|
*PervasiveScope,
|
1986-04-03 00:44:39 +00:00
|
|
|
*GlobalScope;
|
1986-03-26 15:11:02 +00:00
|
|
|
|
1986-04-15 17:51:53 +00:00
|
|
|
#define enclosing(x) ((x)->next)
|
|
|
|
#define scopeclosed(x) ((x)->sc_scopeclosed)
|
|
|
|
#define nextvisible(x) (scopeclosed(x) ? PervasiveScope : enclosing(x))
|